<?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: Order change BAPI Question in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/order-change-bapi-question/m-p/3645682#M877941</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;can BAPI SALES ORDER CHANGE get the details  and also change the order..at one instance..?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 04 Apr 2008 13:11:49 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-04-04T13:11:49Z</dc:date>
    <item>
      <title>Order change BAPI Question</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/order-change-bapi-question/m-p/3645680#M877939</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi I have a requirement where in we have a web application communicates with SAP through a BAPI call and makes changes to the orders.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Web application should synchrounously call BAPI and retrieve the order details.On seeing the Order details the CSR will change the order as needed and save, which should be replicated in SAP.Until the CSR is changing the order and saving it the order should be locked and should not be available for access to any other users...How can I achieve this..?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can any one please outline the details.&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>Fri, 04 Apr 2008 11:55:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/order-change-bapi-question/m-p/3645680#M877939</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-04T11:55:08Z</dc:date>
    </item>
    <item>
      <title>Re: Order change BAPI Question</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/order-change-bapi-question/m-p/3645681#M877940</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;make use of FM 'BAPI_SALESORDER_CHANGE'&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Apr 2008 12:39:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/order-change-bapi-question/m-p/3645681#M877940</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-04T12:39:26Z</dc:date>
    </item>
    <item>
      <title>Re: Order change BAPI Question</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/order-change-bapi-question/m-p/3645682#M877941</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;can BAPI SALES ORDER CHANGE get the details  and also change the order..at one instance..?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Apr 2008 13:11:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/order-change-bapi-question/m-p/3645682#M877941</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-04T13:11:49Z</dc:date>
    </item>
    <item>
      <title>Re: Order change BAPI Question</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/order-change-bapi-question/m-p/3645683#M877942</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI,,&lt;/P&gt;&lt;P&gt;You can use &lt;STRONG&gt;BAPISDORDER_GETDETAILEDLIST&lt;/STRONG&gt; to get all the details related to a given SO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
 IT_SALES_KEY-VBELN = I_VBELN.
  APPEND IT_SALES_KEY.

*Fill in the structures you want to fetch data for.
  WA_ORDER_VIEW-HEADER     = 'X'.
  WA_ORDER_VIEW-ITEM       = 'X'.
  WA_ORDER_VIEW-SDSCHEDULE = 'X'.
  WA_ORDER_VIEW-BUSINESS   = 'X'.
  WA_ORDER_VIEW-PARTNER    = 'X'.
  WA_ORDER_VIEW-ADDRESS    = 'X'.
  WA_ORDER_VIEW-TEXT       = 'X'. 
  WA_ORDER_VIEW-STATUS_H   = 'X'.  WA_ORDER_VIEW-STATUS_I   = 'X'.  

*--Step 3
*Call the BAPI to get the details
  CALL FUNCTION 'BAPISDORDER_GETDETAILEDLIST'
    EXPORTING
      I_BAPI_VIEW             = WA_ORDER_VIEW
    TABLES
      SALES_DOCUMENTS         = IT_SALES_KEY
      ORDER_HEADERS_OUT       = IT_ORDER_HEADERS_OUT
      ORDER_ITEMS_OUT         = IT_ORDER_ITEMS_OUT
      ORDER_SCHEDULES_OUT     = IT_ORDER_SCHEDULES_OUT
      ORDER_BUSINESS_OUT      = IT_ORDER_BUSINESS_OUT
      ORDER_PARTNERS_OUT      = IT_ORDER_PARTNERS_OUT
      ORDER_ADDRESS_OUT       = IT_ORDER_ADDRESS_OUT
      ORDER_STATUSHEADERS_OUT = IT_ORDER_STATHEADERS_OUT 

ORDER_STATUSITEMS_OUT   = IT_STATUSITEMS_OUT 

ORDER_TEXTHEADERS_OUT   = IT_TEXTHEADERS_OUT

IT_TEXTLINES_OUT     = IT_ORDER_TEXTLINES_OUT 

