
In Mexico, it is necessary that all companies receive tax authority validated XML and PDF files that contain the details of the payment made to vendors.
Its mandatory to extract the UUID number from the file that is received from the vendors and save it in a way that makes it easily accessible, in S4 it would be easier to store it in a custom table.
The importance of this interface is to store UUID in S4 system in order to facilitate users identify which invoices were payed to which vendors as well as reconciliation between EDICOM Portal and S4 system. The risk of not having this interface, is that files (PDF and XML) and UUID data will only be stored in EDICOM Portal and reconciliation to corresponding payments would be time consuming for users.
Interaction of SAP with EDICOM portal where SAP CPI is the middleware which sends the XML, PDF to S4. The technical requirement was to create a ODATA which can receive XML and PDF, also should extract UUID details from XML structure and update it to the respective document.
Simple flow chart:
Detailed Flow chart:
To receive and extract the details from XML file, ODATA interface is developed and the received XML and PDF files are attached to the respective FI document.
XML and PDF files are sent in base64 encoded format from SAP CPI then in S4 we make use of various function modules to convert it and make the attachment.
Created ODATA service in tcode SEGW - ZFI_PAYMENT_COMPLEMENT_002
In Data model the custom table ZFI_IF020_PAYCOM is used to give ODATA the reference structure. The last two fields ZPDF & ZXML are created in RAWSTRING format to store the XML and PDF files.
Regenerate the Runtime Artifact ZCL_ZFI_PAYMENT_COM_01_DPC_EXT
This gives us the class where we can write the required logic, here we have redefined the method PAY_COMPSET_CREATE_ENTITY – holds the logic to validate the inputs received from SAP CPI and the logic to add PDF and XML to the FI document.
FI_DOCUMENT_CHANGE FM is used to update UUID to the respecting FI document.
The above FM is passed with the required importing parameters.
PDF Attachment:
PDF file is sent in Base64 format from CPI to S4.
XML Attachment:
XML is also sent in Base64 format from CPI to S4.
If there is any error in the attachment the file is sent to AL11.
All the received inputs including XML and PDF are saved in a custom table.
Report:
Tcode - ZFI_PAYCOMP_MONITOR
A report is created to display the details received using custom table in which the entries made through ODATA Service and displayed in ALV format.
User can view the error details in description and also can select and reprocess the particular file after updating the missed details.
Created and activated the service ZFI_PAYMENT_COMPLEMENT_002_SRV in following tcode /n/iwfnd/maint_service
The ICF Node should be in active status as shown in the screenshot.
Hope this helps someone! 😊
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
1 | |
1 | |
1 | |
1 | |
1 | |
1 |