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

Fetching Message from message class into variable

Former Member
0 Likes
7,028

hello all,

can anyone please tell me that how can i fetch the message from message class?

because i have to take that message in one variable and have to pass it in function module.

regards saurabh.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,424

Hi,

DATA : MESSAGE TYPE STRING.
Select TEXT from t100 into MESSAGE where SPRSL = 'EN' ARBGB = 'YOUR_MESSAGE_CLASS'
msgnr = 'YOUR_MSGNR'
or if you want all the messages to fetch in a single query to avoid performance issue
Select * from t100 into itab where SPRSL = 'EN' ARBGB = 'YOUR_MESSAGE_CLASS'

Cheerz

Ram

3 REPLIES 3
Read only

Former Member
0 Likes
2,424

You can do this in this way :

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

INTO mtext

Read only

Former Member
0 Likes
2,425

Hi,

DATA : MESSAGE TYPE STRING.
Select TEXT from t100 into MESSAGE where SPRSL = 'EN' ARBGB = 'YOUR_MESSAGE_CLASS'
msgnr = 'YOUR_MSGNR'
or if you want all the messages to fetch in a single query to avoid performance issue
Select * from t100 into itab where SPRSL = 'EN' ARBGB = 'YOUR_MESSAGE_CLASS'

Cheerz

Ram

Read only

former_member217544
Active Contributor
0 Likes
2,424

Hi Saurabh,

After getting the message with the above syntax you can pass the variable into teh function module by declaring a import paramater of type STRING or BALMSGTXTP

Regards,

Swarna Munukoti