EXTENSIONOUT          = IT_BAPIREX.
.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will give alll the related data for the given SO&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now to change the SO you can use &lt;STRONG&gt;BAPI_SALESORDER_CHANGE&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sample Code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

  l_vbeln = salesorder.
  i_bapisdhd1x-updateflag  = 'U'.

*--Map the Header Data
  MOVE-CORRESPONDING l_header TO i_bapisdhd1.

*--Item data

"Here you need to loop at item data and insert the BAPI inteface tables.
"Note that you need to fill both Item and Schedule data to update the Item data
*Item table
    it_bapisditmx-itm_number =  l_item-itm_number.
    it_bapisditmx-updateflag =  'U'.
*Item X
    it_bapischdlx-itm_number = it_bapisditm-itm_number.
    it_bapischdlx-sched_line = '0001'.
    it_bapischdlx-req_qty    = 'X'.
*Schedule
    it_bapischdl-itm_number = it_bapisditm-itm_number.
    it_bapischdl-req_qty = l_item-target_qty.
    it_bapischdl-sched_line = '0001'.
*Schedule X
    it_bapischdlx-itm_number = it_bapisditm-itm_number.
    it_bapischdlx-req_qty = 'X'.
    it_bapischdlx-sched_line = 'X'.

    APPEND :it_bapisditm,it_bapischdl,it_bapisditmx, it_bapischdlx.

*--Call SO change BAPI
  CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
    EXPORTING
      salesdocument    = l_vbeln
      order_header_in  = i_bapisdhd1
      order_header_inx = i_bapisdhd1x
    TABLES
      return           = it_retchnge
      order_item_in    = it_bapisditm
      order_item_inx   = it_bapisditmx
      partnerchanges   = it_partnerchanges
      schedule_lines   = it_bapischdl
      schedule_linesx  = it_bapischdlx
      order_text       = it_bapisdtext
      extensionin      = it_bapiparex.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"DO not forget to  COMMIT work if the RETURN table does have Errors/Abort  using  ''BAPI_TRANSACTION_COMMIT''&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also you will have to call the BAPI separately, once to show the details.. and the next time .. to update these ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;Gary&lt;/P&gt;&lt;P&gt;&lt;SPAN __default_attr="red" __jive_macro_name="color"&gt;&lt;STRONG&gt;&amp;lt;REMOVED BY MODERATOR&amp;gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Alvaro Tejada Galindo on Apr 9, 2008 5:29 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Apr 2008 13:19:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/order-change-bapi-question/m-p/3645683#M877942</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-04T13:19:27Z</dc:date>
    </item>
    <item>
      <title>Re: Order change BAPI Question</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/order-change-bapi-question/m-p/3645684#M877943</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;Can you clear me which order you want to get Order menas&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Each order is having different bapis Purchase order, Sales order etc...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BAPI_PLANNEDORDER_CHANGE - Change planned order&lt;/P&gt;&lt;P&gt;BAPI_SALESORDER_CHANGE     - Sales order: Change Sales Order&lt;/P&gt;&lt;P&gt;BAPI_STANDING_ORDER_CHANGE - BAPI: Changes a Standing Order&lt;/P&gt;&lt;P&gt;BAPI_ACC_PURCHASE_ORDER_POST - Post Purchase Order &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;etc...&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;Ganesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Apr 2008 13:28:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/order-change-bapi-question/m-p/3645684#M877943</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-04T13:28:09Z</dc:date>
    </item>
    <item>
      <title>Re: Order change BAPI Question</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/order-change-bapi-question/m-p/3645685#M877944</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Guys,&lt;/P&gt;&lt;P&gt;I need SALES ORDER only...I can use GET DETAILS BAPI to retrieve the data and ORDER change BAPI to change the order but my concern is while CSR is viewing the sales order data..(it might take few mins)..how can I lock the particular sales order(to make it unavailable for other users)until the change is done or during a period of time..?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Apr 2008 14:03:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/order-change-bapi-question/m-p/3645685#M877944</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-04T14:03:18Z</dc:date>
    </item>
    <item>
      <title>Re: Order change BAPI Question</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/order-change-bapi-question/m-p/3645686#M877945</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;One way to do this is :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One RFC which will 'Enqueue' the SO (Lock the SO ) and called just after fetch (if you know that user will be working on after fetch)&lt;/P&gt;&lt;P&gt; and then...&lt;/P&gt;&lt;P&gt; after the user is ready to Confirm his changes you can call the 'Dequeue' FM and subsequently the CHANGE RFC/BAPI.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Another way : (If the SO to be updated only via Web)&lt;/P&gt;&lt;P&gt; Once you fetch the SO, mark a flag that No other user should be able to update the SO and clear it once change BAPI/RFC is triggered.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;Gary&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Apr 2008 14:20:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/order-change-bapi-question/m-p/3645686#M877945</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-04T14:20:24Z</dc:date>
    </item>
    <item>
      <title>Re: Order change BAPI Question</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/order-change-bapi-question/m-p/3645687#M877946</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Gary,Thanks for the suggestions. Is this the module ENQUEUE_EVVBAKE which needs to be used to Enqueue..?If so DO you have any sample Code..I tried using the module and it didnt lock that particaular Sales Order..How it needs to be done..?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Apr 2008 14:49:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/order-change-bapi-question/m-p/3645687#M877946</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-04T14:49:05Z</dc:date>
    </item>
    <item>
      <title>Re: Order change BAPI Question</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/order-change-bapi-question/m-p/3645688#M877947</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 use the following and it works great for me !!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;"To Enqueue.
        CALL FUNCTION 'ENQUEUE_EVVBAKE'
          EXPORTING
            mode_vbak      = 'E'
            mandt          = sy-mandt
            vbeln          = l_vbeln
          EXCEPTIONS
            foreign_lock   = 1
            system_failure = 2
            OTHERS         = 3.
        IF sy-subrc EQ 0.
          EXIT.
        ENDIF.

