cancel
Showing results for 
Search instead for 
Did you mean: 

Design Requirement: Web Service

Former Member
0 Kudos

Hi All,

I am having one requirement where the XML file will come from legacy system and the same needs to be updated simultaneously to SAP ECC and synchronous Web service. So the flow wil be:

File -> PI -> ECC(Idoc) + Web Service (Synchronous)

We are planning to call the web service from enhance Idoc itself and update the record from there only, but i am not sure how enhanced Idoc will call the web service?

Is there any other approach to do the same? Please help.

Thanks!!

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

You could use one mapping and handle the web service portion with a UDF. If the webservice failed you can raise an exception so that the IDOC is not generated either. This would make it close to synchronous because IDOC adapter is naturally asynch.

Here is an example for a User Defined Function webservice call:

http://scn.sap.com/community/pi-and-soa-middleware/blog/2006/11/20/webservice-calls-from-a-user-defi...

markangelo_dihiansan
Active Contributor
0 Kudos

Hello Aaron,

Apologies, but I have to disagree.:) Since the mode of the sender is async, the retry mechanism comes into place. If there is an error, the message would persist and the webservice will be unnecessarily called multiple times (via the udf) until it goes into a system error. Although you could set the number of retries in RWB CC (Receiver Only) monitoring, it would be best used in a sync-sync scenario.

Regards,

Mark

Former Member
0 Kudos

Hi All,

Very rightly said by Mark, this is the reason we are not opting for the SOAP UDF design.

I am thinking of having something like this:

1) File -> PI -> ECC(Idoc)

using first interface i will archive the file on some PI location and create the Idoc in ECC. As soon as the file comes under archive location my second interface will pick that file. I will be using Request Response Bean in sender file adapter.

2) Sync File (from archive location) -> PI -> sysnc Web Service.

In the second interface, during the response mapping (between SOAP response and File response) i will do a RFC lookup and update the response in ECC system.

Note: The response is needed from web service and same needs to be updated in ECC because once the web service execution is sucessful, ECC system triggers the response IDOC.

Please suggest whether i am using correct design or not?

Thanks!!

rajasekhar_reddy14
Active Contributor
0 Kudos

Hi Vasant,

I concur with Mark replay.

Coming to your design looks okay but still i have a feleing that it is not a best design but it works. Try your approch then if any modification required people will give suggestions.

good luck

Regards,

Raj

Former Member
0 Kudos

Hi Mark, this aspect of retries comes down to error handling and design vs requirements. For example, if the web service is checking for update before inserting new, then sending the the vendor information multiple times may not matter (master data vs order data)

Vasant, you asked for ideas about making a synchronous interface with adapters that are naturally not synchronous. You might consider eliminating all files and IDOCS and use Proxy or RFC for talking with ECC as already suggested by Baskar.

Good luck!

Aaron

Former Member
0 Kudos

Hi Raj,

Why do you think, it is not the best design?? Please share your thoughts.

How you would have done this?

Thanks!!

rajasekhar_reddy14
Active Contributor
0 Kudos

1)Polling to archive folder not a right idea may be you can create one more folder FTP then point there,if your client okay with pointing to archive folder then no issues.

2)Updating response using RFC look up works but if you have more fields then it you might face some issues. but it works.

Based on that i said design not best but your design good.

Former Member
0 Kudos

Hi Raj,

Thanks for your inputs.

Probably one last question, i have only seen RFC lookups where we send some input and expect some output.

But in my case i am using RFC lookup for updating the table with web service response (web service reponse structure will have one field and that field data i am planning to send through RFC lookup). So that wil be possible??

Thanks!!

rajasekhar_reddy14
Active Contributor
0 Kudos

Yeah very much possible,

Design RFC Lookup:

Request ABAP Team to build one RFC function module it should have one req and response . The request is going to be your web service response and RFC response is going to be a just loike a confirmation like Web servioce response updated., you can supress this response in mapping level.

RFC Lookup always Sync hence we need some dummy response from ECC.

Hope you are clear.

Regards,

Raj

Former Member
0 Kudos

Thanks Raj!!

Will try to develop this scenario and get back to you in case of any doubts.

Thanks!!

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

Small calrification, I need to update the web service with the same File.

