Dynamic variant calling multiple screens

Hi all,
The concerned issue is that i am trying to execute a report( which on execution throws a selection screen) from a program using 'submit' statement passing a variant. along with it iam creating a dynamic varinat using FM RS_CREATE_VARIANT, the variant is being made, but on execution , the program throws an error meassage " invalid variant called'.
This is because the varinat is calling multiple screens , although only one screen number is passed in teh FM,( screen no 0170).
Please tell me the possible solution fr this .
Cheers,
Thanks in advance.

Hi,
first try to pass only the static variant with the submit statement and c whether its working properly.
and than check for dynamic variant..
c the difference and let me know what happens ??
thanks
ravi aswani

Similar Messages

  • Dynamic variant calling multiple selection screens

    Hi all,
    The concerned issue is that i am trying to execute a report( which on execution throws a selection screen) from a program using 'submit' statement passing a variant. along with it iam creating a dynamic varinat using FM RS_CREATE_VARIANT, the variant is being made, but on execution , the program throws an error meassage " invalid variant called'.
    This is because the varinat is calling multiple  screens , although only one screen number is passed in teh FM,( screen no 0170).
    Please tell me the possible solution fr this .
    Cheers,
    Thanks in advance.

    Hi,
    first try to pass only the static variant with the submit statement and c whether its working properly.
    and than check for dynamic variant..
    c the difference and let me know what happens ??
    thanks
    ravi aswani

  • Call multiple screens from LSMw

    Hi
    i want to call multiple screens from lsmw
    I need to call a three transaction from LSMW wich are subzequent steps for data entry.
    1) first tcode to be called is eprodcust which creates some master data and using this master data and some fields of data creatd i need to call two more tcodes first iq01 to create meter and save then eg31 tcod to feed data.
    Please suggest where in lsmw can i give options for suc hscnerio and call of subsequent screens.
    regards
    Edited by: Prieti_V on Nov 8, 2011 8:28 PM

    Hi Priti ,
    we have few options to handle such cases , to avoid Locked Problems what you can do is
    -->write BDC program within LSMW to create installation ( this will be created within step of 11 Convert Data ).
    -->Based on the above BDC results ,run another BDC within LSMW to create Device.( this will be created within step of 11 Convert Data ).
    -->third BDC records , let SAP do it thru LSMW or can you do it convert data step itself.
    this approch needs lots of codes , so in worst case and if you dont want to break the loadings the follow this.
    *Better to find any BAPI which will do creation of installation ,devices
    regards
    Prabhu

  • Module pool ( call multiple screens )

    hi abapers,
    in module pool program ,
    iam call one screen  into another screen .
    ex : screen no . 100
           iam designed table control  with some column  fields .
    iam call one of column field of table control into another screen,
    at that time last record value of that field will comes to the other screen.
    but i want, what of the selected value of field value comes to the other call screen number.

    Hi Raj,
    Use  GET CURSOR FIELD FNAME  VALUE FVAL.
    Whis is a syntax for system can identify yhe record i.e we can able to select one record from screen 100 is transferred to screen 120.
    FNAME ---> Field Name
    FVAL----->Value Which is selected from that Value (screen 100)..
    Regards
    Ranga

  • Dinamic variant for selection screen

    Hi,
    I got a requirement where i need  a Dynamic variant for selection screen .There is a date field in the selection screen i want to create  a variant such that when i choose it,it should give the current day date in selection screen.can anyone help me.
    Regards,
    Ravi

    Hi,
    Using Customer Exit code you can give it.
    Create a Customer Exit Variable and write simple code in CMOD. See the usefull Exit code for reports in the following url.
    https://wiki.sdn.sap.com/wiki/display/profile/Surendra+Reddy
    WHEN 'ZV_DAT'.
        IF i_step = 1 .
          CLEAR l_s_range.
          l_s_range-low = sy-datum.
          l_s_range-opt = 'EQ'.
          l_s_range-sign = 'I'.
          APPEND l_s_range TO e_t_range.
        ENDIF.
    Thanks
    Reddy

  • Dynamic date variant in selection screen

    I have a selection option s_date in my program where I want to use the dyanmic variant with.
    it is a date range and for the lower range, I would like to have a static value of 04/01/2010 and for the higher range I want to have last date of the prev month.
    I see last date of the prev month in the drop down (F4) Dynamic table, but selecting that is overwriting the s-date-low instead of s_date-high. How can I use the dynamic variant for this ? Can i create my own custom drop downs for these dates?
    S_DATE      FROM  (_04/01/2010_)  TO (LAST DATE OF PREV MONTH)
    Thanks in advance..

    In variant you can specify dates dynamically.
    When you save a variant, system ask you enter variant name and Meaning. On the same screen you can specify these dynamic values.
    For the parameter/select-option where you want to specify dynamic value, press F4 on 'Selection Variable' column.
    Choose type of variable as 'D' (Dynamic date calculation).
    Press F4 on 'Name of Variable(Input only using F4) column and select 'Current date +/- ??? days' on next screen.
    On input screen enter -1.
    Repeat same for To Date' field.
    Prabhudas

  • Dynamic Variant -Current date  in selection screen - for batch jobs

    Hi Experts,
    My report runs in batch job with a variant, daily.
    One of the filed in selction screen should hv CURRENT DATE, with out providing as input explicitly by user.
    So, How Can I get it done?
    Its some thing with Dynamic variants + Selection Variables +  date selection, but, I forgot the navigation etc.
    pl. let me know
    thanq

    thanq.
    and pls. let me further clarify that,
    programitically am populating the date as current date minus 1 in the field of my_date in the selection screen.
    now, they wanna to run the report in back ground, daily.
    now, I followed ur tip/link and saved with_date_variant, fine.
    so, pls. let me know that,
    1) if the report runs in back ground tomorrow with with_date_variant(which is i created by seeing ur link), Is the selection screen my_date(prog. populates as June 5th) will be override with current date(i.e. June 6th)?
    In broad, Is the selection criteria wuld be over writes with the Dynamic varints?
    thanq

  • Dynamically calling selection screens with obligatory

    TABLES :
    ******selection-screen: begin of block bal with frame title txt3.
    ******parameters: RB1  radiobutton group rd1 user-command abc default 'X'.
    ******parameters: RB2  radiobutton group rd1.
    ******selection-screen: end of block bal.
    ******selection-screen: begin of block B1 with frame title txt1.
    ******SELECT-OPTIONS  : s_cust  FOR KNA1-kunnr OBLIGATORY  MODIF ID r1.
    ******SELECT-OPTIONS  : s_plant  FOR plko-werks OBLIGATORY MODIF ID r1 .
    ******selection-screen: end of block val.
    ******selection-screen: begin of block upd with frame title txt2.
    ******SELECT-OPTIONS:  s_vend  FOR lfa1-lifnr OBLIGATORY modif id r2.
    ******SELECT-OPTIONS: s_plan  FOR plko-werks OBLIGATORY modif id r2.
    ******selection-screen: end of block upd.
    Here i need to call these two selection screens dynamically depends on radio buttion selection.
    But
    Problem is a arising when when both are obligatory in selection screen ( with out obligatory , it is working fine)
    I need to call screens dynamically, ecen though we have obligatory
    Let me know procedure , the possibility of same funcationality in tabstips & selection screen.
    Madhu

    Hi Madhu,
    You have to write code in AT SELECTION-SCREEN OUTPUT event.
    First of all remove obligatory from select-options declaration. Do it dynamically in AT SELECTION-SCREEN OUTPUT event.
    You enable or disable the block depending upon the rediobutton selected. Then in the venet AT SELECTION-SCREEN ON field, you can check whethere user has entered data into that field or not depending upon the radiobutton selected.
    TABLES : kna1,
             plko,
             lfa1.
    SELECTION-SCREEN: BEGIN OF BLOCK bal WITH FRAME TITLE txt3.
    PARAMETERS: rb1 RADIOBUTTON GROUP rd1 USER-COMMAND abc DEFAULT 'X'.
    PARAMETERS: rb2 RADIOBUTTON GROUP rd1.
    SELECTION-SCREEN: END OF BLOCK bal.
    SELECTION-SCREEN: BEGIN OF BLOCK b1 WITH FRAME TITLE txt1.
    SELECT-OPTIONS : s_cust FOR kna1-kunnr  MODIF ID r1.
    SELECT-OPTIONS : s_plant FOR plko-werks MODIF ID r1 .
    SELECTION-SCREEN: END OF BLOCK b1.
    SELECTION-SCREEN: BEGIN OF BLOCK upd WITH FRAME TITLE txt2.
    SELECT-OPTIONS: s_vend FOR lfa1-lifnr MODIF ID r2.
    SELECT-OPTIONS: s_plan FOR plko-werks MODIF ID r2.
    SELECTION-SCREEN: END OF BLOCK upd.
    AT SELECTION-SCREEN OUTPUT.
      LOOP AT SCREEN.
        IF rb1 EQ 'X'.
          IF ( screen-name EQ 'S_CUST-LOW'
            OR screen-name EQ 'S_CUST-HIGH'
            OR screen-name EQ 'S_PLANT-LOW'
            OR screen-name EQ 'S_PLANT-HIGH') .
            screen-active = '1' .
          ENDIF.
          IF ( screen-name EQ 'S_VEND-LOW'
            OR screen-name EQ 'S_VEND-HIGH'
            OR screen-name EQ 'S_PLAN-LOW'
            OR screen-name EQ 'S_PLAN-HIGH') .
            screen-active = '0' .
          ENDIF.
        ELSEIF rb2 EQ 'X'.
          IF ( screen-name EQ 'S_VEND-LOW'
            OR screen-name EQ 'S_VEND-HIGH'
            OR screen-name EQ 'S_PLAN-LOW'
            OR screen-name EQ 'S_PLAN-HIGH') .
            screen-active = '1' .
          ENDIF.
          IF ( screen-name EQ 'S_CUST-LOW'
            OR screen-name EQ 'S_CUST-HIGH'
            OR screen-name EQ 'S_PLANT-LOW'
            OR screen-name EQ 'S_PLANT-HIGH') .
            screen-active = '0' .
          ENDIF.
        ENDIF.
        MODIFY SCREEN.
      ENDLOOP.
    Regards,
    Anil Salekar

  • Calling new screen (through variant)

    Hello Gurus,
      I have a small question.
    We have following scenario to implement:
    In Shopping Cart we want new source of supply screen. On click of Source of Supply screen this new screen should be displyed.
      Can anyone tell efficient way to do this without standard code modification?
    Can we use screen variant to replace the subscreen with new subscreen?
    Thanks,
    Girish

    you can do it by catching the function code of that button and call the screen when user press button by
    CALL SCREEN scr.
    Addition:
    ... STARTING AT x1 y1 ... ENDING AT x2 y2
    scr is screen no.
    or if you want to do it in report
    just code it in at user-command .
    and try to use
    show your data by increasing sy-lsind.
    regards
    shiba dutta

  • SAP EP calling ASP screen - asking multiple logon prompt from internet

    Hi,
    We have EP page which calls multiple ASP page from the IIS server. When the users are in internet the system prompt for multiple prompt from the IIS server.
    1. May i know to make it as a single logon
    2. is it possible to do SSO between IIS and EP 7.3
    Thanks

    Hi,
    you can use the SSO22KerbMap ISAPI Filter to accomplish you requirement. Please refer to
    Using SAP Logon Tickets for Single Sign on to Microsoft based web applications
    and
    Single Sign-On of Windows-based Web Service Clients using SAP Logon Tickets
    for more details.
    Alterantively you can try with SAML (see Single Sign-On with SAML 2.0 - Security and Identity Management - SCN Wiki for more details), but then you should implement SAML Service provider on the IIS/ASP side, since unless I'm mistaken the IIS not provide it by default. Maby this link can be helpful for your: An Open Source ASP.NET SAML2 Service Provider | Passion for Coding
    Best regards,
    Artem

  • Using dynamic variants in ABAP

    Hi,
    I have an issue. I want to use dynamic variants in my program. On the selection screen of my program, I have a parameter called Planning date which takes in the current week of the year as input value, i.e lets say today we are Monday 14th of May 2007, so the current week is 20. I want to make this parameter dynamic, i.e to change automatically so that next week the value is week 21.
    Also is setting dynamic variants version dependent? My version is 5.0 SR1 and I don't have the option of save my variant using the 'D' traffic signal.
    Please help me out.
    Thanks

    Hi,
    you can fill your parameter in the initialization event of your report. In order to get the week you can use the function DATE_GET_WEEK.
    Kostas

  • Dynamic text in selection screen

    Hi all,
    I have one requirement in selection screen. I have a parameter and one pushbutton in selection screen .
    To the right side of the parameter, i need to display the text based on some manipulation in a internal in the program.
    If I click on the pushbutton in selection screen , manipulations will be done in the program in a internal table. if the result is ok i need to display the text in the right side of the parameter otherwise no need to display.
    How can I achieve this.
    Urgent
    Thanks
    Saravana

    Hi
    Write the code in the
    AT selection-screen ON PARAMETER of the Button.
    So when pressed on button, that code will do some process and the result will be displayed.
    check it, whether it displays the text or not on selection screen.
    see the doc
    AT SELECTION-SCREEN - selscreen_event
    Syntax
      | { ON {para|selcrit} }
      | { ON END OF selcrit }
      | { ON BLOCK block }
      | { ON RADIOBUTTON GROUP radi }
      | { }
      | { ON {HELP-REQUEST|VALUE-REQUEST}
      |   FOR {para|selcrit-low|selcrit-high} }
      | { ON EXIT-COMMAND }.
    Alternatives:
    1. ... OUTPUT
    2. ... ON {para|selcrit}
    3. ... ON END OF selcrit
    4. ... ON BLOCK block
    5. ... ON RADIOBUTTON GROUP radi
    6. ... { }
    7. ... ON {HELP-REQUEST|VALUE-REQUEST} FOR
          {para|selcrit-low|selcrit-high} }
    8. ... ON EXIT-COMMAND
    Effect
    These additions allow individual evaluation of specific elements of the selection screens of the program. The information as to which selection has triggered the event is contained in the system field sy-dynnr.
    Alternative 1
    ... OUTPUT
    Effect
    This event is triggered at the screen event PBO of a selection screen. In the event block, the selection screen can be prepared through assignments to the data objects of parameters and selection criteria and through dynamic screen modifications.
    Note
    The assignments to input fields in the event block AT SELECTION-SCREEN OUTPUT always affect the selection screen and overwrite the user inputs from previous displays of the same selection screen. Assignments in the event blocks LOAD-OF-PROGRAM oder INITIALIZATION, on the other hand, only have an effect at first program start.
    Alternative 2
    ... ON {para|selcrit}
    Effect
    This event is triggered at the screen event PAI of a selection screen if the content of the input field of a parameter para or a line of a selection criterion selcrit was passed to the ABAP program. In the event block, the user input can be checked. Sending a warning or an error message in the event block makes the fields para and selcrit ready for input again.
    No parameter that is defined as a radio button can be specified. For this purpose, the addition ON RADIOBUTTON GROUP is provided.
    Note
    If a user action takes place in the dialog box for the multiple selection of a selection criterion selcrit, the entries of the selection table are passed to the program, line by line. For each line, the event AT SELECTION-SCREEN ON selcrit is triggered.
    Alternative 3
    ... ON END OF selcrit
    Effect
    This event is triggered after the selection table selcrit has been fully passed to the program after a user action in the dialog box for the multiple selection has taken place. In the event block, the entire selection table can be checked.
    Alternative 4
    ... ON BLOCK block
    Effect
    This event is triggered at the screen event PAI of a selection screen if all the input fields of a block block of the selection screen were passed to the ABAP program. In the event block, the user inputs can be checked. Sending a warning or an error message in the event block makes all the fields of the block block ready for input again.
    Alternative 5
    ... ON RADIOBUTTON GROUP radi
    Effect
    This event is triggered at the screen event PAI of a selection screen if all the fields of a radio button group radi of the selection screen were passed to the ABAP program. In the event block, the user input can be checked. Sending a warning or error message in the event block makes all the radion buttons of the block radi ready for input again.
    Note
    The individual fields of a radio button group are not passed individually and do not trigger the event AT SELECTION-SCREEN ON par.
    Alternative 6
    Effect
    The event AT SELECTION-SCREEN itself is triggered as the last event of selection screen processing if all the input values were passed to the program. In this event block, all the user inputs can be checked. Sending a warning or an error message in the event block makes all the screen fields ready for input once again.
    Alternative 7
    ... ON { HELP-REQUEST | VALUE-REQUEST } FOR
        {para|selcrit-low|selcrit-high} }
    Effect
    The two events ON HELP-REQUEST and ON VALUE-REQUEST are triggered at the screen events POH and POV of a selection screen if - for the input field of a parameter para or one of the input fields of a selection criterion selcrit - the field help F1 or the input help F4 was called. Other selection events are not triggered.
    In the event blocks, a self-defined field or input field can be programmed, which overrides any helps possibly defined in the ABAP Dictionary.
    Notes
    These event blocks can only be implemented for fields of the selection screen that are defined in the same ABAP program and not in a possibly linked logical database.
    With the events for the field and input help, no data is transported between the selection screen and the ABAP program. As with general screens, suitable function modules must be used for these. The parameters and selection criteria changed for the input help are transported to the selection screen.
    Alternative 8
    ... ON EXIT-COMMAND
    Effect
    This event is triggered if the user has called one of the functions Back, Exit or Cancel. In the event block, possible clean-up actions can be executed.
    Example
    In these executable programs, a standard selection screen and a further selection screen are defined. In the event blocks AT SELECTION-SCREEN, the inputs in the selection screens can be specially handled using the name p_carrid and the screen number in sy-dynnr.
    REPORT demo_at_selection_screen.
    Global data
    DATA: sflight_tab TYPE TABLE OF sflight,
          sflight_wa  LIKE LINE  OF sflight_tab.
    Selection screens
    PARAMETERS p_carrid TYPE spfli-carrid.
    SELECTION-SCREEN BEGIN OF SCREEN 500.
      SELECT-OPTIONS s_conn FOR sflight_wa-connid.
      DATA s_conn_wa LIKE LINE OF s_conn.
    SELECTION-SCREEN END OF SCREEN 500.
    Handling selection screen events
    AT SELECTION-SCREEN ON p_carrid.
      IF p_carrid IS INITIAL.
        MESSAGE 'Please enter a value' TYPE 'E'.
      ENDIF.
      AUTHORITY-CHECK OBJECT 'S_CARRID'
                          ID 'CARRID' FIELD p_carrid
                          ID 'ACTVT'  FIELD '03'.
      IF sy-subrc = 4.
        MESSAGE 'No authorization for carrier' TYPE 'E'.
      ELSEIF sy-subrc <> 0.
        MESSAGE 'Error in authority check' TYPE 'A'.
      ELSE.
        IF sy-ucomm = 'ONLI'.
          CALL SELECTION-SCREEN '0500'.
        ENDIF.
      ENDIF.
    AT SELECTION-SCREEN.
      IF sy-dynnr = '0500'.
        IF s_conn IS INITIAL.
          MESSAGE 'Please enter values' TYPE 'W'.
        ELSE.
          SELECT *
                 FROM sflight
                 INTO TABLE sflight_tab
                 WHERE carrid = p_carrid AND
                       connid IN s_conn.
          IF sy-subrc <> 0.
            MESSAGE 'No flights found' TYPE 'E'.
          ENDIF.
        ENDIF.
      ENDIF.
    Main program
    START-OF-SELECTION.
    Reward points if useful
    Regards
    Anji
    Message was edited by:
            Anji Reddy Vangala

  • How to set Dynamic variant  for a program

    Hello experts,
    I want to set variants dynamically on a selection screen. Please help me.
    Thanks,
    Ashwani.

    Hi Ashwani,
    The variant can be set using:
    SUBMIT program name [USING SELECTION-SET <var>]
    USING SELECTION-SET <var>
         This option tells the system to start the called program with the variant <var>.
    For further details you can refer the link below:
    http://help.sap.com/saphelp_nw04/Helpdata/EN/9f/dba51a35c111d1829f0000e829fbfe/frameset.htm
    Also refer,
    http://sapbrainsonline.com/sap-training/SAP-tutorial-pdf-material_425.html
    Regards,
    Soundarya.
    Edited by: K.Soundarya Singh on Mar 16, 2010 7:16 AM

  • Create Dynamic variant for date field

    Hello all,
    I need to have the current month year displayed in my selection screen in format MM.YYYY and the field is of type SPMON (Period to analyze - month).
    and while saving the variant it is showing only 'T' (entries from TVARVC table)  in  "selection variable" field and not showing 'D' (Dynamic selection) for the above field.
    So,please help me in resolving this issue.
    Thanks in advance.

    hi
    good
    go through this code,i hope this ll help you to create the dynamic variant.
    Please find the sample using RS_CREATE_VARIANT (FM).
    It make use of other FM also , just have a look .
    Hope this may help you.
    REPORT ZEXAMPLE.
    DATA: JVARI_DESC LIKE VARID,
    RC LIKE SY-SUBRC,
    VARIANT_TEXT LIKE VARIT-VTEXT,
    JVT LIKE VARIT OCCURS 0 WITH HEADER LINE,
    SELPA LIKE RSPARAMS OCCURS 0 WITH HEADER LINE,
    PARMS LIKE RSPARAMS OCCURS 0 WITH HEADER LINE,
    OBJS LIKE VANZ OCCURS 0 WITH HEADER LINE.
    PARAMETERS: P_VAR LIKE RSVAR-VARIANT. "NAME OF VARIANT
    JVARI_DESC-REPORT = SY-REPID.
    JVARI_DESC-VARIANT = P_VAR.
    JVARI_DESC-ENAME = 'EXAMPLES'.
    JVT-REPORT = SY-REPID.
    JVT-VARIANT = P_VAR.
    JVT-LANGU = SY-LANGU.
    JVT-VTEXT = 'FUNCTION EXAMPLES'.
    APPEND JVT.
    CLEAR SELPA.
    SELPA-SIGN = 'I'.
    SELPA-OPTION = 'EQ'.
    SELPA-KIND = 'P'.
    SELPA-SELNAME = 'P_VAR'.
    SELPA-LOW = P_VAR.
    APPEND SELPA.
    CHECK IF VARIANT EXISTS
    CALL FUNCTION 'RS_VARIANT_EXISTS'
    EXPORTING
    REPORT = JVARI_DESC-REPORT
    VARIANT = P_VAR
    IMPORTING
    R_C = RC
    EXCEPTIONS
    NOT_AUTHORIZED = 1
    NO_REPORT = 2
    REPORT_NOT_EXISTENT = 3
    REPORT_NOT_SUPPLIED = 4
    OTHERS = 5.
    IF RC = 0 AND SY-SUBRC EQ 0.
    DELETE OLD VARIANT
    CALL FUNCTION 'RS_VARIANT_DELETE'
    EXPORTING
    REPORT = JVARI_DESC-REPORT
    VARIANT = P_VAR
    FLAG_CONFIRMSCREEN = 'X'
    EXCEPTIONS
    NOT_AUTHORIZED = 1
    NOT_EXECUTED = 2
    NO_REPORT = 3
    REPORT_NOT_EXISTENT = 4
    REPORT_NOT_SUPPLIED = 5
    VARIANT_LOCKED = 6
    VARIANT_NOT_EXISTENT = 7
    NO_CORR_INSERT = 8
    VARIANT_PROTECTED = 9
    OTHERS = 10.
    IF SY-SUBRC NE 0.
    WRITE: 'UNABLE TO DELETE VARIANT:', P_VAR ,'STATUS=', SY-SUBRC.
    EXIT.
    ELSE.
    WRITE:/ P_VAR, 'DELETED'.
    ENDIF.
    ELSE.
    WRITE:/ P_VAR, 'DOES NOT EXIST'.
    ENDIF. " ALREADY EXISTS
    CALL FUNCTION 'RS_CREATE_VARIANT'
    EXPORTING
    CURR_REPORT = JVARI_DESC-REPORT
    CURR_VARIANT = P_VAR
    VARI_DESC = JVARI_DESC
    TABLES
    VARI_CONTENTS = SELPA
    VARI_TEXT = JVT
    EXCEPTIONS
    ILLEGAL_REPORT_OR_VARIANT = 1
    ILLEGAL_VARIANTNAME = 2
    NOT_AUTHORIZED = 3
    NOT_EXECUTED = 4
    REPORT_NOT_EXISTENT = 5
    REPORT_NOT_SUPPLIED = 6
    VARIANT_EXISTS = 7
    VARIANT_LOCKED = 8
    OTHERS = 9.
    IF SY-SUBRC EQ 0.
    WRITE:/ 'VARIANT', P_VAR, 'CREATED FOR PROGRAM', JVARI_DESC-REPORT.
    ELSE.
    WRITE:/ 'VARIANT', P_VAR, 'NOT CREATED FOR PROGRAM', JVARI_DESC-REPORT.
    EXIT.
    ENDIF.
    CALL FUNCTION 'RS_VARIANT_CONTENTS'
    EXPORTING
    REPORT = JVARI_DESC-REPORT
    VARIANT = P_VAR
    TABLES
    VALUTAB = PARMS
    OBJECTS = OBJS
    EXCEPTIONS
    VARIANT_NON_EXISTENT = 1
    VARIANT_OBSOLETE = 2
    OTHERS = 3.
    IF SY-SUBRC NE 0.
    WRITE : / 'ERROR READING VARIANT CONTENTS.'.
    ELSE.
    CALL FUNCTION 'RS_VARIANT_TEXT'
    EXPORTING
    LANGU = SY-LANGU
    CURR_REPORT = JVARI_DESC-REPORT
    VARIANT = P_VAR
    IMPORTING
    V_TEXT = VARIANT_TEXT.
    WRITE:/ 'VARIANT DESCRIPTION:', VARIANT_TEXT.
    LOOP AT PARMS.
    CHECK PARMS-LOW NE SPACE OR PARMS-HIGH NE SPACE.
    READ TABLE OBJS WITH KEY NAME = PARMS-SELNAME.
    WRITE : /2 PARMS-SELNAME, OBJS-TEXT,
    45 PARMS-KIND,
    PARMS-SIGN,
    PARMS-OPTION,
    PARMS-LOW,
    PARMS-HIGH.
    NEW-LINE.
    ENDLOOP.
    SKIP.
    ENDIF.
    some other approach....
    This function module selects the Selection Screen contents
    CALL FUNCTION 'RS_REFRESH_FROM_SELECTOPTIONS'
    EXPORTING
    curr_report = sy-repid
    TABLES
    selection_table = loc_int_tab
    EXCEPTIONS
    not_found = 1
    no_report = 2
    OTHERS = 3.
    IF sy-subrc NE 0.
    MESSAGE i000 WITH 'Error in RS_REFRESH_FROM_SELECTOPTIONS'(029).
    LEAVE LIST-PROCESSING.
    ENDIF.
    Craete the variant VAR1
    CALL FUNCTION 'RS_CREATE_VARIANT'
    EXPORTING
    curr_report = sy-repid
    curr_variant = wf_variant
    vari_desc = loc_varid
    TABLES
    vari_contents = loc_int_tab
    vari_text = loc_varit
    EXCEPTIONS
    illegal_report_or_variant = 1
    illegal_variantname = 2
    not_authorized = 3
    not_executed = 4
    report_not_existent = 5
    report_not_supplied = 6
    variant_exists = 7
    variant_locked = 8
    OTHERS = 9.
    IF sy-subrc <> 0.
    MESSAGE i000 WITH 'Error while creating dynamic variant'(028).
    LEAVE LIST-PROCESSING.
    ENDIF.
    reward point if helpful.
    thanks
    mrutyun^

  • How to create Dynamic Variant?

    Hi Experts,
    One simple doubt pls.,
    How to create a Dynamic Variant for my_z_selection_screen?
    thanq.

    hi,
    Look at the following Code
    Please find the sample using RS_CREATE_VARIANT (FM).
    It make use of other FM also , just have a look .
    Hope this may help you.
    REPORT ZEXAMPLE.
    DATA: JVARI_DESC LIKE VARID,
    RC LIKE SY-SUBRC,
    VARIANT_TEXT LIKE VARIT-VTEXT,
    JVT LIKE VARIT OCCURS 0 WITH HEADER LINE,
    SELPA LIKE RSPARAMS OCCURS 0 WITH HEADER LINE,
    PARMS LIKE RSPARAMS OCCURS 0 WITH HEADER LINE,
    OBJS LIKE VANZ OCCURS 0 WITH HEADER LINE.
    PARAMETERS: P_VAR LIKE RSVAR-VARIANT. "NAME OF VARIANT
    JVARI_DESC-REPORT = SY-REPID.
    JVARI_DESC-VARIANT = P_VAR.
    JVARI_DESC-ENAME = 'EXAMPLES'.
    JVT-REPORT = SY-REPID.
    JVT-VARIANT = P_VAR.
    JVT-LANGU = SY-LANGU.
    JVT-VTEXT = 'FUNCTION EXAMPLES'.
    APPEND JVT.
    CLEAR SELPA.
    SELPA-SIGN = 'I'.
    SELPA-OPTION = 'EQ'.
    SELPA-KIND = 'P'.
    SELPA-SELNAME = 'P_VAR'.
    SELPA-LOW = P_VAR.
    APPEND SELPA.
    CHECK IF VARIANT EXISTS
    CALL FUNCTION 'RS_VARIANT_EXISTS'
    EXPORTING
    REPORT = JVARI_DESC-REPORT
    VARIANT = P_VAR
    IMPORTING
    R_C = RC
    EXCEPTIONS
    NOT_AUTHORIZED = 1
    NO_REPORT = 2
    REPORT_NOT_EXISTENT = 3
    REPORT_NOT_SUPPLIED = 4
    OTHERS = 5.
    IF RC = 0 AND SY-SUBRC EQ 0.
    DELETE OLD VARIANT
    CALL FUNCTION 'RS_VARIANT_DELETE'
    EXPORTING
    REPORT = JVARI_DESC-REPORT
    VARIANT = P_VAR
    FLAG_CONFIRMSCREEN = 'X'
    EXCEPTIONS
    NOT_AUTHORIZED = 1
    NOT_EXECUTED = 2
    NO_REPORT = 3
    REPORT_NOT_EXISTENT = 4
    REPORT_NOT_SUPPLIED = 5
    VARIANT_LOCKED = 6
    VARIANT_NOT_EXISTENT = 7
    NO_CORR_INSERT = 8
    VARIANT_PROTECTED = 9
    OTHERS = 10.
    IF SY-SUBRC NE 0.
    WRITE: 'UNABLE TO DELETE VARIANT:', P_VAR ,'STATUS=', SY-SUBRC.
    EXIT.
    ELSE.
    WRITE:/ P_VAR, 'DELETED'.
    ENDIF.
    ELSE.
    WRITE:/ P_VAR, 'DOES NOT EXIST'.
    ENDIF. " ALREADY EXISTS
    CALL FUNCTION 'RS_CREATE_VARIANT'
    EXPORTING
    CURR_REPORT = JVARI_DESC-REPORT
    CURR_VARIANT = P_VAR
    VARI_DESC = JVARI_DESC
    TABLES
    VARI_CONTENTS = SELPA
    VARI_TEXT = JVT
    EXCEPTIONS
    ILLEGAL_REPORT_OR_VARIANT = 1
    ILLEGAL_VARIANTNAME = 2
    NOT_AUTHORIZED = 3
    NOT_EXECUTED = 4
    REPORT_NOT_EXISTENT = 5
    REPORT_NOT_SUPPLIED = 6
    VARIANT_EXISTS = 7
    VARIANT_LOCKED = 8
    OTHERS = 9.
    IF SY-SUBRC EQ 0.
    WRITE:/ 'VARIANT', P_VAR, 'CREATED FOR PROGRAM', JVARI_DESC-REPORT.
    ELSE.
    WRITE:/ 'VARIANT', P_VAR, 'NOT CREATED FOR PROGRAM', JVARI_DESC-REPORT.
    EXIT.
    ENDIF.
    CALL FUNCTION 'RS_VARIANT_CONTENTS'
    EXPORTING
    REPORT = JVARI_DESC-REPORT
    VARIANT = P_VAR
    TABLES
    VALUTAB = PARMS
    OBJECTS = OBJS
    EXCEPTIONS
    VARIANT_NON_EXISTENT = 1
    VARIANT_OBSOLETE = 2
    OTHERS = 3.
    IF SY-SUBRC NE 0.
    WRITE : / 'ERROR READING VARIANT CONTENTS.'.
    ELSE.
    CALL FUNCTION 'RS_VARIANT_TEXT'
    EXPORTING
    LANGU = SY-LANGU
    CURR_REPORT = JVARI_DESC-REPORT
    VARIANT = P_VAR
    IMPORTING
    V_TEXT = VARIANT_TEXT.
    WRITE:/ 'VARIANT DESCRIPTION:', VARIANT_TEXT.
    LOOP AT PARMS.
    CHECK PARMS-LOW NE SPACE OR PARMS-HIGH NE SPACE.
    READ TABLE OBJS WITH KEY NAME = PARMS-SELNAME.
    WRITE : /2 PARMS-SELNAME, OBJS-TEXT,
    45 PARMS-KIND,
    PARMS-SIGN,
    PARMS-OPTION,
    PARMS-LOW,
    PARMS-HIGH.
    NEW-LINE.
    ENDLOOP.
    SKIP.
    ENDIF.
    some other approach....
    This function module selects the Selection Screen contents
    CALL FUNCTION 'RS_REFRESH_FROM_SELECTOPTIONS'
    EXPORTING
    curr_report = sy-repid
    TABLES
    selection_table = loc_int_tab
    EXCEPTIONS
    not_found = 1
    no_report = 2
    OTHERS = 3.
    IF sy-subrc NE 0.
    MESSAGE i000 WITH 'Error in RS_REFRESH_FROM_SELECTOPTIONS'(029).
    LEAVE LIST-PROCESSING.
    ENDIF.
    Craete the variant VAR1
    CALL FUNCTION 'RS_CREATE_VARIANT'
    EXPORTING
    curr_report = sy-repid
    curr_variant = wf_variant
    vari_desc = loc_varid
    TABLES
    vari_contents = loc_int_tab
    vari_text = loc_varit
    EXCEPTIONS
    illegal_report_or_variant = 1
    illegal_variantname = 2
    not_authorized = 3
    not_executed = 4
    report_not_existent = 5
    report_not_supplied = 6
    variant_exists = 7
    variant_locked = 8
    OTHERS = 9.
    IF sy-subrc <> 0.
    MESSAGE i000 WITH 'Error while creating dynamic variant'(028).
    LEAVE LIST-PROCESSING.
    ENDIF.

Maybe you are looking for

  • How to store España in database (in a column of a table)

    Could you please tell me how to store España in database (in a column of a table). regards

  • Function with dynamics cursor.

    Hi everybody, I'm trying to write a function having as argument as SQL query(or a part of it). This SQL query should generate a cusror within the function. All the way would have the generated cusror always the same structure. CREATE OR REPLACE FUNCT

  • Nokia E75 wont turn on

    I was carrying my nokia e75 in my pocket and I looked into phone and it was turned off. I tried to turn it on but when I press turn on/red phone button nothing happens. I thought that battery is empty and I connected phone to charger, and when I conn

  • What won't run?

    I am considering buying a MacBook. I hesitate until I'm certain that the software I use will run with the Intel processor. Is there a site that will show what will/will not run? I know there has been problems with certain "pro" software. I just need

  • Query on Price List Qualifiers

    Hi, I am trying to understand the functionality of pricing manager in 11.5.3. What is the meaning of attaching a modifier list as qualifier to price list? i.e. 1. I have 2 price lists named Coporate and Base List. 2. I attach Corporate Price list as