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

bapi return messages

Former Member
0 Likes
371

hi all,

i have a internal table treturn like t_return like bapiret2 occurs 0 with header line to hold the error messages from bapi_goodsmvt.

and i have other internal table t_msg type standard table of solisti1 initial size 0

with header line, which is the message table for the functional module SO_NEW_DOCUMENT_ATT_SEND_API1

so all the error msgs type E in treturn should be sent to t_msg.

can any one send the code for this please.

thanks.

1 REPLY 1
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
335

Hi, what you can do is loop at the T_RETURN table and process each record thru function module MESSAGE_PREPARE, it excepts the message information and builds the message for you.




  call function 'MESSAGE_PREPARE'
       exporting
            language = sy-langu
            msg_id   = t_return-id
            msg_no   = t_return-number
            msg_var1 = t_return-MESSAGE_V1
            msg_var2 = t_return-MESSAGE_V2
            msg_var3 = t_return-MESSAGE_V3
            msg_var4 = t_return-MESSAGE_V4
       importing
            msg_text = message.


You can then simple add the message to the T_MSG internal table.

t_msg = message.
append t_msg.

Regards,

Rich Heilman