cancel
Showing results for 
Search instead for 
Did you mean: 

how to bind internal table values with RootUIElement(Table) from select Que

Former Member
0 Kudos

Hello Friends,

In my view Layout,there r two Input fields ,Submit button and Table... My concept is when user posting values in two input fields and clicking submit button means the result(more than one values) should be displayed in Table...

I written coding also but i dont know to bind internal table values with Table... My code as follows,

method onactionsearch .

data:

Node_Node_Flight type ref to If_Wd_Context_Node,

Elem_Node_Flight type ref to If_Wd_Context_Element,

Stru_Node_Flight type If_View1=>Element_Node_Flight ,

itab TYPE STANDARD TABLE OF sflight.

  • navigate from <CONTEXT> to <NODE_FLIGHT> via lead selection

Node_Node_Flight = wd_Context->get_Child_Node( Name = IF_VIEW1=>wdctx_Node_Flight ).

  • @TODO handle not set lead selection

if ( Node_Node_Flight is initial ).

endif.

  • get element via lead selection

Elem_Node_Flight = Node_Node_Flight->get_Element( ).

  • @TODO handle not set lead selection

if ( Elem_Node_Flight is initial ).

endif.

  • alternative access via index

  • Elem_Node_Flight = Node_Node_Flight->get_Element( Index = 1 ).

  • @TODO handle non existant child

  • if ( Elem_Node_Flight is initial ).

  • endif.

  • get all declared attributes

Elem_Node_Flight->get_Static_Attributes(

importing

Static_Attributes = Stru_Node_Flight ).

select * from sflight into CORRESPONDING FIELDS OF TABLE itab

WHERE carrid = Stru_Node_Flight-carrid and connid = Stru_Node_Flight-connid.

Node_Node_Flight->bind_table( new_items = itab ).

endmethod.

Plz reply me asap...!

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

Code written by u is completely fine, Just check the cardinality of the node( Node_Flight ) is 0:N.

If this is fine then just put a break point on Select query and check whether any data is coming in table itab.

Regards

Pankaj Aggarwal

saket_abhyankar
Active Participant
0 Kudos

Hi Murali,

The code for bind table is: Node_Node_Flight->bind_table( itab ).

If it doesnt work try following things:

1) Create two separate nodes for input data & (ii) selected data ( i.e. data to be displayed in table )

2) Make sure that cardinality of 2nd node is 0.n

Regards,

Saket.

Former Member
0 Kudos

Hi,

What I understood from your coding is...

* navigate from <CONTEXT> to <NODE_FLIGHT> via lead selection
Node_Node_Flight = wd_Context->get_Child_Node( Name = IF_VIEW1=>wdctx_Node_Flight ).

You are reading values from the above node and binding the values to the same node.Am i right?

Did you take seperate context node for your input fields or binded the above context to the fields.If not then read the context attribute values which are binded to the carrid and connid then pass these values to select query.

One more thing is select cardinality 1..n for node NODE_FLIGHT since you are displaying more than one record.

Go through the some basic tutorials.Search in sdn you will it get.Already there is a tutorial in sdn which explains exactly what do you require.

Go throgh this link

Web Dynpro for ABAP: Tutorials for Beginners

[original link is broken]

Edited by: suman kumar chinnam on Mar 26, 2009 10:50 AM