‎2007 Jun 27 9:38 AM
Hi experts!
I need to copy three columns from an internal table <u>itab_upload</u>. I defined the structure for it in the DDIC. It contains 5 columns and another table(<u>Itab_note)</u> for possible entries. For a report I need to copy 3 columns of the itab_upload table (<u>not</u> from the itab_note) into another table and display this using ALV.
Can you please advise how to get the 3 columns from the structured into the flat table so I can use ALV for displaying?
Thanks a lot!
Johann
‎2007 Jun 27 1:01 PM
‎2007 Jun 27 9:50 AM
You can use the same internal table itab_upload to pass to the ALV Function Module. If this is a deep structure, pass only the field that contains the internal table values in that deep structure.
Ex. itab_upload-field1-field12
If you want to show only 3 fields form the internal table on the ALV, create the fieldcat manually so that only those 3 fields are present in the fieldcat that is passed to the ALV Function module.
Ex. to create a fieldcat manually :
....
data : it_fieldcat type slis_t_fieldcat_alv,
wa_fieldcat like line of it_fieldcat,
....
clear wa_fieldcat.
wrk_pos = wrk_pos + 1.
wa_fieldcat-col_pos = wrk_pos.
wa_fieldcat-tabname = 'ITAB_UPLOAD'.
wa_fieldcat-fieldname = 'FIELD1'.
wa_fieldcat-seltext_m = 'Field 1 Description'.
wa_fieldcat-emphasize = ''.
wa_fieldcat-hotspot = 'X'.
append wa_fieldcat to it_fieldcat.
clear wa_fieldcat.
wrk_pos = wrk_pos + 1.
wa_fieldcat-col_pos = wrk_pos.
wa_fieldcat-tabname = 'ITAB_UPLOAD'.
wa_fieldcat-fieldname = 'FIELD3'.
wa_fieldcat-seltext_m = 'Field 3 Description'.
wa_fieldcat-emphasize = ''.
wa_fieldcat-hotspot = ''.
append wa_fieldcat to it_fieldcat.
....
Also refer :
Regards,
Anish Thomas
‎2007 Jun 27 1:01 PM