Skip to Content
author's profile photo Former Member
Former Member

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on May 18, 2011 at 07:58 AM

    hi,

    Please refer the following link.

    Link: [http://help.sap.com/saphelp_47x200/helpdata/en/67/232037ebf1cc09e10000009b38f889/frameset.htm]

    Regards,

    Renuka S.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 25, 2011 at 04:08 AM

    It is not possible to create variants for module pool screen.

    Instead of module pool screen, i used selection screen as dialog pop-up.

    and called it using call selection screen xxx starting at P Q ending at S T.

    This gave the option to save variants for the screen by default.

    Regards,

    Kamini

    Edited by: Kamini Rawat on May 25, 2011 6:08 AM

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi,

      To avail save variant option in module pool screen,

      1. You need to create a data base table similar to INDX table with the fields RELID, VARI_NAME

      PROG_NAME

      UNAME

      SRTF2, MEMORYID, CLUSTR, CLUSID. And the remaining fields can be anything.

      2. Enable the Save button in the Function keys part of GUI Status. And Add a push button for Get variant.

      3. When Save button clicked call a screen with a single field for variant (let us say g_var). After g_var entered, in the PAI of the initial screen export all the screen values to the created database index using the statement .

      EXPORT: g_characteristics_tab TO DATABASE zav0257(ch) ID g_var,

      s_auart TO DATABASE zav0257(au) ID g_var.

      So that the values will be exported to database.

      Then update the fields(VARI_NAME,PROG_NAME,UNAME) of the database table using modify from work area.

      So that you will have the history of variance existence.

      4. Next time , when the user clicks on Get Variant option, call another screen to enter the variant name. Then import the values for that variant from the memory id in the database table.

      It worked for me.

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.