Error saving multiple Sales document modified by the BAPI (with cnfg)

Dear Sir/Madam,
I have a requirement for which i am modifying a Sales Quotation and
then Sales Contract created w.r.t. Sales Quotation. I am using the
following function modules in sequence specified to modify the
documents:
1. BAPI_CUSTOMERQUOTATION_CHANGE - to change Sales Quotation
2. SD_SALESDOCUMENT_CHANGE - to change the Sales Contract with the
parameter CALL_FROM_BAPI marked as 'X' if the quotation was processed
successfully but not saved to the database
The BAPI transaction commit is called only after both the Sales
documents have been processed successfully. In case there is an error
in updation in any one of the Sales documents then the
BAPI_TRANSACTION_ROLLBACK is called.
After successful processing both the documents are getting commited
with the correct reference of the Quotation item in the contract items.
Now when i view the Sales Contract all updations have happened
successfully and i can view the data properly, also the items
configuration data.
When i go to view the Sales Quotation i can see that the new item which
needed to be added to this document has been added successfully however
when i go to view the configuration data for the newly added item i get
an error V1854 , 'Internal error in communication between configuration
and sales document in the form GET_CONFIG_MODE'.
If i do a commit individually after the each function module call then
all documents are saved properly and can be viewed without any errors.
Please advise why this error is happening.
warm regards,
Nitesh

I think I found a way to get it to do what I want,,,
1) Use the first signature collection lock to lock only the fields that that person is signing-off on.
2) The next manager then signs off and locks only his comments and text boxes, as well as the signature of the preceeding manager. This way text fields are only locked by one signature collection and thus to edit anything you have to clear that manager's signature to edit the related text boxes, then to re-sign that section you must clear the other (higher level) signatures to open up the signature field for resigning,,, I think this is providing the protection I want,,, Yea,,, let's get this form back into our stupid ISO system ;)

