<?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: Billing document creation bapi problem in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/billing-document-creation-bapi-problem/m-p/2250747#M486471</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Nuno Silva,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Did you check the return structure?, some times it takes more than usual time to create a sales order (it depends on the system resource, validations etc). wait for couple of seconds before calling 'BAPI_TRANSACTION_COMMIT'. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you would like to know whether this SO BAPI is success, before checking for billing document; check for Salesorder number returned from BAPI, if its blank assume that BAPI has failed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check out a sample code..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Call SAP standard BAPI to create order&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'&lt;/P&gt;&lt;P&gt;       EXPORTING&lt;/P&gt;&lt;P&gt;            salesdocumentin         = salesdocumentin&lt;/P&gt;&lt;P&gt;            order_header_in         = order_header_in&lt;/P&gt;&lt;P&gt;            order_header_inx        = order_header_inx&lt;/P&gt;&lt;P&gt;            sender                  = sender&lt;/P&gt;&lt;P&gt;            binary_relationshiptype = binary_relationshiptype&lt;/P&gt;&lt;P&gt;            int_number_assignment   = int_number_assignment&lt;/P&gt;&lt;P&gt;            behave_when_error       = behave_when_error&lt;/P&gt;&lt;P&gt;            logic_switch            = logic_switch&lt;/P&gt;&lt;P&gt;            testrun                 = testrun&lt;/P&gt;&lt;P&gt;            convert                 = convert&lt;/P&gt;&lt;P&gt;       IMPORTING&lt;/P&gt;&lt;P&gt;            salesdocument           = salesdocument&lt;/P&gt;&lt;P&gt;       TABLES&lt;/P&gt;&lt;P&gt;            return                  = return&lt;/P&gt;&lt;P&gt;            order_items_in          = order_items_in&lt;/P&gt;&lt;P&gt;            order_items_inx         = order_items_inx&lt;/P&gt;&lt;P&gt;            order_partners          = order_partners&lt;/P&gt;&lt;P&gt;            order_schedules_in      = order_schedules_in&lt;/P&gt;&lt;P&gt;            order_schedules_inx     = order_schedules_inx&lt;/P&gt;&lt;P&gt;            order_conditions_in     = order_conditions_in&lt;/P&gt;&lt;P&gt;            order_cfgs_ref          = order_cfgs_ref&lt;/P&gt;&lt;P&gt;            order_cfgs_inst         = order_cfgs_inst&lt;/P&gt;&lt;P&gt;            order_cfgs_part_of      = order_cfgs_part_of&lt;/P&gt;&lt;P&gt;            order_cfgs_value        = order_cfgs_value&lt;/P&gt;&lt;P&gt;            order_cfgs_blob         = order_cfgs_blob&lt;/P&gt;&lt;P&gt;            order_cfgs_vk           = order_cfgs_vk&lt;/P&gt;&lt;P&gt;            order_cfgs_refinst      = order_cfgs_refinst&lt;/P&gt;&lt;P&gt;            order_ccard             = order_ccard&lt;/P&gt;&lt;P&gt;            order_text              = order_text&lt;/P&gt;&lt;P&gt;            order_keys              = order_keys&lt;/P&gt;&lt;P&gt;            extensionin             = extensionin&lt;/P&gt;&lt;P&gt;            partneraddresses        = partneraddresses.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  IF sy-subrc = 0 AND&lt;/P&gt;&lt;P&gt;     salesdocument &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'&lt;/P&gt;&lt;P&gt;         EXPORTING&lt;/P&gt;&lt;P&gt;              wait   = 'X'&lt;/P&gt;&lt;P&gt;         IMPORTING&lt;/P&gt;&lt;P&gt;              return = d_int_return.&lt;/P&gt;&lt;P&gt;    IF d_int_return-type EQ 'E'.&lt;/P&gt;&lt;P&gt;      MOVE-CORRESPONDING d_int_return TO return.&lt;/P&gt;&lt;P&gt;      APPEND return.&lt;/P&gt;&lt;P&gt; ENDIF&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward if its of any use to you&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 28 May 2007 16:17:26 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-05-28T16:17:26Z</dc:date>
    <item>
      <title>Billing document creation bapi problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/billing-document-creation-bapi-problem/m-p/2250746#M486470</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello all.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I created a function wich creates 2 documents, a sales document and a billing document referenced to the sales document.&lt;/P&gt;&lt;P&gt;It works fine almost allways. the problem is sometimes the sales document its not created and the bapi does not return any error messages.&lt;/P&gt;&lt;P&gt;Does anyone have any idea why?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;P&gt;Nuno Silva&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 May 2007 15:34:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/billing-document-creation-bapi-problem/m-p/2250746#M486470</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-28T15:34:58Z</dc:date>
    </item>
    <item>
      <title>Re: Billing document creation bapi problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/billing-document-creation-bapi-problem/m-p/2250747#M486471</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Nuno Silva,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Did you check the return structure?, some times it takes more than usual time to create a sales order (it depends on the system resource, validations etc). wait for couple of seconds before calling 'BAPI_TRANSACTION_COMMIT'. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you would like to know whether this SO BAPI is success, before checking for billing document; check for Salesorder number returned from BAPI, if its blank assume that BAPI has failed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check out a sample code..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Call SAP standard BAPI to create order&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'&lt;/P&gt;&lt;P&gt;       EXPORTING&lt;/P&gt;&lt;P&gt;            salesdocumentin         = salesdocumentin&lt;/P&gt;&lt;P&gt;            order_header_in         = order_header_in&lt;/P&gt;&lt;P&gt;            order_header_inx        = order_header_inx&lt;/P&gt;&lt;P&gt;            sender                  = sender&lt;/P&gt;&lt;P&gt;            binary_relationshiptype = binary_relationshiptype&lt;/P&gt;&lt;P&gt;            int_number_assignment   = int_number_assignment&lt;/P&gt;&lt;P&gt;            behave_when_error       = behave_when_error&lt;/P&gt;&lt;P&gt;            logic_switch            = logic_switch&lt;/P&gt;&lt;P&gt;            testrun                 = testrun&lt;/P&gt;&lt;P&gt;            convert                 = convert&lt;/P&gt;&lt;P&gt;       IMPORTING&lt;/P&gt;&lt;P&gt;            salesdocument           = salesdocument&lt;/P&gt;&lt;P&gt;       TABLES&lt;/P&gt;&lt;P&gt;            return                  = return&lt;/P&gt;&lt;P&gt;            order_items_in          = order_items_in&lt;/P&gt;&lt;P&gt;            order_items_inx         = order_items_inx&lt;/P&gt;&lt;P&gt;            order_partners          = order_partners&lt;/P&gt;&lt;P&gt;            order_schedules_in      = order_schedules_in&lt;/P&gt;&lt;P&gt;            order_schedules_inx     = order_schedules_inx&lt;/P&gt;&lt;P&gt;            order_conditions_in     = order_conditions_in&lt;/P&gt;&lt;P&gt;            order_cfgs_ref          = order_cfgs_ref&lt;/P&gt;&lt;P&gt;            order_cfgs_inst         = order_cfgs_inst&lt;/P&gt;&lt;P&gt;            order_cfgs_part_of      = order_cfgs_part_of&lt;/P&gt;&lt;P&gt;            order_cfgs_value        = order_cfgs_value&lt;/P&gt;&lt;P&gt;            order_cfgs_blob         = order_cfgs_blob&lt;/P&gt;&lt;P&gt;            order_cfgs_vk           = order_cfgs_vk&lt;/P&gt;&lt;P&gt;            order_cfgs_refinst      = order_cfgs_refinst&lt;/P&gt;&lt;P&gt;            order_ccard             = order_ccard&lt;/P&gt;&lt;P&gt;            order_text              = order_text&lt;/P&gt;&lt;P&gt;            order_keys              = order_keys&lt;/P&gt;&lt;P&gt;            extensionin             = extensionin&lt;/P&gt;&lt;P&gt;            partneraddresses        = partneraddresses.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  IF sy-subrc = 0 AND&lt;/P&gt;&lt;P&gt;     salesdocument &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'&lt;/P&gt;&lt;P&gt;         EXPORTING&lt;/P&gt;&lt;P&gt;              wait   = 'X'&lt;/P&gt;&lt;P&gt;         IMPORTING&lt;/P&gt;&lt;P&gt;              return = d_int_return.&lt;/P&gt;&lt;P&gt;    IF d_int_return-type EQ 'E'.&lt;/P&gt;&lt;P&gt;      MOVE-CORRESPONDING d_int_return TO return.&lt;/P&gt;&lt;P&gt;      APPEND return.&lt;/P&gt;&lt;P&gt; ENDIF&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward if its of any use to you&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 May 2007 16:17:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/billing-document-creation-bapi-problem/m-p/2250747#M486471</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-28T16:17:26Z</dc:date>
    </item>
    <item>
      <title>Re: Billing document creation bapi problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/billing-document-creation-bapi-problem/m-p/2250748#M486472</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am checking for both the exitence of an error message in the message structure of the bapi and the existence of a document number.&lt;/P&gt;&lt;P&gt;Is it possible that it returns an error message and still generates a document?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 May 2007 16:42:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/billing-document-creation-bapi-problem/m-p/2250748#M486472</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-28T16:42:57Z</dc:date>
    </item>
    <item>
      <title>Re: Billing document creation bapi problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/billing-document-creation-bapi-problem/m-p/2250749#M486473</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As far as my experience goes, NO. If you get error message then there won't be any document generated , hence no document number&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 May 2007 16:54:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/billing-document-creation-bapi-problem/m-p/2250749#M486473</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-28T16:54:55Z</dc:date>
    </item>
  </channel>
</rss>

