Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Select options values not visible in AT-SELECTION-SCREEN

Former Member
0 Kudos

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

1 ACCEPTED SOLUTION

Former Member
0 Kudos

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.

8 REPLIES 8

Former Member
0 Kudos

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.

Former Member
0 Kudos

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

Former Member
0 Kudos

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.

0 Kudos

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

Former Member
0 Kudos

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.

0 Kudos

I have used DYNP_VALUES_READ it doesn't work.

The select option is like a table with sign option low and high

0 Kudos

I have found the solution

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

CHECK s_werks[] IS INITIAL.

DATA itab_value LIKE STANDARD TABLE OF rsparams.

DATA rsparams_s LIKE rsparams.

CALL FUNCTION 'FASU_V_GET_SELECTOPTIONS'

EXPORTING

curr_report = sy-repid

TABLES

selection_table = itab_value

EXCEPTIONS

not_found = 1

no_report = 2

error = 3

OTHERS = 4.

DELETE itab_value WHERE selname NE 'S_WERKS'.

DELETE itab_value WHERE low IS INITIAL.

IF NOT itab_value[] IS INITIAL.

LOOP AT itab_value INTO rsparams_s.

CLEAR s_werks.

s_werks-option = rsparams_s-option.

s_werks-sign = rsparams_s-sign.

s_werks-low = rsparams_s-low.

s_werks-high = rsparams_s-high.

APPEND s_werks.

ENDLOOP.

ELSE.

DATA lfs_dynpread TYPE dynpread.

DATA lt_dynpread LIKE STANDARD TABLE OF lfs_dynpread.

lfs_dynpread-fieldname = 'S_WERKS-LOW'.

APPEND lfs_dynpread TO lt_dynpread.

lfs_dynpread-fieldname = 'S_WERKS-HIGH'.

APPEND lfs_dynpread TO lt_dynpread.

CALL FUNCTION 'DYNP_VALUES_READ'

EXPORTING

dyname = sy-repid

dynumb = sy-dynnr

TABLES

dynpfields = lt_dynpread

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 EQ 0.

CLEAR s_werks.

LOOP AT lt_dynpread INTO lfs_dynpread.

CASE lfs_dynpread-fieldname .

WHEN 'S_WERKS-LOW'.

s_werks-low = lfs_dynpread-fieldvalue .

WHEN 'S_WERKS-HIGH'.

s_werks-high = lfs_dynpread-fieldvalue.

ENDCASE.

ENDLOOP.

s_werks-option = 'EQ'.

s_werks-sign = 'I'.

APPEND s_werks.

ENDIF. " IF SY-SUBRC EQ 0

ENDIF.

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

0 Kudos

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[].