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

Problem with Binding tables to context nodes

Hi All,

I have a problem with binding tables to context nodes.

I'm using an RFC (FM1) that returns tables with GUIDs. I have to feed these tables as input to a different function module (FM2) for execution.

I tried to bind the tables returned from FM1 to FM2. I've used an input structure of the node, have add the tables to it. I've bound this input structure to the FM2 node.

When I execute the FM2 these table rows are appended to the existing FM2 tables. I actually need just the values to be copied to the input tables.

FM1- ZABC

Node ZABC - OUTPUT - A,B tables (sub nodes)

FM2 - ZXYZ

Node ZXYZ INPUT - X, Y tables (sub nodes)

Structures X1, Y1 of type X and Y respectively

Structure ZXYZ1 of type ZXYZ

Copied values from Output of ZABC A and B into X1 and Y1.

ZXYZ1.addX1

ZXYZ1.addY1

nodeXYZ.bind(ZXYZ1)

Executed FM ZXYZ

Version: NWDS 2.0

Netweaver 2004s SP15

Thank you,

Vasu

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Mar 13, 2009 at 04:41 AM

    Hi Vasu,

    It seems you get the results but the older data is still there & you need to clear that data.

    You can invalidate the context like wdContext.nodeOutput().invalidate() (you can call this code at time of execute statement)

    Kind Regards,

    Nitin

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Mar 13, 2009 at 04:49 AM

    Hi

    You can use the methods WDCopyService

    Example : WDCopyService.copyElements(source, target)

    Best Regards

    Satish Kumar

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      HI

      May be you can fetch the data from the table with looping the table size and catching the

      index of the elements . To be more clear .

      1 . get the size of the table .

      int leadSelection= wdcontext.node<TableName>.getLeadSelection();

      for (int i=0 ;i<n;i++)

      {

      if(wdcontext.node<tablename>.isMultiselected(leadSelection))

      {

      String name = wdcontext.node<tablename>.getelementatindex(leadSelection).getname();

      similarly fetch the size of the other elements from the table .

      and set to other RFC as

      ZClass abc = new ZClass();

      abc.setName(name);

      wdcontext.node<NameName>.bind(abc);

      and othere thing is when you use Abstract class you can insert only one element at a time .

      or may be you may want to set the values direclty to the RFC

      AbstractList lst = new ZClass.ZClassList();

      ZClass cls = new ZClass();

      clas.setName(name)

      lst.add(class);

      wdcontext.currentRFcNameElement.modelObject.setName(lst);

      and

      execute the RFC .

      murali

  • author's profile photo Former Member
    Former Member
    Posted on Mar 30, 2009 at 06:34 PM

    Hi,,

    you need to make loop with you first node size and get the values from first node, and set the values to second node.

    you need to create the elements for both the nodes and get and set the values based on the condition, by using the loop you can get the value of every field.

    like wdContext.node<nodename>.get<nodename>Elementat(i). - to get the record at " ith " position.

    wdContext.node<nodename>.get<nodename>Elementat(i).get<attributename>(); to get the value of a field at a specific position from a record.

    after getting the values from the first node you can set that to second node right

    may be it can help you,

    Cheers,

    Appu

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      I've declared abstract lists of type (FM tables). I've added rows to this lists and set this lists to the function module nodes. This way, news rows are not added and the problem is resolved.

      In the example I mentioned.

      FM2 - ZXYZ

      Node ZXYZ INPUT - X, Y tables (sub nodes)

      Abstractlist of type input tables (X,Y) in the model

      ZXYZ.setAbstractlistX

      ZXYZ.setAbstractlistY

      Executed FM ZXYZ

      Thank you,

      Vasu

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.