‎2008 Dec 16 4:52 PM
Hi,
Can you please exlpain what is purpose of code in which is in Bold.
Create dynamic internal table and assign to FS
call method cl_alv_table_create=>create_dynamic_table
exporting
it_fieldcatalog = ifc
importing
ep_table = dy_table.
assign dy_table-> to <dyn_table>.*
Create dynamic work area and assign to FS*
create data dy_line like line of <dyn_table>.
assign dy_line-> to <dyn_wa>.*
Regards
Sandeep Reddy
‎2008 Dec 16 5:04 PM
Hi
It's to define dynamically an internal table, the variable DY_TABLE is a generic DATA:
DATA: DY_TABLE TYPE REF TO DATA.So u can't direclty work on it, but it needs to use a field-symbol:
FIELD-SYMBOLS: <DYN_TABLE> TYPE TABLE.
ASSIGN DY_TABLE->* TO <DYN_TABLE>.Now the table <DYN_TABLE> is without headerline, so it needs to use a workarea to read it:
DATA: DY_LINE TYPE REF TO DATA.
FIELD-SYMBOLS: <DYN_WA> TYPE ANY.
* Create a workare for <DYN_TABLE>
CREATE DATA DY_LINE LIKE LINE OF <DYN_TABLE>.
ASSIGN DY_LINE->* <DYN_WA>.It can do the same thing while looping <DYN_TABLE>
LOOP AT <DYN_TABLE> ASSIGNING <DYN_WA>.
ENDLOOP.Max
‎2008 Dec 16 5:04 PM
Hi
It's to define dynamically an internal table, the variable DY_TABLE is a generic DATA:
DATA: DY_TABLE TYPE REF TO DATA.So u can't direclty work on it, but it needs to use a field-symbol:
FIELD-SYMBOLS: <DYN_TABLE> TYPE TABLE.
ASSIGN DY_TABLE->* TO <DYN_TABLE>.Now the table <DYN_TABLE> is without headerline, so it needs to use a workarea to read it:
DATA: DY_LINE TYPE REF TO DATA.
FIELD-SYMBOLS: <DYN_WA> TYPE ANY.
* Create a workare for <DYN_TABLE>
CREATE DATA DY_LINE LIKE LINE OF <DYN_TABLE>.
ASSIGN DY_LINE->* <DYN_WA>.It can do the same thing while looping <DYN_TABLE>
LOOP AT <DYN_TABLE> ASSIGNING <DYN_WA>.
ENDLOOP.Max