cancel
Showing results for 
Search instead for 
Did you mean: 

Web Dynpro - RFC - empty output - Pls help

Former Member
0 Kudos

Hi Experts,

i'm getting crazy.

I try to develop a simple Web Dynpro application with a RFC Call (BAPI_CUSTOMERCODE_GETLIST).

I read several tutorials and tried really everything in the meantime, but my ResultView (a table) is still empty. I'm sure that there is nothing wrong or missing in my application in comparison with all the tutorials.

<b>I made following steps</b>

- create a Web Dynpro project

- create an application

- create an adaptive RFC-model

- use model for component

- create custom controller

- create context of custom controller

- create views StartView, ResultView (not in a viewset)

- craeted contexts of Views

- mapped contexts of views to context of custom controller

- created Layout; mapped UIElements (table) to View Context

- created Plugs, actions, data links between Views

- entered following source code in StartView, onActionCallBapi():

	wdThis.wdGetCustContrController().execute_CCBAPI();
	wdThis.wdFirePlugStartOutPlug();

- entered following source code in CustomController, wdDoInit():

	Bapi_Companycode_Getlist_Input input = new Bapi_Companycode_Getlist_Input();
	wdContext.nodeBapi_Companycode_Getlist_Input().bind(input);

- entered following source code in CustomController, execute_CCBAPI():

        try
	{
	wdContext.currentBapi_Companycode_Getlist_InputElement().modelObject().execute();
	}
	catch (WDDynamicRFCExecuteException ce) 
	{    
		msgMgr.reportException(ce.getLocalizedMessage(),true);
		ce.printStackTrace();
	}
	wdContext.nodeBapi_Companycode_Getlist_Output().invalidate();

<b>The result is a still empty table </b> shown in the ResultView. I made a trace in the backend R/3, the RFC call works, but my application, context or whatever seems to ignore the incoming data.

Does anyone have an idea, perhaps missing settings regarding the context or something else ???

Thank you !

Regards Andreas

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

I just sent a sample webdynpro Development Component but there are lots of nice sample applications in Tutorials section you can make use of them.

https://www.sdn.sap.com/irj/sdn/developerareas/webdynpro?rid=/library/uuid/49f2ea90-0201-0010-ce8e-d...

Thanks

Firasath

Former Member
0 Kudos

Hi Andreas, how are you?

I have the same problem as you had, I got empty output node, could you please sen me an example because I do not know how to solve it

My mail is michele.gonzalez@gmail.com

Best Regards!!!

Michele González

former_member8655
Active Participant
0 Kudos

Hi andreas,

in Try block after

ur execution of model

write some thing like this :

<b>wdContext.nodeBapi_Companycode_Getlist_InputElement().invalidate();</b>

Former Member
0 Kudos

Thank you guys !

<b>the problem is solved.</b> the reason was a wrong mapping between the model and the custom controller context.

I made that mapping manually before (via Context tab of custom controller) and i mapped the context output to the node "Bapi_Companycode_Getlist_Output" and not to the "Bapi_Companycode_Getlist_Input.Output".

Now i used the data modeler to create the model binding and he proposed the only right way.

By the way, i bought the book "Java programming with the SAP Web Application Server" authored by Karl Kessler, Peter Tillert, Panayot Dobrikov. It's a good base for fundamental understanding of the web dynpro architecture.

Therein i finally found the way to create the model editing via data modeler, which in the end led to objective.

Thank you, regards

Andreas

Former Member
0 Kudos

Hi Andreas,

I've got the same problem for several days. Would you just explain, how to use or to find this "data modeler?" Because I've got the same code as you and I have worked it out according to this tutorials you mentioned. The problem is: the table (I've got only one view in order to fix the problem)is there, but it's empty.

Thanks for your help!

Former Member
0 Kudos

Mireille,

in the NWDS in the 'Web Dynpro Explorer' move the mouse on your Component (the node below Web Dynpro Components). In the Contextmenu you find 'Open Data Modeler'.

In the Data Modeler window, go onto your Component Controller (or your Custom Controller, if you are using one) and click 'Apply Template' in the Contextmenu. This wizard creates everything you need, in particular the right model binding.

Regards

Former Member
0 Kudos

Hi Andreas,

Your code looks perfectly ok for me too. May be there's something wring with the data mapping. Immediately after executing the RFC, try printing the size of your output node in both your component & in your result view.

wdContext.node<name of your output node>().size();

Best Regards,

Nibu.

Former Member
0 Kudos

Hi Nibu,

thanx, tried your tip, both sizes are = 0.

Seems like something with the relation between the model and the custom controller context (model binding) is not o.k. ?

Will try again to make a new project ...

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

Check your model binding and context binding. Code looks good.

Regards,

Rich Heilman

Former Member
0 Kudos

Hi,

Please check if your output has suply relation role.In the context tab,you can select the output node and see their model class,structure and supplyRelationrole.Probably your supply relation role is not configured.

Let me know if its help.

former_member318735
Participant
0 Kudos

hi,

I've similar problem with a custom bapi. Where can i write this code to get output size?

Former Member
0 Kudos

Huseyin, hello

what do you mean by "<u>Where</u> can i write ..." ?

former_member318735
Participant
0 Kudos

Hi,

I mean in which section of code? how? Do i need to add additional elements to view?

I already solved the RFC problem. I can get and display data.

But still need to know this