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

bdc

Former Member
0 Likes
516

explanation about function module 'format_message'.

3 REPLIES 3
Read only

Former Member
0 Likes
500

Hello,

Please read this: .

Regards.

Read only

Former Member
0 Likes
500

hi Praveen,

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.

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.

hope its clear to you,

inspire if usefull,

Thanks ,

Kalyan.

Read only

Former Member
0 Likes
500

Hi Praveen,

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 messages.


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.

Reward points if useful.

Cheers,

Swamy Kunche