<?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 in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi/m-p/2765230#M643929</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Srinivas&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BAPIs &amp;lt;b&amp;gt;must not&amp;lt;/b&amp;gt; have exceptions because they are primarily intended for remote-access (RFC) to SAP business objects. If a BAPI would raise an exception the RFC connection will break down.&lt;/P&gt;&lt;P&gt;Therefore all BAPIs collect the messages and return them usually in a TABLES parameter RETURN (of structure BAPIRET2).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In order to evaluate the succesful calling of a BAPI add the following coding:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;" call BAPI ...  ==&amp;gt; return messages in TABLES parameter RETURN
" Returned messages are stored in itab lt_return

  LOOP AT lt_return TRANSPORTING NO FIELDS
                 WHERE ( type CA 'AEX' ).   " abort, error, dump
    EXIT.
  ENDLOOP. 
  IF ( syst-subrc = 0 ).
    CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'
      DESTINATION '&amp;lt;rfc destination&amp;gt;'.
  ELSE. 
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
      DESTINATION '&amp;lt;rfc destination&amp;gt;'.
  ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please note that some BAPI do not return any messages at all in case of success.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Finally, in order to retrieve RFC failures add the following standard exceptions to the BAPI call, e.g.:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;  CALL FUNCTION 'BAPI_USER_CREATE1'
      DESTINATION '&amp;lt;rfc destination&amp;gt;'
    ...
   EXCEPTIONS
     system_failure = 1 MESSAGE ld_rfc_msg
     communication_failure = 2 MESSAGE ld_rfc_msg.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;  Uwe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 04 Sep 2007 02:36:19 GMT</pubDate>
    <dc:creator>uwe_schieferstein</dc:creator>
    <dc:date>2007-09-04T02:36:19Z</dc:date>
    <item>
      <title>BAPI</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi/m-p/2765229#M643928</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Why BAPIs do not have exceptions?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Sep 2007 01:59:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi/m-p/2765229#M643928</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-04T01:59:52Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi/m-p/2765230#M643929</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Srinivas&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BAPIs &amp;lt;b&amp;gt;must not&amp;lt;/b&amp;gt; have exceptions because they are primarily intended for remote-access (RFC) to SAP business objects. If a BAPI would raise an exception the RFC connection will break down.&lt;/P&gt;&lt;P&gt;Therefore all BAPIs collect the messages and return them usually in a TABLES parameter RETURN (of structure BAPIRET2).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In order to evaluate the succesful calling of a BAPI add the following coding:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;" call BAPI ...  ==&amp;gt; return messages in TABLES parameter RETURN
" Returned messages are stored in itab lt_return

  LOOP AT lt_return TRANSPORTING NO FIELDS
                 WHERE ( type CA 'AEX' ).   " abort, error, dump
    EXIT.
  ENDLOOP. 
  IF ( syst-subrc = 0 ).
    CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'
      DESTINATION '&amp;lt;rfc destination&amp;gt;'.
  ELSE. 
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
      DESTINATION '&amp;lt;rfc destination&amp;gt;'.
  ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please note that some BAPI do not return any messages at all in case of success.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Finally, in order to retrieve RFC failures add the following standard exceptions to the BAPI call, e.g.:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;  CALL FUNCTION 'BAPI_USER_CREATE1'
      DESTINATION '&amp;lt;rfc destination&amp;gt;'
    ...
   EXCEPTIONS
     system_failure = 1 MESSAGE ld_rfc_msg
     communication_failure = 2 MESSAGE ld_rfc_msg.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;  Uwe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Sep 2007 02:36:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi/m-p/2765230#M643929</guid>
      <dc:creator>uwe_schieferstein</dc:creator>
      <dc:date>2007-09-04T02:36:19Z</dc:date>
    </item>
  </channel>
</rss>

