<?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: Not able to update a contract using BAPI in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/not-able-to-update-a-contract-using-bapi/m-p/7156746#M1515325</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am not sure why it is not working??  Try for any other alternate function modules.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But i see one issue with your coding, always check the return table message type and use commit work, instead of sy-subrc check. This fails for BAPI's&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 11 Aug 2010 19:17:46 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-08-11T19:17:46Z</dc:date>
    <item>
      <title>Not able to update a contract using BAPI</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/not-able-to-update-a-contract-using-bapi/m-p/7156745#M1515324</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am tryin to use a BAPI to update the contract and for this I have coded the following: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;v_ponumber = 'abc-123' .
   MOVE v_ponumber  TO poheader2-number.
    MOVE 'X'  TO poheaderx-number.

    MOVE '00001' TO po_item2-ITEM_NO.
    MOVE 'test text' TO po_item2-SHORT_TEXT.
    APPEND po_item2.
    MOVE '00001' TO po_item2_x-ITEM_NO.
    MOVE 'X' TO po_item2_x-ITEM_NOX.
    MOVE 'X' TO po_item2_x-SHORT_TEXT.
    APPEND po_item2_x.

CALL FUNCTION 'BAPI_CONTRACT_CHANGE'
  EXPORTING
    PURCHASINGDOCUMENT          = v_ponumber
   HEADER                      = poheader2
   HEADERX                     = poheaderx

 TABLES
   ITEM                        = po_item2
   ITEMX                       = po_item2_x


   RETURN                      = return2
          .
if sy-subrc = 0.
commit work.
endif.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in the return table I am getting the message which says that the contract has been updated but I went to see the contract was actually not updated.... any advise where I am missing?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Rajat&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Aug 2010 19:10:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/not-able-to-update-a-contract-using-bapi/m-p/7156745#M1515324</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-08-11T19:10:43Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to update a contract using BAPI</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/not-able-to-update-a-contract-using-bapi/m-p/7156746#M1515325</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am not sure why it is not working??  Try for any other alternate function modules.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But i see one issue with your coding, always check the return table message type and use commit work, instead of sy-subrc check. This fails for BAPI's&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Aug 2010 19:17:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/not-able-to-update-a-contract-using-bapi/m-p/7156746#M1515325</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-08-11T19:17:46Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to update a contract using BAPI</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/not-able-to-update-a-contract-using-bapi/m-p/7156747#M1515326</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the reply Vijay, I was using that commit work just for the testing purposes, I will use BAPI_TRANSACTION_COMMIT to do the actual commit. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thnaks,&lt;/P&gt;&lt;P&gt;Rajat&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Aug 2010 20:02:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/not-able-to-update-a-contract-using-bapi/m-p/7156747#M1515326</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-08-11T20:02:55Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to update a contract using BAPI</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/not-able-to-update-a-contract-using-bapi/m-p/7156748#M1515327</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;somehow it's working now.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Aug 2010 20:06:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/not-able-to-update-a-contract-using-bapi/m-p/7156748#M1515327</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-08-11T20:06:23Z</dc:date>
    </item>
  </channel>
</rss>

