2007 Jun 18 7:35 AM
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.
2007 Jun 18 7:39 AM
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.
2007 Jun 18 7:49 AM
No.. it should not b any message handling.
the field should be mandatory with the Tick mark in it.
2007 Jun 18 7:54 AM
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
2007 Jun 18 7:57 AM
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..
2007 Jun 18 7:39 AM
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
2007 Jun 18 7:42 AM
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
2007 Jun 18 7:45 AM
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
2007 Jun 18 7:47 AM
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
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |