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: 

Weird selection option behaviour for "ON VAUE-REQUEST"

mgross1
Participant
0 Kudos
REPORT  zmgtest.

TABLES sflight.

SELECT-OPTIONS : so_type FOR sflight-planetype NO INTERVALS.

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

so_type-sign = 'I'.
so_type-option = 'EQ'.
so_type-low = 'ABC'.
APPEND so_type.
so_type-low = 'DEF'.
APPEND so_type.

When I run this report and click on the F4 help, I click the multiple selection button and I see DEF twice. Then if I click the F4 help again I see DEF, DEF, ABC, DEF.

I expect to see ABC and DEF on one click of the button. Does anyone know why I don't?

What I'm actually trying to do is create a select option for a filename and have the user select multiple files. The above is just demo code to illustrate my issue.

7 REPLIES 7

matt
Active Contributor

At the event the first thing you should do is

CLEAR: so_type,
       so_type[].

If you run it in debug it'll be obvious why.

mgross1
Participant
0 Kudos

matthew.billingham I tried that but I get the same result. Have you tried running the report?


TABLES sflight.

SELECT-OPTIONS : so_type FOR sflight-planetype NO INTERVALS.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR so_type-low.
CLEAR: so_type, so_type[].
so_type-sign = 'I'.
so_type-option = 'EQ'.
so_type-low = 'ABC'.
APPEND so_type.
so_type-low = 'DEF'.
APPEND so_type.

matt
Active Contributor

This is to do with the transport of values to and from the select options. You can't just set values in so_type. (Sorry, so long since I did this, I'd forgotten this point).

You have to use FM DYNP_VALUES_UPDATE and DYNP_VALUES_READ

Sandra_Rossi
Active Contributor

For selection screens, instead of using DYNP_VALUES_... (UPDATE/READ), SAP recommends using RS_SELECTIONSCREEN_... (UPDATE/READ), so that it works for the detailed selection criteria dialog too.

matt
Active Contributor

As I say. It's been a long time! 😄

raymond_giuseppi
Active Contributor
0 Kudos

matthew.billingham, a very long time indeed (New Function Modules)

matt
Active Contributor
0 Kudos

raymond.giuseppi - been doing this stuff since 1997... 😮