2008 Jan 11 11:51 AM
Hi,
I have a selection screen in which I have radiobuttons(stpr and matr) and select-options(stp and mat) in a block .I have to get an error message when I dont give values and execute.I have already written code for disabling select-options for corresponding radiobutton in AT SELECTION-SCREEN OUTPUT.
So please help me out in solving this problem.
Thanks,
Moin.
2008 Jan 11 11:54 AM
2008 Jan 11 11:55 AM
Hi..
use this:
At selection-screen.
If sp_stp[] is initial.
message e000 with 'Select-options STP cannot be empty'.
endif.
if so_mat[] is initial.
message e000 with "same aboev".
endif.
This validation will throw an error when the user tries to execute the program without entering the values in select-options.
Thanks
Shakir
**Reward points if helpful.
2008 Jan 11 12:00 PM
Hi,
For example,
For checking one field at a time,
say,
matnr is in my select-options,
ie,
select-options: s_matnr for mara-matnr.
if i have to get an error message when I dont give values and execute then,
AT SELECTION-SCREEN ON s_matnr.
if ( s_matnr-low = ' ' ) and ( s_matnr-high = ' ' ).
*error message.*
endif.
-
if there are more than a field then go for,
select-options: s_matnr for mara-matnr obligatory,
s_werks for marc-werks obligatory.
hope this helps.
Edited by: jagannathan krishnan on Jan 11, 2008 1:00 PM
Edited by: jagannathan krishnan on Jan 11, 2008 1:01 PM
2008 Jan 11 12:01 PM
Hi,
Use the at selection-screen on field command and check whether the radio button field is initial.
Regards,
Renjith Michael.
2008 Jan 11 12:08 PM
SELECT-OPTIONS : s_matnr FOR marc-matnr.
"Your code..
START-OF-SELECTION.
IF s_matnr IS INITIAL.
MESSAGE 'Please enter material' TYPE 'S'.
SUBMIT (sy-repid) VIA SELECTION-SCREEN.
ENDIF.
"repeat same for other select-options.
2008 Jan 11 12:09 PM
Hi,
u can do like this.
At selection-screen.
if sy-ucomm = 'ONLI' or sy-ucomm = 'SJOB'.
If sp_stp[] is initial.
message e000 with 'Select-options STP cannot be empty'.
endif.
if so_mat[] is initial.
message e000 with "same aboev".
endif.
endif.
if you are not checking user command whether its run(f8) r run in backgrnd.
it will always throw error when u select other radio button.
2008 Jan 11 12:10 PM
Hi,
After selection screen output.
You do as below :
at selection-screen.
if stpr = 'X'.
if stp[] is initial.
message 'Input values' type 'E'.
elseif matr[] is initial.
message 'Input values' type 'E'.
endif.
Thanks,
Sriram Ponna.