Ansicht
Dokumentation

EDOC_EU_XML_FILE_INV - Peppol: Filling of Invoice XML Files

EDOC_EU_XML_FILE_INV - Peppol: Filling of Invoice XML Files

CPI1466 during Backup   BAL_S_LOG - Application Log: Log header data  
This documentation is copyright by SAP AG.
SAP E-Book

This Business Add-In (BAdI) is used in the eDocument EU (CA-GTF-CSC-EDO-PAP) component. You can use this BAdI to define your own logic of filling fields in invoice XML files. You can use your own logic to do the following:

  • Overwrite default field values
By default, the system fills fields in invoice XML files based on the standard XML mappings. You can change the mapping for a field to meet your own requirements.
Example:
You maintain item notes (Item Text type: Item note) for items in billing documents. You want to show these item notes as item descriptions in the cbc:Description (Item description) field of invoice XML files. With this BAdI, you can overwrite the value of the cbc:Description field with the item note from a source billing document.
  • Fill fields that the system doesn't fill by default
There are some optional fields in invoice XML files. The standard XML mappings don't cover these fields. Accordingly, the system doesn't fill these fields by default. You can fill these fields using your own logic.
Example:
You maintain header notes for billing documents (Header Text type: Header note 1). You want to show these header notes in the cbc:Note (Invoice note) field of invoice XML files. With this BAdI, you can fill the cbc:Note field with the header note from a source billing document.

The system calls this BAdI when generating invoice XML files based on source documents.

Structured Parameter source_data

This structured parameter contains business data of source documents, as follows:

  • If the source document is a billing document, this structured parameter contains the header data and item data of both the billing document and associated accounting document.
  • If the source document is an accounting document, this structured parameter contains the header data and item data of the accounting document only.

The following parameters are available in this structured parameter:

  • billing_header: Contains header data of source billing documents.
  • billing_item: Contains item data of source billing documents.
  • accounting_header: Contains header data of source accounting documents.
  • accounting_item: Contains item data of source accounting documents.

Table Parameter header_item_texts

This table parameter contains header texts and item texts of source documents, as follows:

  • If the source document is a billing document, this table parameter contains the header texts and item texts of both the billing document and associated sales document.
  • If the source document is an accounting document, this table parameter contains the header texts and item texts of the accounting document only.

The following parameters are available in this table parameter:

  • TDOBJECT and TDNAME: Identify the object that a data record refers to.
Details are as follows:
TDOBJECT TDNAME Object Type
BELEG <Accounting Document Number>: <Company Code> (4 digits) + (10 digits) + (4 digits) Header Text of Accounting Document
DOC_ITEM <Item Number in Accounting Document>: (4 digits) + (10 digits) + (4 digits) + (3 digits) Item Text of Accounting Document
VBBK <Billing Document Number>: source_data-billing_header-vbeln Header Text of Billing Document
VBBK <Sales Document Number>: The value is different from source_data-billing_header-vbeln. Header Text of Sales Document
VBBP <Item Number in Billing Document>: The first 10 characters are the same as those of source_data-billing_header-vbeln. Item Text of Billing document
VBBP <Item Number in Sales Document>: The first 10 characters are different from those of source_data-billing_header-vbeln. Item Text of Sales document

  • LINE_ID: Indicates the item number in the invoice XML file. With this ID, you can find the right item in the XML file and set the value.
Note:
For an electronic invoice created based on an accounting document, the value of LINE_ID may be different from the item number in the accounting document.
For an electronic invoice created based on a billing document, the value of LINE_ID, item number in the billing document, and item number in the sales document are the same.
  • TDID: Indicates the text type of a header text or item text.
  • TDSPRAS: Indicates the language of a header text or item text.
  • TDFORMAT: Indicates the formatting of a header text or item text.
  • TDLINE: Contains a header text or item text.

The following table shows a sample data record of a header text from an accounting document, and a sample data record of an item text from this accounting document:

TDOBJECT TDNAME LINE_ID TDID TDSPRAS TDFORMAT TDLINE
BELEG SG0118000002062020   E * Note in Header Text
DOC_ITEM SG0118000002062020002 001 0001 E * Item Long Text

The following table shows some examples of data records of header texts and item texts from sales documents and billing documents:,,

TDOBJECT TDNAME LINE_ID TDID TDSPRAS TDFORMAT TDLINE
VBBK 0003006235   0001 E * Texts in Sales order -> Header Texts -> Form Header
VBBK 0003006235   0002 E * Texts in Billing Document -> Header Text -> Header Note 1
VBBK 0003006235   0003 E * Texts in Billing Document -> Header Text -> Header Note 2
VBBK 0003006235   SINV E * Texts in Sales order -> Header Texts -> Form Header
VBBK 0000163322   0001 E * Texts in Sales order -> Header Texts -> Form Header
VBBK 0000163322   0003 E * Texts in Sales order -> Header Texts ->Header Note 2
VBBP 0003006235000010 000010 0001 E * Material Description
VBBP 0003006235000010 000010 0002 E * Text in Billing Document Item -> Item Texts -> Item note
VBBP 0000163322000010 000010 0001 E * Material Description
VBBP 0000163322000010 000010 0004 E * Texts in Sales order item -> Texts -> Delivery Texts
VBBP 0000163322000010 000010 0005 E * Texts in Sales order item -> Texts -> Purchas order Texts

Structured Parameter xml_file

This structured parameter contains structured XML data for invoices, which is generated by the standard solution. You need to copy all values to the changing parameter xml_file_modified and make value changes in xml_file_modified.

Table Parameter item_number

This table parameter is only relevant to electronic invoices created based on accounting documents. It contains the mapping relationships between item numbers in a source accounting document and item numbers in the corresponding invoice XML file.

The following parameters are available in this table parameter:

  • FI_BUZEI: Indicates the item number in the source accounting document.
  • LINE_ID: Indicates the item number in the invoice XML file
  • SD_POSNR: Not used currently

See the following example:

SD_POSNR FI_BUZEI LINE_ID
000000 002 001

001

Table Parameter xml_file_modified

You need to copy all values of the table parameter xml_file to xml_file_modified. Then you make value changes in xml_file_modified.






BAL_S_LOG - Application Log: Log header data   BAL Application Log Documentation  
This documentation is copyright by SAP AG.

Length: 13672 Date: 20240523 Time: 154437     sap01-206 ( 116 ms )