cancel
Showing results for 
Search instead for 
Did you mean: 

How to read a table and transfer the data into an internal table?

Former Member
0 Kudos

Hello,

I try to read all the data from a table (all attribute values from a node) and to write these data into an internal table. Any idea how to do this?

Thanks for any help.

Accepted Solutions (1)

Accepted Solutions (1)

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

Pretty simple. Just call the get_static_attributes_table method of the node. It will return an internal table for the entire contents of the node.

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi,

get_static_attributes_table method solved the problem!

Thanks everyone.

Former Member
0 Kudos

Hi

You may go through this link it will sort out ur problem definately.

http://help.sap.com/saphelp_nw2004s/helpdata/en/f1/177741adb7167de10000000a155106/content.htm

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

anand prakash rai,

I've seen in two different threads today where you have posted links to online help or SCN documents as answers to the questions, but the links really don't directly answer the question. For instance you posted a link here to the online help for the context, but it doesn't actually have anything in that particular link for reading the internal table back out of the context - only how to populate the context.

It is great that you are wanting to help people, but please make sure that the links you are posting are actually helpful to the topic at hand. Otherwise you actually hinder people by leading them down an unnecessary path to solving their particular problem.

Former Member
0 Kudos

Hi,

Check this code.

Here i creates context one node i.e flights and attributes are from SFLIGHT table.

DATA: lo_nd_flights TYPE REF TO if_wd_context_node,

lo_el_flights TYPE REF TO if_wd_context_element,

ls_flights TYPE if_main=>element_flights,

it_flights type if_main=>elements_flights.

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

lo_nd_flights = wd_context->get_child_node( 'FLIGHTS' ).

CALL METHOD LO_ND_FLIGHTS->GET_STATIC_ATTRIBUTES_TABLE

IMPORTING

TABLE = it_flights.

now the table data will be in internal table it_flights.

Former Member
0 Kudos

Hi,

see the standard example wdt_table component controller method save_changes.