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: 

Error and Warning Messages

Former Member
0 Kudos
159

I want to apply error and warning messages to display on using the selection screen when the fields are bland and wrong values... How to do that??? any help

10 REPLIES 10

sreeramkumar_madisetty
Active Contributor
0 Kudos
125

Hi

Use the at selection-screen on field.

Write the validation logic.

finally emessageno(message class)..for errors

and wmessageno(message class)..for warnings.

Regards,

Sreeram

0 Kudos
125
parameters: p_field type c.

at selection-screen.

  if p_field = space.
     message e001(00) with 'You have an error'.
  endif.

Regards,

RIch Heilman

Former Member
0 Kudos
125
parameters : p_field(10).

at selection-screen.

if p_field is initial.
  SET CURSOR FIELD 'P_FIELD'.
  message e001(ZZ) with 'enter a value for field p-fiel'.
endif.

Former Member
0 Kudos
125

Hi

Use At selection-screen event.

Regards

Haritha.

Former Member
0 Kudos
125

Hi,

Here is a simple code to check if the parameter is blank.


PARAMETERS: p_string TYPE char20.

AT SELECTION-SCREEN ON p_string.
  IF p_string IS INITIAL.
    MESSAGE exxx(YYYY).
  ENDIF.

Regards,

Sumant.

Former Member
0 Kudos
125

Hi,

parameters : p_mantr like mara-matnr.

at selection-screen.

if p_matnr is initial.

SET CURSOR FIELD 'P_MATNR'.

message e001(ZZ) with 'enter material number'.

endif.

Reward points if it is helpful.

Regards,

Sangeetha.A

0 Kudos
125

Hi

Follow the below programs

DEO_SELECTION_SCREEN_EVENTS

DEMO_AT_SELECTION_SCREEN_PBO

http://help.sap.com/saphelp_nw04/helpdata/en/56/1eb6c705ad11d2952f0000e8353423/content.htm

Hope this is useful

<u><b>Award if useful</b></u>

Regards,

Sudheer

Former Member
0 Kudos
125

Hi,

What is your Actual Requirement. you can do validations in selection screens also.

your are asking Warning and Error message, actually which message you want to through, why becuase if you use Error message it won't move to next field until it corrected and Waring message will give when you press enter it will moves to next step. now you can decide which message type you want

1. My point is if you don't want blank fields then that field should make it as Obligatory field then it never move without value to next field or Default value you can initialize.

2. you can put search help to that field then user selects maximum from that data only or at selection-screen on field use the event and do validation there

if sy-subrc ne 0 through a error message

Regards

Ganesh

Former Member
0 Kudos
125

parameters : p_matnr like mara-matnr.

at selection-screen on p_matnr.

if p_matnr is initial.

message i000(bctrain) with ' Enter value for matnr'.

endif.

at selecion-screen on p_matnr.

if p_matnr ne '1616'.

message e000(bctrain) with 'Enter correct value'.

endif.

Message was edited by:

Premalatha G

Former Member
0 Kudos
125

Hi,

U have to <b>award points for useful answers</b> and u have to mention it as solved if ur question is solved. Dont forget.

Regards,

Sudheer