Hiding of Select Options in screen based on selection in selection list box

Hi People,
         I have a screen where i have put a selection list box, it is pre-filled with values, Now based on the value which user selects, I want to show/hide some select-options fields. I have declared the select options in the top include of my program,
SELECT-OPTIONS: so_user FOR ls_rsp_user-user_id MODIF ID 222,
                so_userg FOR ls_rsp_usergrp-user_grp_id MODIF ID 333,
                so_ccode FOR ls_vdmp-bukrs MODIF ID 444,
then in the PBO of my screen, I have written a module, set screen in which I loop over screen & check the group id's
LOOP AT SCREEN.
    IF screen-group1 = '111'.
      IF gv_hier_resp_fields_flag IS NOT INITIAL.
        screen-active = 1.
      ELSE.
        screen-active = 0.
      ENDIF.
    ELSEIF screen-group1 = '222'.
      IF gv_user_fields_flag IS NOT INITIAL.
        screen-active = 1.
      ELSE.
        screen-active = 0.
      ENDIF.
    ELSEIF screen-group1 = '333'.
      IF gv_user_group_fields_flag IS NOT INITIAL.
        screen-active = 1.
      ELSE.
        screen-active = 0.
    ENDIF.
MODIFY SCREEN.
ENDLOOP.
I am setting some flags based on the value which user selects in the selection list box, When I debugged I found that the flags were being set correctly, but the screen group value never set to '222' or '333', these are id's i have used for select options. Hence I am unable to hide/show the select options fields.  Kindly suggest some solutions for this.
Thanks & Regards,
Deepak

then in the PBO of my screen
Your SELECT-OPTIONS are defined in a SELECTION-SCREEN so the PBO actions must be maintained in a AT SELECTION-SCREEN OUTPUT block.
I suppose the selection-screen is a subscreen, if you dont want to get unwanted interactions with a main selection-screen of the report, check sy-dynnr
AT SELECTION-SCREEN OUTPUT.
   CASE sy-dynnr.
     WHEN '1000'. " main screen of report
     WHEN '0100'. " selection-screen defined as subscreen
       LOOP AT SCREEN.
         CASE SCREEN-GROUP1.
           WHEN '111'.
         ENDCASE.
       ENDLOOP.
   ENDCASE.
Regards,
Raymond

