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

radio button and selection screen

Former Member
0 Likes
1,185

hi

my requirement is that if the user enters some particular combination of value in the select options and clicks a particular radio button there should be an error message displayed.

1) I am getting the error message in the form a dialog box , but it has only option of exit , and the user is thrown of the screen. my requirement is that after the error message the user must still be at the same screen so that he can enter new values.

2) the code that i have written also has one more anamoly that the displaying of error depends upon the sequence of actions .

if i enter the value in the select option first and then click the radio button then the error message is displayed which is correct.

but it doesnt work i click the radio button first and then enter the value, the program is executed and NO ERROR message is flashed.

here is what i have written

**********************************************************************************************

SELECTION-SCREEN BEGIN OF BLOCK blk WITH FRAME.

SELECTION-SCREEN BEGIN OF BLOCK blk1 WITH FRAME TITLE text-001.

SELECT-OPTIONS: p_year for s021-spmon obligatory ,

p_kunag FOR vbrk-kunag ,

p_matnr FOR vbrp-matnr ,

p_augru FOR vbrp-augru_auft modif id a1 ,

p_vbeln FOR vbrk-vbeln .

SELECTION-SCREEN END OF BLOCK blk1.

SELECTION-SCREEN BEGIN OF BLOCK blk2 WITH FRAME TITLE text-002.

PARAMETERS: nrw RADIOBUTTON GROUP g1 user-command check,

mwd RADIOBUTTON GROUP g1 ,

rws RADIOBUTTON GROUP g1 ,

edu RADIOBUTTON GROUP g1 ,

standard RADIOBUTTON GROUP g1 default 'X' .

SELECTION-SCREEN END OF BLOCK blk2.

SELECTION-SCREEN END OF BLOCK blk.

at selection-screen output.

loop at screen.

if nrw = 'X' and p_augru-low EQ 'MWD'.

MESSAGE e000(oo) WITH '<Please Enter the correct Order Reason>'.

endif.

endloop.

START-OF-SELECTION.

CASE 'X'.

WHEN nrw.

PERFORM set_dates_nrw.

PERFORM load_data_nrw.

PERFORM get_cust_info_nrw.

PERFORM set_alv_field_cat_nrw.

PERFORM display_alv_nrw.

endcase.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,010

Hi,

Instead of doing the validation the AT SELECTION-SCREEN OUTPUT..do it at AT SELECTION..event..

Also remove the LOOP AT SCREEN..

Modified code.

at selection-screen. " Commented OUTPUT

if nrw = 'X' and p_augru-low EQ 'MWD'. " Removed LOOP AT SCREEN.

MESSAGE e000(oo) WITH '<Please Enter the correct Order Reason>'.

endif.

Thanks,

Naren

hi

my requirement is that if the user enters some particular combination of value in the select options and clicks a particular radio button there should be an error message displayed.

1) I am getting the error message in the form a dialog box , but it has only option of exit , and the user is thrown of the screen. my requirement is that after the error message the user must still be at the same screen so that he can enter new values.

2) the code that i have written also has one more anamoly that the displaying of error depends upon the sequence of actions .

if i enter the value in the select option first and then click the radio button then the error message is displayed which is correct.

but it doesnt work i click the radio button first and then enter the value, the program is executed and NO ERROR message is flashed.

here is what i have written

**********************************************************************************************

SELECTION-SCREEN BEGIN OF BLOCK blk WITH FRAME.

SELECTION-SCREEN BEGIN OF BLOCK blk1 WITH FRAME TITLE text-001.

SELECT-OPTIONS: p_year for s021-spmon obligatory ,

p_kunag FOR vbrk-kunag ,

p_matnr FOR vbrp-matnr ,

p_augru FOR vbrp-augru_auft modif id a1 ,

p_vbeln FOR vbrk-vbeln .

SELECTION-SCREEN END OF BLOCK blk1.

SELECTION-SCREEN BEGIN OF BLOCK blk2 WITH FRAME TITLE text-002.

PARAMETERS: nrw RADIOBUTTON GROUP g1 user-command check,

mwd RADIOBUTTON GROUP g1 ,

rws RADIOBUTTON GROUP g1 ,

edu RADIOBUTTON GROUP g1 ,

standard RADIOBUTTON GROUP g1 default 'X' .

SELECTION-SCREEN END OF BLOCK blk2.

SELECTION-SCREEN END OF BLOCK blk.

at selection-screen output.

loop at screen.

if nrw = 'X' and p_augru-low EQ 'MWD'.

MESSAGE e000(oo) WITH '<Please Enter the correct Order Reason>'.

endif.

endloop.

START-OF-SELECTION.

CASE 'X'.

WHEN nrw.

PERFORM set_dates_nrw.

PERFORM load_data_nrw.

PERFORM get_cust_info_nrw.

PERFORM set_alv_field_cat_nrw.

PERFORM display_alv_nrw.

endcase.

5 REPLIES 5
Read only

Former Member
0 Likes
1,011

Hi,

Instead of doing the validation the AT SELECTION-SCREEN OUTPUT..do it at AT SELECTION..event..

Also remove the LOOP AT SCREEN..

Modified code.

at selection-screen. " Commented OUTPUT

if nrw = 'X' and p_augru-low EQ 'MWD'. " Removed LOOP AT SCREEN.

MESSAGE e000(oo) WITH '<Please Enter the correct Order Reason>'.

endif.

Thanks,

Naren

Read only

Former Member
0 Likes
1,010

Hi

Change this piece of code

at selection-screen output.

loop at screen.

if nrw = 'X' and p_augru-low EQ 'MWD'.

MESSAGE e000(oo) WITH '<Please Enter the correct Order Reason>'.

endif.

endloop.

by

<b>at selection-screen.

if nrw = 'X' and p_augru-low EQ 'MWD'.

MESSAGE e000(oo) WITH '<Please Enter the correct Order Reason>'.

endif.</b>

Reward points if useful.

Regards,

Atish

Read only

Former Member
0 Likes
1,010

Write all the validations in the event AT-SELECTION SCREEN

This will display the error message and still keep you on the same screen.

Reward points if helpful

Read only

jayanthi_jayaraman
Active Contributor
0 Likes
1,010

Hi,

Use at selection-screen.This will solve the exit problem.Kindly reward point if it helps, by clicking the star on the left of reply.

at selection-screen.

loop at screen.

if nrw = 'X' and p_augru-low EQ 'MWD'.

MESSAGE e000(oo) WITH '<Please Enter the correct Order Reason>'.

endif.

endloop.

Read only

Former Member
0 Likes
1,010

thanks guys for ur very quick and very helpful replies.

points given to everyone.

closing this thread.