‎2008 Oct 27 4:34 PM
Hi,
i am using the concept of dynamic table to transpose an internal tabel and create an dynamic ALV.
The dynamic table has also layout fields to set the row color depending on the content.
Now, after the first internal table is transposed and ready to display in ALV i would like to loop over the dynamic internal table and set the value for the row color.
Therefor i need your help.
The "concept" of my idea is as the following:
Loop at <dynamictable> into <dynamic_wa>.
if ...
<dynamic_wa>-rowcolor = 'C610'.
else.
<dynamic_wa>-rowcolor = ' '.
endif.
append <dynamic_wa> to <alv_outtab>.
endloop.
Based on a condition i like to set a particular value in the componet rowcolor of the structure <dynamic_wa>.
But i have no idea how to catch the components of dynamic tables to modify them.
Could anyone please assist me in this?
Thanks,
Ralf
‎2008 Oct 27 4:39 PM
if you know the component name or index then you can do that.
field-symbols: <fs> .
Loop at <dynamictable> into <dynamic_wa>.
if ...
assign component 'ROWCOLOR' of structure <dynamic_wa> to <fs>.
<fs> = 'C610'.
else.
assign component 'ROWCOLOR' of structure <dynamic_wa> to <fs>.
<fs> = ' '.
endif.
append <dynamic_wa> to <alv_outtab>.
endloop.
‎2008 Oct 27 4:41 PM
Hi
DATA: FIELD-SYMBOLS: <FIELD1> TYPE ANY,
<COLOR> TYPE ANY.
LOOP AT <DYNAMICTABLE> ASSIGNING <DYNAMIC_WA>.
ASSIGN COMPONENT <FIELD NAME> OF STRUCTURE <DYNAMIC_WA> TO <FIELD1>.
ASSIGN COMPONENT 'ROWCOLOR' OF STRUCTURE <DYNAMIC_WA> TO <COLOR>.
IF <FIELD1> = ......
<COLOR> = 'C610'.
ELSE.
CLEAR <COLOR>.
ENDIF.
APPEND <DYNAMIC_WA> TO <ALV_OUTTAB>.
ENDLOOP.Max
‎2009 Jan 22 4:38 AM
Hi,
issue :
i have created a dynamic internal table(dyn_tab) and a dynamic work area (dyn_wa).
1. actually i have to calculate some data and then insert the same in to the dynamic table .
ex:
if suppose i have 10 fields in my dynamic table.
and my field names are suppose from 0 to 10 .(wil be created at run time)
iam not able to write " <dyn_wa>-0 = 'help'. " (it is showing an syntax error because the structure is created dynamically which does not have that field name befor the program is executed )
("I WANT TO APPEND A RECORD IN TO DYNAMIC INTERNAL TABLE ")
"PLEASE HELP ME "
please help me out regarding this issue i hope u can do this.
WATING.
Thanks in advance,
shivkanth