cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with executing bapi with structured input parameter

Former Member
0 Kudos

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 .

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

getNewData.addZSubData(NewNo);

You probably have a table as import parameter in the RFC

Answers (3)

Answers (3)

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

Hope this would be a good reference

Former Member
0 Kudos

Kindly close the discussion if it was solved.