<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: BAPI return messages in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-return-messages/m-p/1039046#M85998</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It is your custom BAPI, so this should not be a problem at all. I hope you are doing the call transaction with the option 'messages into &amp;lt;bdc_mesages_itab&amp;gt;'. Once you add this option, your bdc_messages_itab will contain the error messages from the call transaction. Then all you have to do is to loop at this and fill your BAPI_RETURN structure.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
data: begin of i_bdcmsgcoll occurs 0.
        include structure bdcmsgcoll.
data: end of i_bdcmsgcoll.

CALL TRANSACTION 'XD01'
           USING BDCDATA
   MESSAGES INTO I_BDCMSGCOLL.

LOOP AT I_BDCMSGCOLL.
  MOVE: I_BDCMSGCOLL-MSGTYP  TO RETURN-TYPE
        I_BDCMSGCOLL-MSGID   TO RETURN-ID
        I_BDCMSGCOLL-MSGNR   TO RETURN-NUMBER
        I_BDCMSGCOLL-MSGV1   TO RETURN-MESSAGE_V1
        I_BDCMSGCOLL-MSGV2   TO RETURN-MESSAGE_V2
        I_BDCMSGCOLL-MSGV3   TO RETURN-MESSAGE_V3
        I_BDCMSGCOLL-MSGV4   TO RETURN-MESSAGE_V4.
  APPEND RETURN.
  CLEAR RETURN.
ENDLOOP.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Srinivas&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Srinivas Adavi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 10 Oct 2005 18:55:26 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2005-10-10T18:55:26Z</dc:date>
    <item>
      <title>BAPI return messages</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-return-messages/m-p/1039045#M85997</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am writing a custom BAPI in which i am calling XD01 transaction. I want to trap the error message into the BAPI return. How do I do this ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Oct 2005 18:45:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-return-messages/m-p/1039045#M85997</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-10-10T18:45:04Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI return messages</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-return-messages/m-p/1039046#M85998</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It is your custom BAPI, so this should not be a problem at all. I hope you are doing the call transaction with the option 'messages into &amp;lt;bdc_mesages_itab&amp;gt;'. Once you add this option, your bdc_messages_itab will contain the error messages from the call transaction. Then all you have to do is to loop at this and fill your BAPI_RETURN structure.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
data: begin of i_bdcmsgcoll occurs 0.
        include structure bdcmsgcoll.
data: end of i_bdcmsgcoll.

CALL TRANSACTION 'XD01'
           USING BDCDATA
   MESSAGES INTO I_BDCMSGCOLL.

LOOP AT I_BDCMSGCOLL.
  MOVE: I_BDCMSGCOLL-MSGTYP  TO RETURN-TYPE
        I_BDCMSGCOLL-MSGID   TO RETURN-ID
        I_BDCMSGCOLL-MSGNR   TO RETURN-NUMBER
        I_BDCMSGCOLL-MSGV1   TO RETURN-MESSAGE_V1
        I_BDCMSGCOLL-MSGV2   TO RETURN-MESSAGE_V2
        I_BDCMSGCOLL-MSGV3   TO RETURN-MESSAGE_V3
        I_BDCMSGCOLL-MSGV4   TO RETURN-MESSAGE_V4.
  APPEND RETURN.
  CLEAR RETURN.
ENDLOOP.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Srinivas&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Srinivas Adavi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Oct 2005 18:55:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-return-messages/m-p/1039046#M85998</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-10-10T18:55:26Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI return messages</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-return-messages/m-p/1039047#M85999</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;BALW_BAPIRETURN_GET1 will do that. Thanks for your reply.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Oct 2005 19:01:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-return-messages/m-p/1039047#M85999</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-10-10T19:01:14Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI return messages</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-return-messages/m-p/1039048#M86000</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please close the post in that case.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Srinivas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Oct 2005 19:05:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-return-messages/m-p/1039048#M86000</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-10-10T19:05:38Z</dc:date>
    </item>
  </channel>
</rss>

