Output upload to UNIX depends on the layout variant
I have a requirement. once report output is displayed i need to upload that output to UNIX server and downloadble to PC desktop depend on the layout variant.
If i selected the variant report is displaying only the fields depends on the variant but in UNIX it is downaloading all the fields, my client want to download only the fields depends on the layout variant. Could you please suggest me what i have to follow?
Darren Barton replied
You will need to get the field catalog, this depends on the ALV version that you are using it will either be a method call or function module REUSE_ALV_FIELDCATALOG_MERGE.
Once you have the field catalog build a dynamic internal table based upon it, something like..
* Create a new Table CALL METHOD cl_alv_table_create=>create_dynamic_table EXPORTING it_fieldcatalog = IT_LVC_CAT IMPORTING ep_table = new_table. * Create a new Line with the same structure of the table. ASSIGN new_table->* TO <l_table>. CREATE DATA new_line LIKE LINE OF <l_table>. ASSIGN new_line->* TO <l_line>.
Now populate the new table by moving the corresponding fields from your source table and then output the new table to the file system.