on 01-27-2007 11:28 AM
Hello,
I am new with working WD ABAP. I achieved to build a table with some data.
But now I want to get the data back from the view table to an internal table,
to update for example a sap table.
How can ik do this? With the node->bind_table I achieved to give the data to
the view . But what must I do to render it back to an internal table.
For a normal field I know how to this, with the get_attribute method of an element.
Thanks in advance.
Harrie
Hi Harrie.
You can read the data from the context node directly.
data:
Node_Po_Data type ref to If_Wd_Context_Node,
Node_Po_Items type ref to If_Wd_Context_Node.
data:
lt_items type table of bapimepoitem.
data:
Stru_Po_Items type If_V_Po_Data=>Element_Po_Items,
ls_item type bapimepoitem.
field-symbols:
<items> type any table.
* navigate from <CONTEXT> to <PO_DATA> via lead selection
Node_Po_Data = wd_Context->get_Child_Node( Name = IF_V_PO_DATA=>wdctx_Po_Data ).
* navigate from <PO_DATA> to <PO_ITEMS> via lead selection
Node_Po_Items = Node_Po_Data->get_Child_Node( Name = IF_V_PO_DATA=>wdctx_Po_Items ).
* @TODO handle not set lead selection
if ( Node_Po_Items is initial ).
endif.
assign lt_items to <items>.
* get actual content
node_po_items->GET_STATIC_ATTRIBUTES_TABLE(
importing
table = <items>
).
move <items> to lt_items.
Hope this helps.
Cheers,
Sascha
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Harrie.
I just found out that it is much more easier.
Assume that your context structure is bapimepoitem.
data:
lt_items type table of bapimepoitem.
* navigate from <CONTEXT> to <PO_DATA> via lead selection
Node_Po_Data = wd_Context->get_Child_Node( Name = IF_V_PO_DATA=>wdctx_Po_Data ).
* navigate from <PO_DATA> to <PO_ITEMS> via lead selection
Node_Po_Items = Node_Po_Data->get_Child_Node( Name = IF_V_PO_DATA=>wdctx_Po_Items ).
* @TODO handle not set lead selection
if ( Node_Po_Items is initial ).
endif.
* get actual content
node_po_items->GET_STATIC_ATTRIBUTES_TABLE(
importing
table = lt_items
).
You do not need to handle it with field symbols.
Cheers,
Sascha
Hi Harrie Prinsen
You can use GET_DATA_SOURCE() method of the class CL_WD_TABLE.
Regards
Rakesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
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.