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

read layout in background

Former Member
0 Likes
416

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.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
347

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

1 REPLY 1
Read only

Former Member
0 Likes
348

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