Print and Send Invoice & Credit Memo E-Document (pdf, xml format) for Mexico via EDOC_COCKPIT
- Here all data is coming in XML format. Hence XML based Adobe form needs to be created. Layout and @30 custom fields need to be added and mapped to the form. SO its better approach with creation of custom XML based form and configure custom form in place of standard form.
- Here two different BADI will be required, given as below. One for adding custom fields in segment addenda and another one is required for remving added custom fields from addenda so as clients local customers will not receive custom fields.
- On research on google, we came to know that, there is a BADI EDOC_ADAPTOR has a provision to add custom fields in segment called addenda which further helps us to print them on PDF form.
- BADI EDOC_ADAPTOR will be implemented enhancement ZESD_CHANGE_DATA_PDF and class ZCLSD_CHANGE_DATA_PDF will be created. Here we are adding all custom fields required to print the form PDF.
- BADI EDOC_PARTNER_CONNECTOR will be implemented for edit the XMLfile. Here we are removing all custome fields which we have added for printing on PDF.
- New form will be created for this and it should be configure before starting with actual development.
- Form layout, form fields mapping and Logic for code of adding custom fields in addenda segment of BADI has been provided by functional specification. Code has been written in SET_OUTPUT_DATA method.
- As already mentioned in point 2, to fill addenda segment deep structure we have to create, which will hold header and item level data in one line. This is because BADI needs addenda data in the hexadecimal format before proceeding further.
- Once logic is ready and all required custom data is in the addenda segment, then we have to map the data on form which we have already created in SFP.
- We have to create XML based interface and mapped that interface with new form as our data in addenda is in XML format.
- There is no context button as in DDIC based form.
- We need to take following steps to upload our data structure to this form. We need to create data structure in XML format with addition of custom fields in same same order in which we have declared in our code while creating deep structure.
- Link for standard XML file will be provided by client to functional owners. XML file can be edited using Notepad++ for better readability. This will reduces the human errors in the file.
- Follow below steps to Upload above file to adobe form
- To upload the XSD file into a form Go to layout of your Adobe form.
- In Data View click on “Data Connection” then right click.
- if you already have a connection, delete it and add the new one. Deleting step has to follow only for 1st
- Once you click on delete system will ask you delete with mapping on form? Say No to this option or say Keep binding on form. Other wise it will remove all your mapping on form level as well and you need to remap whole form again with all properties
- Select “XSD SChema” and next. Add the XSD Document
And will be able to see the new fields added
After this step we can map our custom fields on form. To view PDF, we have to select In process document from EDOC_COCKPIT t-code and press submit.
Once it is submitted successfully it will turn into green status which means it got approved from local tax authorities and got stamped in XML format. After this step we can view pdf.
Once PDF is view successfully we can press sent to customer from EDOC_COCKPIT t-code. Once sent to customer, XML and PDF both will be sent to mentioned email id probably 3rd party like bank, local customers etc.
If 3rd party doesnot required custom fields which we have added in Addenda segment that we can remove using BADI EDOC_PARTNER_CONNECTOR