First off this technique should work with any RFC connected system but since the only RFC connected system that I use is BizTalk it will therefore have some BizTalk specific information.
I have touched on this topic before in my web cast and in my blog that integrating with SAP can be tough due to the vast differences in terminology, process and technologies used. A situation that I have come across is that you often need a Subject Matter Expert (SME) or someone very familiar with a Business Process to generate an IDoc for a BizTalk developer to test or validate their portion of the integrated application. Sometimes creating an IDoc is very simple where as sometimes it may take a few transactions and screens to generate the IDoc in order to validate one of your use cases. This can lead to some frustration by both the BizTalk Developer and SAP resource as the BizTalk developer is always bothering the SAP resource to create “just one more IDoc”.
Something that a colleague brought to my attention was an SAP transaction called WE19 that allows you to re-process an existing IDoc. This allows the BizTalk developer to have the SAP resource create an initial IDoc and have the BizTalk developer re-submit that IDoc however many times they would like. Another benefit of this is process that involved deltas. We have a process where SAP will provide a “dump” of employee data that we need to update a down stream system with. We don’t need to process this data every day so we will just send the differences, or deltas, on a regular basis. So, even in a test or staging environment, once I have received the IDoc that contains all employee data I will not get that data again unless I ask for it. If we have not had any changes to our employees I will also not get the delta information either since there is no new data to feed the downstream system with.
Using this transaction is great because I don’t need to bother anyone from the SAP side to create data for me. All I need to know is when the last time that particular IDoc was sent. I can find this information in BizTalk by querying tracked message instances or by querying WE02 in SAP. Once I find this information I need to capture the IDoc number as this piece of information is required in order to resubmit the IDoc.
Here are 3 different ways to find an IDoc number. The first two involve BizTalk and the last involves using the WE02 transaction in SAP. You may want to check with your BASIS administrator if you do not have access to the WE02 transaction.
- Option #1 Obtaining the IDoc number from BizTalk Admin by viewing the message context property
- Use a Tracked Message Events query from BizTalk 2009 Admin console and right mouse click on the IDoc that you previously received and select “Message Details”
- Click on the “Context” caption
- Observe the “DOCNUM” value and record it (unfortunately you can’t copy or paste from this screen)
- Option #2 Saving IDoc message to disk and then inspecting context document.
- Once again find the particular IDoc that you are looking for by running a Tracked Message Events query from BizTalk 2009 Admin Console. Once you find this message, right mouse click and select “Save to File”
- Navigate to the folder that you saved these message to and open up the XML file that contains all of the message context information
- Once again locate the “DOCNUM” property and copy that value
- Option #3 Use SAP transaction WE02 to locate your IDOC
- Right mouse click on row and select “Copy Text”. Note it will copy all text in row.
Resubmitting the IDoc
- Now that you have the IDoc number using one of the approaches above you can navigate to SAP transaction WE19, populate the “Existing IDoc” field and click on the clock with the green checkmark in the upper left hand corner(underlined in red) .
- The selected IDoc will then be displayed and then click on the “Standard outbound processing” button
- You now have the ability to provide the number of instances of this IDoc that you would like sent so you can use this as a load testing tool for BizTalk as well. Click the green checkmark to proceed.
- You should now see a successful message indicating that the IDoc has been re-sent.
Summary
I know I have found the WE19 transaction to be very helpful so hopefully you will find it helpful as well. It can be pretty frustrating when you have a deadline and there is no one around to create IDocs for you. Using this approach will lessen your dependency on having a SAP resource around. You can also use this same technique to load up BizTalk with messages and test the robustness of the SAP adapter no matter whether it be the dot net connector version or the WCF version.