cancel
Showing results for 
Search instead for 
Did you mean: 

How to pull data form R3

Former Member
0 Kudos

Hi

I have a requirement that i hv to pull data from BAPI and display it as a popup so that user can select..

I dint understand how to carry on with this.

I have pulled data into component controller from R3

But its giving me error

"ContextModelNode modTest [modelClass]: The context model node has not been bound to a model class (Hint: A Context model node has to be bound to a model class or mapped to a model node of another controller.)"

Can anybody tell me step by step procedure to do this..

Thanks

Monika

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Import the model into WD naming supposr RAMA.

register the model into webdynpro using the usedmodels.

Then goto the Customcontroller the model nodes are avail in rightside of your cutomcustomcontrollercontext and do the Model binding.

Once you get the model into your cuctomcontroller u can register the custom controller into viewcontroller and getting the nodes into view context.

And goto the View and apply template and create the Table by using the existing node.

Goto the init method of the View controller and add the following code.

FNModule_Input input = new FNModule_Input();

wdContext.nodeFNModule_Input().bind(input);

// pass the input

input.setZ_Kunnr("0000000001");

try {

wdContext.currentFNModule_InputElement().modelObject().execute();

wdContext.nodeOutput().invalidate();

} catch (WDDynamicRFCExecuteException e) {

// TODO Auto-generated catch block

e.printStackTrace();

}

This might helps you.

thanks,

Lohi.

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Lohitha

i has been done..

Can u tell me the code to display get the values from R3..

means i have succesfully called BAPI bt wn i displaying the values for a particular field stored in R3 it is giving me something like this..

NodeElement(Testcomp..Output.Plant_List.0)

I have used this code..

String dropvalue=String.valueOf(wdContext.nodeOutput().nodePlant_List().getElementAt(i));

to get values what i have to do..

Thanks

Monika

Former Member
0 Kudos

Hi,

this returns Array of values but you are storing the String only take any ArrayList or String array then you can utilize.

U are going to use this value as one field or a table filed.

Thanks,

Lohi.

Former Member
0 Kudos

The code which i have written in the component controller is:-

Isa_Get_Plants_List_Input input=new Isa_Get_Plants_List_Input();

wdContext.nodeIsa_Get_Plants_List_Input().bind(input);

Plantnames pn=new Plantnames();

try

{

wdContext.nodeIsa_Get_Plants_List_Input ().currentIsa_Get_Plants_List_InputElement().modelObject().execute();

wdContext.nodeIsa_Get_Plants_List_Input().nodeOutput().invalidate();

}

catch(Exception e)

{

e.printStackTrace();

}

int size=wdContext.nodePlant_List().size();

String size1 = String.valueOf(size);

wdComponentAPI.getMessageManager().reportSuccess(size1);

but when i m printing size1 it is showing me 0.

bt in R3 there r 86 entries..

can anybody tell me the reason for this..

Thanks

Monika

Former Member
0 Kudos

Hi,

takes care your Outputnode.

Every function module output table structures always put under one output node.

Under that node only all your output structures will available.

But you can use the statement like this.

int size = wdcontext.nodeoutput().size();

Then you can get the size or other wise send me your output nodestructure

such that we will find the where the error is .

Thanks,

Lohi.

Former Member
0 Kudos

Hi

i forgot to tell that all the data should e pulled into the simple type

Monika

former_member188556
Active Contributor
0 Kudos

Hi Monika,

Use this

<a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/bfbcd790-0201-0010-679d-e36a3c6b89fa">RFC</a>

to know how to pull the data from R3 into ur iView

Regards

BP

Award points if found usefull

Former Member
0 Kudos

Hi Monika,

I think there is something wrong with the way you call the model. Check <a href="http://help.sap.com/saphelp_nw2004s/helpdata/en/5d/3c96e4c1c3934cbd9c19fb9df49944/content.htm">this example</a> to get it working.

Regards,

Christophe