Similar Messages

  • SELECT-OPTIONS in Screen

    Hi,
    I am trying to create select - options in Screen , i.e. not the selection screen but a custom screen, say 9000. I can make the text boxes etc for having the select options. But How do I simulate the button wchich comes after select options. It would be used in dialogue programming with multiple screens having different reports.
    Please reply to me urgently,
    Thanks and Regards
    Arnab Panigrahi

    A few dot points:
    1. You can have a select-option embedded in a dynpro, if you want, by using a subscreen.  There's an example bit of code at
    Module - pool Question..?
    This would be easy to adapt to being a popup rather than a full screen if required.
    2. As noted above, you can code your own select-options as in
    Making a referenced field a range?
    which I think Sesh has quoted from.
    3. For the requirement you expressed initially, the code below should do the trick... you get a different block of extra selections depending on which radionbutton you select.
    Jonathan
    report zlocal_jc_radiobutton_hiding.
    tables:
      sscrfields.           "To allow trapping of Fcode on selection screen
    selection-screen begin of block tot with frame.
    parameters :
      p_rb_01          radiobutton group rbg1 user-command zrb1 default 'X',
      p_rb_02          radiobutton group rbg1.
    selection-screen begin of block block1 with frame title text1.
    parameters:
      p_date                like sy-datum modif id bl1.
    selection-screen end of block block1.
    selection-screen begin of block block2 with frame title text2.
    parameters:
      p_time                like sy-uzeit modif id bl2.
    selection-screen end of block block2.
    selection-screen end of block tot.
    *" Events:
    initialization.
      text1 = 'Enter a date'.
      text2 = 'Enter a time'.
    at selection-screen output.
      perform at_selection_screen_output.
    at selection-screen.
      perform at_selection_screen.
    *&      Form  at_selection_screen_output
    form at_selection_screen_output.
    *" Hide the appropriate fields
      loop at screen.
        if  p_rb_01       = 'X'
        and screen-group1 = 'BL2'.
          screen-active = '0'.
        endif.
        if  p_rb_02       = 'X'
        and screen-group1 = 'BL1'.
          screen-active = '0'.
        endif.
        modify screen.
      endloop.
    endform.                    "at_selection_screen_output
    *&      Form  at_selection_screen
    form at_selection_screen.
    *" trap the radiobutton
      if sscrfields-ucomm = 'ZRB1'. "clicked Subtotal checkbox
    *" if you want to trap this radio button press here
      endif.
    endform.                    "at_selection_screen

  • How to degin a  select-option in screen painter?

    Help me !
    How can i create an object  like select-option  in screen painter.
    I want to input a range ,but there are no button or text   in screen painter  like  select-option?

    hai u can create select options on screen but in little differernt way..
    1st way : if u want to give only 1 interval then declare on screen as two different variables in same line
    and after that append the value in ranges.
    2nd way: here u can define as asingle input vriable  beside that variable u can give a icon as extension in select option and give give some function code to that.if we click on that in user command write following code :
      IF V_OKCODE = 'EXT'.
        CALL FUNCTION 'COMPLEX_SELECTIONS_DIALOG'
            EXPORTING
                 TITLE             = 'Title'
                 TEXT              = 'Text'
                 SIGNED            = 'X'
            LOWER_CASE        = ' '
            NO_INTERVAL_CHECK = ' '
            JUST_DISPLAY      = ' '
            JUST_INCL         = ' '
            EXCLUDED_OPTIONS  =
            DESCRIPTION       =
                 HELP_FIELD        = 'T001W-WERKS'
            SEARCH_HELP       =
             TABLES
                  RANGE             = R_WERKS
            EXCEPTIONS
                 NO_RANGE_TAB      = 1
                 CANCELLED         = 2
                 INTERNAL_ERROR    = 3
                 OTHERS            = 4
        IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
    help field the field reference wich u want to declare and range is where values will be stored atomatically as in select options.
    once we click the icon if we execute the function module a window will open as in selection option in reports.there user can enter the values.once the user enters the values it will stored automatically in ranges declared like r_werks in above example.
    try it..

  • How to declare and work with select-option in screen painter?

    hello there,
    can anybody plz suggest me ,how to declare and work with select-option in screen painter?
    neon

    Hi Blue,
    Please check these threads which will help you a lot..
    module pool programming " to add selection-option on screen"
    Re: Select option in Dialog program screen
    Re: SELECT-OPTIONS in Screen
    Good luck
    Narin

  • Select-Option in Screen??

    Hi Experts,
    Requirement is like select-option on Selection-Screen, I want that same function on Screen(Module Pool). Infact i want that button for random selection what comes automatically  in select-options to select the multiple data.
    Can anyone help me for this.Its very very urgent.
    Thanks in Advance.
    Regards,
    Rahul

    hi rahul,
    its not possible to create multiple selections in module pool.
    but you can create 2 i/o fields for lower and upper limit in module pool and you can write select query with between keyword to get values from lower to upper limits.
    Senthil kumar

  • SELECT-OPTION IN SCREEN (SCREEN-PAINTER)

    I want to put a select option in a screen type screen painter
    Using this the user could enter a ranger of personal numbers.
    Can any one give me a clue on how to do that ?

    This is the code of the program and I my break point I do not have anything in SELPERNR
    REPORT  ZY_TESTSUBSCREEN                        .
    TABLES: PA0003.
    Custom Selection Screen 1010
    SELECTION-SCREEN BEGIN OF SCREEN 1010 AS SUBSCREEN.
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
    SELECT-OPTIONS: SELPERNR FOR  PA0003-PERNR.
    SELECTION-SCREEN END OF BLOCK B1.
    SELECTION-SCREEN END OF SCREEN 1010.
    CALL SCREEN 100.
    BREAK STEPHANK.
    *&      Module  USER_COMMAND_0100  INPUT
          text
    MODULE USER_COMMAND_0100 INPUT.
      CHECK SY-UCOMM(1) NE '%'.
      LEAVE TO SCREEN 0.
    ENDMODULE.                 " USER_COMMAND_0100  INPUT
    This is the screen flow
    PROCESS BEFORE OUTPUT.
    MODULE STATUS_0100.
    CALL SUBSCREEN AREA INCLUDING SY-REPID '1010'.
    PROCESS AFTER INPUT.
    MODULE USER_COMMAND_0100.
    Rich do you have any idea why ?

  • Select options in screens

    Hello friends,
                       I am doing a screen program where the user will enter a range of sales orders,and i have to select from vbap the corresponding materials against that sales order number,but i am finding it difficult to use the select statement.
                      suppose my screen fields are vbeln-low and vbeln-high,so here i cant use the select statement select * from vbap into corresponding fields of iatb where
    vbeln >= vbeln-low and vbeln <=vbeln-high, bcoz if the user doesnt enter vbeln-high then select statement goes wrong,other option i making a structure with fields like sign option low high,but if i have more select options that again beocmes a problem,is there anyway that i can solve this with a single select statement

    Hi
    U can create a SELECTION-SCREEN in a module pool defining it in the TOP-INCLUDE:
    SELECTION-SCREEN BEGIN OF SCREEN 0100.
    SELECT-OPTIONS: SO_VBELN FOR VBAK-VBELN.
    SELECTION-SCREEN END    OF SCREEN 0100.
    In your MAIN SCREEN
    PROCESS PBO.
      MODULE CALL_SEL_SCREEN.
    MODULE CALL_SEL_SCREEN.
       CALL SELECTION-SCREEN 100.
       IF SY-SUBRC = 0.
    ---> User has pressed F8
         SELECT * FROM VBAP INTO TABLE T_VBAP WHERE VBELN IN SO_VBELN.
       ELSE.
    ----> User wants to exit from selection-screen.
       ENDIF.
    ENDMODULE.
    Max

  • Module pool programming " to add selection-option on screen"

    I want to add selection option for a field ( matnr ) on the screen in module pool programmiing. ( how it comes in report programming). If you you know how to add Please help me to solve.....

    Sure, you need to define your selection screen as a subscreen, then embed this into your subscreen area on the dynpro.  Here is a sample program.
    report zrich_0006 .
    tables: mara.
    * Custom Selection Screen 1010
    selection-screen begin of screen 1010 as subscreen.
    selection-screen begin of block b1 with frame title text-001.
    parameters: p_rad1 radiobutton group grp1 default 'X',
                p_rad2 radiobutton group grp1,
                p_rad3 radiobutton group grp1.
    select-options: s_matnr for  mara-matnr,
                    s_matkl for  mara-matkl,
                    s_mtart for  mara-mtart.
    selection-screen end of block b1.
    selection-screen end of screen 1010.
    start-of-selection.
      call screen 100.
    *&      Module  STATUS_0100  OUTPUT
    module status_0100 output.
    *  SET PF-STATUS 'xxxxxxxx'.
    *  SET TITLEBAR 'xxx'.
    endmodule.
    *&      Module  USER_COMMAND_0100  INPUT
    module user_command_0100 input.
    endmodule.
    * Create Screen 100 with a subscreen area called "subscreen_1010"
    * Screen Flow Logic follows
    *process before output.
    *  module status_0100.
    *  call subscreen subscreen_1010 including sy-repid '1010'.
    *process after input.
    *  call subscreen subscreen_1010 .
    *  module user_command_0100.
    Regards,
    Rich Heilman

  • Reset Select options in Screen

    Hi,
    I have a scenario where, i need to disable the select options and clear the visible contents in it.
    Currently below is the logic implemented, the radio button is getting disabled and also cleared of selection.
    Select option fields are getting disabled.
    But the issue is, the Select options LOW and HIGH fields show the older values and are not getting reset.
    Please share your thoughts.
    PARAMETERS : r_pernr RADIOBUTTON GROUP g2 MODIF ID cs1.
    SELECT-OPTIONS :   p_pernr FOR pa0001-pernr MODIF ID cs1.
    AT SELECTION-SCREEN OUTPUT.
      LOOP AT SCREEN.
        IF V_Flag NE 'X' AND
           screen-group1 = 'CS1'.
          r_pernr = space.
          p_pernr-low = space.
          p_pernr-high = space.
          screen-input = 0.
          MODIFY SCREEN.
       ENDIF.
      ENDLOOP.

    TABLES:PA0001.
    DATA:LF_PERNR TYPE CHAR08.
    PARAMETERS : R_PERNR RADIOBUTTON GROUP G2 MODIF ID CS1,
                 R_2 RADIOBUTTON GROUP G2.
    SELECT-OPTIONS : P_PERNR FOR LF_PERNR MODIF ID CS1.
    AT SELECTION-SCREEN OUTPUT.
      LOOP AT SCREEN.
        R_PERNR = SPACE.
        CLEAR P_PERNR[].
        SCREEN-INPUT = 0.
        MODIFY SCREEN.
    ENDLOOP.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_PERNR-LOW.
      PERFORM F4_HELP USING 'P_PERNR-LOW'.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_PERNR-HIGH.
      PERFORM F4_HELP USING 'P_PERNR-HIGH'.
    FORM F4_HELP USING PC_1.
      TYPES:BEGIN OF TY,
          PERNR TYPE PA0001-PERNR,
          END OF TY.
      DATA:IT TYPE TABLE OF TY.
      SELECT PERNR INTO TABLE IT FROM PA0001 UP TO 10 rows.
      CHECK IT[] IS NOT INITIAL.
      DELETE ADJACENT DUPLICATES FROM IT.
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
        EXPORTING
          RETFIELD    = 'PERNR'
          DYNPPROG    = SY-CPROG
          DYNPNR      = SY-DYNNR
          DYNPROFIELD = PC_1
          VALUE_ORG       = 'S'
        TABLES
          VALUE_TAB   = IT[]
        EXCEPTIONS
          OTHERS      = 0.
    ENDFORM.          

  • Select Options in Screen Painter

    Hi there
    Is there some way I can create two text boxes and one button, when the buttons gets pressed the same action as your usual SELECT-OPTIONS dialog box gets displayed? Is ther maybe a function module I can call for this?
    Thanx,
    Jan

    you can call a selection screen in sub screen area
    declare selection screen as
    begin of selection-screen 0100 as subscreen.
    end of selection-screen...
    then,
    in flow logic of your module pool screen
    PBO
    call subscreen <sub_area> including sy-repid '0100'.
    " at selection-screen output event is called
    PAI.
    call subscreen <sub_area>.
    "at selection-screen is called
                                              OR
    Call FM COMPLEX_SELECTIONS_DIALOG when the select options button is pressed
    Edited by: Amit Gupta on Nov 6, 2008 11:19 AM

  • How to realize  select-option in screen

    Hi,everyone.
    in a report , i can define select-option in  SELECTION-SCREEN .
    how can i realize the similar function in a screen ?
    ths!

    Hi,
    Check this sample program to define selection screen in dialog programming.include the selection screen in a subscreen and then include the subscreen in your screen.
    report YS_SELECTION .
    tables: mara.
    Custom Selection Screen 1010
    selection-screen begin of screen 1010 as subscreen.
    selection-screen begin of block b1 with frame title text-001.
    parameters: p_rad1 radiobutton group grp1 default 'X',
                p_rad2 radiobutton group grp1,
                p_rad3 radiobutton group grp1.
    select-options: s_matnr for  mara-matnr,
                    s_matkl for  mara-matkl,
                    s_mtart for  mara-mtart.
    selection-screen end of block b1.
    selection-screen end of screen 1010.
    start-of-selection.
      call screen 100.
    *&      Module  STATUS_0100  OUTPUT
    module status_0100 output.
    SET PF-STATUS 'xxxxxxxx'.
    SET TITLEBAR 'xxx'.
    endmodule.
    *&      Module  USER_COMMAND_0100  INPUT
    module user_command_0100 input.
    endmodule.
    create   screen 100 and create a subscreen area called "subscreen_1010"
    Screen Flow Logic follows
    *process before output.
    module status_0100.
    call subscreen subscreen_1010 including sy-repid '1010'.
    *process after input.
    call subscreen subscreen_1010 .
    module user_command_0100.
    Laxman

  • How to design select-option through screen painter

    I am new to screen painter. I want to make a screen having range of values high/low (just like select-option)......How can I do this using screen painter?

    Hi!
    Method 1
    a) Create a subscreen area in your screen layout where you want to create the select options.
    b) In the top include of  your module pool program declare a selection screen as a subscreen e.g.
           SELECTION-SCREEN BEGIN OF SCREEN 100 AS SUBSCREEN.
                 select-options s_matnr for mara-matnr.
           SELECTION-SCREEN END OF SCREEN.
    c) In the PBO and PAI of the main screen where the select options needs to be created do a call subscreen of the above screen (100).
           CALL SUBCREEN sub_area INCLUDING    
      This call subscreen statement is necessary for transport of values between screen and program.
    Note: All validations of the selection screen fields e.g. the s_matnr field created above should be done in selection screen events like AT SELECTION-SCREEN etc and not in PAI. These selection screen validations etc should be done in the top include only.
    Method 2
    a) Create 2 separate fields in your screen layout - one for the low value and one for the high value. Insert an icon beside the high value which will call the multiple selections popup screen on user command. Use function module COMPLEX_SELECTIONS_DIALOG to achieve this.
    struc_tab_and_field-fieldname   = con_cust.      " 'KUNNR'
    struc_tab_and_field-tablename = con_kna1.     " 'KNA1'.
    CALL FUNCTION 'COMPLEX_SELECTIONS_DIALOG'
              EXPORTING
              TITLE                   = ' '
                text                         = g_titl1                                " 'Customers'
                tab_and_field     = struc_tab_and_field
              TABLES
                RANGE                   = rng_kunnr
              EXCEPTIONS
                NO_RANGE_TAB          = 1
                CANCELLED                    = 2
                INTERNAL_ERROR     = 3
                INVALID_FIELDNAME = 4
                OTHERS                           = 5.
    IF NOT rng_kunnr[] IS INITIAL.
             Read the very first entry of the range table and pass it to
             dynpro screen field
               READ TABLE rng_kunnr INDEX 1.
               IF sy-subrc = 0.
                  g_cust = rng_kunnr-low.
               ENDIF.
    You can use the return table rng_kunnr to populate your own internal range table with the values entered by the user. Basically here you are just simulating the work of a select-options parameter by module pool screen elements
    You can go with it also ....
    Re: Select-options in dynpro
    Regards....

  • Default Selection Option on LDB based Query

    I have written an InfoSet and Query over logical database KDF.  One selection option from the logical database is the clearing date (KD_AUGDT).  I want to select only items that are still open (not cleared) so, manually, I set the selection option to single value [EQ], and no date.
    I want to set this default value within the InfoSet with a coding element so that any query using this InfoSet defaults with the value EQ set.
    Thanks for your help.
    Sergio

    Thanks for your reply, Waseem
    This is not an ideal solution for my needs, unfortunately.  The selection option I need to set here is that the value is equal to 'blank'.  I want to only show open items and via this LDB I can only do so this way.  Also, as a control on performance, I wanted to delegate this InfoSet to open items only so I would prefer to restrict from within the InfoSet.
    Sergio

  • Error at transport in select option   is not followed by itab or value list

    Hi All,
    I have an issue with the following inner join. when i check with code inspector it is not showing any errors but i get the following error while transport.
    "The In operator with SO_MATKL is followed neither by an Internal table nor by a value list".
    This error appears after the system is unicode enabled is that it have any unicode significance please advice on this.
    The following is the code snippet.
    SELECT amatnr amtart aextwg amatkl bwerks bdispo b~ekgrp
        INTO TABLE tb_mara
        FROM mara AS a
       INNER JOIN marc AS b ON amatnr = bmatnr
       WHERE a~matnr IN so_matnr
         AND a~mtart IN so_mtart
         AND a~extwg IN so_extwg
         AND a~matkl IN so_matkl
         AND b~werks IN so_werks
         AND b~dispo IN so_dispo
         AND b~ekgrp IN so_ekgrp.

    Hi Gopal
    Am on UNICODE Enabled system and i dont have problem with below code. Please check, if you have used similar to this???
    tables: mara, marc.
    select-options: so_matnr for mara-matnr,
                    so_mtart for mara-mtart,
                    so_extwg for mara-extwg,
                    so_matkl for mara-matkl,
                    so_werks for marc-werks,
                    so_dispo for marc-dispo,
                    so_ekgrp for marc-ekgrp.
    types: begin of t_mara,
             matnr type matnr,
             mtart type mtart,
             extwg type extwg,
             matkl type matkl,
             werks type werks_d,
             dispo type dispo,
             ekgrp type ekgrp,
           end of t_mara.
    data: tb_mara type table of t_mara.
    SELECT a~matnr a~mtart a~extwg a~matkl b~werks b~dispo b~ekgrp
           INTO TABLE tb_mara
           FROM mara AS a
           INNER JOIN marc AS b ON a~matnr = b~matnr
           WHERE a~matnr IN so_matnr
           AND   a~mtart IN so_mtart
           AND   a~extwg IN so_extwg
           AND   a~matkl IN so_matkl
           AND   b~werks IN so_werks
           AND   b~dispo IN so_dispo
           AND   b~ekgrp IN so_ekgrp.
    Kind Regards
    Eswar

  • Selection option CO15 screen

    Hi experts,
    i want to select the production order depend upon the material in CO15 screen.
    is there possible.
    pls guide me?
    thanks & regds
    K.Bhuvaneswaran

    Hi bhuvaneswaran,
    In Tcode : CO15 Order field is the only selection field.
    But if you don't no the order number then put the Cursor in the Order selection Field and Press F4 and Select the "Process Order Using Info System" and set as default. System will take you to a new screen where it is possible to find the Order number with Material Number.
    Regards
    radhak mk

