cancel
Showing results for 
Search instead for 
Did you mean: 

Consuming ABAP Webservice in Webdynpro app

Former Member
0 Kudos

Hi,

I have wrote a webdynpro app for consuming ABAP webservice. I used the procedure in the link below

http://wiki.sdn.sap.com/wiki/display/WDJava/ConsumingABAPWebServiceinJavaWD

Everything seemed to be went well, I created model and Webservice destinations. I have written the code for calling the webservice, which does not return data as part of response. I mean though the RFC returns data at the backend,its not showing the returned records in the webdynpro table.

I have also tried checking the same by setting external break point. when the webservice is executed from my webdynpro app,it goes to the ABAP debugger and i could clearly see the records in the export parameters of RFC,but the same is not returned in the reponse object.

Could any one let me know what could be missing. Any help is greatly appreciated?

I have used the following code in Init method of my View

Request_ZMYRFC input=new Request_ZMYRFC (model);
wdContext.nodeRequest_ZMYRFC ().bind(input);
	
ZMYRFC  req= new ZMYRFC (model);
req.setPUserid("EDLAS00C");
req.setPLtc("E");
input.setMYRFC (req);
		
 IWDMessageManager manager = wdComponentAPI.getMessageManager();
    try
    {
    wdContext.currentRequest_ZMYRFCElement().modelObject().execute();
      wdContext.nodeResponse().invalidate();
      wdContext.nodeZMYRFCResponse().invalidate();
      wdContext.nodeReturn_res().invalidate();
     wdContext.nodeItem_res_ret().invalidate();
      wdContext.nodeILtcg_res().invalidate();
      wdContext.nodeItem_res_ltcg().invalidate();
    }
    catch(Exception e)
    {
      manager.reportException(e.getMessage(), false);
    }

Thanks

Santhosh

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

This message was moderated.

Former Member
0 Kudos

which version of nwds is using?try to add the same code in component controller's exceute rfc method(i.e., excuteZMYRFC in your case).This method is automatically generated while creating model in nwds.include bind statement also in try block.

Edited by: Murthy Karaka on Mar 22, 2010 11:44 AM

Former Member
0 Kudos

Hi Murthy,

Thanks for the response.

Infact I have written the code in custom controller only. I mean I have used service controller which automatically generated the code. But still I m not getting data in Reponse node.

Do you think any other step is missing?

Infact data is being passed from WD to R3,that I can see in ABAP debugger.

Thanks for the help

Santhosh

Former Member
0 Kudos

santosh,

Check provider system defination in nwa for webservice.After this mapp the provider system and service group after wd app deployed.This is mandatory while consuming webservice in webdynpro for latest versions of CE7.11 or later.for reference check this article/document. http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/50d70a19-45a3-2b10-bba0-807d819daf46

Thanks,

Murthy.

Edited by: Murthy Karaka on Mar 22, 2010 12:59 PM

Former Member
0 Kudos

Hi Murthy,

Thanks for the reponse. I am working on EP 7.0,so provider system and service group might not be needed.

It works fine til passing of input data to R3,but from R3 system, data is not being shown in webdynpro.

I could see the returned rows in ABAP debugger.

Any ideas?

Former Member
0 Kudos

Hi all,

I got it worked. It seems there is some problem with the Table Prameters of RFC with webservice. Hence I have added the paramters under export tab of RFC with the table type structure which solved my issue

Thanks

Santhosh