cancel
Showing results for 
Search instead for 
Did you mean: 

Exposing IDoc as Webservice

Former Member
0 Kudos

Hello Everybody,

I want to find the way how can i expose the IDoc as webservice.

First of all is it possible? If yes then how can we achieve this?

Thanks In advance,

Bhavik

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

From my understanding, an IDoc is a container of data. The best you can do is to expose the Function Module as webservice that creates/updates the IDoc you want to work with.

There are more than one options available, depending on the technology you intend to use. You could, e.g. use Business Connector to expose the FM as a webservice. The online documentation for BC details the process step-by-step. Similarly, any SAP interfacing technology that allows to deploy webservices can be used to expose the FM.

Hope it helps.

Regards

Shehryar

Former Member
0 Kudos

Hi Shehryar,

Thats true.

There are alternate scenarios for that. But i just want to know that is it possible?

If yes then how can we do that?

Thanks for the reply,

Bhavik

Former Member
0 Kudos

Hi Bhavik,

There is a basic difference between web service and IDOC. Web service is a call based interface, where you use request and response mechanism to call a functionality, these are mostly synchronous. IDOC is document based interface, these are mostly assynchronous.

Coming to your problem, since you want to use IDOC's you can not expect to get a response synchronously(Processing of IDOC depends on partner profile) and I am quite sure you are talking about an inbound scenario because for outbound scenario you will consume web service rather than exposing web service.

If my assumption is correct then from WAS 6.20 onwards you can use FM IDOC_PROCESS_ASYNCHRONOUS (I can't recall the exact name of the FM but it sounds like this) and create a WSDL for this using BSP application 'WEBSERVICEBROWSER'.

Regards,

Sanjeev

Former Member
0 Kudos

Hi Sanjeev,

Thanks for your suggesion. can you please give me the Exact FM name? Because i didnt find any such FM module in my SAP R/3 system.

And what exactly this FM does?

Regards,

Bhavik

Former Member
0 Kudos

IDOC_INBOUND_ASYNCHRONOUS

Former Member
0 Kudos

Hi Sanjeev,

What this function module exactly does?

What i want is, I want to post data for creating Purchase order in SAP r/3 through IDoc.

As i cant use this IDoc from outside directly, I have two options.

1. Expose this IDoc as webservice and then use this Webservice across any systems.

2. Expose some Function module as webservice and this Function module behaves like wrraper for this IDoc. Means, this Function module creates IDOc internally.

So, how can i achieve this?

Thanks in advance,

Bhavik

athavanraja
Active Contributor
0 Kudos

if the requirement is to create purchase order using webservice method why cant you just use the BAPI

BAPI_PO_CREATE1 .

just give the WSDL for this to the application which want to consume this webservice.

or is it that you want to do it only thru IDOC method? if yes

look at the service at trnsaction SICF

sap/bc/idoc_xml

to this node the external application can post XML document (IDOC in xml format).

Take a look at the handler class code of this node which would give you some idea.

Regards

Raja

Former Member
0 Kudos

Hi Raja,

I checked transaction SICF but there i didn't find idoc_xml under bc node.

There is another way to look at that?

Thanks in Advance,

Bhavik

athavanraja
Active Contributor
0 Kudos

we are are WAS6.4 maybe its a new feature in WAS6.4 Are you also on WAS6.4

Regards

Raja

Former Member
0 Kudos

Hi Raja,

I am trying this thing on SAP R/3 4.70 system.

Is it required to WAS6.40?

Our WAS 6.40 is down at this time. so, i will check when its up.

Thanks,

Bhavik

Former Member
0 Kudos

Hi Bhavik,

No you are not required to have a WAS 6.40 for accepting IDOC as XML over http port. We have done that on R3 4.7 Enterprise. Only difference is that you need to create a service in SICF (if you have the authorization you can do that easily). In the 'handler list' tab of the service put 'CL_HTTP_IDOC_XML_REQUEST' and activate the service. You are ready to accept the IDOC-XML over http.

Regards,

Sanjeev

Former Member
0 Kudos

Hi Sanjeev,

Do you know what all parameters need to pass to this handler's method?

Thanks,

Bhavik

Message was edited by: Bhavik Devisha

Former Member
0 Kudos

Hi Bhavik,

You don't need to call any method ICM takes care of that automatically, once you have specified this class as handler for the service you can post an XML IDOC on the URL of the service.

Regards,

Sanjeev

Former Member
0 Kudos

Hi Sanjeev,

from where i can get that URL for this service?

Regards,

Bhavik

Former Member
0 Kudos

Hi Bhavik,

Click on you ICF service, what you get in the ICF path is your URL (replace default host with your ICM host name and port).

Regards,

Sanjeev

athavanraja
Active Contributor
0 Kudos

transaction SICF

Former Member
0 Kudos

Hi Sanjeev,

Thanks for your reply.

Thats right.

I got that URL but i think i have to pass some data as parameters to this URL also. But i don't know what are the parameters for that.

Is any additional parameters are required for that? or simply post the Idoc data to this URL?

Thnaks,

Bhavik

Former Member
0 Kudos

Hi Sanjeev,

Thanks for your reply.

Thats right.

I got that URL but i think i have to pass some data as parameters to this URL also. But i don't know what are the parameters for that.

Is any additional parameters are required for that? or simply post the Idoc data to this URL?

And what is the structure of the IDoc data payload?

Thnaks,

Bhavik

Former Member
0 Kudos

Hi Sanjeev,

Thanks for your reply.

Thats right.

I got that URL but i think i have to pass some data as parameters to this URL also. But i don't know what are the parameters for that.

Is any additional parameters are required for that? or simply post the Idoc data to this URL?

And what is the structure of the IDoc data payload?

Thnaks,

Bhavik

Former Member
0 Kudos

Sorry for multiple post for the same.

Its because of the server problem or my connection problem.

So, ignore multiple posts.

Message was edited by: Bhavik Devisha

Former Member
0 Kudos

Bhavik,

You need to post an XML-IDOC to this URL. If you don't know how to post XML document to a URL take help from a friend.

cheers,

Sanjeev

Former Member
0 Kudos

Hi Sanjeev,

Here i have asked but i didnt get convinced reply. I know how to post XML data to this service. But i don't know what is the structure oh this XML data and is it requires any additional parameters in URL?

Thanks,

Bhavik

Former Member
0 Kudos

to know the structure of XML data you need the schema for the IDOC which you can get using transaction WE60 or from ifr.sap.com.

-Sanjeev

Former Member
0 Kudos

Hi Sanjeev,

Now, I am passing the XML data for CREMAS.CREMAS03 IDoc to the idoc_xml service to the following HTTP request:

http://<host name>:<port>/sap/bc/idoc_xml?sap-user=<user>&sap-password=<password>&sap-client=<client>&sap-language=E

Is this link is correct or not.

When i am passing the data to this URL it is giving me the response code 407 which is because of some conflicts.

Any ideas behind this?

Thanx,

Bhavik

Former Member
0 Kudos

Bhavik,

Did you ever find the solution for this. We also want to post IDOC using WebService. I could not find the idoc_xml service also, the way document describes. Input will be highly appriciated

Thanks,

Sanjay Amin

Answers (0)