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

How to set selection screen

Former Member
0 Likes
1,373

I have a question that ...

i have 2 options --

when select 1st option , show group1 screen

when select 2nd option, show group2 screen

like the follow ..which is pretty work!....but i have another question that how to set the screen field ..

my question is that if i select group1 screen...i want to set

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

if S1_EBELN = '' and S1_IHREZ = ''.

message e398 with 'pls input one of these two options!'.

elseif S1_EBELN ne '' and S1_IHREZ ne ''.

message e398 with 'Only one of these two options input is allowed!'.

endif.

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

i've tried to insert these statement within the LOOP...but not work ......

so can anyone know how to set?

PARAMETERS:

R1 RADIOBUTTON GROUP OPT1 USER-COMMAND R DEFAULT 'X'.

PARAMETERS:

R2 RADIOBUTTON GROUP OPT1.

SELECTION-SCREEN BEGIN OF BLOCK RPT1 WITH FRAME TITLE TEXT-001.

SELECTION-SCREEN SKIP 1.

SELECT-OPTIONS: S1_BUKRS FOR EKKO-BUKRS MODIF ID ABC.

SELECT-OPTIONS: S1_EBELN FOR EKKO-EBELN MODIF ID ABC .

SELECT-OPTIONS: S1_IHREZ FOR EKKO-IHREZ MODIF ID ABC .

SELECTION-SCREEN END OF BLOCK RPT1.

SELECTION-SCREEN BEGIN OF BLOCK RPT2 WITH FRAME TITLE TEXT-001.

SELECTION-SCREEN SKIP 1.

SELECT-OPTIONS: S2_BUKRS FOR EKKO-BUKRS MODIF ID DEF.

SELECT-OPTIONS: S2_MBLNR FOR MKPF-MBLNR MODIF ID DEF.

SELECT-OPTIONS: S2_XBLNR FOR MKPF-XBLNR MODIF ID DEF .

SELECTION-SCREEN END OF BLOCK RPT2.

IF R1 = 'X'.

LOOP AT SCREEN.

IF screen-group1 = 'DEF'.

  • screen-input = '1'.

  • SCREEN-required = '1'.

  • SCREEN-INVISIBLE = '1'.

screen-input = '0'.

screen-output = '1'.

screen-active = '0'.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ELSEIF R2 = 'X'.

LOOP AT SCREEN.

IF screen-group1 = 'ABC' .

screen-active = '0'.

screen-input = '0'.

screen-output = '1'.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ENDIF.

8 REPLIES 8
Read only

seshatalpasai_madala
Product and Topic Expert
Product and Topic Expert
0 Likes
1,328

Hi,

You have to put the code where you loop SCREEN under the event

AT SELECTION-SCREEN OUTPUT.

Regards,

Sesh

Read only

Former Member
0 Likes
1,328

go for Checkbox with default x

if first checkbox is selected, enable the first which is default else otherise remove the checkbox the second screen would be enable with ur options.

It would have both screens when first checkbox is marked the second sceen would be disable mode if they remove checkbox of first screen the first screen would be disable.

ANy with radio button ur doing the same.

Read only

Former Member
0 Likes
1,328

thx ...

but i've already write..

at selection-screen output.

IF R1 = 'X'.

LOOP AT SCREEN.

IF screen-group1 = 'DEF'.

  • screen-input = '1'.

.........

.....

Read only

Former Member
0 Likes
1,328

sky,

try writing this code in at selection-screen.

if S1_EBELN = '' and S1_IHREZ = ''.

message e398 with 'pls input one of these two options!'.

elseif S1_EBELN ne '' and S1_IHREZ ne ''.

message e398 with 'Only one of these two options input is allowed!'.

endif.

Read only

Former Member
0 Likes
1,328

thx

i've tried it b4 and put it into the LOOP...

just like ...

AT SELECTION-SCREEN OUTPUT.

IF R1 = 'X'.

LOOP AT SCREEN.

IF screen-group1 = 'DEF'.

  • screen-input = '1'.

  • SCREEN-required = '1'.

  • SCREEN-INVISIBLE = '1'.

screen-input = '0'.

screen-output = '1'.

screen-active = '0'.

MODIFY SCREEN.

ENDIF.

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

if S1_EBELN = '' and S1_IHREZ = ''.

