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

Regarding Format_message function module in call transaction

Former Member
0 Likes
3,623

Dear Friends,

In Call tranasction error handling if sy-subrc ne 0 we will move

into one internal table and we can download it to presentaion server using WS_download so why do we use FORMAT_MESSAGE wht is the use of that..

Regards

Jagadeeshwar.B

1 ACCEPTED SOLUTION
Read only

sachin_mathapati
Contributor
0 Likes
1,770

Hi jagadeesh,

CALL TRANSACTION tcode USING lt_bdcdata

MODE 'E' MESSAGES INTO itab.

Now itab contains only message no and message Id and not the actual message.

So to get the actual message we use 'Format_message' .In format_message we pass message id, message number and language .so based on these we get the exact message from T100 table.

Regards,

Sachin M M

7 REPLIES 7
Read only

naimesh_patel
Active Contributor
0 Likes
1,770

FORMAT_MESSAGE will give you actual message based on the message id, message no, and message variables.

Regards,

Naimesh Patel

Read only

0 Likes
1,770

Thanks Nimesh for quick response, so format_message gives predifined system mesages. then how does the user identify which is the error record based on format_message.

Or does format_message gives any idea of the record that has been errored out.

Regards

Jagadeesh B

Read only

Former Member
0 Likes
1,770

The messages returned by the call transaction BDCMSGCOLL Internal table will not make any sense to the business user.

If youuse FORMAT_MESSAGE fm you wil get a proper english text for the message .

Regards,

Ravi

Read only

0 Likes
1,770

Hi Ravi Kanth,

Thanks for your answer, with using format_message function module how would be the output.

pls let me know.

thanks

Regards

Jagadeeswar.B

Read only

Former Member
Read only

Former Member
0 Likes
1,770

Using 'FORMAT_MESSAGE' you will get the exact message in English.

In the importing parameter you will receive the message into variable 'msg', which you can write in the report output

CALL TRANSACTION 'ME21' USING bdcdata MODE 'N' UPDATE 'S' MESSAGES INTO it_message.

LOOP AT it_message.

CALL FUNCTION 'FORMAT_MESSAGE'

EXPORTING

id = it_message-msgid

lang = it_message-msgspra

no = it_message-msgnr

v1 = it_message-msgv1

v2 = it_message-msgv2

IMPORTING

msg = v_msg

EXCEPTIONS

not_found = 1

OTHERS = 2.

ENDLOOP.

Read only

sachin_mathapati
Contributor
0 Likes
1,771

Hi jagadeesh,

CALL TRANSACTION tcode USING lt_bdcdata

MODE 'E' MESSAGES INTO itab.

Now itab contains only message no and message Id and not the actual message.

So to get the actual message we use 'Format_message' .In format_message we pass message id, message number and language .so based on these we get the exact message from T100 table.

Regards,

Sachin M M