<?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: error handling in bapi in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-handling-in-bapi/m-p/1438367#M208769</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Normally BAPI's will retun you an internal table with RETURN table, which will have the list of message it encountered while processing the BAPI.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then you need to loop at that internal table to build the messages, you can use message&lt;STRONG&gt;text&lt;/STRONG&gt;build FM to build the messages.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regds&lt;/P&gt;&lt;P&gt;Manohar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 15 Jul 2006 08:52:14 GMT</pubDate>
    <dc:creator>Manohar2u</dc:creator>
    <dc:date>2006-07-15T08:52:14Z</dc:date>
    <item>
      <title>error handling in bapi</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-handling-in-bapi/m-p/1438366#M208768</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;how to handles the errors in bapi function modules asa compared to normal function modules&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks,&lt;/P&gt;&lt;P&gt;kiran.M&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 15 Jul 2006 08:49:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-handling-in-bapi/m-p/1438366#M208768</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-15T08:49:49Z</dc:date>
    </item>
    <item>
      <title>Re: error handling in bapi</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-handling-in-bapi/m-p/1438367#M208769</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Normally BAPI's will retun you an internal table with RETURN table, which will have the list of message it encountered while processing the BAPI.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then you need to loop at that internal table to build the messages, you can use message&lt;STRONG&gt;text&lt;/STRONG&gt;build FM to build the messages.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regds&lt;/P&gt;&lt;P&gt;Manohar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 15 Jul 2006 08:52:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-handling-in-bapi/m-p/1438367#M208769</guid>
      <dc:creator>Manohar2u</dc:creator>
      <dc:date>2006-07-15T08:52:14Z</dc:date>
    </item>
    <item>
      <title>Re: error handling in bapi</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-handling-in-bapi/m-p/1438368#M208770</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;  Normally u avoid exceptions in BAPI.&lt;/P&gt;&lt;P&gt;Use internal table ; Populate the error if any and return the internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;BAPI-step by step&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapgenie.com/abap/bapi/example.htm" target="test_blank"&gt;http://www.sapgenie.com/abap/bapi/example.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sappoint.com/abap/bapiintro.pdf" target="test_blank"&gt;http://www.sappoint.com/abap/bapiintro.pdf&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 15 Jul 2006 08:52:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-handling-in-bapi/m-p/1438368#M208770</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-15T08:52:20Z</dc:date>
    </item>
    <item>
      <title>Re: error handling in bapi</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-handling-in-bapi/m-p/1438369#M208771</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;EXample for error handling in bapi.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Bapi :- BAPI_0035_CHANGE&lt;/P&gt;&lt;P&gt;           Tables :- RETURN&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Return is a internal table which returns error .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Structure of return table ( BAPIRET2 ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPE&lt;/P&gt;&lt;P&gt;ID&lt;/P&gt;&lt;P&gt;NUMBER&lt;/P&gt;&lt;P&gt;MESSAGE&lt;/P&gt;&lt;P&gt;LOG_NO&lt;/P&gt;&lt;P&gt;LOG_MSG_NO&lt;/P&gt;&lt;P&gt;MESSAGE_V1&lt;/P&gt;&lt;P&gt;MESSAGE_V2&lt;/P&gt;&lt;P&gt;MESSAGE_V3&lt;/P&gt;&lt;P&gt;MESSAGE_V4&lt;/P&gt;&lt;P&gt;PARAMETER&lt;/P&gt;&lt;P&gt;ROW&lt;/P&gt;&lt;P&gt;FIELD&lt;/P&gt;&lt;P&gt;SYSTEM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;u append the error in this table.&lt;/P&gt;&lt;P&gt;look at the structure ( BAPIRET2 ) for detail.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 15 Jul 2006 08:56:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-handling-in-bapi/m-p/1438369#M208771</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-15T08:56:46Z</dc:date>
    </item>
    <item>
      <title>Re: error handling in bapi</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-handling-in-bapi/m-p/1438370#M208772</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kiran,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is no explicit condition or any BAPI or FM to handle the errors. It has to be done manually, the same procedure we use in BDC programs after CALL TRNSACTION and getting the messages into the Internal Table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Assume I am using &amp;lt;b&amp;gt;BAPI_QUOTATION_CREATEFROMDATA2&amp;lt;/b&amp;gt; for creating quotations(Transaction VA21).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I called the BAPI and got the following error messges in my &amp;lt;b&amp;gt;RETURN&amp;lt;/b&amp;gt; table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
&amp;lt;b&amp;gt;TYPE |ID                  | NUMBER| MESSAGE&amp;lt;/b&amp;gt;
E   |VP                  |112   |Please enter sold-to party or ship-to party
E   |V4                  |219   |Sales document  was not changed     

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So based on this you have to determine your error handling.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Something like this after calling the BAPI.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
  READ TABLE return WITH KEY id     = 'VP'
                             number = '112'.
  IF sy-subrc  = 0.

* Your error handling

  ENDIF.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use the BAPI_MESSAGE_GETDETAIL to get the detailed error messages. Refer to the table T100 for exporting parameters.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Arun Sambargi.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 15 Jul 2006 15:27:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-handling-in-bapi/m-p/1438370#M208772</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-15T15:27:16Z</dc:date>
    </item>
    <item>
      <title>Re: error handling in bapi</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-handling-in-bapi/m-p/1438371#M208773</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;  All BAPIs contains Return table as table parameter.  This table is populated with error messages/Sucessful messages after BAPI was executed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please check this table for any error messages.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ganesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 16 Jul 2006 11:02:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-handling-in-bapi/m-p/1438371#M208773</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-16T11:02:05Z</dc:date>
    </item>
  </channel>
</rss>

