I have configured IS 4.6 to receive and process IDOCs sent by SAP R/3. On successful completion of processing, the IDOC status in SAP is still shown as Status= 03 “Data passed to port OK”.
I would like to know, how to set the IDOC processing status in SAP for the processed IDOC.
this sounds interesting. But from where do you get the IDoc-No? The only thing I see in the pipeline after sending it is the TID. Sorry, I’m new to this…
Sorry for the delay in answering your question. The Idoc number is stored in the Idoc control record. Since you are new to this I would suggest the following:
Use pub.flow:savePipelineToFile service at the top of your integration to capture an outbound Idoc from SAP.
Once you have saved an Idoc, disable the service and use pub.flow:restorePipeLineFromFile to use the captured Idoc to step through your code.
Next place the sap.idoc:transformFlatToHierarchy service in your flow. The output of this service will be a record called ‘boundNode’.
Save your flow and step through it.
After the restorePipeLineFromFile service has executed, look at the results tab. You will see a number of strings, records, and record lists. The IDOC_CONTROL_REC_40 record list shows the Idoc number in the DOCNUM field. The IDOC_DATA_REC_40 record list shows the actual SAP data. This is just an FYI…be sure to read the footnote below! ,
After the transformFlatToHierarchy service executes, look at the results tab again and study the contents of ‘boundNode’. boundNode will look exactly like the Idoc structure found in R/3. This is the record you will use to map your data.
Expand all of the levels of boundNode and you will find the DOCNUM field in the EDI_DC40 segment.
Code the rest of your integration mapping and looping as necessary. The DOCNUM field from boundNode should be mapped to the DOCNUM field of the PI_T_WDLSP import table required by the RFC. Be sure to set the proper status in PI_STATUS whenever you actually call the RFC.
FOOTNOTE: Before you call the RFC, make sure the pipeline is as clean as possible. If you have any variables in there from previous interactions with SAP, they may interfere with your current call. For example, check out the variables in the pipeline after step 5 above. You should drop them ALL.
I’m not an ABAP expert, so I really don’t know of a way to easily retrieve the Idoc number that was assigned to the inbound message. The RFC mentioned above will not give you that functionality. Basically, SAP assigns a range of Idoc numbers to each app server, so depending on which app server you hit your message will be assigned a number in that range.
I would talk with the ALE guru on your project to find out if there is a way to configure the ALE Layer to return the Idoc numbers that are assigned to the messages when they post. They may need to write a custom program to do this because the flow service created from the inbound routing rule does not return the numbers.
I want to set IDoc processing status for Incoming IDocs(to IS).
Can you please give me(or direct me to) the details of RFC WDLD_EDI_STATUS_SET. (I’m new to SAP R/3 interfacing).
You need to pass the IDOC Number as a record list along with the appropriate status. For the exact definition of the RFC, use the Lookup Feature in the SAP adapter and specify the RFC name. It will give you all the export and import parameters.