2069736 Consulting

SAP Note 2069736 eDocument Chile - eInvoicing: Additional Information to Full Solution Consulting © 2014 by SAP AG. All

Views 298 Downloads 155 File size 420KB

Report DMCA / Copyright

DOWNLOAD FILE

Recommend stories

Citation preview

SAP Note 2069736 eDocument Chile - eInvoicing: Additional Information to Full Solution Consulting

© 2014 by SAP AG. All rights reserved. SAP and the SAP logo are registered trademarks of SAP AG in Germany and other countries. Business Objects and the Business Objects logo are trademarks or registered trademarks of Business Objects Software Ltd. Business Objects is an SAP company. Sybase and the Sybase logo are registered trademarks of Sybase Inc. Sybase is an SAP company. Copyright/Trademar

The following steps explain how to fill or change fields of the request after the AIF mapping; in more detail method SET_OUTPUT_DATA of BAdI EDOC_ADAPTOR can be used to fill additional fields of the electronic invoice or to change existing ones. Implement the BAdI EDOC_ADAPTOR

1.

To implement the BAdI EDOC_ADAPTOR please follow the instructions provided in the attachment “1995867 - Manual Post-Implementation Steps.pdf” of note 1995867, in the section “4. Create Implementation for BAdI EDOC_ADAPTOR”.

2. Method SET_OUTPUT_DATA of the BAdI EDOC_ADAPTOR You can implement the method SET_OUTPUT_DATA to fill or change the content of any field in the request that you need, after the standard AIF mapping. In particular, you have to implement this method to fill certain fields that cannot be filled during the AIF mapping because they are customer-dependent (every customer will decide where to store the values for these fields in the system). Therefore, you will need to implement this method to fill the fields as explained below. 2.1. 2.2. 2.3.

Go to transaction SE24 and edit the implementation class created for the BAdI EDOC_ADAPTOR in the step 1. Implement the method SET_OUTPUT_DATA with a coding as explained in the following sections. The fields have to be filled depending on the source type of the eDocument. To extract the data based on the source document type, you can implement a logic like this:

DATA: LS_FI_INVOICE TYPE EDOC_SRC_DATA_FI_INVOICE, LS_SD_INVOICE TYPE EDOC_SRC_DATA_SD_INVOICE, LS_GI_POSTING TYPE EDOC_SRC_DATA_SD_GI, LS_EDOC_LIST

TYPE EDOC_SRC_DATA_LIST,

LT_IDTE

TYPE TABLE OF EDOCLIDTE.

DATA: LR_EDOCUMENT TYPE REF TO CL_EDOCUMENT_CL

FIELD-SYMBOLS: TYPE ANY. CASE IO_SOURCE->MV_SOURCE_TYPE. WHEN 'FI_INVOICE'. ASSIGN LS_FI_INVOICE TO . *

Get data of source document IO_SOURCE->GET_DATA( IMPORTING ES_DATA = ).

******* IMPLEMENT YOUR BUSISNESS LOGIC HERE TO GET THE VALUE FROM THE SOURCE D ATA ******* STRUCTURE LS_FI_INVOICE OR ANY CUSTOMER TABLE IN YOUR SYSTEM WHEN 'SD_INVOICE'. ASSIGN LS_SD_INVOICE TO . *

Get data of source document Copyright/Trademar

IO_SOURCE->GET_DATA( IMPORTING ES_DATA = ). ******* IMPLEMENT YOUR BUSISNESS LOGIC HERE TO GET THE VALUE FROM THE SOURCE D ATA ******* STRUCTURE LS_SD_INVOICE OR ANY CUSTOMER TABLE IN YOUR SYSTEM

WHEN 'GI_POSTING'. ASSIGN LS_GI_POSTING TO . *

Get data of source document IO_SOURCE->GET_DATA( IMPORTING ES_DATA = ).

******* IMPLEMENT YOUR BUSISNESS LOGIC HERE TO GET THE VALUE FROM THE SOURCE D ATA ******* STRUCTURE LS_GI_POSTING OR ANY CUSTOMER TABLE IN YOUR SYSTEM WHEN 'EDOC_LIST'. ASSIGN LS_EDOC_LIST TO . *

Get data of source document IO_SOURCE->GET_DATA( IMPORTING ES_DATA = ).

******* IMPLEMENT YOUR BUSISNESS LOGIC HERE TO GET THE VALUE FROM THE SOURCE D ATA WHEN 'LEDGER'. ASSIGN LS_EDOC_LIST TO . *

Get data of source document IO_SOURCE->GET_DATA( IMPORTING ES_DATA = ).

******* IMPLEMENT YOUR BUSISNESS LOGIC HERE TO GET THE VALUE FROM THE SOURCE D ATA WHEN 'SRC_FILE'. LR_EDOCUMENT ?= IO_EDOCUMENT. *

