‎2010 May 03 9:10 AM
I have a report, which has "Layout" and "Export file path" fields on selection screen. I need to export the report to CSV file in the format of dynamical layout while executing on background.
In this case:
1. How do I read the structure of layout before ALV dispaly.
2. How do I chang the internal table dynamically according to layout structure.
Kindly suggest.
‎2010 May 03 9:22 AM
Hi ,
You can use Function Module 'REUSE_ALV_VARIANT_DEFAULT_GET' to get the variant name.
Please check the code --
CONSTANTS:
lc_a TYPE char1 VALUE 'A'.
MOVE sy-repid TO fs_variant-report.
CALL FUNCTION 'REUSE_ALV_VARIANT_DEFAULT_GET'
EXPORTING
i_save = lc_a
CHANGING
cs_variant = fs_variant
EXCEPTIONS
wrong_input = 1
not_found = 2
program_error = 3
OTHERS = 4.
IF sy-subrc IS INITIAL.
p_varian = fs_variant-variant.
ELSE.
p_varian = space.
ENDIF. " IF sy-subrc IS INITIAL.
Thanks and Regards
Pinaki
‎2010 May 03 9:22 AM
Hi ,
You can use Function Module 'REUSE_ALV_VARIANT_DEFAULT_GET' to get the variant name.
Please check the code --
CONSTANTS:
lc_a TYPE char1 VALUE 'A'.
MOVE sy-repid TO fs_variant-report.
CALL FUNCTION 'REUSE_ALV_VARIANT_DEFAULT_GET'
EXPORTING
i_save = lc_a
CHANGING
cs_variant = fs_variant
EXCEPTIONS
wrong_input = 1
not_found = 2
program_error = 3
OTHERS = 4.
IF sy-subrc IS INITIAL.
p_varian = fs_variant-variant.
ELSE.
p_varian = space.
ENDIF. " IF sy-subrc IS INITIAL.
Thanks and Regards
Pinaki