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: 

Message type 'E'

Former Member
0 Kudos

I m using message type E. for that i should get an error message in red color in the status bar.

But i m not getting like that.For me an information message is raised with stop symbol & the program exits.

I want to diaplay an error message in the status bar.

I m writing the message in the exception handling.

i.e after execution of the FM i m checking the sy-subrc. if sy-subrc is one of the exception number in FM i want to write the error message in red color.

Can any one solve this issue.

Thanks in advance.

8 REPLIES 8

Former Member
0 Kudos

It Depends upon Mode of Program what u are using .

Regards

Prabhu

0 Kudos

This is my code.

if the decimal is greater than number of characters i want to give an error message.

Check sy-subrc = 5 for that. But i m getting an popup message and the program exits.

call function 'CTCV_GENERATE_PATTERN'

exporting

charact_format = attribute

  • USER_NEUTRAL = X

importing

pattern = grid_str_header-template

new_format = attribute

exceptions

  • INVALID_FORMAT = 1

  • LENGTH_MISSING = 2

  • TOO_LITTLE_PLACES = 3

too_many_places = 4

too_many_decimals = 5

  • NO_EXP_FOR_CURR = 6

  • TOO_SHORT = 7

.

case sy-subrc.

when '4'.

if grid_str_header-data_type = 'CHAR'.

  • IF GRID_STR_HEADER-NO_OF_CHAR > 30.

grid_str_header-no_of_char = 30.

message s109(109) with 'MAX OF 30 CHARS ONLY ALLOWED'.

else.

grid_str_header-no_of_char = 15.

message s109(109) with 'MAX OF 15 CHARS ONLY ALLOWED'.

endif.

when '5'.

  • MESSAGE W300(301) WITH 'TOO MANY DECIMALS'.

message 'ERROR' type 'E' .

endcase.

Can any one solve this problem.

Thanks in advance

0 Kudos

Hi,

This should be like

when '5'.
MESSAGE e300(301) WITH 'TOO MANY DECIMALS'.
endcase.

Hope this solves ur problem.

Reward points and close thread if this solves else get back with queries.

Former Member
0 Kudos

Hi

After exceptions check the sy-subrc:

IF SY-SUBRC > 0.
  MESSAGE EXXX(YY) WITH <TEXT>.
ENDIF.

Max

Former Member
0 Kudos

Hello,

If the FM raises an exception then the system itself will give a error message.

For that u need to uncomment the following

<b> IF SY-SUBRC <> 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.</b>

If this also doesn't solves ur problem then paste ur code where u r calling that FM

If useful reward.

Vasanth

Former Member
0 Kudos

Hi kalapana,

try with the message type s might be solve your problem

Former Member
0 Kudos

Hi,

try this.

if sy-subrc ne 0.

message e001(e) with 'no record found (text)'.

Endif.

Regards,

former_member186746
Active Contributor
0 Kudos

hi,

Check report demo_messages

this is also available from transaction ABAPDOCU.

Kind regards, Rob dielemans