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

F.M. FORMAT_MESSAGE

Former Member
0 Likes
1,950

1)What is the purpose of F.M

FORMAT_MESSAGE?

2) How above function module

is useful in bdc call transaction method.?

please explain with sample code.

3 REPLIES 3
Read only

Former Member
0 Likes
1,395

this FM is used to format the message which we receive in bdc

use bdcmsgcoll structure to catch the error message from the call transaction.

then pass the values to this function module.

Without using this FM, u can take care of the message.

bye

Read only

Former Member
0 Likes
1,395

Hi,

Format_Message FM is using to format the message to show the output

as a standard message. You have to pass this FM all standardard system variables only it will imports a message into a table.

using that table you can display the messges.

Thanks

Ganesh

Read only

former_member156446
Active Contributor
0 Likes
1,395

ip_bdcmsgcoll is the table that we get from call transaction..

data:ip_bdcmsgcoll structure bdcmsgcoll.


  read  table ip_bdcmsgcoll with key msgtyp = 'E' binary search .

  if sy-subrc = 0.
    call function 'FORMAT_MESSAGE'
      exporting
        id        = ip_bdcmsgcoll-msgid
        lang      = '-E'
        no        = ip_bdcmsgcoll-msgnr
        v1        = ip_bdcmsgcoll-msgv1
        v2        = ip_bdcmsgcoll-msgv2
        v3        = ip_bdcmsgcoll-msgv3
        v4        = ip_bdcmsgcoll-msgv4
      importing
        msg       = vl_message
      exceptions
        not_found = 1
        others    = 2.