Application Development 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: 

How to get actual error messages

Former Member
0 Kudos

I use a call transction method if there is any error capture it to an internal table of

type bdcmsgcoll..

But here it gives me just batch parameters and other fields along with a message number..susing this message number how do i get the actual SAP genrated message(text message)..ther must be some function module which will give accept these parameters and give out hte actual message...

5 REPLIES 5

Former Member
0 Kudos

Hi..,

Goto SE11 and open the table t100... IN this table u can find all messages... give the message number and the message class...

Or u can use this function module...

WRITE_MESSAGE

regards,

sai ramesh

Message was edited by:

Sai ramesh

0 Kudos

HI,

Using this FM BALW_BAPIRETURN_GET1.

In the return strucutre field MESSAGE should give you the message.

Regards,

Sesh

Former Member
0 Kudos

Hi,

Read the dictionary table T100 FOR ALL ENTRIES in BDCMSGCOLL.

(also use the condition T100-SPRAS = SY-LANGU)

Hope this helps.

Former Member
0 Kudos

Hi,

use CALL FUNCTION 'MESSAGE_TEXT_BUILD'

DATA :messtab TYPE TABLE OF bdcmsgcoll.

DATA: wa_messtab TYPE bdcmsgcoll.

DATA: wa_textout TYPE t100-text.

LOOP AT messtab INTO wa_messtab .

CALL FUNCTION 'MESSAGE_TEXT_BUILD'

EXPORTING

msgid = wa_messtab-msgid

msgnr = wa_messtab-msgnr

msgv1 = wa_messtab-msgv1

msgv2 = wa_messtab-msgv2

msgv3 = wa_messtab-msgv3

msgv4 = wa_messtab-msgv4

IMPORTING

message_text_output = wa_textout.

MESSAGE wa_textout TYPE wa_messtab-msgtyp.

ENDLOOP.

<b>Reward points</b>

Regards

Message was edited by:

skk

sivapuram_phanikumar
Active Participant
0 Kudos

Hi,

You can get the actual error message by using the FM <b>FORMAT_MESSAGE</b>.

Lets suppose that you got error messages into t_msg internal table...

loop at t_msg into x_msg.

call function 'FORMAT_MESSAGE'

exporting

id = x_msg-msgid

lang = sy-langu

no = x_msg-msgnr

V1 = x_msg-MSGV1

V2 = x_msg-MSGV2

V3 = x_msg-MSGV3

V4 = x_msg-MSGV4

importing

msg = v_msgstr

  • EXCEPTIONS

  • NOT_FOUND = 1

  • OTHERS = 2

.

if sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

endif.

write:/ v_msgstr.

endloop.

Here, the variable <b>v_msgstr</b> will be having the actual error message...

Hope it helps.

Regards,

Phani.

Message was edited by:

Sivapuram Phani Kumar