"To Dequeue
      CALL FUNCTION 'DEQUEUE_EVVBAKE'
        EXPORTING
          mode_vbak = 'E'
          mandt     = sy-mandt
          vbeln     = l_vbeln.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;Gary.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Apr 2008 15:09:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/order-change-bapi-question/m-p/3645688#M877947</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-04T15:09:21Z</dc:date>
    </item>
    <item>
      <title>Re: Order change BAPI Question</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/order-change-bapi-question/m-p/3645689#M877948</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;I have a problem...Iam calling 'ENQUEUE_EVVBAKE' through a BAPI which gets the sales order details..Its a synchronous bapi so when the execution of the BAPi is completed the sales order is unlocked...My requirement is until I call the Salesorder change BAPI the sales order should be remaining unlocked...is there any way to achieve this...please help..&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;P&gt;Larry&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Apr 2008 17:47:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/order-change-bapi-question/m-p/3645689#M877948</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-09T17:47:26Z</dc:date>
    </item>
    <item>
      <title>Re: Order change BAPI Question</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/order-change-bapi-question/m-p/3645690#M877949</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;If someone in R/3 is using the SO-(VA02) then it will difficult for the user to update it via the WEB and the Change BAPI will return a message -'Order locked by Username'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On the other hand if the users are always going to work from the web then it should not be a problem to work with the same SO#.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What you can do is.... &lt;/P&gt;&lt;P&gt;1.Call the 'Create' action in the Web and trigger the create BAPI.&lt;/P&gt;&lt;P&gt;On successful execution of the BAPI call the Enqueue RFC.&lt;/P&gt;&lt;P&gt;This will ensure that the SO is locked for use in SAP and even if some other user wants to update, he/she will get an error message.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. Now the user wants to update some values in the web and save these details&lt;/P&gt;&lt;P&gt;Call the 'Update' action and trigger the Dequeue RFC so that the SO is unlocked in SAP and after this call the Change BAPI.&lt;/P&gt;&lt;P&gt;On successful completion of update in SAP, call the Enqueue RFC again to lock the SO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;Gary.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Apr 2008 12:24:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/order-change-bapi-question/m-p/3645690#M877949</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-10T12:24:28Z</dc:date>
    </item>
  </channel>
</rss>

