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

Read message form message class

Former Member
26,298

HI All

i want to read message from message class (SE91) into my variable

there is a way to get it without raise a message?

just to read it to some variable and proceed with the program flow .

Regards

James

1 ACCEPTED SOLUTION
Read only

Former Member
13,258

Use the INTO addition of the message statement. Check this example


data: var type string.

MESSAGE E004(ZR0) INTO var.

Vikranth

7 REPLIES 7
Read only

Former Member
0 Likes
13,258

Hi ,

You can create the text in the text-001 and you can continue with the program with out raising the error message.

With Regards,

Sumodh.P

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
13,258

You can use the MESSAGE ... INTO <variable> statement for this. Read the SAP documentation for details [http://help.sap.com/abapdocu_70/en/ABAPMESSAGE_OPTIONS.htm#!ABAP_ADDITION_3@3@]

BR,

Suhas

Read only

Former Member
13,259

Use the INTO addition of the message statement. Check this example


data: var type string.

MESSAGE E004(ZR0) INTO var.

Vikranth

Read only

Former Member
0 Likes
13,258

Hi,

Use Function Module "FORMAT_MESSAGE".

Regards

Vinod

Read only

mohammed_moqeeth
Active Participant
13,258

Hi James,

You can capture the message of SE91 with function module 'FORMAT_MESSAGE' .

Example:

CALL FUNCTION 'FORMAT_MESSAGE'

EXPORTING

id = i_message-msgid

lang = i_message-msgspra

no = i_message-msgnr

v1 = i_message-msgv1

v2 = i_message-msgv2

IMPORTING

msg = g_msg

EXCEPTIONS

OTHERS = 0.

Regards,

Moqeeth.

Read only

0 Likes
13,258

Thank you ,

this is exactly what I was looking.

Read only

Former Member
0 Likes
13,258

Messsage E001(class name) into var.

The above statement can be used where class name is message class name and var is variable of string type.