Very very urgent

can any one please tell me how to write a service to receive an idoc from sap .

a service to receive an idoc from sap -please help


Tell us how the source SAP is transporting the IDOC to webMethods?
Is it from SAP Adapter or http or FTP??

If you are using webMethods SAP Adapter please use the following sequence of WmSAP Package services in your receiving flow service:


Note:Before this you have to setup the SAP Adapter and create RFC Listener(which talks to SAP system)and Routing rules like(sender/receiver/messagetype/receivingServiceName etc…

Please also go thru the SAPAdapterUserguide for more information.

Note:If you are very urgent anytime use the Search functionality provided in this site.

Hope this helps,

Thankyou very much RMg.The sap is transporting the idoc to webMethods.I am new to webMethods.can u please explain in detail .or if u would please export me the flowservice package so that i can see and understand and do e-mail i.d is alot again


Check this thread,

And request this persion “Michel R. Osborne” (WM-SAP Expert)may be he can help you with some ideas for starters.



  I contacted Mr.Mike Carlson but he gave me a reply he didnt know  

about WmJBoss .Do u know anybody who is working on WmJBoss.
my problem was regarding Receive message from Queue in WmJBoss.


I have a question related to this topic.

I have written a general service to encode the Idoc received from the SAP adapter into XML format. The XML is then passed to TN where routing, etc. is sorted out via processing rules, etc.

I have registered this service as the inbound service for the default handling of Idoc’s.

Everything works fine. The XML gets posted to TN appropriately and routed provided I have set up TN appropriately. However, I still see that the wm.PartnerMgr.gateway.runtime.InboundProcess service is being invoked (it subsequently encounters an exception due to my cleansing of the pipeline).

I obviously am missing something. My intent is to bypass the Partner Manager. I thought if a routing rule was defined in the SAP Adapter satisfying a particular Idoc, then that Idoc would not be passed to the Partner Manager. What is missing?

Many thanks for any help/ideas provided.

To bypass the partner manager, you define a map on the server list page not a routing rule on the Routing page. You’ll want to define a map for the INBOUND_IDOC_PROCESS and IDOC_INBOUND_ASYNCHRONOUS function modules to call your service. The project I’m currently on is doing exactly this. You don’t need to define anything on the Routing section of the adapter admin.

Thank you very much Rob. I pretty much understand now what has to be done.

Another question if you don’t mind. The service associated with IDOC_INBOUND_ASYNCHRONOUS (or INBOUND_IDOC_PROCESS), will
IDOC_CONTROL_REC_40, IDOC_DATA_REC_40, etc. be in the pipeline as before or does the service need to do more than previously (when invoked via the Partner Manager)?

Thanks again!

Call sap.idoc:decodeSDATA as the first step in your service to get those vars in the pipeline.

Thanks Rob. I haven’t been able to look at this for a few weeks.

My service is being invoked as expected. However, I am still having problems seeing the Idoc information in the pipeline. I have added a savePipelineToFile as the first step. Upon inspecting the pipeline, I do not see the necessary Idoc information.

Invoking sap.idoc:decodeSDATA results in an exception: Input values do not contain IDOC control and data tables

Any suggestions as to what may going wrong? The service is invoked, nothing is going to the Partner Manager, etc.

As always, your assistance is much appreciated!

Please ignore the previous post.

Even though sap.idoc:decodeSDATA results in an exception, the vars I require are brought into the pipeline as you noted should be the case.

Is there a way to avoid having the exception thrown?

Thanks for the help!

Your service is likely being invoked multiple times with different values for $action. The first time, decodeSDATA will work just fine. This is for $action=1 (create I think). Then your service is invoked with $action=3 (commit) and then 4 (confirm). In these two cases, decodeSDATA will complain. $action might be 2 (rollback) instead. Add code to handle/ignore $action>1 and the exceptions should go away.

Thank you Rob. I implemented your suggestion and no undesired exceptions are currently encountered.

Many thanks for the assistance!

Hi Rob,

i run into the same problems like Joe. Unfortunately , I did what you described in your posting and my service throws an exception for $action = 1: Input values do not contain IDOC control and data tables.

I did a copy of the pipeline - there are no IDoc data available. (See attachment)

My feeling is, that the Idoc contains no data. Do I have an other chance to check the Idata - content before processing the Idata in my flow?


SavedIDOc (1.1 k)