So, File will create the Idoc in ECC and the same file simultaneously needs to call the sysnc web service and update the file.

Once it is done (both ECC and Web service gets updated) i need to trigger a response Idoc from ECC and send it to Sender system.

So, if i split my design how will proxy (in case of Proxy -> SOAP scenario) will have the source file data?

Thanks!!

rajasekhar_reddy14
Active Contributor
0 Kudos

You really want Web service to be sync? if it is Async then

one interface

File----->PI------>IDoc/SOAP possible.

Then you develop one more interface to send response from SAP ECC to File.

baskar_gopalakrishnan2
Active Contributor
0 Kudos

>Once it is done (both ECC and Web service gets updated) i need to trigger a response Idoc from ECC and send it to Sender system.

How do you create response idoc from ECC?   Webservice is the one going to provide response for your request file not idoc... Please clarify the requirement.

Former Member
0 Kudos

Hi Raj,

Yes web service needs to be sync because the Web service will send the reponse as "ok" or "nok" (stating the the vendor has been uploaded in legacy system) ..... if both the message ceration is successfull (Cremas Idoc in ECC and web service response ) then response IDoc wil be triggered from SAP ECC

Thanks!!

rajasekhar_reddy14
Active Contributor
0 Kudos

The problem with File adapter is it wont support Sync communication hence you have to handle this requirement using ccBPM.

1)Instead of IDoc use ABAP Proxy and call Cremas IDoc from Proxy program and Proxy send back status to PI easily beause it supports Async.

2)SOAP adapter supports Sync and Async so no worries.. you can easily get reasponse from Web service and update the same to Sender File system.

If you want ECC reponse not real time then develop indivdual interface to send response back to File and you no need proxy (Point 1 changes not required).

Eventually you need ccBPM for this.

Regards,

Raj

Former Member
0 Kudos

Hi,

The req is file will have some vendor data and that file needs to be uploaded in SAP ECC (CREMAS) and one of the client's web service (so that data in ECC and Web service is in sync - client want in this way).

Now  ECC program will check that if Cremas Idoc is successfully created as well as the reponse from the web service is "OK" then it wil trigger one Response Idoc from SAP ECC and updates the same in sender system.

Thanks!!

Former Member
0 Kudos

Hi Raj,

Actually we dont want to use BPM so we thought that enhancement in the idoc will do the trick for us. This enhanced Idoc will call the sync web service and then if the response of this web service is sucessfull then ECC will trigger the response Idoc.

Do you think that this design will work? and how enhaced Idoc will call the web service?

Thanks!!

rajasekhar_reddy14
Active Contributor
0 Kudos

We can extend the IDoc with additiona fields but i doubt you can call web service from IDocs,, but we can call web service from ECC and vice versa.

But i dont think it is good design(as per my experience).

refer my first reply to your thread and apply that approch.

baskar_gopalakrishnan2
Active Contributor
0 Kudos

You cannot make a webservice call from idoc. You have to change your requirement to proxy from idoc.

baskar_gopalakrishnan2
Active Contributor
0 Kudos

If you do with your design, you would do partial through PI middleware and rest without PI (i.e from ECC to webservice).  I would also recommend to split the requirement into two interfaces. 

@Raja

>IDoc wont support Async communication henace i would recommend Proxy.

Idoc supports only async. Might be your typo.

Create two interfaces. FIle to Proxy. and another interface proxy to soap.  Since idoc supports only async you might not able to retrieve response from webservice using idoc. So better go for RFC or Proxy.

rajasekhar_reddy14
Active Contributor
0 Kudos

Hi Vasant,

Why dont you devide your requirement in to two interfaces

1)File to IDoc

2)Proxy to Web service.

From IDoc call a Proxy program to send data to PI then PI will call web service with request and response will send back to ECC.

IDoc wont support Async communication henace i would recommend Proxy.

Regards,

Raj

Ryan-Crosby
Active Contributor
0 Kudos

Hi Vasant,

I would have to second what Raja said here, he's right on with your requirement...

Regards,

Ryan Crosby

rajasekhar_reddy14
Active Contributor
0 Kudos

Typo mistake :      IDoc wont Support Sync communication .

Ryan-Crosby
Active Contributor
0 Kudos

Yea I figured it was a simple typo...