‎2007 Jan 16 9:56 PM
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 .
‎2007 Jan 16 10:01 PM
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
‎2007 Jan 16 10:03 PM
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
‎2007 Jan 16 10:05 PM
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
‎2007 Jan 16 10:11 PM
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