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: 

dynamic messages

Former Member
0 Kudos

How to display dynamic messages?

Regards,

swathi.

10 REPLIES 10

Former Member
0 Kudos

Hi Swathi,

You can make use of Place holders provided in abap <b>'?' and '&'</b>.

<b>Reward points if this helps,</b>

Kiran

Former Member
0 Kudos

All messages are stored in table <b>T100</b>. You create and edit them using Transaction <b>SE91</b>. Once you have created a message, you can use it in the <b>MESSAGE</b> statement in a program.

There are 2 ways you can define a message....

> MESSAGE E001(ZMESSAGE_CLASS).

Using this definition we can refer a message class and then the message is directly reflected.

> MESSAGE 'Some error' TYPE 'E'.

Using this method we can hard code the message.

I think your requirement is the former method.

Hope this helps you.

Regards,

Pavan

Former Member
0 Kudos

Hi Swathi,

In the message class, for a message number define the parameters as

001 & 'doesnt exist'

You can pass values ot & then it will display dynamically.

If you write a MESSAGE statement in the report as

MESSAGE 0001(ZMSG) V_MATNR.

then it will display as v_matnr values doesnt exist.

Thanks,

Vinay

Former Member
0 Kudos

hi swathi,

goto SE91 [ message class] -> create a new message class -> and in attributes section please give & & & & [in place of hard coded statements] -> save.

nad in ur program u can use that message class in many ways as

1. declare it in REPORT statement as

report zlauri message-id suresh.

.................

............

.........

message S000 with 'suresh'.

...............

2. u can use message class at run time as

message W000(zlauri) with 'warnings'.

where zaluri is a existing message class. for this type there is no need to declare in report statement.

3. message 'suresh babu aluri' type 'E'.

u can follow any type. it depends on ur requirement.

if helpful reward some points.

with regards,

Suresh Aluri.

Former Member
0 Kudos

Hi Swathi,

just define one message with the place holders.

Example: Message class : ZZ Message No: 000 Text: &&&&

Now when ever you want to give some message use the WITH statement along with message statement.

Ex: Message e000 wtih 'ABC' 'XYZ' '123' .

Satya

Former Member
0 Kudos

HI,

write &1 in the message class.

while writing the message do like this.

MESSAGE E100(ZMSGCLS) with '<ur message>'.

<b>reward if helpful</b>

rgds,

bharat.

Former Member
0 Kudos

Hi,

This is the solution.

In, <b>SE91</b> when u create the mesage class, u can set the dynamic message using<b> ?</b> and <b>%</b> symbol in message text.

For Example:

<b> 002 Sales area is not assigned to customer & </b>

If suppose, the above statement u r using in the message class, then for the condition given, u will get this message along with customer number ( In place of &, Customer Number will be substituted ).

Hope u got it.

Try and reward if found useful.

Former Member
0 Kudos

Hi yedlapalli

we have one transaction se91 for creating message class and message numbers and matnining messages.

messages are stored in table T100.

we have different message types ERROR

Warning

sucess

abend

information messages

reprot initial line we are defining like this MESSAGE-ID ZSW (zsw is message class).

MESSAGE E011 (E011 is error message number).

like

MESSAGE I012 (I012 is information message number).

onece you double click on the e011 it will take you se91 message maintaining screen there depend on your requirement give message.

jehu_wang
Explorer

Try this:

MESSAGE ID 'xxx' TYPE 'x' NUMBER 'xxx' WITH 'xxx' 'xxx' INTO 'xxx'.

0 Kudos

It can be used with the example usage given in a method or function.