‎2008 Oct 06 6:48 AM
in report you declare message class like that
report Z_XXx message-id xxx.
function module you can't put message-id please advise how to declare a generic message class
‎2008 Oct 06 7:00 AM
just go to any function module, go to its main program(function group) and see
you can specify message id here in the main program of function module.. it looks some thing like this..
FUNCTION-POOL ZXXXXXXXX message-id zz. "MESSAGE-ID .
‎2008 Oct 06 6:54 AM
Hi,
You dont need to insert a message class in a program. Even without inserting it you can display your message. There are 2 scenarios
1. When you have to display an existing message from a message class.
Message e000(ZMC).
This is displays the message 000 of message class ZMC.
2. Without using a message class.
Message 'Message Text' type 'E'.
This will display an error message with the text 'Message text'.
Regards,
Pramod
‎2008 Oct 06 6:55 AM
hi ,
u cant use message id u can use exception and raise it where ever u need...
Regards,
Vikram.S
‎2008 Oct 06 6:56 AM
hi
you can define the message class
in transaction se91.
and there you can define the messages you want to display
‎2008 Oct 06 6:57 AM
Hello
Question not quite comprehensible, but try:
table T100
t-code SE91
May be it will help ...
‎2008 Oct 06 6:58 AM
Hi...
Say your message class name is MC.
In your function module..
PERFORM add_message USING 'message type' 'MC' 'message number' 'space' 'format'
'space' 'space' 'space' 'space' 'space'.And maintain one include to handle this subroutine...
declare the variables:
data: xreturn like bapiret2 occurs 0 with header line.form add_message using type
id
number
language
format
v1
v2
v3
v4
field.
clear xreturn.
move type to xreturn-type.
move id to xreturn-id.
move number to xreturn-number.
call function 'BAPI_MESSAGE_GETDETAIL'
exporting
id = id
number = number
language = sy-langu
textformat = format
* LINKPATTERN = ''
message_v1 = v1
message_v2 = v2
message_v3 = v3
message_v4 = v4
importing
message = xreturn-message
exceptions
others = 4.
if sy-subrc ne 0.
clear xreturn-message.
endif.
move v1 to xreturn-message_v1.
move v2 to xreturn-message_v2.
move v3 to xreturn-message_v3.
move v4 to xreturn-message_v4.
move field to xreturn-field.
append xreturn.
clear xreturn.
endform. " add_messageYou can use FORMAT_MESSAGE also to display the message...
Thanks,
Naveen.I
‎2008 Oct 06 6:58 AM
hi..
YOU can declare the message class in function group as
ex:
FUNCTION-POOL YYV_SYSF MESSAGE-ID YYMSG.
regards,
Padma
‎2008 Oct 06 6:59 AM
hi..
YOU can declare the message class in function group as
ex:
FUNCTION-POOL YYV_SYSF MESSAGE-ID YYMSG.
regards,
Padma
‎2008 Oct 06 7:00 AM
just go to any function module, go to its main program(function group) and see
you can specify message id here in the main program of function module.. it looks some thing like this..
FUNCTION-POOL ZXXXXXXXX message-id zz. "MESSAGE-ID .