Application Development and Automation 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: 
Read only

display message

Former Member
0 Likes
885

Hi,

how can I display message dynamically...say I want to get input from user and display that input's content.in my message for example

the message content is " my name is x".this x I want to get from user and display in my message.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
861

Hi Mohan,

There is something called Place Holders in message. You can pass upto 9 variables in that place holders.

While creating the message in the message class (SE91) create the place holder. Then when your are calling the message in your program you need to pass the variable along with it.

Example:

data: my_var(30) type c value 'Hello'.

Message s001(ztest_msg_class) with my_var.

Output: Success for Hello.

Hope this will help. Please let me know if you need any more details.

Thanks and Regards,

Samantak.

Rewards points for useful answers.

7 REPLIES 7
Read only

former_member195698
Active Contributor
0 Likes
861

Check the link

http://help.sap.com/saphelp_nw70/helpdata/en/9f/dbaaaf35c111d1829f0000e829fbfe/content.htm

section : Filling Message Texts Dynamically

e.g.


parameters:pa_uname like sy-uname.

data : wf_text like sy-msgv1.


wf_text = pa_uname.

message i999(ZCLASS) with wf_text.

your message 999 for message class ZCLASS will be "my name is &"

regards,

aj

Edited by: Abhishek Jolly on Jul 6, 2008 11:23 AM

Read only

Former Member
0 Likes
862

Hi Mohan,

There is something called Place Holders in message. You can pass upto 9 variables in that place holders.

While creating the message in the message class (SE91) create the place holder. Then when your are calling the message in your program you need to pass the variable along with it.

Example:

data: my_var(30) type c value 'Hello'.

Message s001(ztest_msg_class) with my_var.

Output: Success for Hello.

Hope this will help. Please let me know if you need any more details.

Thanks and Regards,

Samantak.

Rewards points for useful answers.

Read only

Former Member
0 Likes
861

Mohan,

Search in SDN with term 'place holders'. you will get your answer.

Amit.

Read only

Former Member
0 Likes
861

Hiii!


PARAMETERS:
  p_name(20) TYPE c.


MESSAGE i006(z_msg) with p_name.

Regards

Abhijeet Kulshreshtha

Read only

Former Member
0 Likes
861

Hi,

for this you need to create a global message class .

Go to Transaction SE91,Create message class and create message one message(001) with Place holders(&) and the Required text.

Now Call the Message in your progarm ans pass the user name -like

Message I001(messageclass) with username.

You will get the user name in runtime .

Regards,

Sujit

Read only

Former Member
0 Likes
861

Hi Mohan,

Sap has provide us with place holders and you can also use them in message like &1.... , at runtime the placeholder of the message will be replaced by the variable that you provide in your message, you can use any standard message if it met your requirement or else you can also build your message class by using the T-code se91.

Regards,

Pritam.

Read only

former_member787646
Contributor
0 Likes
861

Hi,

Try this...

PARAMETERS: name(50) TYPE C.

MESSAGE name TYPE 'I'.

Hope it helps you.

Murthy