Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Variants for module pool screena

Hi,

I tried creating a variant for module pool screen by using the FM : RS_CREATE_VARIANT.

For this i created a dummy report which has the same parameters as the fields in the screen.

CALL FUNCTION 'RS_VARIANT_CONTENTS'

EXPORTING

report = gc_dummy_rep

variant = 'variant5'

  • MOVE_OR_WRITE = 'W'

  • NO_IMPORT = ' '

  • EXECUTE_DIRECT = ' '

  • IMPORTING

  • SP =

tables

  • L_PARAMS =

  • L_PARAMS_NONV =

  • L_SELOP =

  • L_SELOP_NONV =

valutab = lt_params

  • OBJECTS =

  • FREE_SELECTIONS_DESC =

  • FREE_SELECTIONS_VALUE =

  • EXCEPTIONS

  • VARIANT_NON_EXISTENT = 1

  • VARIANT_OBSOLETE = 2

  • OTHERS = 3

.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

but when i try to retrieve the values stored in the variant using FM : RS_VARIANT_CONTENTS.

CALL FUNCTION 'RS_VARIANT_CONTENTS'

EXPORTING

report = gc_dummy_rep

variant = 'variant5'

  • MOVE_OR_WRITE = 'W'

  • NO_IMPORT = ' '

  • EXECUTE_DIRECT = ' '

  • IMPORTING

  • SP =

tables

  • L_PARAMS =

  • L_PARAMS_NONV =

  • L_SELOP =

  • L_SELOP_NONV =

valutab = lt_params

  • OBJECTS =

  • FREE_SELECTIONS_DESC =

  • FREE_SELECTIONS_VALUE =

  • EXCEPTIONS

  • VARIANT_NON_EXISTENT = 1

  • VARIANT_OBSOLETE = 2

  • OTHERS = 3

.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

I get an error message : variant5 not found.

is there anything that i miss here?

or is the way i use to create variant for module pool screen not right?

Regards,

Kamini

Former Member
Not what you were looking for? View more on this topic or Ask a question