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: 

How to get the values of Select-options from the screen.

Former Member
0 Kudos

The value of parameter can be obtained by function module 'DYNP_VALUES_READ' but How to get the values of Select-options from the screen? I want the F4 help values of select-options B depending on the values in Select-option A.So I want to read the Select-option A's value.

4 REPLIES 4

Former Member
0 Kudos

Hi Shikha,

Use FM <b>RS_REFRESH_FROM_SELECTOPTIONS</b>.

This will give u Current contents of selection screen.

Reward points if helpful.

Regards,

Hemant

MarcelloUrbani
Active Contributor
0 Kudos

Look at the dynpro 1000:

usually for select-option sx you have two fields: sx-low and sx-high.

Loot at the select option itself if you need offscreen values.

Former Member
0 Kudos

Hi Shikha,

use the select option LOW and HIGH fields as the field names to append into the internal table for DYNPFIELDS and you would get the low and high values of the select option after calling the function module DYNP_VALUES_READ.

In case, if we fill the select option using the multiple selection button that comes with the select option, the values will be reflected in the select option field since the PAI takes place and we can use directly this field values to get the possible values of the other field.

Hope you got it.

Ram

Former Member
0 Kudos

Hi,

Refer this following code..this will solve your problem...


"Following code reads value entered in s_po select options and willprovide search 
"help for s_item depending upon s_po value.

REPORT TEST.
TABLES : ekpo.
 
DATA: BEGIN OF itab OCCURS 0,
ebelp LIKE ekpo-ebelp,
END OF itab.
 
SELECT-OPTIONS   s_po FOR ekpo-ebeln.
SELECT-OPTIONS s_item FOR ekpo-ebelp.
 
INITIALIZATION.
 
AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_item-low.
  DATA:
  dyn_field TYPE dynpread,
  temp_fields TYPE TABLE OF dynpread,
  zlv_dynpro TYPE syst-repid.
  zlv_dynpro = syst-repid.
 
  CALL FUNCTION 'DYNP_VALUES_READ'
    EXPORTING
      dyname     = zlv_dynpro
      dynumb     = syst-dynnr
      request    = 'A'
    TABLES
      dynpfields = temp_fields
    EXCEPTIONS
      OTHERS     = 0.
 
  LOOP AT temp_fields INTO dyn_field.
    IF dyn_field-fieldname EQ 'S_PO-LOW'.
        SELECT * INTO CORRESPONDING fields OF TABLE itab FROM ekpo
        WHERE ebeln EQ dyn_field-fieldvalue.
        EXIT.
    ENDIF.
  ENDLOOP.