‎2007 Jul 26 12:21 PM
Hi experts
In BDC call transaction method i used format_message function module to trap the error. But there was some problem with the parameter which i have passed through that function module so that it shows sme dump error.
any body can tell me wht are the parametrs that i have to pass through the FM.
‎2007 Jul 27 4:02 PM
hi
u can use this as well
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
CALL FUNCTION 'BALW_BAPIRETURN_GET2' " to catch any error msg
EXPORTING
type = sy-msgty
cl = sy-msgid
number = sy-msgno
par1 = sy-msgv1
par2 = sy-msgv2
par3 = sy-msgv3
par4 = sy-msgv4
IMPORTING
return = pex_return
.
ENDIF.
regards
vijay
reward points if helpful
‎2007 Jul 26 12:26 PM
Hi,
Try with the following fm also,previously i have handled in my program.
DATA :it_messtab TYPE TABLE OF bdcmsgcoll.
DATA: wa_messtab TYPE bdcmsgcoll.
wa_textout TYPE t100-text.
LOOP AT it_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.
Regards
‎2007 Jul 26 4:01 PM
It might be some type mismatch error...
check the import and export parameters u r passing to FM if those have the same type as required..
but what I found that.. in this FM... u can pass variable of any type..
So there may be some parameter missing...
all import parameters are optional.. but u have to MSGID and MSGNR to get some msg..
can u provide with ur code segment u r using for this FM.
Regards
Prax
‎2007 Jul 26 4:04 PM
Hi Pratik,
try this
DATA : L_ERR_MSG(500).
ALL FUNCTION 'TB_MESSAGE_BUILD_TEXT'
EXPORTING
LANGU = SY-LANGU
MSGID = SY_MSGID
MSGNO = SY_MSGNO
MSGV1 = SY_MSGV1
MSGV2 = SY_MSGV2
MSGV3 = SY_MSGV3
MSGV4 = SY_MSGV4
IMPORTING
TEXT = L_ERR_MSG.
‎2007 Jul 27 4:02 PM
hi
u can use this as well
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
CALL FUNCTION 'BALW_BAPIRETURN_GET2' " to catch any error msg
EXPORTING
type = sy-msgty
cl = sy-msgid
number = sy-msgno
par1 = sy-msgv1
par2 = sy-msgv2
par3 = sy-msgv3
par4 = sy-msgv4
IMPORTING
return = pex_return
.
ENDIF.
regards
vijay
reward points if helpful
‎2007 Jul 28 3:43 AM
some time message type not decleared properly.
dump comes.
so decleared message class properly.
please refer a funcation modules format message.
import parameters