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

Call MESSAGE dynamically

Former Member
0 Likes
3,323

Hi all,

How can I call a message dynamically?

For e.g.: MESSAGE E011(00)

Where

00 --> Message ID (class) - get at runtime

011 --> Message number - get at runtime

Thanks,

Khanh

Edited by: Khanh Nguyen on Mar 26, 2010 6:43 PM

1 ACCEPTED SOLUTION
Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
1,650

You always see this in the SY-SUBRC NE 0 statement of a function module but never thought about it

DATA: v_id  TYPE sy-msgid VALUE 'Z_MSG',
      v_mtype TYPE sy-msgty VALUE 'I',
      v_num  TYPE sy-msgno VALUE '014'.

MESSAGE ID v_id TYPE v_mtype NUMBER v_num.

3 REPLIES 3
Read only

Former Member
0 Likes
1,650

Hi

try with an assign

MESSAGE <msgno>(<msgid>).

Marco

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
1,651

You always see this in the SY-SUBRC NE 0 statement of a function module but never thought about it

DATA: v_id  TYPE sy-msgid VALUE 'Z_MSG',
      v_mtype TYPE sy-msgty VALUE 'I',
      v_num  TYPE sy-msgno VALUE '014'.

MESSAGE ID v_id TYPE v_mtype NUMBER v_num.

Read only

Former Member
0 Likes
1,650

Hi Suhas Saha,

This time I copied your correct name.

You've helped me many times.

Thank you sir :).

Thanks,

Khanh