Similar Messages

  • Error While Creating Sales Document - on a new rollout

    Dear Friends,
            While going for new Plant Creation on a Rollout, i am getting the following error while creating Sales Order,
    Kindly suggest the needy to me,
    " _Template and one-time material processing is not activated                                                                               
    No determination routine is specified for the SD documents for the 
    permitted combinations                                                                               
    The combination of sales organization, document category, and      
    document type or delivery type for the SD document is not permitted_ "
    Thanks & Regards
    T.Arulvanan

    Dear Freind,
    Have you assigned the Sales Area to the Document types
    T-code : OVAZ.
    Also Check the Sales Applications  V/c2
    Can you double click on the error and See what is the datails of the error appearing?
    Regards,
    Amlan Sarkar

  • Error in assigning sales document type to sales area

    Dear All,
    I am trying to assing sales document type to sales area, but system is not allowing me to do that
    I am having this error message
    " First, maintain the sales area <1000/14/00> as a common sales area, and
      then assign allowed sales document types. This means: Complete the IMG
      activity Assign sales area to sales document types in the sequence
      entered here."
    Note:
    I have never created a distribution channel "14" and division "00" then why system is asking me to define this as a common sales area.
    How can I maintain common sales area ?

    Dear Ali,
    1.You go to VOR1 transaction here you check what is the distribution channel assigned as common distribution channel for your sales organisation and distribution channel ,if it is improper then maintain correct Distribution channel.
    2.You go to VOR2 transaction here you check what is the division assigned as common division to your sales organisation and Divisionif ,it is improper then maintain correct Division.
    3.You go to OVAO transaction here you assign reference sales organisation to your sales organisations.
    4.You go to OVAM transaction here you assign reference distribution channel to your sales organisation and common distribution channel.
    5.You go to OVAN transaction here you assign reference division to your sales organisation and common division.
    6.Finally you assin sales document type to your referenced sales area.
    I hope this will help you,
    Regards,
    Murali.
    Edited by: Murali Mohan.Tallapaneni on Nov 11, 2008 5:58 AM

  • ATP check for multiple materials on multiple sales document

    Hi,
    System 4.70
    Is it possible to carry out an ATP check for multiple materials on multiple sales documents.
    I have written a bespoke program and the program requires an ATP check to be performed for each material and sales document, I am currently using BAPI_MATERIAL_AVAILABILITY which is bringing back the necessary information but it's a bit slow.
    Does any one have any ideas please.
    Regards
    J-J

    The ATP Check using the BAPI is done per material and plant. If you're looping through sales documents and then materials you're probably doing the ATP check for the same material over and over again.
    Just get the list of materials you need and the corresponding plants and call the BAPI for each of them.
    Also do a run-time analysis (tcode SE30) to check exactly what slows down your program.
    regards.

  • Last year I updated my system to OSX 10.9.1.  Ever since whenever I type an email message it is saved multiple times (sometimes dozens, if the message is long) in multiple places (Saved, Trash, etc.)  Any cure?

    Last year I updated my IMac system to OSX 10.9.1.  Ever since whenever I type an email message it is saved multiple times (sometimes dozens, if the message is long) in multiple places (Saved, Trash, etc.)  Any cure for this annoying (and growing) problem?  Thanks.

    You have Sophos installed, which is certainly capable of causing panics. However, the panic logged above happened in safe mode, and wasn't caused by any third-party software. That type of panic is usually caused by a memory fault.
    If your model has user-replaceable memory, and you've upgraded the memory modules, reinstall the original memory and see whether there's any improvement. Be careful not to touch the gold contacts. Clean them with a mild solvent such as rubbing alcohol. Aftermarket memory must exactly match the technical specifications for the model.
    Apple Diagnostics or the Apple Hardware Test, though generally unreliable, will sometimes detect a fault. A negative test can't be depended on. Run the extended version of the test, if applicable.

  • IDOC Error V1 042 - Sales document X is currently being processed by user X

    Hello Experts,
    I am using the IS-Retail solution of SAP and I am facing a IDOC Error which keeps the IDOC in Status 51. I traced the Error Message and it was V1 042. I am using an Inbound IDOC 'SHP_OBDLV_CREATE_STO01' to create the STOs (Deliveries) using the POs and there is a locking issue of the PO giving error message 'Sales document XXX is currently being processed by user XXX'.
    I have created a backgroung job using a program to post the STOs using IDOCs that picks up multiple files from Application Server and processes them one by one. Now when 2 or more files use the same PO then this error occus.
    I added a couple of minutes of wait time between the file processing but that did not help.
    Please let me know if you have faces same situation and what solution did you apply.
    Regards,
    PS

    Hopefully you have fixed this by now, but for anyone else who might be looking at this problem.  We had this problem and we had the 2 programs check to see if the other was already runing.  If so the program would submit itself for a number of minutes, different for both programs, and then exit.  We also, and just before this, checked to make sure that there were not 2 of the running programs running and if so to exit.  This was necessary because re-scheduling could put a program in conflict with itself.  I hope that this may help someone.  We used the join V_OP and searched for the program name, not the job name.
    Kevin

  • Link multiple sales documents to a credit memo

    Hi,
    Long time ago someone showed me standard configuration  ( SPRO -Sales and Distribution -> Basic Functions) -Where a credit memo can be linked to multiple sales order/billing document.
    In the credit memo screen, you enter multiple sales order/billing document in each row and corresponding credit memo in adjacent column.
    Does anyone know this?
    Thanks.

    Hi,
    If you want to link one credit memo with multiple sales/billing document
    Then create credit memo with reference to previous document when you are on main screen of credit memo
    Again go to SALES DOCUMENT >>> create with reference
    then specify another previous document and click on copy the item from second previous document should be appear
    Note : Due to system unavailable I am not tested this please try
    As far as my understanding it will work if customer from previous document are same
    kapil

  • Technical error extracting B1 Sales documents

    Hello,
    I have a Business Process to extract B1 Sales documents to BW.
    The process is scheduled and when it start running I get following technical error:
    com.sap.b1i.xcellerator.XcelleratorException: XCE001 Nested exception: com.sap.b1i.bizprocessor.BizProcException: BPE001 Nested exception: com.sap.b1i.xcellerator.XcelleratorException: XCE001 Nested exception: com.sap.b1i.xcellerator.XcelleratorException: XCE001 Nested exception: java.lang.OutOfMemoryError: Java heap space (failed to allocate 18997024 bytes)
    ¿Is there any posibility to limit the memory in order to avoid the error?
    Regards,
    Jose

    Hello Jose,
    This  error usually occurs on a 64 bit environment using 64 bit Installation files and the root cause is the assigned memory in SAP Business One integration service is set too low.
    You should raise the maximum memory pool of SAP Business One integration services (Tomcat Services) to greater than 1500 MB.
    Hope that helps.
    Cheers,
    Lisa

  • Crystal Report - multiple sales document types

    In XLR, I can easily drag 'DocNum', 'DocDate', 'Sales Doc Type' fields and specify the filter to show sales doc type equal to A/R invoice and A/R credit memo. It neatly shows various types of sales documents and display them in rows.
    In crystal, I have to drag the 'DocNum', 'DocDate' fields for A/R Invoice, A/R credit memo individually under different columns. Is there a way I can dispaly mixed sales document types in rows? Thanks.

    Hi,
    In XLR, you get the data from JDT1 table. You can do the same for CR.
    Thanks,
    Gordon

  • Sales document not able to save with rection reasons after delete the reference order

    Hi Experts,
    Good day!!
    My user wrongly created a sales order with sales document type as ZOR instead of ZORS.
    Then with reference to ZOR sales order, user created another sales order with sales document type as ZORS.
    Once he created sales order(ZORS)  with document type ZOR, he has deleted ZOR sales order.
    But after deletion of ZOR sales order user has to make those sales order line items as reasons for rejection but system not allowed to change.
                          Request you to please help how to over come this issue.
    Test case on above scenario:
    Same above scenario am trying to do but system not allowing to delete the sales order and the information message shows as "
    Item 000010 cannot be deleted (CRM does not allow deletion) Message no. V2251" Plz help this one also.
    Regards,
    Sree

    Hi,
    I've tried to simulate the scenario you were in in standard SAP system, but failed to have it reproduced, and therefore, I suppose this issue could be something relevant to the specific environment you have
    my exercise:
    create a sales order with type OR, and then create another one with OR with reference to the first one, and then have the first one deleted, check in document flow from the second order and make sure the first one is marked 'archived', and then set rejection code for the line item in the second order - I was able to save it => at last, I've got two orders, the first one archived, while the second one completed

  • How to do search with multiple texts across documents and rename the file with found text?

    Hello:
    I'm trying to do the batch search across the multiple documents and rename the file (or save as) after the found word?
    In example:
    I have many unique texts and would want to search across the multiple documents.
    If a document is found with that unique text then, the document is either renamed or save as with that unique text. 
    So, I could know what unique text that file holds.
    How do I do that?
    Let me know.
    Thanks

    Welcome to the forum!
    When you want to post a block of code, you can enclose it with the mark ups { code }
    That is the key word code surrounded by curly brackets, but without the spaces
    You seem to be running a very old (and unsupported release of the database)
    7.3 has not been a current release for about 10 years.
    It's probably been that long since I've used this technique, but i think it should work.
    You should consider welcoming your system to the 21st century by upgrading to a supported release ;-)
    If you used split to chop up your export file, use cat or dd to reassemble it.
    So, something like this:
    mknod bk.dmp p
    cat xaa xab xac xad xae xaf xag xah xai > bk.dmp &
    imp SYSTEM/$PASSWD parfile=imp_bk.parfile
    rm bk.dmp
    $ cat imp_bk.parfile
    file=bk.dmp
    log=imp.log
    full=y
    buffer=1048576
    ignore=y
    commit=y let us know if still have problems.
    Good Luck!

  • Warning 'sales document is not yet complete' with BAPI_SALESORDER_CHANGE after deleting correspnding delivery

    Hi,
    I'm trying to change a sales order (add some positions) after deleting the corresponding delivery to it.
    But I get the warning "sales document is not yet complete: Edit Data", because of incomplete dates in schedule lines.
    The schedule lines are filled correctly.
    When I have a Sales Order without corresponding delivery, this Order could be changed successful with BAPI BAPI_SALESORDER_CHANGE.
    But if there is a Sales Order with corresponding Delivery (where I do delete the delivery first with BAPI BAPI_OUTB_DELIVERY_CHANGE ), than the BAPI for changing the Order gives a warning "sales document is not yet complete: Edit Data".
    This is confusing.
    Is there something I have to consider when changing a sales order after deleting its delivery?
    Coding:
    "1. delete delivery to sales order
    CLEAR ls_header_data.
       CLEAR ls_header_ctrl.
       ls_header_data-deliv_numb = iv_vbeln.
       ls_header_ctrl-deliv_numb = iv_vbeln.
       ls_header_ctrl-dlv_del    = abap_true. "set flag for deletion
    * call BAPI to delete delivery
       CALL FUNCTION 'BAPI_OUTB_DELIVERY_CHANGE'
         EXPORTING
           header_data    = ls_header_data
           header_control = ls_header_ctrl
           delivery       = iv_vbeln
         TABLES
           return         = et_msg.
    IF ...
    COMMIT WORK AND WAIT.
    ELSE.
    ENDIF.
    "2. change Sales order (adding new item positions)
    "add new/changed data
       LOOP AT IT_NEW_ITEMS ASSIGNING <ls_new_items>.
         CLEAR: ls_order_item_in,
                ls_order_item_inx,
                ls_schedule_line,
                ls_schedule_linex.
         add 10 to lv_posnr.
         ls_order_item_in-itm_number = lv_posnr. "posNr
         ls_order_item_in-material = <ls_new_items>-matnr. "material
         ls_order_item_in-target_qty = <ls_new_items>-menge.  "quantity
         ls_order_item_in-sales_unit = <ls_new_items>-MEINH. "sales unit
         APPEND ls_order_item_in TO lt_order_item_in.
         "fill order item check table
         ls_order_item_inx-itm_number = lv_posnr.
         ls_order_item_inx-updateflag = 'I'.
         ls_order_item_inx-material   = abap_true.
         ls_order_item_inx-target_qty = abap_true.
         ls_order_item_inx-sales_unit = abap_true.
         APPEND ls_order_item_inx TO lt_order_item_inx.
         "schedule lines
         ls_schedule_line-itm_number   = lv_posnr. "posnr
         ls_schedule_line-sched_line   = '1'.
         ls_schedule_line-req_qty      = ls_order_item_in-target_qty. "quantity
         ls_schedule_line-req_date      = lv_lfdate.               "schedule line date
         APPEND ls_schedule_line TO lt_schedule_line.
         "schedule lines check table
         ls_schedule_linex-itm_number   = lv_posnr. "posnr
         ls_schedule_linex-sched_line   = '1'.
         ls_schedule_linex-req_qty      = abap_true. "quantity
         ls_schedule_linex-req_date      = abap_true.               "schedule line date
         ls_schedule_linex-UPDATEFLAG  = 'I'.
         APPEND ls_schedule_linex TO lt_schedule_linex.
       ENDLOOP.
       "call bapi to add items to sales order
       CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
         EXPORTING
           SALESDOCUMENT    = iv_sales_order
           ORDER_HEADER_INX = ls_order_header_inx
         TABLES
           RETURN           = et_msg
           ORDER_ITEM_IN    = lt_order_item_in
           ORDER_ITEM_INX   = lt_order_item_inx
           SCHEDULE_LINES   = lt_schedule_line
           SCHEDULE_LINESX  = lt_schedule_linex.
    IF....
    COMMIT WORK AND WAIT.
    ELSE.
    ENDIF.

    The first thing I would try is to use fm BAPI_TRANSACTION_COMMIT (with parameter WAIT = 'X') instead of COMMIT WORK AND WAIT which is directly put in your code (this is almost the same but not exactly).
    Then make sure that if your code performs two BAPI calls one after the other, they are separated with either a call to fm BAPI_TRANSACTION_COMMIT or BAPI_TRANSACTION_ROLLBACK.
    Then - if the above is applied and still does not help - I would suspect that some invalid / incomplete data is passed to fm BAPI_SALESORDER_CHANGE.
    regards

  • Sales document was not changed BAPI

    Hi Experts,
            Am trying to upload sales documents using BAPI_SALESDOCU_CREATEFROMDATA1, but am getting an error like "sales document was not changed". here is my sample code. Thanks in Advance.
    TYPE-POOLS : TRUXS.
    types : BEGIN OF TY_file,
    auart TYPE auart,
    vkorg TYPE vkorg , "
    vtweg TYPE vtweg ,
    spart TYPE spart ,
    KUNNR  TYPE kunnr ,
    KUNNR1  TYPE kunnr ,
    matnr TYPE matnr  ,
    dzmeng TYPE dzmeng  ,
    WERKS_d TYPE werks_d ,
    END OF TY_file.
    *TYPES : tt_file TYPE STANDARD TABLE OF ty_file.
    data : it_file TYPE TABLE OF TY_FILE,
                   wa_file TYPE TY_file.
    PARAMETERs : p_file TYPE IBIPPARMS-PATH.
    at SELECTION-SCREEN on VALUE-REQUEST FOR p_file.
       PERFORM browse_file.
       START-OF-SELECTION.
       PERFORM LOAD_FLAT_FILE.
       PERFORM CALL_BAPI_CREATE.
    FORM browse_file .
    CALL FUNCTION 'F4_FILENAME'
      IMPORTING
        FILE_NAME           = p_file
    ENDFORM.                    " browse_file
    FORM LOAD_FLAT_FILE .
       DATA : LT_RAW TYPE TRUXS_T_TEXT_DATA.
       CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
         EXPORTING
           I_FIELD_SEPERATOR          = 'X'
          I_LINE_HEADER              = 'X'
           I_TAB_RAW_DATA             = LT_RAW
           I_FILENAME                 = P_FILE
         TABLES
           I_TAB_CONVERTED_DATA       = IT_FILE
        EXCEPTIONS
          CONVERSION_FAILED          = 1
          OTHERS                     = 2
       IF SY-SUBRC = 0.
         MESSAGE 'UPLOADED' TYPE 'I'.
           ENDIF.
    ENDFORM.                    " LOAD_FLAT_FILE
    FORM CALL_BAPI_CREATE .
    DATA: v_vbeln            LIKE vbak-vbeln.
    DATA: header             LIKE bapisdhead1.
    DATA: headerx            LIKE bapisdhead1x.
    DATA: item               LIKE bapisditem  OCCURS 0 WITH HEADER LINE.
    DATA: itemx              LIKE bapisditemx OCCURS 0 WITH HEADER LINE.
    DATA: partner            LIKE bapipartnr  OCCURS 0 WITH HEADER LINE.
    DATA: return             LIKE bapiret2    OCCURS 0 WITH HEADER LINE.
    DATA: lt_schedules_inx   TYPE STANDARD TABLE OF bapischdlx
                              WITH HEADER LINE.
    DATA: lt_schedules_in    TYPE STANDARD TABLE OF bapischdl
                              WITH HEADER LINE.
    LOOP AT IT_FILE INTO WA_FILE.
       header-doc_type = WA_FILE-auart.
       headerx-doc_type = 'X'.
       header-sales_org = WA_FILE-vkorg.
       headerx-sales_org = 'X'.
       header-distr_chan  = WA_FILE-vtweg.
       headerx-distr_chan = 'X'.
       header-division = WA_FILE-spart.
       headerx-division = 'X'.
       headerx-updateflag = 'I'.             " flag for create a new document
       partner-partn_role = 'AG'.
       partner-partn_numb = WA_fILE-KUNNR.
       APPEND partner.
       partner-partn_role = 'WE'.
       partner-partn_numb = WA_fILE-KUNNR1.
       APPEND partner.
       itemx-updateflag = ''.
       item-itm_number = '000010'.
       itemx-itm_number = 'X'.
       item-material = WA_FILE-matnr.
       itemx-material = 'X'.
       item-plant    = WA_FILE-WERKS_d.
       itemx-plant   = 'X'.
       item-target_qty = WA_fILE-dzmeng.
       itemx-target_qty = 'X'.
       APPEND item.
       APPEND itemx.
       lt_schedules_in-itm_number = '000010'.
       lt_schedules_in-sched_line = '0001'.
       lt_schedules_in-req_qty    = WA_FILE-DZmeng.
       APPEND lt_schedules_in.
       lt_schedules_inx-itm_number  = '000010'.
       lt_schedules_inx-sched_line  = '0001'.
       lt_schedules_inx-updateflag  = 'X'.
       lt_schedules_inx-req_qty     = 'X'.
       APPEND lt_schedules_inx.
       CALL FUNCTION 'BAPI_SALESDOCU_CREATEFROMDATA1'
            EXPORTING
                 sales_header_in     = header
                 sales_header_inx    = headerx
            IMPORTING
                 salesdocument_ex    = v_vbeln
            TABLES
                 return              = return
                 sales_items_in      = item
                 sales_items_inx     = itemx
                 sales_schedules_in  = lt_schedules_in
                 sales_schedules_inx = lt_schedules_inx
                 sales_partners      = partner.
    *  LOOP AT return WHERE type = 'E' OR type = 'A'.
    *    EXIT.
    WRITE : / RETURN-NUMBER, RETURN-TYPE, RETURN-MESSAGE.
    *  ENDLOOP.
    *  IF sy-subrc = 0.
    *    WRITE: / 'Error in creating document'.
    *  ELSE.
    *    COMMIT WORK AND WAIT.
    *    WRITE: / 'Document ', v_vbeln, ' created'.
    *  ENDIF.
    *  LOOP AT RETURN.
    *WRITE : / RETURN-NUMBER, RETURN-TYPE, RETURN-MESSAGE.
       ENDLOOP.
       END

    Hi Experts,
            Am trying to upload sales documents using BAPI_SALESDOCU_CREATEFROMDATA1, but am getting an error like "sales document was not changed". here is my sample code. Thanks in Advance.
    TYPE-POOLS : TRUXS.
    types : BEGIN OF TY_file,
    auart TYPE auart,
    vkorg TYPE vkorg , "
    vtweg TYPE vtweg ,
    spart TYPE spart ,
    KUNNR  TYPE kunnr ,
    KUNNR1  TYPE kunnr ,
    matnr TYPE matnr  ,
    dzmeng TYPE dzmeng  ,
    WERKS_d TYPE werks_d ,
    END OF TY_file.
    *TYPES : tt_file TYPE STANDARD TABLE OF ty_file.
    data : it_file TYPE TABLE OF TY_FILE,
                   wa_file TYPE TY_file.
    PARAMETERs : p_file TYPE IBIPPARMS-PATH.
    at SELECTION-SCREEN on VALUE-REQUEST FOR p_file.
       PERFORM browse_file.
       START-OF-SELECTION.
       PERFORM LOAD_FLAT_FILE.
       PERFORM CALL_BAPI_CREATE.
    FORM browse_file .
    CALL FUNCTION 'F4_FILENAME'
      IMPORTING
        FILE_NAME           = p_file
    ENDFORM.                    " browse_file
    FORM LOAD_FLAT_FILE .
       DATA : LT_RAW TYPE TRUXS_T_TEXT_DATA.
       CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
         EXPORTING
           I_FIELD_SEPERATOR          = 'X'
          I_LINE_HEADER              = 'X'
           I_TAB_RAW_DATA             = LT_RAW
           I_FILENAME                 = P_FILE
         TABLES
           I_TAB_CONVERTED_DATA       = IT_FILE
        EXCEPTIONS
          CONVERSION_FAILED          = 1
          OTHERS                     = 2
       IF SY-SUBRC = 0.
         MESSAGE 'UPLOADED' TYPE 'I'.
           ENDIF.
    ENDFORM.                    " LOAD_FLAT_FILE
    FORM CALL_BAPI_CREATE .
    DATA: v_vbeln            LIKE vbak-vbeln.
    DATA: header             LIKE bapisdhead1.
    DATA: headerx            LIKE bapisdhead1x.
    DATA: item               LIKE bapisditem  OCCURS 0 WITH HEADER LINE.
    DATA: itemx              LIKE bapisditemx OCCURS 0 WITH HEADER LINE.
    DATA: partner            LIKE bapipartnr  OCCURS 0 WITH HEADER LINE.
    DATA: return             LIKE bapiret2    OCCURS 0 WITH HEADER LINE.
    DATA: lt_schedules_inx   TYPE STANDARD TABLE OF bapischdlx
                              WITH HEADER LINE.
    DATA: lt_schedules_in    TYPE STANDARD TABLE OF bapischdl
                              WITH HEADER LINE.
    LOOP AT IT_FILE INTO WA_FILE.
       header-doc_type = WA_FILE-auart.
       headerx-doc_type = 'X'.
       header-sales_org = WA_FILE-vkorg.
       headerx-sales_org = 'X'.
       header-distr_chan  = WA_FILE-vtweg.
       headerx-distr_chan = 'X'.
       header-division = WA_FILE-spart.
       headerx-division = 'X'.
       headerx-updateflag = 'I'.             " flag for create a new document
       partner-partn_role = 'AG'.
       partner-partn_numb = WA_fILE-KUNNR.
       APPEND partner.
       partner-partn_role = 'WE'.
       partner-partn_numb = WA_fILE-KUNNR1.
       APPEND partner.
       itemx-updateflag = ''.
       item-itm_number = '000010'.
       itemx-itm_number = 'X'.
       item-material = WA_FILE-matnr.
       itemx-material = 'X'.
       item-plant    = WA_FILE-WERKS_d.
       itemx-plant   = 'X'.
       item-target_qty = WA_fILE-dzmeng.
       itemx-target_qty = 'X'.
       APPEND item.
       APPEND itemx.
       lt_schedules_in-itm_number = '000010'.
       lt_schedules_in-sched_line = '0001'.
       lt_schedules_in-req_qty    = WA_FILE-DZmeng.
       APPEND lt_schedules_in.
       lt_schedules_inx-itm_number  = '000010'.
       lt_schedules_inx-sched_line  = '0001'.
       lt_schedules_inx-updateflag  = 'X'.
       lt_schedules_inx-req_qty     = 'X'.
       APPEND lt_schedules_inx.
       CALL FUNCTION 'BAPI_SALESDOCU_CREATEFROMDATA1'
            EXPORTING
                 sales_header_in     = header
                 sales_header_inx    = headerx
            IMPORTING
                 salesdocument_ex    = v_vbeln
            TABLES
                 return              = return
                 sales_items_in      = item
                 sales_items_inx     = itemx
                 sales_schedules_in  = lt_schedules_in
                 sales_schedules_inx = lt_schedules_inx
                 sales_partners      = partner.
    *  LOOP AT return WHERE type = 'E' OR type = 'A'.
    *    EXIT.
    WRITE : / RETURN-NUMBER, RETURN-TYPE, RETURN-MESSAGE.
    *  ENDLOOP.
    *  IF sy-subrc = 0.
    *    WRITE: / 'Error in creating document'.
    *  ELSE.
    *    COMMIT WORK AND WAIT.
    *    WRITE: / 'Document ', v_vbeln, ' created'.
    *  ENDIF.
    *  LOOP AT RETURN.
    *WRITE : / RETURN-NUMBER, RETURN-TYPE, RETURN-MESSAGE.
       ENDLOOP.
       END

  • Error on commit: Another user has changed the row with primary key : Rec_10

    i am using jdev 11g R2
    i implemented a master form and two detail tables on a jspx page
    added createInsert, commit and rollback buttons
    actions from these buttons all are executed from a bean
    for entity attributes: refresh after insert and update are marked as checked
    i am using login page for authorizing the user by getting the user information from user table
    and then using the userid i am applying the setVisible property on some components at bean code
    when i am inserting a new row there is no problem, here i am generating the new id like 'Rec_10', using a database sequence
    but when i am trying to update a current record, it is showing the error --> Error on commit: JBO-25014: Another user has changed the row with primary key oracle.jbo.Key[Rec_22 ]
    on clicking the commit button and also it is not updating the record on database
    Thanx in Advance
    kumar
    Edited by: user10922309 on Nov 18, 2009 3:25 AM
    Edited by: user10922309 on Nov 18, 2009 4:28 AM

    Hi John
    thnq for your quick responce.
    here are the attribute details:
    Attribute Name: RecID, Type: String, Value Type: Expression, Value: 'Rec_' + (new oracle.jbo.server.SequenceImpl("Rec_SEQ_AN", object.getDBTransaction())).getSequenceNumber()
    Updatable: While New and Primary Key, Queryable, Persistent, Mandatory, Refresh After: Update, Refresh After: Update and Insert are markded as checked
    error details:
    oracle.jbo.RowInconsistentException: JBO-25014: Another user has changed the row with primary key oracle.jbo.Key[APP_22 ].
         at oracle.jbo.server.OracleSQLBuilderImpl.doEntitySelectForAltKey(OracleSQLBuilderImpl.java:1062)
         at oracle.jbo.server.BaseSQLBuilderImpl.doEntitySelect(BaseSQLBuilderImpl.java:548)
         at oracle.jbo.server.EntityImpl.doSelect(EntityImpl.java:7762)
         at oracle.jbo.server.EntityImpl.lock(EntityImpl.java:5554)
         at oracle.jbo.server.EntityImpl.beforePost(EntityImpl.java:6057)
         at oracle.jbo.server.EntityImpl.postChanges(EntityImpl.java:6229)
         at oracle.jbo.server.DBTransactionImpl.doPostTransactionListeners(DBTransactionImpl.java:3127)
         at oracle.jbo.server.DBTransactionImpl.postChanges(DBTransactionImpl.java:2935)
         at oracle.jbo.server.DBTransactionImpl.commitInternal(DBTransactionImpl.java:1991)
         at oracle.jbo.server.DBTransactionImpl.commit(DBTransactionImpl.java:2233)
         at oracle.adf.model.bc4j.DCJboDataControl.commitTransaction(DCJboDataControl.java:1580)
         at oracle.adf.model.binding.DCDataControl.callCommitTransaction(DCDataControl.java:1404)
         at oracle.jbo.uicli.binding.JUCtrlActionBinding.doIt(JUCtrlActionBinding.java:1289)
         at oracle.adf.model.binding.DCDataControl.invokeOperation(DCDataControl.java:2120)
         at oracle.jbo.uicli.binding.JUCtrlActionBinding.invoke(JUCtrlActionBinding.java:693)
         at oracle.adf.controller.v2.lifecycle.PageLifecycleImpl.executeEvent(PageLifecycleImpl.java:394)
         at oracle.adfinternal.view.faces.model.binding.FacesCtrlActionBinding._execute(FacesCtrlActionBinding.java:217)
         at oracle.adfinternal.view.faces.model.binding.FacesCtrlActionBinding.execute(FacesCtrlActionBinding.java:201)
    --> at Index.saveApplicationAll(Index.java:6246)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at com.sun.el.parser.AstValue.invoke(AstValue.java:157)
         at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:283)
         at org.apache.myfaces.trinidadinternal.taglib.util.MethodExpressionMethodBinding.invoke(MethodExpressionMethodBinding.java:53)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.broadcastToMethodBinding(UIXComponentBase.java:1245)
         at org.apache.myfaces.trinidad.component.UIXCommand.broadcast(UIXCommand.java:183)
         at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:475)
         at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:756)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._invokeApplication(LifecycleImpl.java:673)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:273)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:165)
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
         at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
         at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
         at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
         at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:191)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:85)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:420)
         at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:54)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:420)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:247)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:157)
         at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.security.jps.wls.JpsWlsFilter$1.run(JpsWlsFilter.java:96)
         at java.security.AccessController.doPrivileged(Native Method)
         at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:313)
         at oracle.security.jps.wls.util.JpsWlsUtil.runJaasMode(JpsWlsUtil.java:146)
         at oracle.security.jps.wls.JpsWlsFilter.doFilter(JpsWlsFilter.java:140)
         at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:70)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.dms.wls.DMSServletFilter.doFilter(DMSServletFilter.java:202)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3588)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
         at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2200)
         at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2106)
         at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1428)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
    --> on click commit button Index.saveApplicationAll method will invoked.
    Thats it.
    Kumar
    Edited by: user10922309 on Nov 18, 2009 4:32 AM

  • Replacing the bapi with the new bapi for purchase order creation

    Hi,
       In the customised code call is there for the bapi function module  'BAPII_PO_CREATE'.
       Iam trying to replace the call with the code that calls function module 'BAPI_PO_CREATE1'.
       Please help me about what changes I needed to do in the code . As there is much mismatch in the import and export parameters
    and tables in both the function modules.
       Thanks in advance.
    Edited by: anwar.indya on Mar 25, 2011 2:18 PM
    Edited by: anwar.indya on Mar 25, 2011 2:19 PM

    Hi,
    As per  u r requirement
    you can use  : BAPI =>    BAPI_PO_CREATE  with suitable Document  Type ( Stock trasnfert : STO )
    IF  u want to auto po must be created after each delivry in this case you need to use BADI
    'MB_MIGO_BADI; In This BAPI  There is method : POST_DOCUMENT
    In this method u can write code for Auto PO Creation by using BAPI .
    Hope This will Resolve u r query.
    Thanks and Regads
    Santosh

Maybe you are looking for