Skip to Content

step by step Idoc to file scenario

Author: Chandana Wijetunga

Configuration steps in Integration Repository:

This is the IDOC structure we are going to use in our scenario.

Figure 1 IDoc structure used in scenario.

  1. P.N – Since we are using input as IDOC we do not require to create input datatype.

Figure 2 Final output data type

  1. Create Message Type for the final data type as shown in figure 3

Figure 3 Message Type for final data type

  1. Only one message interface is required for file which will be asynchronous inbound message interface. Message interface for sender system is not required as IDoc sits on the ABAP stack. The message is directly triggered from sender system to integration pipeline. The message interface is created as shown in figure 4.

Figure 4 Inbound-Asynchronous Message Interface

  1. No Message Mapping is required as XSL will be used as mapping program.   Since Segment Asset appears multiple times in IDoc, to retain the context of the segment XSLT program will be used which will convert the hierarchy of the IDoc to the flat structure and will retain order of the segment in which it appears.
  2. Create the Interface Mapping with source as IDoc and data type created as target. Use XSL program as mapping program as shown in fig 5.

Fig 5 Interface Mapping using XSL Program

Configuration steps in Integration Directory:

  1. a> Create one communication channel as shown in figure 6. Make sure that the service selected is of 3rd party in System Landscape Directory.  

b> Specify the FTP parameters and set the Connection Mode as permanently because we want to generate the CSV file as soon as IDoc is generated. Specify the directory in which you want to specify the file.

c> Specify the content conversion on receiver side as shown in figure 7 for all the segments. Specify field names, field separator and end separator in the content conversion for the segments including header and trailer.

Figure 6 FTP details of communication channel

Figure 7 Content conversion on receiver side

  1. No Sender Agreement is required in this scenario as IDoc sits on the ABAP stack.

  1. Create the Receiver Agreement as shown in figure 8.

Figure 8 Receiver Agreement with SAPISU as sender and file as receiver

  1. Create Receiver Determination as shown in figure 9

Figure 9 Receiver Determination

  1. Create Interface Determination as shown in figure 10.

Figure 10 Interface Determination for IDoc to File Scenario

All the objects created should be activated without any error. Make sure of the following steps to test the scenario.

Monitoring the flow

  1. Log in to Adaptor Monitor and check for the file adaptor. The status of the adaptor should be green and working.
  2. Check the ftp connection, it should connect to destination folder without any error.
  3. Log in to sender system, go to transaction WE19 (test tool to generate IDoc), generate Idoc of the required message type.
  4. Log in to Xi system and execute transaction SXMB_MONI and check for the XML messages. Use your source and destination system to filter messages, it should have chequered flag.
  5. Check the destination directory, it should have file with the name specified along with the time stamp. Check the file, it should have data for all segments. 
Be the first to leave a comment
You must be Logged on to comment or reply to a post.