‎2008 Oct 08 5:51 AM
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
‎2008 Oct 08 6:00 AM
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.
‎2008 Oct 08 6:00 AM
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.
‎2008 Oct 08 7:36 AM
‎2008 Oct 08 6:00 AM
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
‎2008 Oct 08 7:36 AM
‎2008 Oct 08 10:37 AM
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.
‎2008 Oct 08 10:59 AM
‎2008 Oct 08 11:03 AM
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.
‎2008 Oct 08 10:54 AM
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.