Get data of Incoming file LT_IDTE = LR_EDOCUMENT->MT_EDOCLIDTE[]. ******* IMPLEMENT YOUR BUSISNESS LOGIC HERE

WHEN ... * Other source types ENDCASE.

2.4.

Also, the fields might be relevant only for a certain type of electronic document (e.g. only for Debit Notes or Credit Notes or for specific DTE Types). To fill the data in the electronic document based on the eDocument type, you can implement a logic like this:

Copyright/Trademar

FIELD-SYMBOLS : TYPE EDO_CL_ENVIO_BOLETA,

TYPE EDO_CL_ENVIO_DTE, TYPE EDO_CL_SIGN_WAYBILL_LEDGER_RE4, TYPE EDO_CL_ENVIO_RECIBOS_TYPE.

* Fill the field in the output structure with the value that has been selecte d CASE IV_EDOC_TYPE. WHEN 'CL_DTE'. ASSIGN CS_OUTPUT_DATA TO . ******* IMPLEMENT YOUR BUSISNESS LOGIC HERE TO GET THE PREVIOUSLY SELECTED VA LUE ******* AND ASSIGN IT TO THE TARGET FIELD IN WHEN 'CL_BOLETA'. ASSIGN CS_OUTPUT_DATA TO . ******* IMPLEMENT YOUR BUSISNESS LOGIC HERE TO GET THE PREVIOUSLY SELECTED VA LUE ******* AND ASSIGN IT TO THE TARGET FIELD IN WHEN 'CL_DTESUM'. ASSIGN CS_OUTPUT_DATA TO . ******* IMPLEMENT YOUR BUSISNESS LOGIC HERE TO GET THE PREVIOUSLY SELECTED VA LUE ******* AND ASSIGN IT TO THE TARGET FIELD IN WHEN 'CL_DELNOTE'. ASSIGN CS_OUTPUT_DATA TO . ******* IMPLEMENT YOUR BUSISNESS LOGIC HERE TO GET THE PREVIOUSLY SELECTED VA LUE ******* AND ASSIGN IT TO THE TARGET FIELD IN WHEN 'CL_GRDTE'. ASSIGN CS_OUTPUT_DATA TO . ******* IMPLEMENT YOUR BUSISNESS LOGIC HERE TO GET THE PREVIOUSLY SELECTED VA LUE ******* AND ASSIGN IT TO THE TARGET FIELD IN

* WHEN ... * Other eDocument types ENDCASE.

3. Mandatory Fields 3.1. Boleta If you need to create eDocuments for Boleta from SD and FI documents, you will need to fill the following fields of the request after the AIF mapping using the method SET_OUTPUT_DATA of the BAdI EDOC_ADAPTOR: 3.1.1. Service Indicator - Field in XML: EnvioBOLETA / SetDTE /DTE/ Documento/Encabezado/IdDoc/IndServicio 3.1.2. Ticket Folio - Field in XML: EnvioBOLETA / SetDTE /DTE/ Documento/ Detalle/InfoTicket/FolioTicket Copyright/Trademar

3.1.3. Issue Date - Field in XML: EnvioBOLETA / SetDTE /DTE/ Documento/ Detalle/InfoTicket/FchGenera 3.1.4. Event Name - Field in XML: EnvioBOLETA / SetDTE /DTE/ Documento/ Detalle/InfoTicket/ NmbEvento 3.1.5. Ticket Type - Field in XML: EnvioBOLETA / SetDTE /DTE/ Documento/ Detalle/InfoTicket/ TpoTiket

3.1.6. Show Code - Field in XML: EnvioBOLETA / SetDTE /DTE/ Documento/ Detalle/InfoTicket/ CdgEvento 3.1.7. Date and Time of Show - Field in XML: EnvioBOLETA / SetDTE /DTE/ Documento/ Detalle/InfoTicket/FchEvento 3.1.8. Place of Show - Field in XML: EnvioBOLETA / SetDTE /DTE/ Documento/ Detalle/InfoTicket/LugarEvento 3.1.9. Location of Event - Field in XML: EnvioBOLETA / SetDTE /DTE/ Documento/ Detalle/InfoTicket/UbicEvento

3.2 Goods Receipt If you need to create Acknowledgement for Goods Receipt from Incoming documents, you will need to fill the following fields of the request after the AIF mapping using the method SET_OUTPUT_DATA of the BAdI EDOC_ADAPTOR: 3.2.1 Place where was received the goods

- Field in XML EnvioRecibos/SetRecibos/Recibo/DocumentoRecibo/Recinto 3.2.2 Goods receiver tax code

- Field in XML EnvioRecibos/SetRecibos/Recibo/DocumentoRecibo/RutFirma

Copyright/Trademar