message e398 with 'pls input one of these two options!'.

elseif S1_EBELN ne '' and S1_IHREZ ne ''.

message e398 with 'Only one of these two options input is allowed!'.

endif.

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

ENDLOOP.

ELSEIF R2 = 'X'.

LOOP AT SCREEN.

IF screen-group1 = 'ABC' .

screen-active = '0'.

screen-input = '0'.

screen-output = '1'.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ENDIF.

but the result is when i execute the program ....the error msg pop up at once ..and only the exit button let u to exit the program... ( no chance for me th input the field)..

Read only

0 Likes
1,328

DATA : FLAG.

AT SELECTION-SCREEN OUTPUT.

IF R1 = 'X'.

FLAG = 'X'.

LOOP AT SCREEN.

IF screen-group1 = 'DEF'.

  • screen-input = '1'.

  • SCREEN-required = '1'.

  • SCREEN-INVISIBLE = '1'.

screen-input = '0'.

screen-output = '1'.

screen-active = '0'.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ELSEIF R2 = 'X'.

CLEAR FLAG.

LOOP AT SCREEN.

IF screen-group1 = 'ABC' .

screen-active = '0'.

screen-input = '0'.

screen-output = '1'.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ENDIF.

AT SELECTION-SCREEN.

IF FLAG = 'X'.

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

if S1_EBELN = '' and S1_IHREZ = ''.

message e398 with 'pls input one of these two options!'.

elseif S1_EBELN ne '' and S1_IHREZ ne ''.

message e398 with 'Only one of these two options input is allowed!'.

endif.

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

ENDIF.

JUST TRY LIKE THIS.

REGARDS

SHIBA DUTTA

Read only

Former Member
0 Likes
1,328

Modified ur code .

tables : ekko, mkpf.
PARAMETERS : R1 RADIOBUTTON GROUP RG USER-COMMAND R DEFAULT 'X'.
PARAMETERS : R2 RADIOBUTTON GROUP RG .

SELECTION-SCREEN BEGIN OF BLOCK RPT1 WITH FRAME TITLE TEXT-001.
SELECTION-SCREEN SKIP 1.
SELECT-OPTIONS: S1_BUKRS FOR EKKO-BUKRS MODIF ID ABC.
SELECT-OPTIONS: S1_EBELN FOR EKKO-EBELN MODIF ID ABC .
SELECT-OPTIONS: S1_IHREZ FOR EKKO-IHREZ MODIF ID ABC .
SELECTION-SCREEN END OF BLOCK RPT1.

SELECTION-SCREEN BEGIN OF BLOCK RPT2 WITH FRAME TITLE TEXT-001.
SELECTION-SCREEN SKIP 1.
SELECT-OPTIONS: S2_BUKRS FOR EKKO-BUKRS MODIF ID DEF.
SELECT-OPTIONS: S2_MBLNR FOR MKPF-MBLNR MODIF ID DEF.
SELECT-OPTIONS: S2_XBLNR FOR MKPF-XBLNR MODIF ID DEF .
SELECTION-SCREEN END OF BLOCK RPT2.



at selection-screen output.

IF R1 = 'X'.
LOOP AT SCREEN.
IF screen-group1 = 'DEF' .
screen-active = '0'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.


ENDIF.

IF R2 = 'X'.
LOOP AT SCREEN.
IF screen-group1 = 'ABC' .
screen-active = '0'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.


at selection-screen .
if r1 = 'X'.
if s1_ebeln[] is initial and s1_ihrez[] is initial..
message e001(zxx) with 'pls input one of these two options!'.
endif.

if NOT s1_ebeln[] IS initial.
IF NOT s1_ihrez[] IS INITIAL.
message e001(zxx) with 'only one entry in Ebeln or Ihrez is
allowed'.
ENDIF.
ENDIF.
endif.

START-OF-SELECTION.
WRITE:/ 'hi'.

***add on

split the text into two texts .

<b>if NOT s1_ebeln[] IS initial.

IF NOT s1_ihrez[] IS INITIAL.

message e001(zxx) with text-001 text-002.

*'only one entry in Ebeln = text-001

or Ihrez is allowed'. = text-002.</b>

regards,

vijay

Read only

Former Member
0 Likes
1,328

thx !