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: 

Reports - selection screen

Former Member
0 Kudos
124

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.

7 REPLIES 7

Former Member
0 Kudos
86

Hi,

Use obligatory option.

Jogdand M B

abdulazeez12
Active Contributor
0 Kudos
86

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.

Former Member
0 Kudos
86

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

Former Member
0 Kudos
86

Hi,

Use the at selection-screen on field command and check whether the radio button field is initial.

Regards,

Renjith Michael.

Former Member
0 Kudos
86

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.

Former Member
0 Kudos
86

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.

Former Member
0 Kudos
86

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.