Maybe you are looking for

  • Sunone console not opening after upgrade from DS5.2 patch 3 to patch 4

    Hello, The Sunone Console is not opening when i upgrade from Directory server 5.2 patch 3 to patch4. I getting the following error message "error 501 Cannot logon because of an Incorrect userid,incorrect password or directory problem" can u please gu

  • Dynamic images in reports -- PDF output

    In Reports uilder I can link an image object to a URL as described in the product help. This works well with an HTML output but in PDF only the image URL appears. How could I solve this problem? Thank you.

  • Is it possible to assign a value to args in main method?

    I am trying to understand a class and it has a try { } after the main method and it seems to be checking the length of agrs. I keep getting the exception it throws. I don't understand how you can put something into args or when there would ever be a

  • Adobe - Error executing program

    Hi, When I am executing the WebDynpro program DEMO_ADOBE_OFFLINE I am getting the following error in the log file ACCESS.ERROR: Authorization check for caller assignment to J2EE security role [sap.com/com.sap.lcr*sld : LcrClassWriter]. We have done t

  • Impossible to buy software other than cloud?

    Just out of interest, I looked at the options to BUY any Adobe individual software progs (I don't need to - it's just for interest) and there are NO options to buy the software anymore ONLY cloud versions on Adobe's site. Does this mean that CS7 - wh