Performance of bapi BAPI_SALESORDER_CHANGE.

Now we meet the reqeust to split the order item by quantity in order to assign wbs number to each material
For example the sales order contains one item with 10 Qty and we need to split to 10 items and each item with 1Qty
Order:
     Line 0001          Material            10Qty
Change to:
    Line  0001          Material            1Qty      WBS-001
    Line  0002          Material            1Qty      WBS-002
    Line  0003          Material            1Qty      WBS-003
    Line  0010          Material            1Qty      WBS-010
We used bapi BAPI_SALESORDER_CHANGE to do above process but the run time seems very slowly (time out)
I tried to delete the schedule_lines and schedule_linessx from import for test.
it runs fast but the result is there is no quantity in each line item.
without schedule_line import, the order will be:
    Line  0001          Material            0Qty      WBS-001
    Line  0002          Material            0Qty      WBS-002
    Line  0003          Material            0Qty      WBS-003
    Line  0010          Material            0Qty      WBS-010
Does any one tried BAPI BAPI_SALESORDER_CHANGE and met the same problem (slowly)?
And any suggestion?
Thank you very much!

Hi,
BAPI_SALESORDER_CHANGE should not raise time out,
unless you process huge amount of data.
Maybe some data are locked or some user-exit causes infinite loop or incorrect select on large table.
Try to perform runtime analysis with small amount of data,
and during execution check SM12 for locks and SM50 for sequential reads.
Regards,
Przemysław

