Skip to Content

I have recently come  across the need to “manually” move an IDoc for testing purposes form one SAP system to another. The two systems were in two different environments and not planned to be connected network wise. So we needed a way to export and import an IDoc.

The idea was to export the IDoc on system A to a file and then import it in system B from that file. It seemed an easy task, but turned out to be quite tricky. I haven’t found much help from searching online or in SAP docs but enough to put something together that worked at the end. I’d like to share this here in a step-by-step guide.

Please note that this is only for manual testing purposes for single cases and not intended to serve as any kind of IDoc interface.

We firsts export an existing IDoc from source system, download the file to the local computer and then upload it to another system:

 

 

1 How to export a flat IDoc file in SAP ERP:

 

SAP GUI, Transaction Code: WE19

  1. Load an existing Idoc (see we02) via idoc number.
  2. Click on “inbound file” (note: this is actually confusing. You’re going to write a file to the file system, but the function is called inbound file. But it’s all right and you can go ahead.)
  3. Enter a path on the server (use transaction AL11 to find a suitable path) and a filename. The file name can be chosen freely. Execute the function and ignore the error about the not found port!

 

  1. Download the exported file to your local machine using Transaction Code: CG3Y (or FM ARCHIVFILE_SERVER_TO_CLIENT as per a reader’s comment).
    You can also use AL11 which displays a list of all available files. Select the file and then click the button marked below (“Download File as Text”):
  2. Target is a patch on your local machine.
  3. Choose ASC for ASCII mode.
  4. Execute the download.
  5. You can now edit the file on your PC if needed, or further process/distribute it. Or you can now upload it e.g. to another SAP system and edit it there before processing (see next chapter).

 

 

2 Upload and Inbound Process a Flat IDoc File

  1. Upload the file using transaction code CG3Z (or FM ARCHIVFILE_CLIENT_TO_SERVER as per a reader’s comment) e.g. to a temp directory.
  2. Use t.code WE19 and select “File as Template”.
  3. Enter the path where you’ve uploaded the file and the filename.
  4. The test tool displays your IDoc, you can also change it here.
  5. You also need to create the control record (I don’t go into details of this here as this is required knowledge about the standard IDoc processing and can be found elsewhere). To create the control record, click on the first line in the editor and enter the data as needed (of course, change the name to your IDoc’s message type. Here it’s a business partner IDoc) :
  6. When you’re ready, click “Standard Inbound”. If a partner profile (WE20) exists, it will be processed after executing the function (or collected for later processing). See the status of the new IDoc in WE02.

 

To report this post you need to login first.

4 Comments

You must be Logged on to comment or reply to a post.

  1. Former Member

    Good post, I’ve seen request for this before, only for newer installed systems these up/download transactions are not present, but there are functon modules that have similar functionality:

    CG3Y -> FM ARCHIVFILE_SERVER_TO_CLIENT

    CG3Z -> FM ARCHIVFILE_CLIENT_TO_SERVER

     

    (1) 
    1. Philippe Addor Post author

      Thank for posting the FM names!

      I was working on a S4/HANA system that was relatively newly installed but customized to some extend already, and the transactions were present.

      (0) 
  2. Michelle Crapo

    Nice!   Anything that can get me from a production system to my development one is a great post!  IDOCs always are a bit of a challenge with the deep structures.

    (1) 

Leave a Reply