2008 Apr 23 7:24 AM
Hi there,
I have a question: Isn't it possible to write a warning-message in the start-of-selection-block? I have the following code:
START-OF-SELECTION.
IF s_matnr IS INITIAL.
MESSAGE w036(z_mm).
ENDIF.
IF p_migo = true.
MESSAGE w059(z_mm).
ENDIF.
SELECT * FROM mara
[...]
But when I run this program the warning-messages appear as normal errors and not as warnings. Why is this so? I can't understand this behaviour?
I wanna to warn the user if he is selecting to much data because of missing information in the selection-screen...
If I use the AT SELECTION-SCREEN-block, the messages works fine, but the the messages also appear if the user clicks on the extension button of a select-option, and that I wanna to have.
Thank you
Regards
Markus
2008 Apr 23 7:37 AM
Hi,
Check SAP Note 139175 which goes into detail regarding the behaviour of messages of different types in different contexts.
Regards,
Raj.
2008 Apr 23 7:33 AM
hi,
use these validations in at selection screen output or At selection screen on field events
screen validation is to be done in these events only
or try to use different message types and see bcoz messages behave differntly for each and every event
Regards,
Priya
2008 Apr 23 7:37 AM
Hi,
Check SAP Note 139175 which goes into detail regarding the behaviour of messages of different types in different contexts.
Regards,
Raj.
2008 Apr 23 7:42 AM
Hi
Do in this way.
AT SELECTION-SCREEN ON s_matnr.
IF s_matnr IS INITIAL.
MESSAGE w036(z_mm).
ENDIF.
AT SELECTION-SCREEN ON p_migo.
IF p_migo = true.
MESSAGE w059(z_mm).
ENDIF.
2008 Apr 23 8:45 AM
Thank you for your answers, but if I use the ON-Statement in combination with AT SELECTION-SCREEN there will be the message given out also when I click on the button for extended use of the select-option.
How can I avoid this?
Thanks!
2008 Apr 23 7:43 AM
Hi,
You can get the warning messages as you required when you use the validation in
AT SELECTION-SCREEN ON 'filed_name' .
If you do this validation in AT SELECTION-SCREEN OUTPUT.
then the warning message will appear as soon as the selection screen appear.
so use it in the AT SELECTION-SCREEN ON 'field_name'.
****Reward if useful.
With Regards,
Sunny.
2008 Apr 23 7:43 AM
You can use the display like statement like this as an alternative (after regarding previous posts):
MESSAGE w036(z_mm) DISPLAY LIKE 'W'.
2008 Apr 23 7:48 AM
Hi Markus,
Messages behave differently for different events..
Message W on screen or selection screen appears on status bar and it's processing is Like type E, but the user can confirm the message by pressing ENTER without having to enter new values. The system then resumes PAI processing directly after the MESSAGE statement.
For start-of-selection it behaves differently as u mentioned.
Regards
Syed Abdul Adil