on 05-11-2006 1:05 PM
Hi All,
I need to pass a structure <b>Zess_Testtable</b> as a table parameter to the RFC.
This structure needs to hold multiple rows.
Currently I am using the below mentioned LOC.
<b>wdContext.currentZesstest1_InputElement().modelObject().addZpernr1(objESSTable);</b>
where objESSTable is a object of the Zess_Testtable structure.
However the above code works when the structure objESSTable has single of data.
For setting multiple rows of data I tried to use the below code:
<b>wdContext.nodeZesstest1_Input().nodeZpernr1().bind(objVector);</b>
Here objVector is object of Vector class holding multiple rows of the sturcture objESSTable.
But this is not working.
Please help!!
Hi Sanjay,
Assuming a model node, you can do something like this:
//BAPI model class
Z_Dsktp_Wi_Container_Read_Input read = new Z_Dsktp_Wi_Container_Read_Input();
//bind node with the model
wdContext.nodeZ_Dsktp_Wi_Container_Read_Input().bind(read);
//Swwwimulti is a structure (work area in ABAP terms).. add such multiple work areas to the BAPI
for (int i = 0; i < reqWi_Ids.size(); i++) {
Swwwimulti multi = new Swwwimulti();
multi.setWi_Id((String) reqWi_Ids.elementAt(i));
//add structure to the model
read.addIt_Wi_Id(multi);
}
Regards,
Rajit Srinivas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sanjay,
You need to put the structure into a loop for setting the
value of multiple rows.Please try with the procedure bellow
// Code for creating structure
ITechnicalDescription technicalDescription =
TechnicalDescriptionFactory.newTechnicalDescription(
"CO_DEMO",
"CO_DEMO_DESCRIPTION",
resourceAccessor,
locale);
IStructureInfo output =
technicalDescription.getOutputStructureInfo();
IStructureInfo accountStructure = output.addStructure("DemoOutPutData");
accountStructure.setMultiplicity(IStructureInfo.MULITIPLICITY_0_N);
accountStructure.addAttribute("Account", IAttributeInfo.BASE_STRING);
// Code for setting the value of the structure with multiple row
IStructure output = executionContext.getOutputStructure();
for(int i=0;i < wdContext.node_<Name>.size(); i++)
{
IStructure accntstr= output.addStructure("DemoOutPutData");
accntstr.setAttributeValue("Account" ,<value> );
}
I think this will be helpful.
Thanks
Chandan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
78 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.