Application Development 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: 

Warning-Message in START-OF-SELECTION?

Former Member
0 Kudos
1,076

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

1 ACCEPTED SOLUTION

Former Member
0 Kudos
253

Hi,

Check SAP Note 139175 which goes into detail regarding the behaviour of messages of different types in different contexts.

Regards,

Raj.

7 REPLIES 7

Former Member
0 Kudos
253

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

Former Member
0 Kudos
254

Hi,

Check SAP Note 139175 which goes into detail regarding the behaviour of messages of different types in different contexts.

Regards,

Raj.

asik_shameem
Active Contributor
0 Kudos
253

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.

0 Kudos
253

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!

Former Member
0 Kudos
253

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.

Sm1tje
Active Contributor
0 Kudos
253

You can use the display like statement like this as an alternative (after regarding previous posts):

MESSAGE w036(z_mm) DISPLAY LIKE 'W'.

former_member705122
Active Contributor
0 Kudos
253

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