Application Development and Automation 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: 
Read only

select option multiple single values

Former Member
0 Likes
1,739

I am using select option for user id in the selection screen . If i give any multiple single values and if there is no data for a particular user X , a message saying "no data for the user X" must be displayed . I dont know how to handle these multiple values . All the data is stored in an internal table .

4 REPLIES 4
Read only

Former Member
0 Likes
885

Hi,

In the at selection-screen for s_opt-low event,

use a select query to check theUSR02 to chek the userid.

If it does not exist pop-up the erro message.

If you have multiple selection option, write the same code in at selection-screen for s_opt-high also.

Regadrs

Subramanian

Read only

Former Member
0 Likes
885

You can use FM SELECT_OPTIONS_RESTRICT to force the user to enter single values only. then you can loop throught the select-option to process values rather than use IN.

Rob

Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
885

If you want to check each value, you need to LOOP at the select-option and check each value against the table. Something like this, maybe.



report zrich_0001 .

data: iusr01 type table of usr01 with header line.

select-options: s_bname for iusr01-bname.

at selection-screen.

check sy-ucomm = 'ONLI'
   or sy-ucomm = space.

  select * into table iusr01
                 from usr01
                        where bname in s_bname.

  loop at s_bname.

    read table iusr01 with key bname = s_bname-low.
    if sy-subrc  <>  0.
      message i001(00) with 'User ' s_bname-low ' does not exist'.
    endif.

  endloop.

Regards,

Rich Heilman

Read only

Former Member
0 Likes
885

Try this:

AT SELECTION-SCREEN.

IF s_user IS INITIAL.

"Display enter user id message........"

ENDIF.

SELECTION-SCREEN.

IF not S_user[] IS INITIAL.

  • Check selected User ID exist in User Master

SELECT bname

FROM usr01

INTO d_bname

WHERE bname IN S_user.

IF sy-subrc NE 0.

MESSAGE "No data selected".

STOP.

ENDIF.

Thanks,

Santosh