Skip to Content
author's profile photo Former Member
Former Member

Problem with executing bapi with structured input parameter

Hi Experts,

My RFC module requires input in form of a data structure.

So I my creating a model object for the structured input parameter . but he setter method requires arguement as abstraction list.What does it mean?

Zdata_Input getNewdata = new Zdata_Input();

wdContext.Zdata_Input().bind(getNewdata);

Zsubdata NewNo = new Zsubdata();

getNewdata.setZsubdata(NewNo); // giving Error

Zdata_input is my main context node .

Zsubdata is subnode of this model node .(Table Parameter in associated BAPI) .

Thanks in advance .

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on May 30, 2005 at 12:39 PM

    getNewData.addZSubData(NewNo);

    You probably have a table as import parameter in the RFC

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 30, 2005 at 12:48 PM

    If Zsubdata is an import Structure, then get the Model Class Name for Zsubdata.Suppose it is ModelSubdata.Then,

    ModelSubdata Obj = new ModelSubdata ();

    Obj.set<attribute1>;

    Obj.set<attribute2>;....

    getNewdata.setZsubdata(Obj);

    If Zsubdata is an import Table, then,

    for(all the elements to be added)

    {

    ModelSubdata obj = new ModelSubdata ();

    obj.set<attribute1>;

    .

    .

    getNewdata.addZsubdata(Obj);

    }

    Hope this helps

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 01, 2005 at 01:06 PM

    Hi

    In case of structures you will see some classes generated when you import the adaptive RFC models.

    Assume for your Bapi "Z_RFC_Input" there is a structure called ZSTRUCT

    then you will have a proxy class called "ZSTRUCT" generated.

    So in your code you would do something like

    Z_RFC_Input inp = new Z_RFC_Input();
    wdContext.nodeZ_RFC_Input_Element().bind(inp);
    
    //This is how you pass values to the structure
    
    ZSTRUCT zs = new ZSTRUCT();
    zs.set<Attribute1>();
    zs.set<Attribute2>();
    
    inp.set<Structname>(zs);
    
    try
    {
       //you execute the model
       wdContext.currentZ_RFC_InputElement.modelObject().execute();
    }
    catch(Exception e)
    {
    }

    Hope that helps.

    regards

    ravi

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 02, 2005 at 07:05 AM

    Thanks to every body . My Problem is solved because of your valuable help.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.