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

Capturing message class

Former Member
0 Likes
1,115

Hi All,

I want to capture the message Generated by Messae class M7060 i.e 'Document & Posted' , '&' will be replaced by a number during runtime and i want to capture this number to a variable.Please help!

Thanks in advance

Sandeep Shenoy

9 REPLIES 9
Read only

Former Member
0 Likes
960

try this <b>Sy-msgno</b>

Read only

0 Likes
960

Chandra, thanks for the reply ,but sy-msgno gives 060 but i need the contents of it not msgno.

Read only

0 Likes
960

ok use FM TG_MESSAGE_BUILD

i am not sure abt the name of FM as i dont have sap now , search in se37 for messagebuild , u will get one FM use that FM and pass sy-msgno , it will give u the message

Read only

0 Likes
960

goto debugging mode and set the watchpoint on SY-MSGNO = 060. It takes u to the message statement, where you can find the variable name which will replace the & in Message class. Hope this will be helpfull.

Regards:-

Santosh.D

Read only

Former Member
0 Likes
960

chk this


CALL FUNCTION 'TB_MESSAGE_BUILD_TEXT'
       EXPORTING
            LANGU = SY-LANGU
            MSGID = P_SY_MSGID
            MSGNO = P_SY_MSGNO
            MSGV1 = P_SY_MSGV1
            MSGV2 = P_SY_MSGV2
            MSGV3 = P_SY_MSGV3
            MSGV4 = P_SY_MSGV4
       IMPORTING
            TEXT  = P_L_ERR_MSG.

Read only

Former Member
0 Likes
960

hi sandeep,

try using the FM MESSAGE_PREPARE.

CALL FUNCTION 'MESSAGE_PREPARE'

EXPORTING

LANGUAGE = EN

MSG_ID = ZZ

MSG_NO = w_no

MSG_VAR1 = w_var1

MSG_VAR2 = w_var2

MSG_VAR3 = w_var3

IMPORTING

MSG_TEXT = W_MSGTEXT

EXCEPTIONS

FUNCTION_NOT_COMPLETED = 1

MESSAGE_NOT_FOUND = 2

OTHERS = 3.

hope this helps,

do reward if it helps,

priya.

Read only

Former Member
0 Likes
960

hi,

In the program says,

data: v_test(3) tyep c value '123'.

message e060(m7) with v_test.

data: v_temp like v_test.
  v_temp = v_test.

You haev to modify the program for this.

If it is a Standard program, as you can not modify the program, you can not hte value captured.

Regards,

Sailaja.

Read only

shishupalreddy
Active Contributor
0 Likes
960

Hi,

iN CALL TRANSACTION for MB1B tcode you r trying to create MBLNR if you want to capture them

Call transaction 'MB1B' using bdcdata messages into MTAB.

IF sy-subrc = 0.

read table MTAB WITH KEY MSGid = 'M7'

msgtyp = 'S'

MSGNUMBER = '060'.

if sy-subrc = 0.

w_mblnr = mtab-msgv1.

endif.

hope this will help you.

Read only

shishupalreddy
Active Contributor
0 Likes
960

hello ,

did u get the solution with my suggestion or still you want me to elaborate the answer..

thaks