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: 

Function Module to store all the messages during BDC?

Former Member
0 Kudos
994

hi all,

which module function is used to store all the messages generated during BDC.

thanks

ekta

1 ACCEPTED SOLUTION

varma_narayana
Active Contributor
0 Kudos
379

Hi..

In case of Session method Error messages are automatically stored in a Log which we can See in SM35.

In case of Call transaction method we can use the BDCMSGCOLL internal table to collect the Message and Call the FM FORMAT_MESSAGE To get the Message text.

<b>reward if Helpful</b>

4 REPLIES 4

varma_narayana
Active Contributor
0 Kudos
380

Hi..

In case of Session method Error messages are automatically stored in a Log which we can See in SM35.

In case of Call transaction method we can use the BDCMSGCOLL internal table to collect the Message and Call the FM FORMAT_MESSAGE To get the Message text.

<b>reward if Helpful</b>

JozsefSzikszai
Active Contributor
379

hi ekta,

you have to use STORE_MESSAGE FM. Before that you have to start FM MESSAGES_INITIALIZE. After that you can display all messages with MESSAGES_SHOW.

hope this helps

ec

Former Member
0 Kudos
379

Hi,

Using function module 'FORMAT_MESSAGE' you can capture the messages.

Here is a sample of the program code for that:

LOOP AT it_messtab.

CALL FUNCTION 'FORMAT_MESSAGE'

EXPORTING

id = it_messtab-msgid

lang = it_messtab-msgspra

no = it_messtab-msgnr

v1 = it_messtab-msgv1

v2 = it_messtab-msgv2

IMPORTING

msg = g_msg

EXCEPTIONS

OTHERS = 0.

IF it_messtab-msgtyp = 'S'.

it_sucess-sucess_rec = g_msg.

it_sucess-lifnr = it_header-lifnr." Based on your field

it_sucess-tabix = v_lines.

APPEND it_sucess.

ELSEIF it_messtab-msgtyp = 'E'.

it_error-error_rec = g_msg.

it_error-lifnr = it_header-lifnr.

it_error-tabix = v_lines.

APPEND it_error.

ELSE.

it_info-info_rec = g_msg.

it_info-lifnr = it_header-lifnr.

it_info-tabix = v_lines.

APPEND it_info.

ENDIF.

ENDLOOP.

Hope this helps.

Reward if helpful.

Regards,

Sipra

Former Member
0 Kudos
379

Thanks a lot,

ekta