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.

  1. Create namespace for grouping of interfaces and to control accessing it. Use transaction code /AIF/CUST for it.

Config%20path%201

Config path 1

 

e.g. Created ZP2P Namespace to group all interfaces relevant to P2P scenarios

Namespace

Namespace

  1. 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.

AIF%20Interface%20Generator

AIF Interface Generator

After successful execution, AIF IDOC interface structure ZP2P_AIF_ASN generated and assigned to our interface IN_ASN.

AIF%20Interface%20structure

AIF Interface structure

Assignment of ASN_IN interface generated to the name space ZP2P.

AIF%20Interface%20Config%20path

AIF Interface Config path

AIF%20Interface

AIF Interface

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.

Interface%20engine%20-%20Config%20path

Interface engine – Config path

Interface%20engine

Interface engine

  1. 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.Assign%20Idoc%20-%20Config%20pathAssign%20Idoc%20type
  2. Define action ZP2P_ASN_PROCESS and assignment to interface IN_ASN; This allows interface to process ASN idoc

Define%20Action

Define Action

Define%20Action

Define Action

 

Action%20-%20SAP%20Config%20path

Action – SAP Config path

Action%20assignment

Action assignment

  1. Function module ZP2P_AC_ID_CREATE created and assigned to action ZP2P_ASN_PROCESS

FM%20Assignment%20to%20Action

FM Assignment to Action

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’

FM%20for%20Action

FM for Action

  1. Use transaction WE57 to create entry for assignment of ASN inbound idoc messages to process within SAP AIF.

  1. Create custom process code ZDLS from Transaction WE42

  1. Maintain partner profile from transaction code WE20

8. Creation of custom single index table ZP2P_ID_INX_SGL with fields VBELN and LIFEX; This single-index table used for saving message processing information along with ASN document header level index fields in AIF.

 

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

  1. Testing Inbound ASN IDOC using IDOC test tool: Transaction WE19
  2. 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/

Sara Sampaio

Sara Sampaio

Author Since: March 10, 2022

0 0 votes
Article Rating
Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x