Similar Messages

  • Unable to update sales order unsing the BAPI 'BAPI_SALESORDER_CHANGE'

    Hi All,
    I am unable to update the payment method field for some sales orders using the bapi 'BAPI_SALESORDER_CHANGE'. I am getting the reason in the table RETURN as 'Field 'ZLSCH' cannot be changed, VBAPKOM 000050  ready for input'.
    Could anyone throw some light on it.
    Thanks a ton.
    Regards,
    Santosh Kotra.

    Hi
    Without reversing invoice we can't update price and this is standard bevaior which is logical too. For your scenario I am wondering why would you want to change price for a line item or order which is alrady invoiced and posted to FI. What difference would it make to change price in sale order when this has already been posted in FI?
    Thank$

  • Problem in BAPI  'BAPI_SALESORDER_CHANGE'.

    Hi All,
    I am facing a problem in BAPI  'BAPI_SALESORDER_CHANGE'. My requirement is as below.
    For a particular type of Sales Order i have to update all the ship-to PO.Basically in all these PO's we have to suffix
    'old'.
    I am pasting the code which I used. I am actually displaying the return message in a table.
    The message says 'Schedule Order is saved'.
    When i go and check the SO the ship-to PO is not updated.
    Also i have one more querry.
    Is thsi BAPI to be run for each item or can i collect all items in t_item_in and then call the BAPI.
    Please guide me on this.
    Thanks in Advance,
    Saket.
    LOOP AT t_vbkd INTO wa_vbkd.
    CONCATENATE wa_vbkd-bstkd_e '-' v_po INTO v_po_ref.
    t_item_in-purch_no_c    = v_po_ref.
    t_item_inx-purch_no_c   = v_po_ref.
    t_item_inx-updateflag  = 'X'.
      APPEND t_item_in.
      APPEND t_item_inx.
    *LOOP AT t_vbak INTO wa_vbak.
    v_vbeln = wa_vbkd-vbeln.
    w_headerx-updateflag = 'U'.
    CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
      EXPORTING
        SALESDOCUMENT               = v_vbeln
        ORDER_HEADER_INX            = w_headerx
      TABLES
        RETURN                      = t_return
        ORDER_ITEM_IN               = t_item_in
        ORDER_ITEM_INX              = t_item_inx.
    READ TABLE t_return WITH KEY type = 'E'.
      IF sy-subrc = 0.
        t_output-rmks = t_return-message.
      ELSE.
        t_output-rmks = t_return-message.
      ENDIF.
      READ TABLE t_vbak INTO wa_vbak
       WITH KEY vbeln = v_vbeln.
      t_output-vbeln = v_vbeln.
      t_output-auart = wa_vbak-auart.
      t_output-vkorg = wa_vbak-vkorg.
      t_output-bstkd_e_old = wa_vbkd-bstkd_e.
      t_output-bstkd_e_new = t_item_in-purch_no_c.
      APPEND t_output.
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
    EXPORTING
       WAIT          = 'X'
    IMPORTING
      RETURN        =
    ENDLOOP.

    REPORT  ZSALESORDER_CHANGE MESSAGE-ID 38.
    PARAMETERS: p_vbeln TYPE vbap-vbeln OBLIGATORY, "Order Number
    p_posnr TYPE vbap-posnr OBLIGATORY, "Order Item
    p_etenr TYPE vbep-etenr OBLIGATORY, "Schedule Line
    p_reqqty TYPE bapischdl-req_qty OBLIGATORY. " Order Qty
    DATA: i_hdr TYPE bapisdh1,
    i_hdrx TYPE bapisdh1x,
    i_ret TYPE bapiret2 OCCURS 0 WITH HEADER LINE,
    wa_ret TYPE bapiret2.
    DATA: BEGIN OF i_sched OCCURS 10.
    INCLUDE STRUCTURE bapischdl.
    DATA: END OF i_sched.
    DATA: BEGIN OF i_schedx OCCURS 10.
    INCLUDE STRUCTURE bapischdlx.
    DATA: END OF i_schedx.
    START-OF-SELECTION.
    REFRESH: i_sched, i_schedx, i_ret.
    CLEAR: i_sched, i_schedx, i_ret.
    i_hdrx-updateflag = 'U'.
    i_sched-itm_number = p_posnr.
    i_sched-sched_line = p_etenr.
    i_sched-req_qty = p_reqqty.
    i_schedx-updateflag = 'U'.
    i_schedx-itm_number = p_posnr.
    i_schedx-sched_line = p_etenr.
    i_schedx-req_qty = 'X'.
    APPEND i_sched.
    APPEND i_schedx.
    CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
    EXPORTING
    salesdocument = p_vbeln
    order_header_in = i_hdr
    order_header_inx = i_hdrx
    TABLES
    return = i_ret
    schedule_lines = i_sched
    schedule_linesx = i_schedx.
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
    LOOP AT i_ret.
    WRITE / i_ret-message.
    ENDLOOP.
    http://abap.wikiprog.com/wiki/BAPI_SALESORDER_CHANGE
    Edited by: krupa jani on Jul 30, 2009 9:22 AM

  • BAPI: BAPI_SALESORDER_CHANGE - Document Change History

    Hi ,
    When I change a Sales Order usingthe BAPI: BAPI_SALESORDER_CHANGE, will it create the change history for the document?
    Appreciate Your help.
    Thanks,
    Kannan.

    Transaction is SCDO and look at object called VERKBELEG
    Check the below link :
    http://help.sap.com/saphelp_nw04s/helpdata/en/c7/69bccff36611d3a6510000e835363f/content.htm
    Thanks
    Seshu

  • Updating Condition Rate in SO using BAPI 'BAPI_SALESORDER_CHANGE'

    Hi,
    I want to update the price related to condtions(both automatic and manual) in Sales Order items from input file. I am using bapi 'BAPI_SALESORDER_CHANGE' to for this.
    I used follwing code,
    wa_so_cond-itm_number = wa_input-so_item.
    wa_so_cond-cond_type  = wa_input-kschl.
    wa_so_cond-cond_st_no = '011'.
    wa_so_cond-cond_count = '00'.
    wa_so_cond-cond_value = wa_input-kbetr.
    APPEND wa_so_cond TO i_so_cond.
    CLEAR wa_so_cond.
    wa_so_condx-itm_number = wa_input-so_item.
    wa_so_condx-cond_type  = wa_input-kschl.
    wa_so_condx-cond_st_no = '011'.
    wa_so_condx-cond_count = '00'.
    wa_so_condx-updateflag = c_u.
    wa_so_condx-cond_value = c_x.
    APPEND  wa_so_condx TO i_so_condx.
    CLEAR wa_so_condx.
    But this is creating a new line in conditions instead of updating the existing line, even though the existing line is a inactive by crerating a new line I want to update the exsting line with new condition rate instead of creating a new line. Please help me if you have any soultion for this.
    Thanks in Advance,
    Prasad JVV.

    Hi Sandipan,
    I used APPEND to fill the conditions_in & conditions_inx, without filling the tables how can I modify?
    Thanks,
    Prasad JVV.

  • Performance when call BAPI_SALESORDER_CHANGE ?

    Hi, All:
    When I call the following function module to update partner associated to contract.
    If there are about 30,000 partner associated this one contract.  Updating performance is too bad.
    Is there any good idea to improve performance for this case.
    CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
        EXPORTING
          salesdocument    = v_vbeln  ( contract number)
          order_header_inx = li_bapi_ord_indx
        TABLES
          return           = li_bapi_return
          partnerchanges   = li_partnerchanges. ( partners )
    Any help is appreciated!

    Hi
    30k partners is a very big number, but u should try to understand where are the bottle necks, we can't help you without to know where the problem is.
    Perhaps a your custom control in some user-exits could be the problem.
    Max

  • BAPI  'BAPI_SALESORDER_CHANGE'

    Hello guru's,
    I am trying to figure out why my bapi is not working. I hope that someone can help me out.
      SELECT *
        FROM vbak
        INTO TABLE it_vbak
        WHERE vbeln = '3245349'.
      LOOP AT it_vbak into wa_vbak.
        CLEAR : s_bapisdh1 , s_bapisdh1x.
        MOVE : 'U'  TO s_bapisdh1x-updateflag,
               'X'  TO s_bapisdh1x-dlv_block,
               'Z9' TO s_bapisdh1-dlv_block.
        CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
          EXPORTING
            salesdocument    = wa_vbak-vbeln
            order_header_in  = s_bapisdh1
            order_header_inx = s_bapisdh1x
          TABLES
            return           = it_bapiret2.
        CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
    ENDLOOP
    Thanks.

    SELECT *
        FROM vbak
        INTO TABLE it_vbak
       you need to append the internal table before passing it to BAPI.
    WHERE vbeln = '3245349'.
      LOOP AT it_vbak into wa_vbak.
        CLEAR : s_bapisdh1 , s_bapisdh1x.
        MOVE : 'U'  TO s_bapisdh1x-updateflag,
               'X'  TO s_bapisdh1x-dlv_block,
               'Z9' TO s_bapisdh1-dlv_block.
             Append s_bapisdh1x.
            Append s_bapisdh1.
        CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
          EXPORTING
            salesdocument    = wa_vbak-vbeln
            order_header_in  = s_bapisdh1
            order_header_inx = s_bapisdh1x
          TABLES
            return           = it_bapiret2.
        CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
    ENDLOOP

  • BAPI 'BAPI_SALESORDER_CHANGE' - Change a field

    Hi all!
    I am doing an exercise which it's necessary to change just one field (PO number) in a sales order using the BAPI from the subject. After the execution of the BAPI, "return" table shows the following message:
    E   |V2                  |051   |Terms of delivery FH are not defined.    <
    E   |V4                  |219   |Sales document 0000001666 was not changed<
    Here follows the code:
    DATA: " for BAPI use
        v_vbeln LIKE vbak-vbeln, " order that i would like to change
        v_order_header_in LIKE bapisdh1,
        v_order_header_inx LIKE bapisdh1x,
        v_purch_no_c LIKE bapisdh1-purch_no_c, "
        v_return LIKE TABLE OF bapiret2.
    INITIALIZATION.
      p_vbeln = 1666.
      v_order_header_inx-updateflag = 'U'.
      v_order_header_inx-purch_no_c = 'X'.
      CONCATENATE 'test_' v_purch_no_c INTO v_purch_no_c.
      v_order_header_in-purch_no_c = v_purch_no_c.
      v_order_header_inx-purch_no_c = 'X'.
    CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
        EXPORTING
          salesdocument               = v_vbeln
          order_header_in             = v_order_header_in
          order_header_inx            = v_order_header_inx
        TABLES
          return                      = v_return.
    If sy-subrc = 0.
      CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
    What does the error "Terms of delivery FH are not defined" mean? Did i forget to import an obligatory entry?
    Thanks a lot!

    Hi guys!
    after a lot of tries i found what this error means. Let me explain what was the problem:
    I was trying to update a single field at the sales order (po number), but l didn't see that this order had another field with a value ("FH") which was deleted and was get from another table.
    So as you just specify in BAPI which fields you would like to change when in an update, problably the BAPI try to keep the rest of the fields without doing any kind of check. And this resulted in my problem with that error message.
    Can i go ahead at this and ask if there is a way to make BAPI check the fields not specified at the import of the function?
    Thanks a lot for everybody who tried to help me.

  • Can't update Configuration via BAPI  BAPI_SALESORDER_CHANGE

    According to  Note 562124 - Configuration change via BAPI.
    I create a customer  program to change characteristic value in SO by BAPI_SALESORDER_CHANGE
    It is confused , I can change the 'from value' (BAPICUVA-VALUE) successfully, but I can't change the 'To value' (BAPICUVAL-VALUE_TO)  for characteristic.
    What is the reason, anyone come across this problem?

    Any suggestion?

  • Performance of BAPI's to create Leads and Activities

    Hi,
    I'm using the BAPI's BAPI_LEAD_CREATEMULTI and BAPI_ACTIVITYCRM_CREATEMULTI to create Leads and Activities.
    The scenario is:
    1) The input file has 3 types of records coming in
       (a) Leads only
       (b) Activities only (Prospect Lead activities)
       (c) LEad + Activity (rescheduled activities)
    2) Depending on the type of record, I'm required to create the relevant order and if required link the lead and activity (scenario - C)(using the FM CRM_DOC_FLOW_MAINTAIN_OW).
    3) In addition to this, I'm also required to link campaign elements to both Leads and Activities (done within the BAPI's BAPI_LEAD_CREATEMULTI and BAPI_ACTIVITYCRM_CREATEMULTI in the doc_flow structure).
    ISSUE:
    The issue that I am facing is that it is taking a lot of time to create these. I'm basically running a custom conversion program for LEads and Activities. The rate is almost 6-8 secs for each record, and we have about 500,000 records to be converted.
    Also, I'm having to use the following function modules after the creation of Leads and Activities:
    1) CRM_MA_ACT_SAVE - to set the status of the activity to OPEN or IN PROGRESS. This is being done after the creation of an activity because the BAPI BAPI_ACTIVITYCRM_CREATEMULTI seems to always default the status to OPEN.
    2) CRM_ORDER_CHANGE_STATUS - to set the status of the LEad to OPEN or IN PROGRESS. This is being done after the creation of an activity because the BAPI BAPI_LEAD_CREATEMULTI seems to always default the status to OPEN.
    3) BAPI_LEAD_ATT_CHANGE - to set the STATUS SINCE field for a Lead. This is being done because I'm unable to set the STATUS_SINCE field using the BAPI BAPI_LEAD_CREATEMULTI.
    The logic being used within the code is to process a batch of records (500/1000 records - value is an input selection parameter) from the input file in one go, and then commit all of them after their creation. After this, the next batch of records is again processed and committed.
    We've also tried to create LEads and Activities record by record and not in batches... but the performance still remains the same.
    I'm not sure what is slowing down the process. If whether it is all the commits, or if it is the additional use of the FM's to change the 'status' and 'Stauts-since' values after having committed the leads and activities.
    When we look at the LEads and Activities that are created, everything looks fine. It is only that the performance is really slow.
    Thanks for all your patience and suggestions,
    - Akarsh

    In order to improve the performance you could use several processes. Just start you conversion-program with several variants at the same time.
    Last time I converted 80.000 contracts it took me 6 hours with 5 processes.
    Hopes this helps.

  • Performance of BAPI's to create Leads and Activities in CRM

    Hi,
    I'm using the BAPI's BAPI_LEAD_CREATEMULTI and BAPI_ACTIVITYCRM_CREATEMULTI to create Leads and Activities.
    The scenario is:
    1) The input file has 3 types of records coming in
    (a) Leads only
    (b) Activities only (Prospect Lead activities)
    (c) LEad + Activity (rescheduled activities)
    2) Depending on the type of record, I'm required to create the relevant order and if required link the lead and activity (scenario - C)(using the FM CRM_DOC_FLOW_MAINTAIN_OW).
    3) In addition to this, I'm also required to link campaign elements to both Leads and Activities (done within the BAPI's BAPI_LEAD_CREATEMULTI and BAPI_ACTIVITYCRM_CREATEMULTI in the doc_flow structure).
    ISSUE:
    The issue that I am facing is that it is taking a lot of time to create these. I'm basically running a custom conversion program for LEads and Activities. The rate is almost 6-8 secs for each record, and we have about 500,000 records to be converted.
    Also, I'm having to use the following function modules after the creation of Leads and Activities:
    1) CRM_MA_ACT_SAVE - to set the status of the activity to OPEN or IN PROGRESS. This is being done after the creation of an activity because the BAPI BAPI_ACTIVITYCRM_CREATEMULTI seems to always default the status to OPEN.
    2) CRM_ORDER_CHANGE_STATUS - to set the status of the LEad to OPEN or IN PROGRESS. This is being done after the creation of an activity because the BAPI BAPI_LEAD_CREATEMULTI seems to always default the status to OPEN.
    3) BAPI_LEAD_ATT_CHANGE - to set the STATUS SINCE field for a Lead. This is being done because I'm unable to set the STATUS_SINCE field using the BAPI BAPI_LEAD_CREATEMULTI.
    The logic being used within the code is to process a batch of records (500/1000 records - value is an input selection parameter) from the input file in one go, and then commit all of them after their creation. After this, the next batch of records is again processed and committed.
    We've also tried to create LEads and Activities record by record and not in batches... but the performance still remains the same.
    I'm not sure what is slowing down the process. If whether it is all the commits, or if it is the additional use of the FM's to change the 'status' and 'Stauts-since' values after having committed the leads and activities.
    When we look at the LEads and Activities that are created, everything looks fine. It is only that the performance is really slow.
    Thanks for all your patience and suggestions,
    - Akarsh

    In order to improve the performance you could use several processes. Just start you conversion-program with several variants at the same time.
    Last time I converted 80.000 contracts it took me 6 hours with 5 processes.
    Hopes this helps.

  • Extension of BAPI - BAPI_SALESORDER_CHANGE

    Hi All,
    I have added some custome fields in the table VBAK. Now i want to update these fields using BAPI_SALESORDER_CHANGE which are not present in it currently. So how can i extend BAPI to update the custom fields ???

    Hi,
    first, go to SE37 and check the BAPI's default documentation for the EXTENSIONIN table parameter. There, it explains analytically what you have to do in order to update Z fields that have been appended in VBAK or VBAP through the standard BAPI.
    NOTE that you MUST have updated accordingly the tables/structures VBAKKOZ, VBAKKOZX, BAPE_VBAK, BAPE_VBAKX
    So, if the sales order number is 1000000001 and your added custom field is named ZZCUST with length 5 chars and you want to set the ZZCUST value to ABCDEm, then append a line in EXTENSIOIN as follows:
    EXTENSIONIN-STRUCTURE = BAPE_VBAK
    EXTENSIONIN-VALUEPART1 = 1000000001ABCDE
    Also, call the BAPI passing the 1000000001 (sales order document number to the SALESDOCUMENT parameter and set the UPDATEFLAG field of the structure ORDER_HEADER_INX to 'X' to make the BAPI actually update the sales document header data (includind the new Z field).
    Try it and READ the BAPI's standard documentation!
    Reward if it helps,
    Regards,
    George

  • Custom fields update using BAPI: BAPI_SALESORDER_CHANGE

    Hi,
          I have append one field into VBAP Table, and i want to update that filed value by using BAPI_SALESORDER_CHANGE FM. I have done all the coding but still its not updating the table. I have checked with SAP fields like order quantity, its upadating the database but the custom fileds are not upadting.
    steps i have done:  Append field to :           VBAP,BAPE_VBAP,VBAPKOZ
                                   Append Check field to : BAPE_VBAPX,VBAPKOZX
    Here is the code : plz check and add ur comments
      DATA : l_wa_bapiparex        TYPE bapiparex,
             l_wa_ord_header        TYPE bapisdh1x,
             l_itab_bapiparex      TYPE STANDARD TABLE OF bapiparex INITIAL SIZE 0,
             l_itab_return         TYPE STANDARD TABLE OF bapiret2   INITIAL SIZE 0,
             l_wa_item              TYPE bapisditm,
             l_itab_item           TYPE STANDARD TABLE OF bapisditm  INITIAL SIZE 0,
             l_wa_itemx             TYPE bapisditmx,
             l_itab_itemx          TYPE STANDARD TABLE OF bapisditmx INITIAL SIZE 0,
             ORDER_HEADER_IN       LIKE BAPISDH1.
      l_wa_ord_header-updateflag = 'U'.
      ORDER_HEADER_IN-REF_DOC = '0000000244'.
    *Populate Item detail
      l_wa_item-itm_number = '000010'.
      l_wa_item-NET_WEIGHT = '5000'.
      APPEND l_wa_item TO l_itab_item.
    *Populate Item detail checkbox
      l_wa_itemx-itm_number = '000010'.
      l_wa_itemX-NET_WEIGHT = 'X'.
      l_wa_itemx-updateflag = 'U'.
      APPEND l_wa_itemx TO l_itab_itemx.
      l_wa_bapiparex-structure = 'BAPE_VBAP'.
      l_wa_bapiparex-valuepart1+0(10) = '0000000244'.
      l_wa_bapiparex-valuepart1+10(6) = '000010'.
      l_wa_bapiparex-valuepart1+16(15) = 'ABCDEF'.
      APPEND l_wa_bapiparex TO l_itab_bapiparex.
      CLEAR l_wa_bapiparex.
      l_wa_bapiparex-structure = 'BAPE_VBAPX'.
      l_wa_bapiparex-valuepart1+0(10) = '0000000244'.
      l_wa_bapiparex-valuepart1+10(6) = '000010'.
      l_wa_bapiparex-valuepart1+17(1) = 'X'.
      APPEND l_wa_bapiparex TO l_itab_bapiparex.
      clear l_wa_bapiparex.
      CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
        EXPORTING
          salesdocument    = '0000000244'
          order_header_in  = ORDER_HEADER_IN
          order_header_inx = l_wa_ord_header
        TABLES
          return           = return
          order_item_in    = l_itab_item
          order_item_inx   = l_itab_itemx
         schedule_lines   = l_itab_schedule
         schedule_linesx  = l_itab_schedulex
          extensionin      = l_itab_bapiparex.
    IF SY-SUBRC = 0.
      CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
    EXPORTING
      WAIT          = 'X'
    IMPORTING
      RETURN        =
    ELSE.
       RAISE ERROR.
    ENDIF.
    I HAVE GONE THROUGH DEBUGGING AND FOUND ALL ARE GOING FINE...ITS UPDATING VBKOM AND VBKOMX STRUCTURE BUT AT LAST ITS NOT UPDATING THE CUSTOM FIELDS
    Thanks,
    Baidya

    Sorry guys........this code is correct one.......there is a problem in IDES....i tried in client server its working fine
    If anyone is having this type of requirement then copy this program.
    thanks,
    Baidya

  • COMMIT and PERFORMANCE and BAPI UPDATE

    When looping through  about 10 000 documents it goes initially quite fast but in the end it is very slow. Is it a basis problem?
    Initially it takes about 0,5 sec and in the end each document update takes about 20 sec. In total about 15 hours!
    My basis consultant says I should do a commit as seldom as possible. But I want to do it after each document (=a LUW?). I could add a counter and do a commit each 100:th document, but I do not like it.
    Pseudo logic.
    loop at itab (about 20 000 recs)
    ..CALL FUNCTION 'BAPI_CTRACDOCUMENT_CHANGE'
    ..Update of a ZTABLE
    ..COMMIT WORK.
    ..GET RUNTIME+display RUNTIME-diff
    endloop.

    Hi mikael,
    1. My basis consultant says I should do a commit as seldom as possible
    Yes, they are right.
    If we don't do commit,
    then,
    in the database, the rollback area
    goes on increasing, increasing,
    and occupies memory and gets slow.
    2. I could add a counter and do a commit each 100
    Thats the best practical solution.
    The figure 100 or 50 or 200 etc,
    one has to figure out practically.
    regards,
    amit m.

  • Calling a Sales Order Change BAPI in a Sales Order Exit

    Functional Requirement:
    While creating a Sales Order with Reference to another Sales Order, on saving the new sales order, change something in the referenced sales order.
    I am trying to achieve the same by doing the following:
    In the standard SAP user exit called during saving the new sales order USEREXIT_SAVE_DOCUMENT I am calling the BAPI BAPI_SALESORDER_CHANGE on the referenced Sales Order.
    However the BAPI is unable to change the other sales order giving an error Enter the document number. I am specifying the Document Number while calling the BAPI, so I know that is not the error.
    I just wish to know whether it is technically possible to call a BAPI to update another Sales Order while we are currently saving one Sales Order.

    Hi Girish,
    If it works correctly when run seperately and you are sure the data passed into the BAPI is exactly the same then it may be something like table locks or similar causing your original problems...
    What about packaging up your working Z program into a custom function module and calling that from within USEREXIT_SAVE_DOCUMENT as a seperate task (IN NEW TASK) and building in a slight delay of say 5 seconds at the start of your code?
    I'll be honest, this isn't an ideal solution but might be sufficient to resolve your issues.  I'd be inclined to see if you could just run your Z program as a background process every 5 minutes or so to capture any changes and perform updates but if this is a no no from your functional people I'm not sure what else to suggest sorry.  I've never personally had to update a document from within the save routine of another document so can't give any advice based on my own experiences sorry.
    Gareth.

Maybe you are looking for

  • Performance Issue in Oracle EBS

    Hi Group, I am working in a performance issue at customer site, let me explain the behaviour. There is one node for the database and other for the application. Application server is running all the services. EBS version is 12.1.3 and database version

  • Why does youtube keep pausing?

    Can anybody tell me why youtube keeps pauseing when I try to watch something. How do I fix it

  • Download flash web page errors

    I am using Chromium without flash player. I go to this page to install flash player http://get.adobe.com/flashplayer/ and just get an empty div. div id="content-body">              <script type="text/javascript">             registerOnLoad(function()

  • Incremental commit

    Hi All, We have a table with more than 64 lacs of recods. and the direct deletion will cause the buffer problem. So, we planned for the bulk collect .. Forall deletion with limit of 50000. Is there any alternative way for the same with oracle 10g fea

  • Export playlist and edit using excel or other editor

    I have a lot of duplicates due to the same songs being downloaded through different albums (i.e. greatest hits, compilations). I have used a playlist to display all songs and then I displayed the duplicates using the "duplicates" function. I would li