Skip to Content
avatar image
Former Member

Select options values not visible in AT-SELECTION-SCREEN

Hi,

I have the following problem, in a report I have two select options, and when the user put a value in the first select option in the second one he need to see only the valuse filtered by the first select option.

I'm able to see the values in the first select option only if I press enter.

How can I solve it?

thank you

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • Best Answer
    avatar image
    Former Member
    Sep 17, 2008 at 10:22 AM

    use this code,

    u wont have to press enter after that,

    dont forgot to pass field name

    u will loop at IDFIELDS after sy-subrc.

    IDFIELDS-field value is your first field data

    DATA : IDFIELDS LIKE DYNPREAD OCCURS 0 WITH HEADER LINE.

    A_PROGNAME = SY-REPID.

    A_DYNPNR = SY-DYNNR.

    IDFIELDS-FIELDNAME = 'your first input parameter name'.

    APPEND IDFIELDS.

    CALL FUNCTION 'DYNP_VALUES_READ'

    EXPORTING

    DYNAME = A_PROGNAME

    DYNUMB = A_DYNPNR

    • TRANSLATE_TO_UPPER = ' '

    • REQUEST = ' '

    • PERFORM_CONVERSION_EXITS = ' '

    • PERFORM_INPUT_CONVERSION = ' '

    • DETERMINE_LOOP_INDEX = ' '

    TABLES

    DYNPFIELDS = IDFIELDS

    EXCEPTIONS

    INVALID_ABAPWORKAREA = 1

    INVALID_DYNPROFIELD = 2

    INVALID_DYNPRONAME = 3

    INVALID_DYNPRONUMMER = 4

    INVALID_REQUEST = 5

    NO_FIELDDESCRIPTION = 6

    INVALID_PARAMETER = 7

    UNDEFIND_ERROR = 8

    DOUBLE_CONVERSION = 9

    STEPL_NOT_FOUND = 10

    OTHERS = 11

    .

    IF SY-SUBRC <> 0.

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

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

    ENDIF.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi Giovanni,

      Instead of fetching all the available select screen values and deleting the unncesseary values, you can capture all the values of S_WERKS in the event AT SELECTION-SCREEN ON s_werks.

      The event above will be triggered when the extension button of the select option is clicked, follow the below sample code

      RANGES:
         r_werks FOR t001w-werks.
      
      AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_lgort-low.
       
         IF r_werks[] IS INITIAL.  
           populate lt_dynpread with S_WERKS-LOW and S_WERKS-HIGH
           CALL FM 'DYNP_VALUES_READ'
         ENDIF. 
      
      AT SELECTION-SCREEN ON s_werks.
         r_werks[] = s_werks[].
      
      

  • avatar image
    Former Member
    Sep 17, 2008 at 10:05 AM

    Refer the following program for screen groups

    TABLES : SFLIGHT, VBAP, VBAK.
    
    DATA OK_CODE TYPE SY-UCOMM.
    
    SELECTION-SCREEN BEGIN OF BLOCK BLK1 WITH FRAME TITLE TEXT-001.
    PARAMETERS FLDATE TYPE SFLIGHT-CARRID AS LISTBOX VISIBLE LENGTH 20 MODIF ID AB1.
    parameters carrid type SFLIGHT-CARRID AS LISTBOX VISIBLE LENGTH 20 MODIF ID AB2.
    parameters VBELN type VBAK-VBELN AS LISTBOX VISIBLE LENGTH 20 MODIF ID AB2.
    PARAMETERS ERNAM TYPE VBAK-VBELN AS LISTBOX VISIBLE LENGTH 20 MODIF ID AB2.
    SELECTION-SCREEN END OF BLOCK BLK1.
    
    SELECTION-SCREEN BEGIN OF BLOCK BLK WITH FRAME TITLE TEXT-002.
    PARAMETERS: R_1 RADIOBUTTON GROUP RADI DEFAULT 'X' USER-COMMAND STAN..
    PARAMETERS: R_2 RADIOBUTTON GROUP RADI.
    SELECTION-SCREEN END OF BLOCK BLK.
    
    *SELECTION-SCREEN BEGIN OF BLOCK BLK2 WITH FRAME TITLE TEXT-003.
    *SELECTION-SCREEN PUSHBUTTON 10(20) TEXT-004 USER-COMMAND EXIT.
    *SELECTION-SCREEN PUSHBUTTON 40(20) TEXT-005 USER-COMMAND REPORT.
    *
    *SELECTION-SCREEN END OF BLOCK BLK2.
    
    
    *and control behaviour in the event. Something like these:
    
    AT SELECTION-SCREEN OUTPUT.
      LOOP AT SCREEN.
        IF R_1 = 'X'.
          IF SCREEN-GROUP1 = 'AB2'.
            SCREEN-INPUT = '0'.
    *        SCREEN-INTENSIFIED = '1'.
            MODIFY SCREEN.
          ENDIF.
        ELSEIF R_2 = 'X'.
          IF SCREEN-GROUP1 = 'AB1'.
            SCREEN-INPUT = '0'.
    *        SCREEN-INTENSIFIED = '0'.
            MODIFY SCREEN.
          ENDIF.
        ENDIF.
      ENDLOOP.
    
    *  CASE OK_CODE.
    *
    *  WHEN 'EXIT'.
    *  LEAVE PROGRAM.
    *
    *  WHEN 'REPORT'.
    *  LEAVE TO LIST-PROCESSING.
    *
    *  ENDCASE.
    **   ENDLOOP.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 17, 2008 at 10:11 AM

    Please Specify your problem. Can you give the name of the select options for which you want the event at-selection screen output to take place.

    One way can defaultin the values in the initialization event and displaying them as non editable on screen.

    Manish K Srivastava

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 17, 2008 at 10:16 AM

    Hi,

    Try this.

    In the at selection-screen event filter the values to be displayed in the 2nd select option and populate it in a internal table. Then call the function module 'F4IF_INT_TABLE_VALUE_REQUEST'.

    Then you will have only the filtered values in the second select option.

    Sharin.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      I was not clear I try to explain better

      REPORT ztest001.

      TABLES: t001w, t001l.

      DATA: lt_selection TYPE TABLE OF rsparams.

      SELECT-OPTIONS : s_werks FOR t001w-werks MEMORY ID swr, " Plant

      s_lgort FOR t001l-lgort . " Storage Location

      AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_lgort-low .

      here I need to use S_WERKS to filter the help of S_LGORT and S_WERKS is empty if I do nopt press enter so here I need something to get all the values for S_WERKS, I have used DYNP_VALUES_READ but works only if I have a value in low and high but if I have multiple value or different sign it doesn't work

      START-OF-SELECTION.

      ....

      ....

      END-OF-SELECTION.

      Edited by: Giovanni Pirollo on Sep 17, 2008 12:20 PM