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

FOMAT_MESSAGE

Former Member
0 Likes
966

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.

1 ACCEPTED SOLUTION
Read only

Vijay
Active Contributor
0 Likes
797

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

5 REPLIES 5
Read only

Former Member
0 Likes
797

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

Read only

Former Member
0 Likes
797

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

Read only

Former Member
0 Likes
797
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.
Read only

Vijay
Active Contributor
0 Likes
798

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

Read only

Former Member
0 Likes
797

some time message type not decleared properly.

dump comes.

so decleared message class properly.

please refer a funcation modules format message.

import parameters