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

Selection screen field-mandatory

Former Member
0 Likes
1,017

Hai Experts,

I have two fields bukrs and vkorg in two different blocks of a selection screen..

my requirement is this:

when bukrs is blank, the field vkorg should be mandatory.

when bukrs is given value, vkorg should not be mandatory.

how to do this.

Following is the code wat i have written. but it is not satisfying the requirement.

LOOP AT SCREEN.

IF s_bukrs IS INITIAL.

IF s_vkorg IS INITIAL.

screen-group1 = 'MO1'.

screen-required = '1'.

MODIFY SCREEN.

EXIT.

ENDIF.

ENDIF.

IF s_bukrs IS NOT INITIAL.

IF s_vkorg IS INITIAL.

screen-group1 = 'MO1'.

screen-required = '0'.

MODIFY SCREEN.

EXIT.

ENDIF.

ENDIF.

ENDLOOP.

Regards,

Neela.

Hai Experts,

I have two fields bukrs and vkorg in two different blocks of a selection screen..

my requirement is this:

when bukrs is blank, the field vkorg should be mandatory.

when bukrs is given value, vkorg should not be mandatory.

how to do this.

Following is the code wat i have written. but it is not satisfying the requirement.

LOOP AT SCREEN.

IF s_bukrs IS INITIAL.

IF s_vkorg IS INITIAL.

screen-group1 = 'MO1'.

screen-required = '1'.

MODIFY SCREEN.

EXIT.

ENDIF.

ENDIF.

IF s_bukrs IS NOT INITIAL.

IF s_vkorg IS INITIAL.

screen-group1 = 'MO1'.

screen-required = '0'.

MODIFY SCREEN.

EXIT.

ENDIF.

ENDIF.

ENDLOOP.

Regards,

Neela.

8 REPLIES 8
Read only

Former Member
0 Likes
918

hi ,

at selection-screen output.

if is p_bukrs initial and p_vkorg is initial.

message 'provide p_vkorg input' type 'S'.

exit.

endif.

reward points if helpful,

regards,

seshu.

Read only

0 Likes
918

No.. it should not b any message handling.

the field should be mandatory with the Tick mark in it.

Read only

0 Likes
918

Hi Neela,

Just based on the values the AT SELECTION SCREEN OUTPUT is not triggered. User need to press the enter key then only it will be triggered, thats why it is not possible for you to achieve this functionality.

Regards,

Atish

Read only

0 Likes
918

Hi Atish,

Upon using AT SELECTION-SCREEN OUTPUT.

The fields are always assumed and found to be initial.

This event is to be caught in At Selection-screen.

Please guide it hence forth.

Thanks,

Tej..

Read only

Former Member
0 Likes
918

Hi

AT SELECTION-SCREEN OUTPUT.

IF s_bukrs[] is initial.

IF s_vkorg[] is initial.

<loop at SCREEN, and set sttributes as desired>

ENDIF.

ENDIF.

Regards

Raj

Read only

Former Member
0 Likes
918

maybe we can solve this in a simpler way.

instead of starting from the selection screen itself, can u have a dialog screen with these two fields where u can do the necessary validations before the selection screen is being executed?

thanks,

max

Read only

Former Member
0 Likes
918

you have to do like this and for achieving the requirement you have to press enter in the selection screen or any user interaction to trigger at selection-screen event.

data : flag.

at selection-screen output.

if flag = 'X'.

LOOP AT SCREEN.

IF s_bukrs IS INITIAL.

IF s_vkorg IS INITIAL.

screen-group1 = 'MO1'.

screen-required = '1'.

MODIFY SCREEN.

EXIT.

ENDIF.

ENDIF.

IF s_bukrs IS NOT INITIAL.

IF s_vkorg IS INITIAL.

screen-group1 = 'MO1'.

screen-required = '0'.

MODIFY SCREEN.

EXIT.

ENDIF.

ENDIF.

ENDLOOP.

clear flag.

endif.

at selection-screen.

flag = 'X'.

start-of-selection.

regards

shiba dutta

Read only

Former Member
0 Likes
918

Hi Neela,

Instead of using the LOOP AT SCREEN and then changing the attributes try the standard way. The way you are doing is not the standard way of coding in SAP.

In the AT SELECTION SCREEN just check if the BUKRS is intial and VKORG is initial then give the error message.

Thats it.

Reward points if useful.

Regards,

Atish