Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

from deep structured to flat itab

Former Member
0 Likes
745

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
511

HI

refer this link.

Reward all helpfull answers.

Regards.

Jay

2 REPLIES 2
Read only

former_member150733
Contributor
0 Likes
511

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

Read only

Former Member
0 Likes
512

HI

refer this link.

Reward all helpfull answers.

Regards.

Jay