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

Regarding DISVARIANT

Former Member
0 Likes
2,869

Hi All,

I have a small doubt,

Iam in support project. I am go through the program which is already developed someone.....

In that program, I saw one statement.....like.........

PARAMETERS : p_vari LIKE disvariant-variant.

data: is_variant LIKE disvariant.

Here, my doubt is, what is exact use of this Disvariant structure...............

please help me in this regard........

1 ACCEPTED SOLUTION
Read only

JozsefSzikszai
Active Contributor
0 Likes
1,441

this will be the variant of the ALV list. The report displays an ALV list, and the user is able to choose on the selection screen, how the report should appear.

Hi All,

I have a small doubt,

Iam in support project. I am go through the program which is already developed someone.....

In that program, I saw one statement.....like.........

PARAMETERS : p_vari LIKE disvariant-variant.

data: is_variant LIKE disvariant.

Here, my doubt is, what is exact use of this Disvariant structure...............

please help me in this regard........

4 REPLIES 4
Read only

JozsefSzikszai
Active Contributor
0 Likes
1,442

this will be the variant of the ALV list. The report displays an ALV list, and the user is able to choose on the selection screen, how the report should appear.

Read only

Former Member
0 Likes
1,441

in alv report we haVE option to save the layout(that is selecting particular fields to be displayed--- filtering option an d can be saved as variant).....

like this u can create many variant .....

as per the need u can select the output(variant to be displayed) in report output..

Read only

Former Member
0 Likes
1,441

Hi,


DATA: is_variant TYPE disvariant.
PARAMETER: p_layout LIKE is_variant-variant.


AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_layout.
  PERFORM alv_f4.


*&---------------------------------------------------------------------*
*&      Form  ALV_F4
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  -->  p1        text
*  <--  p2        text
*----------------------------------------------------------------------*
FORM alv_f4 .
  is_variant-report = sy-repid.

  CALL FUNCTION 'REUSE_ALV_VARIANT_F4'
    EXPORTING
      is_variant = is_variant
      i_save     = 'A'
    IMPORTING
      es_variant = is_variant
    EXCEPTIONS
      not_found  = 2.
  IF sy-subrc = 2.
    MESSAGE ID sy-msgid TYPE 'S' NUMBER sy-msgno
            WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  ELSE.
    p_layout = is_variant-variant.
  ENDIF.

ENDFORM.                                                    " ALV_F4

At run time you just save the layout....that will display as layout variant in future...

but for this in ALV function....you have to include one thing..


in REUSE_ALV_GRID_DISPLAY..
..................
   i_save                         = 'A'
.............................................

Arunima

Read only

Former Member
0 Likes
1,441

Thank you freinds.........