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

at selection-screen problem: triggering an error message...

aris_hidalgo
Contributor
0 Likes
467

Hello experts,

I have 3 radiobuttons and 1 parameter in my selection screen. it works in such a way that whenever the user clicks on the 3rd radiobutton the parameter will be inputtable. Now, what I want to do is that whenever the 3rd radiobutton is clicked and the user forgot to put a value in the paramater an error message will be triggered saying 'please put a value'.

Now, creating a code for that is easy but here is the problem: whenever I click on any of the radiobuttons the message triggers. Anyway, below is my code:

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

SELECTION-SCREEN BEGIN OF LINE.

PARAMETERS: pr_upld RADIOBUTTON GROUP grp MODIF ID id3

USER-COMMAND ucomm.

SELECTION-SCREEN COMMENT 2(20) text-007 FOR FIELD pr_upld.

SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN BEGIN OF LINE.

SELECTION-SCREEN COMMENT 03(15) text-a11 FOR FIELD p_flnme MODIF ID id3.

PARAMETERS: p_flnme LIKE rlgrap-filename DEFAULT 'C:\' MODIF ID id3.

SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN BEGIN OF LINE.

SELECTION-SCREEN COMMENT 1(22) text-002 FOR FIELD p_dcode MODIF ID id1.

PARAMETERS: p_dcode LIKE vbak-kunnr MODIF ID id1,

p_name1 LIKE kna1-name1 MODIF ID id1.

SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN BEGIN OF LINE.

PARAMETERS: pr_list RADIOBUTTON GROUP grp MODIF ID id4.

SELECTION-SCREEN COMMENT 2(7) text-003 FOR FIELD pr_list MODIF ID id4.

SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN BEGIN OF LINE.

PARAMETERS: pr_add RADIOBUTTON GROUP grp MODIF ID id2.

SELECTION-SCREEN COMMENT 2(3) text-005 FOR FIELD pr_add MODIF ID id2.

SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN BEGIN OF LINE.

PARAMETERS: pr_edit RADIOBUTTON GROUP grp MODIF ID id5.

SELECTION-SCREEN COMMENT 2(4) text-006 FOR FIELD pr_edit MODIF ID id5.

SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN BEGIN OF LINE.

SELECTION-SCREEN COMMENT 03(20) text-a12 FOR FIELD p_code MODIF ID id2.

*PARAMETERS: p_kunnr LIKE zts0001-kunnr.

PARAMETERS: p_code LIKE zts0001-cdseq MODIF ID id6.

SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN END OF BLOCK box1.

AT SELECTION-SCREEN OUTPUT.

IF v_compflag EQ space.

LOOP AT SCREEN.

IF screen-group1 = 'ID1'.

screen-input = '0'.

screen-output = '1'.

MODIFY SCREEN.

ELSEIF screen-group1 = 'ID2'.

screen-active = '1'.

MODIFY SCREEN.

ELSEIF screen-group1 = 'ID3'.

screen-active = '0'.

MODIFY SCREEN.

ELSEIF screen-group1 = 'ID4'.

screen-active = '1'.

MODIFY SCREEN.

ELSEIF screen-group1 = 'ID5'.

screen-active = '1'.

MODIFY SCREEN.

ELSEIF screen-group1 = 'ID6'.

screen-active = '1'.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ELSEIF v_compflag NE space.

LOOP AT SCREEN.

IF screen-group1 = 'ID1'.

screen-active = '0'.

MODIFY SCREEN.

ELSEIF screen-group1 = 'ID2'.

screen-active = '0'.

MODIFY SCREEN.

ELSEIF screen-group1 = 'ID3'.

screen-active = '1'.

MODIFY SCREEN.

ELSEIF screen-group1 = 'ID4'.

screen-active = '1'.

MODIFY SCREEN.

ELSEIF screen-group1 = 'ID5'.

screen-active = '0'.

MODIFY SCREEN.

ELSEIF screen-group1 = 'ID6'.

screen-active = '0'.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ENDIF.

*for users that are not controllers

LOOP AT SCREEN.

IF screen-name = 'P_CODE'.

screen-input = '0'.

ENDIF.

MODIFY SCREEN.

ENDLOOP.

IF pr_list = 'X' OR

pr_add = 'X' OR

pr_upld = 'X'.

LOOP AT SCREEN.

IF screen-group1 = 'ID6'.

screen-input = '0'.

ENDIF.

MODIFY SCREEN.

ENDLOOP.

ELSEIF pr_edit = 'X'.

LOOP AT SCREEN.

IF screen-group1 = 'ID6'.

screen-input = '1'.

ENDIF.

MODIFY SCREEN.

ENDLOOP.

ENDIF.

*for controllers

IF pr_upld = 'X'.

LOOP AT SCREEN.

IF screen-name = 'P_FLNME'.

screen-input = '1'.

ENDIF.

MODIFY SCREEN.

ENDLOOP.

ELSEIF pr_list = 'X'.

LOOP AT SCREEN.

IF screen-name = 'P_FLNME'.

screen-input = '0'.

ENDIF.

MODIFY SCREEN.

ENDLOOP.

ENDIF.

AT SELECTION-SCREEN.

IF pr_edit = 'X' AND p_code IS INITIAL.

MESSAGE e008 WITH 'Please specify Code.'.

ENDIF.

Again, thank you guys and have a nice day!

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
391

Hi viraylab,

1. Such validations can be handled in the event

START-OF-SELECTION.

2. We should them and other such validations,

using this logic

START-OF-SELECTION.

IF ERRORCONDIDTION.

<b>MESSAGE 'PLEASE ENTER ' TYPE 'S'

LEAVE LIST-PROCESSING.</b>

ENDIF.

WRITE 😕 'ABC'.

3.

The most important statements are

:

A) message should be of type I, or S, or W

(and not error E)

b) LEAVE LIST-PROCESSING

(it discontinues the further list showing,

and again, re-displays, the selection screen)

regards,

amit m.

2 REPLIES 2
Read only

dani_mn
Active Contributor
0 Likes
391

Hi,

Use user-command addition with radio button declaration.

Like:

PARAMETERS: pr_upld RADIOBUTTON group b1 USER-COMMAND ucom.

Regards,

Wasim Ahmed

Read only

Former Member
0 Likes
392

Hi viraylab,

1. Such validations can be handled in the event

START-OF-SELECTION.

2. We should them and other such validations,

using this logic

START-OF-SELECTION.

IF ERRORCONDIDTION.

<b>MESSAGE 'PLEASE ENTER ' TYPE 'S'

LEAVE LIST-PROCESSING.</b>

ENDIF.

WRITE 😕 'ABC'.

3.

The most important statements are

:

A) message should be of type I, or S, or W

(and not error E)

b) LEAVE LIST-PROCESSING

(it discontinues the further list showing,

and again, re-displays, the selection screen)

regards,

amit m.