Variant in Module Pool

Hi Experts,
I am trying to activate Variant functionality in Module Pool. Saw this blog and followed the instruction http://scn.sap.com/docs/DOC-27331.
Thanks to it I successfully managed to save Variant from the screen.
The only problem now once I selected the Variant, values are not appearing back to the input field.
Do you have any ideas on how to return the variant values back to the screen?
Thanks,
Lyssa

Hi Experts,
I am trying to activate Variant functionality in Module Pool. Saw this blog and followed the instruction http://scn.sap.com/docs/DOC-27331.
Thanks to it I successfully managed to save Variant from the screen.
The only problem now once I selected the Variant, values are not appearing back to the input field.
Do you have any ideas on how to return the variant values back to the screen?
Thanks,
Lyssa

Similar Messages

  • Is it possible to save a variant in Module Pool program

    Hi,
    We have got a requirement to save a Variant for the user selections in Module Pool Program. Is it possible to save a variant in a Module Pool Program?
    Please let me know how to do that if it is possible.
    Thanks in Advance.

    hi Dagny,
      You can't have variants for module pool. It is possible only for selection screen.
    You have following alternatives :-
    1. Create a report with same selection screen as you have now in module pool.
    And then make a call screen to your intial module pool.
    In this way you can all the advantage of variants as well as module pool.
    OR
    2. Create a transaction variant using transaction SHDO.
    Hope it is helpful.
    and do search the form , it is already answered before.
    regards
    venkat

  • 'Save As Variant' for Module Pool Program - FM to be called?

    I have a dialog program, i want to activate the 'Save As variant' when i click on save on the selection screen of the transaction i created for the dialog program. What funtionality should be called or written for the PF-STATUS to implement the functionality.

    hi Dagny,
      You can't have variants for module pool. It is possible only for selection screen.
    You have following alternatives :-
    1. Create a report with same selection screen as you have now in module pool.
    And then make a call screen to your intial module pool.
    In this way you can all the advantage of variants as well as module pool.
    OR
    2. Create a transaction variant using transaction SHDO.
    Hope it is helpful.
    and do search the form , it is already answered before.
    regards
    venkat

  • 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

    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.

  • How to store the variant in Module Pool Programming

    Hi,
       I have the module pool program which is having 4 screen. depends on the first and second screen, third screen is called. i want to store the data of third screen to the variant. All the screen except first screen is a subscreen.
    Regards,
    Dhiraj.

    Hi Dhiraj,
    You can create a variant only for a Report. Module Pool Programs require a dialog with the user & hence creating a varint is not possible. You  can possibly create some Parameter IDs & default values in there.
    Regards,
    Suresh Datti

  • Variant in module pool pragram

    Hi,
    In Reports , we r using variant to save the input paramerters.
    Like that i want in Module pool program also .
    Plz give the details
    Regards,
    Rani.

    Hi,
    Check this thread..
    save variant in module pool

  • How can one save variants for module pool screens.

    hai all,
         i have done a module pool screen for taking information from user..later i leave to list processor and give a report to the user.
      i am testing the program with many input parameters.i don't want to enter the values each time i execute the program.can i not save a variant like i save for normal abap editor programs?
    any other solution ?

    Hii..
    Variants can be created in Selection Screen only...
    For ur Scenario:
    To leave to the list use the Statements
    <b>LEAVE TO LIST-PROCESSING And return .</b>
    then the Data will be automatically retained.
    <b>Reward if Helpful</b>

  • Reg : Variant saving for Module Pool Programming

    Hey Friends,
       Plz help me in how to create variant for Module Pool Programming as in normal reports.Thanx in advance.

    Hi,
    You can create variants for Module pool program using the transaction SHD0. You can create Screen variants for your screens using this Tcode.
    Go to SHD0 -> Give the Transaction code(ZTRAN) for which you want to create a variant -> name of some variant (ZVAR) -> create -> takes you to your transaction -> Give the values that you want to be displayed as variants -> Click on Save -> Opens a pop up to confirm the screen entries -> Check the check boxes of those fields that you have entered the data with (the column with check boxes that says W.Content) -> Exit and Save -> Save the variant -> You can see a screen variant created (ZVAR_0100)
    Now Goto -> Create variant transaction -> Give your transaction variant name (ZVAR) -> Select Transaction with variant -> Takes you to SE93 transaction -> Give the transaction variant name  -> save. Run with the created transaction.
    Edited by: Nitwick on Jul 27, 2009 4:49 PM

  • How to create transaction or screen variant for custom tcode in module pool

    Hi,
              I have one module pool program with custome tcode ,i want to create transaction or screen variant for this tcode.Next time when we run this tcode we need a variant for this tcode.
    I tried by using of SHD0 but it is working only for standred tcodes.Is there any possibilty please help me.
    thanks,
    Lavanya.

    Hi,
    you created a Custom Tcode for ur module pool Pgm..if u execute the Tcode in the output screen give the input details and press Save Option then variant will be created. Then you can use that variant.
    otherwise.. while creating a Tcode..
    select an option for Tcode type Tranasction With variant ..there u will provide the variant for ur Tcode ( which is already created ).
    Regards,
    PraVeen.

  • Save a variant in a custom module-pool.

    Hi all,
    i hope there is someone that can help me.
    My problem is: i've to save a variant in a module-pool custom SAPMZ...ecc.
    Is there a function module or a routine or some specific ABAP istruction to save a variant?
    I ask this because in my custom module-pool i've insert input field in main dynpro.
    Thanks a lot,
    regards,
    Alex.

    Please use below code it works for me:
    What I did was copy the function group SVAR.  When it asked what function module to copy just select
    'RS_VARIANT_SAVE_FROM_SELSCREEN' and renamed it to 'ZS_VARIANT_SAVE_FROM_SELSCR'.
    DATA: lv_screen LIKE sy-dynnr.
      CLEAR: t_rkey, t_screen.
      REFRESH: t_rkey,  t_screen.
      t_rkey-report = sy-repid.
      APPEND t_rkey.
      t_screen-program   = sy-repid.
      t_screen-dynnr     = '0101'.
      t_screen-type      = 4.
      APPEND t_screen.
      lv_screen = '0101'.
      EXPORT lv_screen TO MEMORY ID 'MZ_COMISSION_REPORT_F02_SCREEN'.
      CALL FUNCTION 'ZS_VARIANT_SAVE_FROM_SELSCR'
        EXPORTING
          curr_report          = sy-repid
          vari_report          = sy-repid
        IMPORTING
          variant              = w_variant
        TABLES
           p_screens           = t_screen
         p_sscr               = t_selctab
         p_vari               = t_vari
        EXCEPTIONS
          illegal_variant_name = 1
          not_authorized       = 2
          no_report            = 3
          report_not_existent  = 4
          report_not_supplied  = 5
          OTHERS               = 6.
      t_rkey-variant = w_variant.
      MODIFY t_rkey INDEX 1.
      CALL FUNCTION 'RS_RWSET_SAVE_VARIANT'
        EXPORTING
          rkey    = t_rkey
        TABLES
          selctab = t_selctab.
    Then in program LZSVARF07 function save_as_variant find where it's transfering the screen.
      READ TABLE variscreens WITH KEY dynnr = sy-dynnr.
      IF sy-subrc NE 0.
        IMPORT lv_screen FROM MEMORY ID 'MZ_COMISSION_REPORT_F02_SCREEN'.
        IF lv_screen IS INITIAL.
          variscreens-dynnr = sy-dynnr.
        ENDIF.
      ENDIF.
      PERFORM fill_varidyn TABLES p_dynsfields
                           USING  $rkey space. "Kein import von DYNSFIELDS
    Good luck!
    Edited by: Alex Nguyen on May 2, 2009 1:36 AM
    Edited by: Alex Nguyen on May 5, 2009 5:26 PM

  • How to pass the field value from module pool program to smartform using submit?

    // AT pai of module pool pgm i entered the following: here gv_orderid is my value to be available at smart form(driver pgm) & zmusic_store_smf is the driver program of my smartform.
    gv_orderid= wa-itemid./
    SUBMIT ZMUSIC_STORE_SMF VIA SELECTION-SCREEN
                                  WITH p_order = gv_orderid
                                  AND RETURN.
    //AT driver pgm(zmusic_store_smf):
    START-OF-SELECTION.
    CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
        EXPORTING
          formname                 = 'ZMUSIC_SMARTFORM1'
    *   VARIANT                  = ' '
    *   DIRECT_CALL              = ' '
       IMPORTING
         fm_name                  = lv_form
       EXCEPTIONS
         no_form                  = 1
         no_function_module       = 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.
    CALL FUNCTION lv_form
       EXPORTING
    *      iv_orderid = is_purchase_item-zorder_id.
    iv_orderid = gv_orderid.
    // here i'm trying to call my smartform('ZMUSIC_SMARTFORM1')  from this driver pgm but unable to access the value of gv_orderid please help me out with this.

    Declare the gv_orderid in modulepool program.
    And Declare the parameter as import parameter in smartform.
    CALL FUNCTION  lv_form
       EXPORTING
    *   ARCHIVE_INDEX              =
    *   ARCHIVE_INDEX_TAB          =
    *   ARCHIVE_PARAMETERS         =
    *   CONTROL_PARAMETERS         =
    *   MAIL_APPL_OBJ              =
    *   MAIL_RECIPIENT             =
    *   MAIL_SENDER                =
    *   OUTPUT_OPTIONS             =
    *   USER_SETTINGS              = 'X'
         i_input                    =  gv_orderid
    * IMPORTING
    *   DOCUMENT_OUTPUT_INFO       =
    *   JOB_OUTPUT_INFO            =
    *   JOB_OUTPUT_OPTIONS         =
    * EXCEPTIONS
    *   FORMATTING_ERROR           = 1
    *   INTERNAL_ERROR             = 2
    *   SEND_ERROR                 = 3
    *   USER_CANCELED              = 4
    *   OTHERS                     = 5

  • Select option in module pool program

    Hi,
    I have develop a module pool program. In one of the screen i need select option. so do any one have idea or approach for it.
    Thanks in advance.

    Hi,
    try the following code
    tables : mard.
    data : ok_code_100 type sy-ucomm.
    selection-screen begin of screen 1010 as subscreen.
    selection-screen begin of block b1 with frame title text-001.
    select-options: s_werks for mard-werks,
    s_lgort for mard-lgort.
    parameters : p_var like disvariant-variant.
    parameter: p_rb1 radiobutton group rd1 default 'X', " list
    p_rb2 radiobutton group rd1. " grid
    selection-screen end of block b1.
    selection-screen end of screen 1010.
    start-of-selection.
    CALL SCREEN 100.
    *& Module STATUS_0100 OUTPUT
    text
    module status_0100 output.
    set pf-status 'Z11_SUBMIT'.
    set titlebar 'CALL'.
    endmodule. " STATUS_0100 OUTPUT
    *& Module USER_COMMAND_0100 INPUT
    text
    module user_command_0100 input.
    case ok_code_100.
    when 'EXIT'.
    leave program.
    when 'SUBM'.
    submit z11_ap_alv_mat using
    selection-screen '1000'
    with s_plant in s_werks
    with s_stor in s_lgort
    with p_var = p_var
    with p_rb_01 = p_rb1
    with p_rb_02 = p_rb2
    and return.
    endcase.
    endmodule. " USER_COMMAND_0100 INPUT
    here u have to design a subscreen area SUB_1010 in the screen painter, there is a option given there for that.
    and also in the flow logic of screen 0100 you have to call the subscreen SUB_1010 both in PBO and PAI like :
    process before output.
    module status_0100.
    call subscreen sub_1010 including sy-repid '1010'.
    process after input.
    call subscreen sub_1010.
    module user_command_0100.
    reward if helpful

  • How to save a varaints in module pool programming

    Hi All,
    How to save a varaints in module pool programming.
    Thanks in Advance.
    GS.

    Hi,
    Forgot my previous reply.
    Just now I checked.
    Create transaction[say.,zzz_test1] using SE93 [choose the option Program and screen] for your module pool program.
    Then use SHDS transaction to create a variant[say zzz_v1] for the transaction you created above.
    Then use SE93 [choose the option Transaction with Variant] to create another transaction zzz_test2 by mentioning the module pool program name and zzz_test1 transaction which you created and zzz_v1 variant which you created.
    Then if you run the transaction ZZZ_test2,then you can see the variant values.
    I created just now all these and it works.
    Hope this is clear.
    If not,get back.

  • Display Continuous Fluctuations in Input Data in Module Pool Screen

    Dear All,
    We are working on a Weighbridge Interface scenario, where the weighbridge is sending data to a digitizer, which is connected to the COM port of a PC. The objective is to read the data from the digitizer, and display in a Module pool screen. However, there is one more requirement: the weight may fluctuate until it stabilizes, and the fluctuations have to be displayed on screen. For example, the tare weight of a vehicle may be 12.4 TON, but when the vehicle is standing on the weighbridge, the weight may vary from 10.4 to 12.4 TON. The idea is to capture the stable weight, so that any discrepancies can be avoided. In the current IT system implementation, the fluctuations in the weight are displayed. But using ABAP, can these fluctuations be captured? For example, we may design a screen containing a field for capturing the weight, and the weight displayed there automatically refreshes as soon as there is a change in the digitizer reading. Is this possible to achieve? If so, how?
    Awaiting answers.
    Thanks and Regards,
    Sid

    Hi Sid,
    just a suggestion for the refreshing of an ABAP screen: you can use class CL_GUI_TIMER, but it only handles whole seconds, i.e. 1 second, 2 seconds and so on, but not 0.5 seconds...
    An example of an ABAP listing could be the following:
    *& Report  ZZAVV001
    REPORT  zzavv001 NO STANDARD PAGE HEADING.
    CONSTANTS: c_yes(1) TYPE c VALUE 'X'.
    DATA: BEGIN OF t_bseg OCCURS 0.
            INCLUDE STRUCTURE bseg.
    DATA: END OF t_bseg.
    data: d_num_bkpf type i,
          d_num_bseg type i.
    PARAMETERS: interval TYPE i DEFAULT 5.  "meaning 5 seconds
    *       CLASS lcl_receiver DEFINITION
    CLASS lcl_receiver DEFINITION.
      PUBLIC SECTION.
        METHODS:
          handle_finished FOR EVENT finished OF cl_gui_timer.
    ENDCLASS.                    "lcl_receiver DEFINITION
    * Global data
    DATA:
      test       TYPE i,
      receiver   TYPE REF TO lcl_receiver,
      timer      TYPE REF TO cl_gui_timer.
    START-OF-SELECTION.
      CREATE OBJECT timer.
      CREATE OBJECT receiver.
      SET HANDLER receiver->handle_finished FOR timer.
      timer->interval = interval.
      CALL METHOD timer->run.
      PERFORM load_data.   "or whatever you have to do to read the weight
      PERFORM show_list.   "or whatever you have to do to print the weight you've read
    *       CLASS lcl_receiver IMPLEMENTATION
    CLASS lcl_receiver IMPLEMENTATION.
      METHOD handle_finished.
        PERFORM carga_datos.
        PERFORM muestra_listado.
        CALL METHOD timer->run.
      ENDMETHOD.                    "handle_finished
    ENDCLASS.                    "lcl_receiver IMPLEMENTATION
    *&      Form  load_data
    *       text
    FORM load_data.
      clear: d_num_bkpf,
             d_num_bseg.
      select single count( * )
        into d_num_bkpf
        from bkpf.
      select single count( * )
        into d_num_bseg
        from bseg.
    ENDFORM.                    "load_data
    *&      Form  show_list
    *       text
    FORM show_list.
      get time.
      skip to line 1.
      position 1.
      write: / 'Date / Time:', sy-datum, sy-uzeit.
      write: / 'Number of BKPF records:', d_num_bkpf.
      write: / 'Number of BSEG records:', d_num_bseg.
    ENDFORM.                    " show_list
    Okay, it's just a tiny code snippet, but I hope it may help you by designing auto-refreshing screens.
    Kind regards,
    Alvaro

  • Probelm in module pool selection screen

    Hi,
    I wanted to create transaction variant for my selection screen which i have to design through module pool
    if use the following code im not able to get the screen fields during trancation varian creation
    call screen 1001.
    SELECTION-SCREEN BEGIN OF SCREEN 101.
      SELECTION-SCREEN BEGIN OF BLOCK BL1.
       select-options:s_matnr for mara-matnr.
      SELECTION-SCREEN END  OF  BLOCK BL1.
    Kindly giv me a solution for the above query.
    Thanks In Advance,
    Santhiya B

    Hi,
    The easy way out is use a report program so you can have a normal selection screen and enjoy the variant capability for free. You can then do a 'call screen' so the rest of your processing will behave like a dialog program.
    If that's not possible, here's another option. It's not elegant, but I've done it. If others have better ways, please do share.
    1) Create a dummy program (ZXXXVARI). In this program, all it needs is the selection fields similar to what you have in your module pool.
    2) Add buttons to your dialog screen so users can choose variants, save variant, etc.
    3) Define internal array VALUTAB LIKE RSPARAMS.
    4) When user wants to save their selection, populate VALUTAB, then call FUNCTION 'RS_CREATE_VARIANT' EXPORTING CURR_REPORT = "ZXXXVARI", etc., or call function 'RS_CHANGE_CREATED_VARIANT', depending on whether the variant already exists on the table VARI or not.
    5) When user wants to choose a variant to use, just display the variants in VARI under his id. Once he selects a variant, CALL FUNCTION 'RS_VARIANT_CONTENTS' to retrieve the values saved and put them on the dialog screen.

