on 03-31-2011 3:26 PM
Hi,
I need help creating a table with one column where the fields of that column are the name of the columns of another table.
Can some one please help me?
Regards
Ok.
One last thing, how do I bind it to a node named SORT.
Regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You cannot just simple bind any table to any node.
You need to have matching types.
What you can do is , see the structure of the SORT node use this structure instead of the String_table in my code.
lt_tab type string_table --> to the table type of the SORT
ls_name type string->struct type of SORT
This way you are making sure that there are no type mismatching.
Edited by: Baskaran Senthivel on Apr 1, 2011 3:44 PM
Thanks for all.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I tried that but this error appears in run time.
" Dynamic type conflict when assigning references "
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi.
Now I get an error.
"wa..." cannot be converted to the line type of LT_COMP.
Regards and thank you for your help!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
try this one ..
DATA:
lr_rtti_struc TYPE REF TO cl_abap_structdescr,
lt_comp TYPE cl_abap_structdescr=>component_table,
ls_comp like line of lt_comp,
lt_tab type string_table,
ls_name type string.
lr_rtti_struc ?= cl_abap_structdescr=>describe_by_name( `spfli` ).
lt_comp = lr_rtti_struc->get_components( ).
loop at lt_comp into ls_comp.
clear ls_name.
ls_name = ls_comp-name.
append ls_name to lt_tab.
endloop.
My main difficulties are in coding.
I want to create a table with the elements of SPFLI table.
Regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You need to do that with using RTTI.
See this wiki [http://wiki.sdn.sap.com/wiki/display/ABAP/RuntimeTypeServices(RTTS)|http://wiki.sdn.sap.com/wiki/display/ABAP/RuntimeTypeServices(RTTS)]
For example.
DATA:
lr_rtti_struc TYPE REF TO cl_abap_structdescr,
lt_comp TYPE cl_abap_structdescr=>component_table,
ls_comp like line of lt_comp,
wa_tabdescr type abap_compdescr,
lt_tab type string_table,
ls_name type string.
lr_rtti_struc ?= cl_abap_structdescr=>describe_by_name( `spfli` ).
lt_comp = lr_rtti_struc->get_components( ).
loop at lt_comp into wa_tabdescr.
clear ls_name.
ls_name = wa_tabdescr-name.
append ls_name to lt_tab.
endloop.
The lt_tab contains the names of the line types of the table. You can bind this table to the context_node with same structure and bind that to the TABLE UI.
Edited by: Baskaran Senthivel on Mar 31, 2011 9:56 PM
What is the problem here. You may have to explain your difficulties so that we can help you effectively.
Normally you need a context node with cardinality of 0..n or 1..n.
In the node create a attribute say col_name of type string.
Now fill the node or bind a internal table to context node.
Bind this node to the table UI dataSource property.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
82 | |
10 | |
10 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.