Processing ASN IDOC with SAP Application interface frame work
I read many SDN blogs on SAP AIF interfaces and its concepts. Based on the knowledge acquired from multiple blogs, I am writing this article in step wise by simplifying, implementing many of AIF features in one valid business case and to allow readers to get quick idea of SAP AIF interface implementation. Thank you Michal Krawczyk for all your effort and sharing knowledge through various blogs.
Business case: Supplier uses Advanced shipment notification (ASN) document to inform customer that he or she has sent the customer a delivery. Assuming this document sent in IDOC format to create inbound delivery in SAP. SAP application interface frame work to be used for processing these ASN inbound IDOC’s and monitoring its success and error IDOC postings by vendors, materials etc. Following is the step wise approach to process ASN IDOC within SAP AIF and how it allowed us, to use standard SAP AIF monitoring transaction /AIF/ERR for it.
- Create namespace for grouping of interfaces and to control accessing it. Use transaction code /AIF/CUST for it.
e.g. Created ZP2P Namespace to group all interfaces relevant to P2P scenarios
- For inbound ASN IDOC basic idoc type is DELVRY07 and valid message type is DESADV. Using Basic IDOC type and message type generate interface structure from transaction code /AIF/IDOC_GEN. Here i took IDOC process scenario 2 for processing idoc’s within SAP AIF. Input selection field entries appear as shown below.
After successful execution, AIF IDOC interface structure ZP2P_AIF_ASN generated and assigned to our interface IN_ASN.
Assignment of ASN_IN interface generated to the name space ZP2P.
Interface engine generated; Our ASN interface should be able to process IDOC within SAP AIF, update additional index tables for more specific selection of idoc segment fields and to provide log of it.
- Assign IDOC type DELVRY07 and Message type DESADV to the interface ASN_IN; I used message function to process ASN IDOC’s always in SAP AIF.
- Define action ZP2P_ASN_PROCESS and assignment to interface IN_ASN; This allows interface to process ASN idoc
- Function module ZP2P_AC_ID_CREATE created and assigned to action ZP2P_ASN_PROCESS
Create custom function group ZP2P_AIF and function module ZP2P_AC_ID_CREATE assign to action ZP2P_ASN_PROCESS.
Standard SAP uses FM /SPE/IDOC_INPUT_DESADV1 for ASN Idoc postings. Code implementation for our FM ZP2P_AC_ID_CREATE as follows.
To call IDOC posting FM ‘/SPE/IDOC_INPUT_DESADV1’
- Use transaction WE57 to create entry for assignment of ASN inbound idoc messages to process within SAP AIF.
- Create custom process code ZDLS from Transaction WE42
- Maintain partner profile from transaction code WE20
9. Creation of custom multi-index table ZP2P_ID_INX_MUL; This multi-index table used for saving message processing information along with ASN document item level index fields in AIF.
10. Create ZP2P_AIF_SEL_SCREEN module pool program for custom selection subn monitoring and error handling.
11. Assign custom tables ZP2P_ID_INX_SGL and ZP2P_ID_INX_MUL and custom
12. Selection screen inputs for search assignment to interface
- Testing Inbound ASN IDOC using IDOC test tool: Transaction WE19
- Standard SAP transaction code /AIF/ERR allows us to monitor logs. Inputs for our case as follows
This is my first SAP Blog, Although it seems repeating from different blogs with cuts & pieces. For better understanding, I implemented different SAP AIF features with essential steps required in one of standard sap valid business process.
I am looking forward from readers for suggestions and comments on it.
Relevant helpful blogs: https://blogs.sap.com/2012/10/20/michals-pi-tips-application-interface-framework-aif-idoc-processing-with-aif-actions/