Maybe you are looking for

  • How can I connect my G5 iMac to Telefonica ADSL?

    I just moved to Spain. The ADSL connection offered by telefonica seems to be set up with just PCs in mind. I do not know how I can connect my iMAc and my extreme Airport Base Station to that ADSL system. Do I need any special configuration in the Bas

  • IPod Mini Issues

    Hello, everyone. For the past month now, my iPod has been going through major issues, and i'm running out of ideas. It doesn't appear to be a battery issue, because my iPod is responsive, however, the minute I turn it on, a sad folder icon appears, a

  • Message doesnot return back in sequantial asynchronous scenario

    I have an scenario like this,all of messages are executing asynchronously by calling from sproxy, Request clientZET029 --> NumberRangeRequest_Out   XI  NumberRangeRequest_In --> clientOER030 Response clientOER030    --> NumberRangeConfirmation_Out  X

  • Problem After writing the Jfree chart into pdf

    Hi All, I am writing the Jfreechart object with my company logo into JSP and and setting the content type as "application/pdf". I am getting the error as java.lang.IllegalStateException: getOutputStream() has already been called for this response. I

  • How to enable Extended Features in Reader 10

    I have pdf forms that were created in Acrobat 8 Pro. Users could change the fields on the forms and save them. Our Enterprise has since "upgraded" to Reader 10. Users can longer make changes in the fields of the forms created in v.8 Pro. I have read