Which user exits can be found in FI inbound processing of IDocs of category INVOIC01/02 and what can they be used for?
In the IDoc INVOIC01/02 how can you
- 1. change the G/L account (BSEG-HKONT)?
- 2. change the company code (BSEG-NEWBK)?
- 3. fill or change the additional account assignments?
- 4. fill the allocation number (BSEG-ZUONR)?
- 5. fill the segment text (BSEG-SGTXT)?
- 6. assign own names for the batch input sessions?
EDI, IDOC_INPUT_INVOIC_FI, SAPLIEDI, OBCC, OBCE, OBCB, INVOIC01, INVOIC02, INVOIC, FEDI0001
Reason and PrerequisitesG/L account and company code
User exit 001
gives you the option of determining the G/L account and the company code for posting the delivery of goods/services.If no G/L account is determined, a corresponding exception can be triggered and a message generated as well. Up to and including Release 4.6C, you have to use the workaround described in note 330390 for the exceptions due to an error in the interface.
The exit is always called after an item segment was a processed completely and all of the data for this item is known (except for the additional account assignments and taxes).
The following data is available in the exit:
- the company code of this item
- the vendor account
- batch input fields and field contents of the current line item
Name of function module: EXIT_SAPLIEDI_001
The G/L account is determined from the settings in the Customizing Transaction OBCB by default.
The user exit cannot be used for changing the account assignment of any condition line items that may exist.For conditions, the account assignment is determined exclusively by means of the Customizing in OBCB.
User exit 002
enables you to change the additional account assignments (COBL, coding block). When processing the line item data this is called directly after exit 001, but only if additional account assignments have already been made in the standard system or in exit 101.
As with 001 an exception and output of a message is supported here, too. (Up to and including Release 4.6C, take note 330390 into account.)
The following data is available in the exit:
- the company code of this item
- the vendor account
- date DATAB and DATBI
- batch input fields and field contents of the current line item
Name of function module: EXIT_SAPLIEDI_002
The additional account assignments are filled from the settings of the Customizing Transaction OBCC by default.
User exit 003
enables you to change the field BSEG-ZUONR (allocation number). As with 001 and 002 the exception NOT_FOUND can be triggered and a message generated as well. (Up to and including Release 4.6C, take note 330390 into account.)
The call is carried out after exit 002.
The following data is available in the exit:
- the company code of this item
- the vendor account
- batch input fields and field contents of the current line item
Name of function module: EXIT_SAPLIEDI_003
The allocation number is not filled as a default.
User exit 004
enables you to set line item text (BSEG-SGTXT) for the G/L account lines. If a text is to be added for the vendor line item, you can use user exit 102. Exit 004 is called after exit 003 and has the same data and the same exception. (Up to and including Release 4.6C, take note 330390 into account.)
The following data is available in the exit:
- the company code of this item
- the vendor account
- batch input fields and field contents of the current line item
Name of function module: EXIT_SAPLIEDI_004
Only the first line of the segment text is transferred as a default.
User exit 005
This exit is only relevant if you have set processing of the INVOIC01 IDocs for batch input sessions in the Customizing Transaction OBCE.These sessions receive a description as a default according to the schema: IV_ <Partner>. <Partner> is the name of the partner from the IDoc control record.
You are advised to distinguish the BDC sessions by using different names. You can do this with user exit 005.
The following data is available in the exit:
- the company code of this item
- the vendor account
Name of function module: EXIT_SAPLIEDI_005
User exit 101
is called up for every segment after standard processing. Customer-defined segments can be processed this way.Furthermore, qualifiers that are not used in the standard system can be evaluated this way. In the case of incorrect specifications in the IDoc, a message can be generated. The message must be notified to the program in a structure FIMSG (see ABAP Dictionary). The messages are issued in the IDoc status record.A message of category E (Error) causes the IDoc to receive status 51 (incorrect).
The message is displayed in the status record of the IDoc.
The exit contains the following information:
- Control record information (in table IDOC_CONTRL)
- the index of the current IDoc in IDOC_CONTRL_INDEX (usually
irrelevant, since at present the IDocs are always processed separately)
- the complete IDoc data (segment name, segment data in IDOC_DATA)
- the index of the segment processed currently (in IDOC_DATA_INDEX)
- the header and item data processed up to now for the call of
transaction FB01 (in DOCUMENT_DATA)
- the tax data processed up to now (in TAX_DATA)
- the additional account assignments for CO, CO-PA and
Business area (in ADDITIONAL_DATA) processed up to now
- the number of the currently processed line item (in DOCUMENT_LINE)
Procedure to process customer-defined segments or qualifiers:
- 1. Call up segment name: IDOC_DATA-SEGNAM;
- 2. place IDOC_DATA-SDATA in the structure related to the segment;
- 3. evaluate data and append the result to the corresponding internal table (for example, DOCUMENT_DATA). The meaning of the fields:
STYPE: 'K' for document header data and 'P' for line item data
COUNT: Number of the item (is transferred in DOCUMENT_LINE)
FNAM : batch input name of the field to be appended (for example, 'COBL-KDPOS')
The field name must be entered in upper case.
FVAL : required field contents
Name of function module: EXIT_SAPLIEDI_101
User exit 102
enables the validation and adjustment of the document data along the same lines as for user exit 101.However, it is called after all segments of the IDoc are read.At this point all data for the document is known. For the documents to be split, only the clearing lines are missing. For the vendor posting, item 1 is reserved. At this point it time, it is still incomplete. If you want to add data, that is not filled in the standard system (for example, the segment text), add the respective entry to table DOCUMENT_DATA.
An example for the segment text for the vendor line item:
STYPE = 'P', COUNT = 1, FNAM = 'BSEG-SGTXT', FVAL = <your text>
The exit contains the following information:
- Control record information (in table IDOC_CONTRL)
- the index of the current IDoc in IDOC_CONTRL_INDEX (usually
irrelevant, since at present the IDocs are always processed separately)
- the complete IDoc data (segment name, segment data in IDOC_DATA)
- all header and item data for the document (except for vendor and
clearing items (in DOCUMENT_DATA)
- all tax data (in TAX_DATA)
- all additional account assignments for CO, CO-PA and business area
(in ADDITIONAL_DATA). Changes in this table, however,
no longer have any effect on the document, since the processing of the
items has already been completed.
Name of function module: EXIT_SAPLIEDI_102
You can obtain additional information from the documentation for the corresponding function module using Transaction SE37.
If you find the documentation does not exist in your own language, you should read Note 126192.
--
Ankur Bhandari.
SAP Consultant