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: 

How to display Message in a Report

Former Member
0 Kudos

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

1 ACCEPTED SOLUTION

Former Member
0 Kudos

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

5 REPLIES 5

Former Member
0 Kudos

Hi,

Just create a message (SE91) with placeholders &. In your program write MESSAGE Exxx WITH <asset number>.

Regards,

John.

amit_khare
Active Contributor
0 Kudos

in Message tab create a mesasage with &.

e.g. -

101 & is the error value

in report write -

message e101 with 'MINES'.

~Amit

Vijay
Active Contributor
0 Kudos

hi

message can be displayed like this

message <msg type><three digit no>( msg class).

here message canbe

e - error message

i - information message

s -status message

regards

vijay

reward points if helpful

Former Member
0 Kudos

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

Former Member
0 Kudos

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.