Skip to Content
avatar image
Former Member

How to pull data form R3

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • Best Answer
    avatar image
    Former Member
    Feb 06, 2007 at 09:42 AM

    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.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Feb 06, 2007 at 10:13 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      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.

  • avatar image
    Former Member
    Feb 06, 2007 at 07:27 AM

    Hi

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

    Monika

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Feb 06, 2007 at 12:47 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      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.