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: 

BDC Error Messages ????

Former Member
0 Kudos
102

hi i have one bdc for PR Creation, and if there is any error message i stored in my internal table, now my problem is that when i find the text of that error message no. like 629 in t100 it gives <b>Item & payment budget exceeded</b> but when i run it in foreground it gives the correct error like <b>Item XXXX payment budget exceeded 5000.</b> how to read this error message. when i read messagtab table after cunning by bdc these values comes in msgv1 & msgv2 etc.. but how to know in which field the value is coming.. i hope i have cleared my query..

abhishek suppal

1 ACCEPTED SOLUTION

Former Member
0 Kudos
74

Hi Abhishek,

Use the Function Module, 'FORMAT_MESSAGE' to format the message, this function module will return the formatted message in the export parameter... Hope this will help you

Regards,

Phani Kumar.

7 REPLIES 7

Former Member
0 Kudos
74

data wrk_message(250).

MESSAGE ID <itab messageid> TYPE <itab messagetype> NUMBER <itab message number > with <itab message 1 > <itab message 2 > <itab message 3 > <itab message 4 > into wrk_message.

regards

gv

Message was edited by: Venkat

Former Member
0 Kudos
74

This is the standard code for handling messages returned by call transaction

LOOP AT MESSTAB.

SELECT SINGLE * FROM T100 WHERE SPRSL = MESSTAB-MSGSPRA

AND ARBGB = MESSTAB-MSGID

AND MSGNR = MESSTAB-MSGNR.

IF SY-SUBRC = 0.

L_MSTRING = T100-TEXT.

IF L_MSTRING CS '&1'.

REPLACE '&1' WITH MESSTAB-MSGV1 INTO L_MSTRING.

REPLACE '&2' WITH MESSTAB-MSGV2 INTO L_MSTRING.

REPLACE '&3' WITH MESSTAB-MSGV3 INTO L_MSTRING.

REPLACE '&4' WITH MESSTAB-MSGV4 INTO L_MSTRING.

ELSE.

REPLACE '&' WITH MESSTAB-MSGV1 INTO L_MSTRING.

REPLACE '&' WITH MESSTAB-MSGV2 INTO L_MSTRING.

REPLACE '&' WITH MESSTAB-MSGV3 INTO L_MSTRING.

REPLACE '&' WITH MESSTAB-MSGV4 INTO L_MSTRING.

ENDIF.

CONDENSE L_MSTRING.

WRITE: / MESSTAB-MSGTYP, L_MSTRING(250).

ELSE.

WRITE: / MESSTAB.

ENDIF.

ENDLOOP.

Former Member
0 Kudos
75

Hi Abhishek,

Use the Function Module, 'FORMAT_MESSAGE' to format the message, this function module will return the formatted message in the export parameter... Hope this will help you

Regards,

Phani Kumar.

0 Kudos
74

hi phani

is there any FM to read the long text also for any error like for message class BP and no. 629.... i want to show the long text also.....

abhishek suppal

0 Kudos
74

use fm BAPI_MESSAGE_GETDETAIL to get long text.

plz try to close ur previous threads if solved.There are many threads still open.

regards

gv

Message was edited by: Venkat

0 Kudos
74

dear gv

i used this fm

but it gives just the text as

In document item , payment budget  for fiscal year  was exceeded by .

it shud display

In document item XXXX, payment budget  for fiscal year  2006 was exceeded by 5500 .

for my msg id BP and no. 629.

0 Kudos
74

did u pass all the parameters

MESSAGE_V1,MESSAGE_V2,MESSAGE_V3,MESSAGE_V4

regards

gv