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

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

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();

}

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jul 07, 2010 at 07:20 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jul 07, 2010 at 07:03 AM

    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:

    initializing AbstractList Model in Custom Controller

    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/761eba66-0401-0010-b982-d5f5bd9e8f90?quicklink=index&overridelayout=true

    Hope it will helps

    Regards

    Arun

    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.