2007 Jan 09 11:27 AM
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.
2007 Jan 09 11:30 AM
It Depends upon Mode of Program what u are using .
Regards
Prabhu
2007 Jan 09 11:41 AM
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
2007 Jan 09 1:14 PM
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.
2007 Jan 09 11:31 AM
Hi
After exceptions check the sy-subrc:
IF SY-SUBRC > 0.
MESSAGE EXXX(YY) WITH <TEXT>.
ENDIF.
Max
2007 Jan 09 11:32 AM
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
2007 Jan 09 11:32 AM
Hi kalapana,
try with the message type s might be solve your problem
2007 Jan 09 11:34 AM
Hi,
try this.
if sy-subrc ne 0.
message e001(e) with 'no record found (text)'.
Endif.
Regards,
2007 Jan 09 1:01 PM
hi,
Check report demo_messages
this is also available from transaction ABAPDOCU.
Kind regards, Rob dielemans