Skip to main content
Skip table of contents

p$TDV:SMPAPI:WkTx_Ini


p$TDV:SMPAPI:WkTx_Ini

Initialization of the interface for text generation for output documents which are based on a SalesManager shopping cart. All shopping cart header data and all shopping cart positions (without characteristics) are read.

Please note:

After running p$TDV:SMPAPI:WkTx_Ini, p$TDV:SMPAPI:EtTxInit has to be called as well to initialize the output document.

For the identification of the shopping cart, the shopping cart ID number is used. It is indirectly transferred by the parameter filter of the transferred PGs mtext (see there) to this interface. The parameter filter contains a text with the following syntax:

’WarenkorbID=<ID>’


Where ID is a parameter for the current shopping cart ID which has then to be transferred to this function. This ID can be extracted from the text using the function p$TDV:SMPWak:Wk_Id .

By employing this shopping cart ID a parameter group for the header data (Parameter WkKopfPG) is read. The structure of this PG can be found in the documentation of SMWkKopf.

Likewise, all positions are read into the transferred parameter group array WkPosPGL (see PG SMWkPos). Every array index resembles a shopping cart position and the sequence of the positions resembles the sequence in the shopping cart. The position characteristics are not read automatically for all positions, but can be read with the functions of the SalesManager interface instead, e.g. p$TDV:SMPAPI:WkTx_LMK or p$TDV:SMPAPI:L_MrkMal.

Syntax:

Status = p$TDV:SMPAPI:WkTx_Ini( WkKopfPG, WkPosPGL, WkID )

 

Argument

Type

Meaning

 

WkKopfPG

String

Name of a global PG for the shopping cart header data

 

WkPosPGL

String

Name of a global single-index PG array for the data of the individual shopping cart positions

 

WkID

String

Identification number of the shopping cart (as a string)

Result:

-

 

Example: Initialization of a shopping cart output document

The document name is to be "Ang.doc". The shopping cart header data is to be loaded into the PG wkkopf, the positions are to be loaded into the PG-Array wk.

Extracting of the provided shopping cart ID:

ET "DokInit":

 

 

R 01

SONST

B 01

 

 

 

A 01

WkID = p$TDV:SMPWak:Wk_Init( smtext.Filter )

x

 

A 02

p$DokInit2()

x

 


Check the result and initialize the text generation:

ET "DokInit2":

 

 

R 01

SONST

B 01

WkID > 0

j

 

B 02

 

 

 

A 01

p$TDV:SMPAPI:WkTx_Ini( ’wkkopf’, ’wk’, f$FormatNumber( WkID, ’#’ ) )

x

 

A 02

p$TDV:SMPAPI:EtTxInit( ’c:’, ’WKDocs’, ’Ang’, 0 )

x

 

A 03

f$Message(’Error’, ’No shopping cart ID received!’ )

 

x

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.