02-07-2008 7:32 AM
Hi Experts,
I have a small doubt, in my program output contains Asset number and Asset values, the user needs if the asset values comes mines he needs a message with asset number and and this mines value as a errer message. How to make this?
Any one plz guide this,
Point will be sure.
Mohana
02-07-2008 10:25 AM
hi,
u need to create message class for this by T-Code SE91...
in that u need to write & at the place u want to pass parameter from program...
means i have message like
Record Number & Changed Successfully
its number is 001 in message class...
now i will write
MESSAGE s001(zmsg_fmtr) WITH srno.
in my program...
where
s---status message
001---number
zmsg_fmtr----my message class
srno---parameter which i want to pass
reward if usefull....
Edited by: Dhwani shah on Feb 7, 2008 11:26 AM
02-07-2008 7:34 AM
Hi,
Just create a message (SE91) with placeholders &. In your program write MESSAGE Exxx WITH <asset number>.
Regards,
John.
02-07-2008 7:34 AM
in Message tab create a mesasage with &.
e.g. -
101 & is the error value
in report write -
message e101 with 'MINES'.
~Amit
02-07-2008 10:17 AM
02-07-2008 10:25 AM
hi,
u need to create message class for this by T-Code SE91...
in that u need to write & at the place u want to pass parameter from program...
means i have message like
Record Number & Changed Successfully
its number is 001 in message class...
now i will write
MESSAGE s001(zmsg_fmtr) WITH srno.
in my program...
where
s---status message
001---number
zmsg_fmtr----my message class
srno---parameter which i want to pass
reward if usefull....
Edited by: Dhwani shah on Feb 7, 2008 11:26 AM
02-07-2008 10:39 AM
Hi,
I hope this will help u.
Messages are defined in table T100.
You maintain messages and message classes using transaction SE91.
3. Syntax
Message xnnn
x is the type of message ( See: Types of messages )
nnn is the identifier of the message.
Example: message e001
4. Setting the message class
You set the message class for the whole program in the header of thje program:
report my_report message-id .
Setting the message class for a sigle message:
Message ID type number
Example: message id ZB type W number 004 with Test.
5. Types of messages
IInfoPress ENTER to continue
WWarningCorrection possible
EErrorCorrection required
AAbendTransaction terminated
XExitTransaction terminated with short dump
SSuccessMessage on next screen
6. Paramiterized messages
You can paramiterize messages, so that you can insert your own text programmatically
in messages.
When you define the message use & for the parameters:
This is a &1 message
When you call the message use the syntax
Message e001 with bad
The resulting message: This is a bad message
7. Writing message into a field
Sometimes you want to store e.g. an error message from a function module in a text field instead of displaying it.
Use this syntax to store the message to the field l_errror_text.
CALL FUNCTION something
IF sy-subrc <> 0. MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4 into l_errror_text. ENDIF.
Reagrds.