‎2005 Sep 06 5:04 AM
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
‎2005 Sep 06 5:51 AM
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.
‎2005 Sep 06 5:08 AM
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
‎2005 Sep 06 5:18 AM
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.
‎2005 Sep 06 5:51 AM
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.
‎2005 Sep 06 6:47 AM
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
‎2005 Sep 06 7:24 AM
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
‎2005 Sep 06 7:53 AM
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.
‎2005 Sep 06 8:00 AM
did u pass all the parameters
MESSAGE_V1,MESSAGE_V2,MESSAGE_V3,MESSAGE_V4
regards
gv