Ansicht
Dokumentation

PARSE_IDOC - NOTRANSL: Erstellen von Anwendungsbelegen oder -stammdaten aus IDOC's

PARSE_IDOC - NOTRANSL: Erstellen von Anwendungsbelegen oder -stammdaten aus IDOC's

General Data in Customer Master   CPI1466 during Backup  
This documentation is copyright by SAP AG.
SAP E-Book

Functionality

This function module provides an application tool which creates application documents from an incoming IDoc. This tool is called a parser. The purpose of the parser is NOT to interpret the content of the IDoc segments and create application documents independently but to control the creation of the application document by the application concerned.

The parser provides the following functions for the application for IDoc receipt:

- selective calling of an application function for each IDoc segment

- triggering of a posting routine in the application if:

- a new document header is recognized in the IDoc

- the maximum number of permitted document items has been reached

- the IDoc is completed

- saving of IDoc areas from which the application could not create a

document or document item because an error occurred.

- triggering new processing of incorrect IDoc areas

- return to the correct IDoc item if a part of the IDoc has already

been processed and an application document created, and processing

is then terminated

- recognizing posting terminations

- preventing repeated posting termination if the data is successfully

posted in the meantime

As a result you are able to concentrate purely on the application side during IDoc development. The parser provides the functionality for inbound processing control.

The procedure for inbound IDoc processing using the parser is as follows:

- A function module of the application in question is called from the

EDI/ALE interface

- The application FM creates the processing rules for the parser

- The application FM calls the parser (FM PARSE_IDOC) and transfers

the IDoc segment table and the rules which are to be used for IDoc

processing to the parser

- The parser reads the IDoc table and calls the relevant application

function module on the basis of the rules and according to the

status

- Once the IDoc has been completed, the parser returns to the calling

program with the relevant status information

The application transfers the rules to the parser in the form of a

table which has the following structure:

- seg : name of the IDoc segment

- fcode : function code if various types of application documents

are to be created from an IDoc

- rule_index : sequential number if a number of functions are to be

called for a segment

- pflag : segment type

- function : name of the function module which is to be called for

the segment

The parser interface to the relevant function module of the application

depends on the type of segment. The following are possible:

- First header segment; characteristic pflag = 'H1'

This segment always indicates the start of a new document.

The interface to the application is as follows:

Import parameters of the application:

i_segment like edidd - IDoc segment

i_parser_info type parser_info_entry - parser information

Export parameters of the application:

o_application_variables

Exceptions of the application

error_in_application

- Further header segments; characteristic pflag = 'HS'

This segment indicates further segments of the header level.

The interface corresponds to that of the first header segment.

- First item segment; characteristic pflag = 'P1'

This segment indicates the first segment of an item.

The interface corresponds to that of the first header segment.

- Further item segments; characteristic pflag = 'PS'

This segment indicates further segments of an item.

The interface corresponds to that of the first header segment.

- Function for processing an item; characteristic pflag = 'PF'

This function is called by the parser when all segments of an item

have been processed.

The interface to the application is as follows:

Import parameters of the application

i_parser_info type parser_info_entry - parser information

Export parameters of the application

o_line_item_assign - line number of the application doc.

o_application_variables

Exceptions of the application:

error_in_application

- Function for processing a document; characteristic pflag = 'HF'

This function is called by the parser if the application document is

to be posted. It is important for the application to schedule the

data for updating but not to carry out a COMMIT. The parser carries

out a COMMIT as soon as its own update requests are transmitted.

The interface to the application is as follows:

i_parser_info type parser_info_entry - parser information

Tables parameter:

o_t_line_items_with_error - incorrect items

Exceptions of the application:

error_in_application

- Function for error logging at item level;

characteistic pflag = 'PE'

This function is called if an error occurs at item level.

Interface parameters are not required.

- Function for error logging at header level;

Characteristic pflag = 'HE'

This function is called when an error occurs at header level.

Interface parameters are not required.

- Function for initializing the application;

characteristic pflag = 'AI'

This function is called each time the parser receives a new IDoc.

Interface parameters are not required.

Example

Receipt of IDocs by the POS interface for goods movements can be used as an example.

The function module which is called by EDI/ALE is called 'IDOC_INPUT_POS_INV_MANAGEMENT'.

The rules for the parser are defined in the FORM-routine 'SET_GOODS_MOVEMENT_PARS_RULES' of function group 'WPUE'.

The function modules of the application which the parser calls can be determined from the coding of the above FORM-routine.

Notes

Further information





Parameters

AUTOMATIC_RETRY
DOCUMENT_SPLIT
IDOC_CONTRL
IDOC_DATA
IDOC_STATUS
MAX_NUMBER_OF_DOCUMENTS
NUMBER_OF_ERRORS
PARSER_RULES
POST_WITH_GAPS

Exceptions

Function Group

WPPA

TXBHW - Original Tax Base Amount in Local Currency   rdisp/max_wprun_time - Maximum work process run time  
This documentation is copyright by SAP AG.

Length: 7609 Date: 20240523 Time: 133740     sap01-206 ( 65 ms )