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

reg alv

Former Member
0 Likes
541

hi all

which function module used in alv reporting to display the varients in selection screen

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
522

Refer this

w_variant-report = w_repid.
  CALL FUNCTION 'REUSE_ALV_VARIANT_DEFAULT_GET'
       EXPORTING
            i_save        = 'A'
       CHANGING
            cs_variant    = w_variant
       EXCEPTIONS
            wrong_input   = 1
            not_found     = 2
            program_error = 3
            OTHERS        = 4.

  IF sy-subrc <> 0.
    w_variant-report = w_repid.
  ENDIF.

3 REPLIES 3
Read only

Former Member
0 Likes
522

Check this one.

Read only

Former Member
0 Likes
523

Refer this

w_variant-report = w_repid.
  CALL FUNCTION 'REUSE_ALV_VARIANT_DEFAULT_GET'
       EXPORTING
            i_save        = 'A'
       CHANGING
            cs_variant    = w_variant
       EXCEPTIONS
            wrong_input   = 1
            not_found     = 2
            program_error = 3
            OTHERS        = 4.

  IF sy-subrc <> 0.
    w_variant-report = w_repid.
  ENDIF.

Read only

Former Member
0 Likes
522

hi,

Basically the most important function module you would require is

'REUSE_ALV_VARIANT_DEFAULT_GET'

use this as follwoing

DATA :wa_variant TYPE disvariant, "Work area for variant,

wa_variant1 TYPE disvariant, "Work area for variant

SELECTION-SCREEN BEGIN OF BLOCK bvar WITH FRAME.

PARAMETERS: p_varnt LIKE slis-vari.

SELECTION-SCREEN END OF BLOCK bvar.

*--Pass the report name

v_repid = sy-repid. "Report ID

wa_variant-report = v_repid.

*--Call the function module to get the default variant

CALL FUNCTION 'REUSE_ALV_VARIANT_DEFAULT_GET'

EXPORTING

i_save = c_save

CHANGING

cs_variant = wa_variant1

EXCEPTIONS

wrong_input = 1

not_found = 2

program_error = 3

OTHERS = 4.

*--Check Subrc

IF sy-subrc = 0.

p_varnt = wa_variant-variant.

ENDIF.

other variant function module could be used after this are:

'REUSE_ALV_VARIANT_EXISTENCE' --> to check the validation of vriant name

and

'REUSE_ALV_VARIANT_F4' - >to include search help

reward if helpful

Rohan