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

Loop at screen

Former Member
0 Likes
1,971

hi friends,

I have two fields in selection screen i should only enter in any one of them.

for ex:if i am entering value in first field then second field should be displayed vice versa.

<removed_by_moderator>

Read the "Rules of Engagement"

Edited by: Juan Reyes on Oct 8, 2008 9:55 AM

1 ACCEPTED SOLUTION
Read only

former_member195383
Active Contributor
0 Likes
1,310

Hi..

As far as I understand ur requirement is wen value is entered in one field the second field should come in to display mode..that is..it should be disabled..If that is wat ur requirement is ..then the following block of code will help you out.

suppose the value entered in 1st field is stored in wf_field1 and the value entered in 2nd field is stored in wf_field2.

write the following code below th event

AT SELECTION-SCREEN OUTPUT.

if not wf_field1 is initial.

loop at screen.

IF screen-name = 'FIELD2' .

screen-input = 0.

screen-output = 0.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

endif.

if not wf_field2 is initial.

loop at screen.

IF screen-name = 'FIELD1' .

screen-input = 0.

screen-output = 0.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

endif.

8 REPLIES 8
Read only

former_member195383
Active Contributor
0 Likes
1,311

Hi..

As far as I understand ur requirement is wen value is entered in one field the second field should come in to display mode..that is..it should be disabled..If that is wat ur requirement is ..then the following block of code will help you out.

suppose the value entered in 1st field is stored in wf_field1 and the value entered in 2nd field is stored in wf_field2.

write the following code below th event

AT SELECTION-SCREEN OUTPUT.

if not wf_field1 is initial.

loop at screen.

IF screen-name = 'FIELD2' .

screen-input = 0.

screen-output = 0.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

endif.

if not wf_field2 is initial.

loop at screen.

IF screen-name = 'FIELD1' .

screen-input = 0.

screen-output = 0.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

endif.

Read only

0 Likes
1,310

sorry it is not working can u help me

Read only

Former Member
0 Likes
1,310

SELECTION-SCREEN BEGIN OF LINE.

PARAMETER: R1 TYPE C RADIOBUTTON GROUP R USER-COMMAND R1 DEFAULT 'X',

A TYPE C.

SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN BEGIN OF LINE.

PARAMETER: R2 TYPE C RADIOBUTTON GROUP R,

B TYPE C.

SELECTION-SCREEN END OF LINE.

AT SELECTION-SCREEN OUTPUT.

IF R1 = 'X'.

LOOP AT SCREEN.

IF SCREEN-NAME = 'A'.

SCREEN-INPUT = 1.

MODIFY SCREEN.

ENDIF.

IF SCREEN-NAME = 'B'.

SCREEN-INPUT = 0.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ELSE.

LOOP AT SCREEN.

IF SCREEN-NAME = 'A'.

SCREEN-INPUT = 0.

MODIFY SCREEN.

ENDIF.

IF SCREEN-NAME = 'B'.

SCREEN-INPUT = 1.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ENDIF.

Edited by: Amit Gupta on Oct 8, 2008 7:03 AM

Read only

0 Likes
1,310

sorry it is not working andno radio button

Read only

0 Likes
1,310

You could play around with the given example or search SDN. I've seen lots of threads containing examples that are similar to your question.

Read only

0 Likes
1,310

can u send me the code if possible

Read only

0 Likes
1,310

Since you're being a tad bit lazy: if you pay for it, i'll gladly write the program for you.

Alternatively: try things out. There are enough examples given that you can use.

Read only

Former Member
0 Likes
1,310

Hi ,

Check this code.

This may help you.

<Sample code>

TABLES: SSCRFIELDS.

SELECTION-SCREEN BEGIN OF BLOCK BLK1 WITH FRAME.

PARAMETERS : PA RADIOBUTTON GROUP RAD USER-COMMAND COM MODIF ID MOD

DEFAULT 'X' ,

PB RADIOBUTTON GROUP RAD MODIF ID RAD,

PC RADIOBUTTON GROUP RAD MODIF ID CAD.

SELECTION-SCREEN SKIP.

SELECTION-SCREEN END OF BLOCK BLK1.

SELECTION-SCREEN BEGIN OF BLOCK BLK2 WITH FRAME.

PARAMETERS : PA1(20) MODIF ID M1 DEFAULT 'chandu',

PB1(20) MODIF ID R1 DEFAULT 'vikram',

PC1(20) MODIF ID C1 DEFAULT 'devina'.

SELECTION-SCREEN SKIP.

SELECTION-SCREEN END OF BLOCK BLK2.

AT SELECTION-SCREEN OUTPUT.

IF PA = 'X'.

LOOP AT SCREEN.

IF SCREEN-GROUP1 = 'M1'.

SCREEN-INTENSIFIED = '1'.

SCREEN-ACTIVE = 1.

SCREEN-DISPLAY_3D = '1'.

MODIFY SCREEN.

ENDIF.

IF SCREEN-GROUP1 = 'R1'.

SCREEN-INTENSIFIED = '0'.

SCREEN-ACTIVE = 1.

SCREEN-INPUT = 0.

SCREEN-DISPLAY_3D = '0'.

MODIFY SCREEN.

ENDIF.

IF SCREEN-GROUP1 = 'C1'.

SCREEN-INTENSIFIED = '0'.

SCREEN-ACTIVE = 1.

SCREEN-INPUT = 0.

SCREEN-DISPLAY_3D = '0'.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ENDIF.

IF PB = 'X'.

LOOP AT SCREEN.

IF SCREEN-GROUP1 = 'R1'.

SCREEN-INTENSIFIED = '1'.

SCREEN-ACTIVE = 1.

SCREEN-DISPLAY_3D = '1'.

MODIFY SCREEN.

ENDIF.

IF SCREEN-GROUP1 = 'M1'.

SCREEN-INTENSIFIED = '0'.

SCREEN-ACTIVE = 1.

SCREEN-INPUT = 0.

SCREEN-DISPLAY_3D = '0'.

MODIFY SCREEN.

ENDIF.

IF SCREEN-GROUP1 = 'C1'.

SCREEN-INTENSIFIED = '0'.

SCREEN-ACTIVE = 1.

SCREEN-INPUT = 0.

SCREEN-DISPLAY_3D = '0'.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ENDIF.

IF PC = 'X'.

LOOP AT SCREEN.

IF SCREEN-GROUP1 = 'R1'.

SCREEN-INTENSIFIED = '0'.

SCREEN-ACTIVE = 1.

SCREEN-INPUT = 0.

SCREEN-DISPLAY_3D = '0'.

MODIFY SCREEN.

ENDIF.

IF SCREEN-GROUP1 = 'M1'.

SCREEN-INTENSIFIED = '0'.

SCREEN-ACTIVE = 1.

SCREEN-INPUT = 0.

SCREEN-DISPLAY_3D = '0'.

MODIFY SCREEN.

ENDIF.

IF SCREEN-GROUP1 = 'C1'.

SCREEN-INTENSIFIED = '1'.

SCREEN-ACTIVE = 1.

SCREEN-DISPLAY_3D = '1'.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ENDIF.

<Sample code>

Regards.