DataXstream OMS+

SAP PI Dilemma: How to Get Production IDocs for Testing

SAP PI Dilemma: How to Get Production IDocs for Testing

Every SAP developer/consultant knows that to be able to test new programming logic and/or configuration efficiently and thoroughly, sufficient test data is required to ensure quality. I have worked on several SAP PI projects and have run into the issue of not having great test data (or, for that matter, any test data!) in my development/test environment. If you’re ever in a spot where you need to test IDocs from a different system, here is a step-by-step guide on how to get them without having to perform much setup.

Step 1: Locate an IDoc to Export

Before you perform the process of moving IDocs from production to your development environment, the first step is to identify an IDoc or IDocs in your production environment that you want to copy to your other environment.

Step 2: Export the IDoc

Execute SAP transaction WE19 and enter the IDoc number from the previous step. If you are exporting IDocs from a production system, I would suggest doing the following: Double click the EDIDC node to open up the EDIDC segment and delete all of the sender/receiver information (ports, partner no., etc.) to guard against the possibility of accidental reprocessing of production data.

Step 3: Export the IDoc as File

Select the button Inbound File and enter the server path and file name you wish to deposit the file and then uncheck the checkbox that says Start IDoc inbound processing of file immediately. This will save the file to the Application Server.

Step 4: Copy the File to the Development/Test SAP Server

Copy the file from the production SAP instance to the development/test SAP instance.  There are a variety of methods that can be utilized to accomplish this task.

Step 5: Create New File Port

If this is the first time you are transferring IDOCs, execute transaction WE21 to create a file port. Make sure that the Unicode format is not checked.

Step 6: Load IDoc File

Execute transaction WE16. Enter the path and name of the file that was placed on the application server. Enter the port created in the previous step and execute.

Step 7: Verify IDoc

To verify the IDoc, execute transaction WE02/WE05 to verify that the IDoc is there–it will be under the Inbound IDocs. Once the IDOC exists in the system, you can modify the control record with the IDoc test tool (transaction WE19).  Via WE19 the IDoc can be copied and processed as an inbound or outbound IDoc.

Summary

Provided these transactions are available, this is a fairly simple way to get IDocs from a Production system to a QA or Development system for testing. The benefit of using this method is avoiding the use of a basis resource to setup connections between systems. While this is not the preferred method to move mass quantities of IDocs from system to system, it is simple and quick.

2 Comments

  1. Avatar for Sunil Kumar
    Sunil Kumar
    May 12, 2021 at 6:01 pm · Reply

    Hi Author,
    May i ask if the inbound IDOC which we created using WE19 will create any problem.
    Good to hear about clearing port details but the generated IDOC, I am worried if the colleagues in charge try to process it. How to tackle this situation.

    thanks for your answer in advance.

    Regards,
    Sunil

  2. Avatar for Hendrik Maas
    Hendrik Maas
    August 3, 2022 at 5:39 pm · Reply

    If possible (release, system setup), I use TA: WLF_IDOC to send Idocs via RFC from Prod to Test.

    It is much easier as doing it via file.
    All best
    Hendrik

Leave a reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.