cancel
Showing results for 
Search instead for 
Did you mean: 

Java dynpro - bind a table in the input parameters of an RFC

Former Member
0 Kudos

Hi ,

JAVA Webdynpro - I have to bind a table in the input parameters of an RFC.

The code below is taking in the N num of rows but is repeating the last row N times and

sending it to the RFC.

Ztsgt_Pos_Name postionTab = new Ztsgt_Pos_Name();

Ztsgt_Pos_Name.Ztsgt_Pos_Name_List positionTabList = new Ztsgt_Pos_Name.Ztsgt_Pos_Name_List();

int e = wdContext.nodePosition_List_update().size();

int f = 0;

for( f = 0; f < e; f = f+1 )

{

wdContext.nodePosition_List_update().setLeadSelection( f );

postionTab.setPosition_Nm( wdContext.nodePosition_List_update().currentPosition_List_updateElement().getPosition_Nm() );

postionTab.setPosition_Dscr( wdContext.nodePosition_List_update().getPosition_List_updateElementAt(f).getPosition_Dscr());

positionTabList.addZtsgt_Pos_Name( postionTab );

}

UpdatePosit.setPosition_List( positionTabList );

try {

wdContext.nodeZRFC_3318_UPDATE_VEND_POSITION().nodePosition_List5().invalidate();

wdContext.currentZRFC_3318_UPDATE_VEND_POSITIONElement().modelObject().execute();

wdContext.nodeOutput5().invalidate();

} catch (WDDynamicRFCExecuteException e1) {

// TODO Auto-generated catch block

e1.printStackTrace();

}

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Place follwoign line within for loop as first line; which will solve your issue:

Ztsgt_Pos_Name postionTab = new Ztsgt_Pos_Name();

Regards,

ganga

Former Member
0 Kudos

Thanks Ganga, You were Spot On.

It works now.

Thanks Arun for the Valuable inputs.

Answers (1)

Answers (1)

p330068
Active Contributor
0 Kudos

Hi SMI SAP Project Team,

Please check the code for loop and lead selection when you setting the values.

for( f = 0; f < e; f++)

Refer to below documents:

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/761eba66-0401-0010-b982-d5f5bd9e8...

Hope it will helps

Regards

Arun