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

system message to a string

Former Member
0 Likes
35,816

Hi.

How can I insert a system message to an abap string within my program instead of to the screen?

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

I want to get the final message that suppose to appear on the screen into a single string.

Thanks,

Rebeka

1 ACCEPTED SOLUTION
Read only

PatrickMueller
Product and Topic Expert
Product and Topic Expert
18,236

Same effect (but better readability):


CONCATENATE sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4 
     INTO lv_message SEPARATED BY space.

Also possible during message creation:


MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno 
         WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4
         INTO lv_message.

Regards

Patrick

8 REPLIES 8
Read only

Former Member
0 Likes
18,236
Concatenate sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4 into lv_message.

Best regards,

Prashant

Read only

0 Likes
18,236

But those fields includes only the variable details.

What about the constant string ?? See for example message class 06 message number 312.

I want to insert my string in the program the following:

Purchasing info record 50005523 100-356-01 IDR1 already exists.

Thanks in advcne,

Rebeka

Read only

Former Member
0 Likes
18,236

Try with using concatenate statement.

Read only

Former Member
0 Likes
18,236

Hi,

use the generic message in the message class by passing & & & &.

Regards,

Naresh

Read only

Former Member
0 Likes
18,236

Hi,

To combine the message text and the variable elements into one text string you could use a function module like MESSAGE_TEXT_BUILD.

Regards,

Nick

Read only

former_member404244
Active Contributor
0 Likes
18,236

Hi,

Delcare a variable of 255 chars.

U can concatenate and put it in one varibale..

I hope i understood ur requirement.

Regards,

Nagaraj

Read only

PatrickMueller
Product and Topic Expert
Product and Topic Expert
18,237

Same effect (but better readability):


CONCATENATE sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4 
     INTO lv_message SEPARATED BY space.

Also possible during message creation:


MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno 
         WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4
         INTO lv_message.

Regards

Patrick

Read only

Former Member
0 Likes
18,236

"into gv_text" after the message id ..... solves the problem.

Thanks all,

Rebeka