2009 Sep 24 11:05 AM
Hi guys,
I have created dynamic table and work area for report.
i have populated few values in dynamic work area.
Now i want to read that data from work area again for calculation.
i can not use local varialbes to store those values as i dont know how many such variables i need to read.
that will be known only at run time.
So as per my knowledge i have only 1 option...to read those all values from work area.
Kindly help me .... how can i read data which is stored in dynamic work area.
2009 Sep 24 11:11 AM
Hi Kiran,
Following is not exact code, but exact solution to your problem:
LOOP AT <dyn_table> ASSIGNING <dyn_wa>.
l_tabix = sy-tabix.
ASSIGN COMPONENT 'KOTAB' OF STRUCTURE <dyn_wa> TO <l_kotab>.
IF <l_kotab> IS ASSIGNED AND <l_kotab> IS INITIAL.
<l_kotab> = gt_tabs-kotab.
MODIFY <dyn_table> FROM <dyn_wa> INDEX l_tabix.
ENDIF.
ENDLOOP.I am hardcoding KOTAB as I was sure about that being in the dynamic structure.
You can loop on the field catalogue, which you used to create dyamic table, to use the FIELDNAME to read all the fields of the work area (structure) of your dynamic table.
thanks,
Aabhas
Edited by: Aabhas K Vishnoi on Sep 24, 2009 8:12 PM
Hi guys,
I have created dynamic table and work area for report.
i have populated few values in dynamic work area.
Now i want to read that data from work area again for calculation.
i can not use local varialbes to store those values as i dont know how many such variables i need to read.
that will be known only at run time.
So as per my knowledge i have only 1 option...to read those all values from work area.
Kindly help me .... how can i read data which is stored in dynamic work area.
2009 Sep 24 11:11 AM
Hi Kiran,
Following is not exact code, but exact solution to your problem:
LOOP AT <dyn_table> ASSIGNING <dyn_wa>.
l_tabix = sy-tabix.
ASSIGN COMPONENT 'KOTAB' OF STRUCTURE <dyn_wa> TO <l_kotab>.
IF <l_kotab> IS ASSIGNED AND <l_kotab> IS INITIAL.
<l_kotab> = gt_tabs-kotab.
MODIFY <dyn_table> FROM <dyn_wa> INDEX l_tabix.
ENDIF.
ENDLOOP.I am hardcoding KOTAB as I was sure about that being in the dynamic structure.
You can loop on the field catalogue, which you used to create dyamic table, to use the FIELDNAME to read all the fields of the work area (structure) of your dynamic table.
thanks,
Aabhas
Edited by: Aabhas K Vishnoi on Sep 24, 2009 8:12 PM
2009 Oct 09 8:14 AM
2009 Oct 09 8:15 AM
2009 Oct 09 8:16 AM