Update LineNum in Sales Order line Details

Dear All,
I have imported a sales order into a database from another database on SAP B1 2005A using DTW. The sales order has only one line item.
However, after importing, the linenum of the target table RDR1 is 0 while the source has it as 1. All the other fields have been updated with the correct data.
I am trying to update the same sales order's LineNum to 1 using DTW with the 'update' option ticked and the process runs successfully. However upon checking the database I find out that it has added another line item with the same details. Can a linenum field be changed/updated? The reason behind my need to change the linenum is because after trying to import a sales delivery linking it to that sales order it gives me an error :[DLN1.BaseEntry][Line: 1] 'No matching records found [ODBC:2028]'.
Kind Regards,
Asif

Asif,
The number of lines in the Sales Order does not neccesarily co-relate to the line number.
Just a simple example:
Create a Sales Order....Add a line item..add Sales Order
Open the same sales order..delete the line item (delete row) and add the same item / another item.  Though the Sales Order seems to have only one item..now if you check RDR1 the linenum would be 1.
The architecture of SAP B1 is to generate a new linenum each time you add a row.
Thats probably why you are seeing the difference.
If you want to match the target linenum. simply delete the row and add the same line item and Update SO.
DTW will not update the linenum as it is system managed. 
My recommendation for your situation is - if you do not have the same item more than once on a Sales Order - then it is better to get the BaseLine from the Database you imported the Sales Orders to.
Let me know if you need any further direction with this.
Suda

Similar Messages

  • How to update UDF of sales order line of closed sales order header

    Hello experts,
    We are using SAP 8.81.313  PL 05  and we noticed that through SDK using businessobject SAPbobsCOM.BoObjectTypes.oOrders,  we can't update an user defined field on sales order line for a sales order with header closed.
    calling the method  Update()   it returns 0  but actually the table field  was not changed !
    Also we noticed that It's possible to make an update of UDF of delivery line for a delivery with header closed.
    I don't understand why.
    Is it a bug or the expected behavior ?
    Our customer needs to change some UDF of sales order line even when the order header is CLOSED.
    Please help me.
    Many thanks for your time.
    Best regards
    Andrea

    Hi Elio,
    Yes from UI it's the expected behavior but through DI API  I could update an user defined field of sales order line even if the LineStatus is equal to "C" (Closed) but only if the order header is not closed.
    Regards
    Andrea

  • SALES ORDER LINE IS CANCELLED BUT DELIVERY DETAIL IS SHOING AS BACKORDERED

    SALES ORDER LINE IS CANCELLED BUT still the DELIVERY DETAIL IS showing as BACKORDERED it should be in cancelled
    status.The Sales order (only one ex:3904854) is cancelled , however order in shipping transactions screen indicates order is on backorder.
    at that time of order cancellation the line level workflow error out due to the Workflow package is inactive .
    I tried to resubmit the error out workflow using retry option from the responsibility “Workflow Administrator” the workflow is completed with forcible option but still the delivery detail is in back order status not changing it to cancel status.
    Error Name :-4068 [Error Process Error: WF Error Message: ORA-04068: existing state of packages has been discarded  
              ORA-04061: existing state of package body "APPS.XRX_SUPPLIES_NEW_WF_PKG" has been invalidated    
              ORA-04065: not executed, altered or dropped package body "APPS.XRX_SUPPLIES_NEW_WF_PKG"                         
              ORA-06508: PL/SQL: could not find program unit being called: "APPS.XRX_SUPPLIES_NEW_WF_PKG" [Error Process           Error: 3114: Activity 'WFERROR/R_ERROR_RETRY' is not a process.]
    Error Stack: Wf_Engine_Util.Function_Call(XRX_SUPPLIES_NEW_WF_PKG.XRX_CLOSE_LINE_DETAILS, OEOL, 55098479, 195982, RUN)
    [Error Process Error:   Wf_Engine.CreateProcess(WFERROR, WF5147218, R_ERROR_RETRY) ]

    Mohan
    You need a simple script to get the status corrected. Log an SR or search metalink for the script. I am sure there is one out there (if you search with the orphan reservations). This script supported, but not exactly targeted at your problem But it will solve it. You can log an SR and confirm.
    Thanks
    Nagamohan

  • This field cannot be updated as there are open sales order lines

    When trying to enable Item Attributes then I am getting a message "This field cannot be updated as there are open sales order lines". I cancelled the Sales Order ( which was having only 1 sales order line and that is also cancelled) but still I am getting the same message.
    How to overcome this problem.
    Khan

    Thanks Karthik & Sandeep........
    Issue got fixed. There was an open Sales order Line because of that line the issue was coming. After cancelling that SO Line, Users were able to update the Item field.
    Regards,
    Khan.
    http://moreapps4u.blogspot.com/

  • Update Sales Order line item field

    Need to update a field mfrgr of VBAP table with some user defined values on selection screen parameter.
    I have selected all the Sales order line items in an internal table which need to be updated.
    How can I use the update command with set expression to do the same ? If yes how ? if no what is the best way to do the same.

    I am using the following command and it doesnt work as it says cannot use AND command.
              loop at it_vbfa.
                    UPDATE  VBAP
                    WHERE VBELN = it_vbfa-vbeln
                    and   posnr = it_vbfa-vbelv
                    SET MFRGR = P_MFRGR.
                    IF SY-SUBRC = '0'.
                       COMMIT WORK.
                    ENDIF.
              endloop.
    Any pointers ? What am I doing wrong.

  • Cannot update Override ATP flag on sales order line

    Unable to update the override ATP flag on sales order line.
    Is there any way that this functionality can be achieved.

    Yes, I have set it to yes and it works.
    Thank you

  • Update a Customise status massage/Qty in Sales Order line at PGI

    Dear Gurus,
    We are new to SD and we are willing to implement a status update or the PGI Qty in the Sales order line level, at a PGI by using a Out bound Delivary or shipment document. We are willing to customise  condition group field  (VBKD-KDKG1) in addtional data A. is there a posibility of doing this or any other solution we can do for this. Your kind replies will be highly appriciated at this time.
    Thank.....
    Pubudu & Jeewana.

    Hi,
    It is possible through user-exit/Badi.
    To update PGI Status you can use user-exit "MB_CF001-Customer Function Exit in the Case of Updating a Mat. Doc." Or you can use BAdi "MB_DOCUMENT_UPDATE".
    To update Shipment document status you can use BAdi "BADI_LE_SHIPMENT-BadI: Shipment Processing".
    But how will you handle the partial delivery cases?

  • Line id in sales order lines and source_line_id in wsh delivery details are entirely different

    i am trying to get serial number based on sales order line,i am getting no data since   AND WSH.SOURCE_LINE_ID = OOL.LINE_ID is failing,Please help me.Im not getting what wrong im doing
    SELECT OOH.ORDER_NUMBER
         ,OOH.FLOW_STATUS_CODE
         ,OOH.CUST_PO_NUMBER
         ,OOL.ORDERED_ITEM
         ,OOL.LINE_ID
         ,OOL.ORDERED_QUANTITY
         ,OOH.ORDER_TYPE_ID
        ,WSN.FM_SERIAL_NUMBER
    FROM SO_ORDER_TYPES_ALL SOT
         ,OE_ORDER_HEADERS_ALL OOH
         ,OE_ORDER_LINES_ALL OOL
         ,WSH_SERIAL_NUMBERS WSN
         ,WSH_DELIVERY_DETAILS WSH
    WHERE 1=1
      AND WSN.DELIVERY_DETAIL_ID = WSH.DELIVERY_DETAIL_ID
      AND WSH.SOURCE_LINE_ID = OOL.LINE_ID
      AND OOL.SOURCE_TYPE_CODE = 'EXTERNAL'
      AND OOH.HEADER_ID = OOL.HEADER_ID
      AND OOH.ORDER_TYPE_ID = SOT.ORDER_TYPE_ID
      AND SOT.NAME = 'US Distributor Order'

    what is the status of SO and SO line ?
    Have you manually check the line_id and source_line_id from backend using select statement ?

  • Sales Order Line Item Details

    Hi Experts,
    Is there anyone knows in what variable or table does the line item number of the selected sales order line item after selecting any commands in Va01 transaction?
    Points will be rewarded...
    thanks in advance

    Most likely in the user exits you cannot know what line has been selected on the screen. Normally VBAP-POSNR has the line number of the line being currently processed, but it's not the same line that user selected (i.e. clicked on) on the screen.
    I think you can only get this information in the screen's PAI (I might be wrong though). If you need to pass this information further you could fill in a global variable in the screen's exit and then use it later in other user exits.

  • Cancel Sales Order lines that are picked

    Hi
    1. I'm trying to cancel sales order lines through process order api that are picked and delivery status is Staged/Pick Confirmed. The error is
    You are not allowed to cancel Order Line because:
    Line has been pick confirmed/staged.
    I'm unable to perform by below means
    1.There is a processing constraint on the field SCHEDULE_ARRIVAL_DATE.
    Delete the processing constraint and retry the cancel line process - Processing constraint form the fields are protected against update
    2.Navigate to the shipping transaction form and query the order. Select the line and enter 0 at shipped quantity.Save the record.Ship confirm the line, this will cause the line to be backordered.Query the order line in the order entry form and cancel this. - Shipping transactions form the fields are protected against update
    2. Is there a way to cancel Internal Sales Order(ISO) lines of one OU and the corresponding internal requisition is another OU
    Thanks
    kumar

    If you are in R12, there are some enhancements from Oracle that allows updating/cancelling certain Internal requistion fields and Internal orders automatically. You may need to disable few processing constraints too.
    As of Now Oracle support change to following attribute at OM side
    1 Order Quantity
    2 Request Date
    3 Schedule date
    4 Arrival date
    Similarly if we make changes in following fields in Approved IR
    1 Quantity
    2 Need by Date
    These changes will got reflected in ISO
    Plus cancel the IR line or ISO line, the other one gets cancelled automaically.
    To cancel the picked line, first undo the pick confirmation process by back ordering. or unassign the delivery details from the delivery (if created already) and cancel the delivery.In either case, you need to manually trasnfer the qty from staging area to original locations. Oracle doesn't automatically move the qty back, (undo move order transaction).
    Ganesan.

  • Field added in Aditional data tab of sales order line item at screen 8459

    Hi all,
    My problem is .
    I have appended one field in VBAP table, given it a name "WBS ELEMENT"
    The field is getting displayed in VA23 as well as VA02 Transaction.
    when i create sales order with the quotation reference,
    the "WBS Element"  of line item of quotation should get updated in "WBS Eleement "  of sales order line item
             This i am doing by triggering user exit.
    Problem is:
    Once Quotation  line item get copied to the sales order line item
    and the screen is in front of you with those details,
    before saving sales order .
    if you go at the sales order line item withou saving the document
    The field i have created in the screen 8459 i.e WBS Element ,doesnt get displayed.
    how could i retain the field Ihave created on screen 8459
    while creating the sales order from quotation before saving that sales order.
    Pleas help .

    Hi Vikram,
    It seems as it has been coded only to save the values into the new field that you have appended to VBAP. But before saving if the user wants to see the field, it is blank. You can try coding in PBO (process before output) of the relevant screen as follows:
    1. Get the reference of the quotation. Something like XVBAP-VGBEL will give this number.
    2. Get the value of Z field in VBAP by passing this quotation.
    3. Copy the above value to the corresponding Z field in XVBAP (or any internal table which holds VBAP data before saving)
    Please reward if helpful.
    Regards,
    Krishna

  • Problem with sales order line items

    hey All,
    I wrote a simple test program this morning Using DI API that creates and updates orders, and I found some weird behaviour:
    1. Once an order is created, if a line item is deleted off the order in B1 - the updates work fine.
    2. If an item is added to the end of the order, the updates work fine.
    3. If an item is added in the middle of the existing line items, the next update does weird things - it swaps prices and item keys and screws up the order total.
    4. If an item code is changed to an existing item (such as changing the AddModel the actual item code), the update does weird thing, same as #3.
    Has anyone experienced issues such as this? Or has anyone successfully completed an application like this that works properly?

    Ok can anyone from SAP comment on this please? I have some more details if you want to duplicate this.
    My simple program just creates a sales order from DI API. Then you complete step 2, 3, 4 as listed below using a Business One Client.
    I then go back to my program and do some simple updates to the sales order through DI API using the SetCurrentLine method and looping over the Lines object count. Once I call the update method and go back into B1 to look at the order the DI API has updated the wrong items.
    Anyone have any ideas or run into a similiar problem? We are desperate here for a fix.
    Steps to duplicate
    1. Create B1 sales order using DI API with 4 line items for example
    2. In B1, delete a line item in the middle of the order
    3. Change the first any item Code to a different item
    4. Save the order in B1.
    6. Run a sales order update from DI API.
    7. Recall the order in B1 - the totals will be all jacked up and the prices will no longer match the items

  • Billing schedule Dates using a BAPI/FM for a sales order line

    Hello,
    I am trying to update a sales order line with an Item category which inturn updates the Billing Plan.
    I am able to update the sales order with required details and the default billing plan.
    Now I want to change the Billing schedule i.e the Billing Plan dates Invoice end date and the percantage etc whcih I am trying to do using
    SD_ORDER_BILLING_SCHEDULE AND BILLING_SCHEDULE_MAINTAIN AND THEN BILLING_SCHEDULE_SAVE.
    This for some reason will not update the Billing schedule.
    It triggers the user exists etc but even though I pass all the required details in the Old and new FPLA and FPLT tables...it is not helping.
    When I tried using BILLING_SCHEDULE_DIALOG it opens the screen with the Billing plan in edit mode.
    Is there any other way to do the updates.I tried changing in the User exist etc. I also checked the program sdfpla02.
    Many thanks,
    Krishna.
    Edited by: Krishna on Mar 21, 2011 8:30 PM

    See the following example
    * Read the billing plan
        CALL FUNCTION 'BILLING_SCHEDULE_READ'
          EXPORTING
            fplnr = hfplnr
          TABLES
            zfpla = hfpla
            zfplt = hfplt.
        MOVE hfpla TO hfpla2.
    *READ TABLE zfpla2 INDEX 1.
        hfpla2-lodat = p_stat.
        hfpla2-tndat = p_end.
        hfpla2-rfpln = ''.
        hfpla2-lodar = ''.
        hfpla2-tndar = ''.
        hfpla2-fpart = p_bplan.
        hfpla2-perio = p_bplan.
        hfpla2-horiz = p_hori.
    *** Very important to set field updkz = 'U' ***
        hfpla2-updkz = 'U'. "--> UPDATE!!
        APPEND hfpla2.
        CLEAR pos.
        CALL FUNCTION 'BILLING_SCHEDULE_SAVE'
          TABLES
            fpla_new = hfpla2
            fpla_old = hfpla
            fplt_new = hfplt " --> NEW
            fplt_old = hfplt.
        CALL FUNCTION 'SD_SALES_DOCUMENT_SAVE'
          EXPORTING
            i_no_messages = ' '.
        CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
          EXPORTING
            wait = 'X'.
    CALL FUNCTION 'SD_SALES_DOCUMENT_READ'
            EXPORTING
              document_number = doc.
          MOVE zbill-itm_number TO pos.
          CALL FUNCTION 'SD_SALES_BILLINGPLAN_READ'
            EXPORTING
              i_vbeln                = doc
              i_posnr                = pos
            IMPORTING
              e_fpla                 = e_fpla
            TABLES
              e_fplt                 = e_fplt
            EXCEPTIONS
              no_billingplan_allowed = 1
              no_billingplan_found   = 2
              OTHERS                 = 3.
          IF sy-subrc NE 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    * WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
          ENDIF.
    * Read the billing plan
          CALL FUNCTION 'BILLING_SCHEDULE_READ'
          EXPORTING
          fplnr = e_fpla-fplnr
    * I_VFKDAT =
    * I_BFKDAT =
          TABLES
          zfpla = zfpla
          zfplt = zfplt.
    * Upddate the ZFPLT2 table with the new values
    *MOVE zfplt TO zfplt2.
          MOVE zfpla TO zfpla2.
    *READ TABLE zfpla2 INDEX 1.
          zfpla2-lodat = zbill-datesfrom.
          zfpla2-tndat = zbill-datesto.
          zfpla2-rfpln = ''.
          zfpla2-lodar = ''.
          zfpla2-tndar = ''.
          zfpla2-fpart = p_bplan.
          zfpla2-horiz = p_hori.
    *** Very important to set field updkz = 'U' ***
          zfpla2-updkz = 'U'. "--> UPDATE!!
          APPEND zfpla2.
        ENDLOOP.
        CLEAR pos.
        CALL FUNCTION 'BILLING_SCHEDULE_SAVE'
          TABLES
            fpla_new = zfpla2
            fpla_old = zfpla
            fplt_new = zfplt " --> NEW
            fplt_old = zfplt.
        CALL FUNCTION 'SD_SALES_DOCUMENT_SAVE'
          EXPORTING
            i_no_messages = ' '.
        CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
          EXPORTING
            wait = 'X'.

  • Need to report on sales order lines using specific pricing modifier

    Is there a report I can run for a specific modifier number that will give me all the sales order lines that were adjusted using that pricing modifier?

    Use oe_price_adjustments table and link that to the qp_list_headers and lines to get the details of the modifiers.
    Thanks
    Nagamohan

  • Third Party GRN Posting Date to be Copied to Sales Order Line item Billing Date

    Hello Experts
    I have a client requirement where in they want to bill line items in the sales order ( third party process ) to the end customer in sync with the GRN posting dates happened in the PO
    For EG if GRN happened on 1st July 2014 then Billing Date should come in as 31st July 2014 so when they execute VF04 giving from and to dates as 1st july to 31st corresponding sales order can be invoiced
    Actual problem is for suppose if i create a sales order in the month of june say 26th basing on the factory calendar setting and invoicing list maintained in the customer master system defaults the billing date to 30th June 2014 , and the same when user runs VF04 from 1st June to 30th June this sales order shows as due and mistakenly end user invoices the customer ( whereas logical GR would have only received in July 1st )
    My requirement is similar to below threads but i am unable to find answer how to copy GR Posting date to Billing Date of the sales order line item
    use GR Doc date as billing date
    3rd party sales process (w/o ship notif) - Billing

    Hi Lakshmipathi ji,
    As my requirement is to update the billing date at the sales order line item level , As a process user goes in executes VF04
    For Ex
    Sales Order Created Date is 1st June 2014 then System Defaults Billing Date at line item to 30th June 2014
    Now when i do GRN suppose on 1st July 2014 for that line item , system should trigger a code where in check the posting date of the GRN and override the same in the Biiling Date field of the sales order line item
    So when VF04 is run for a month All the GRN which are recieved in the month of July are invoiced in July
    Please share me your thoughts do we need to check any userexits from MM side which reads the posting date of GRN and then copies in to my third party sales order
    Regards
    Hiba

Maybe you are looking for

  • Console message repeats itself

    Hi! Got a problem with the console living a life on its own,- a message keeps repeating itself. Think I had a similar problem with a Canon scanner. Looking for devices matching vendor ID=1193 and product ID=8719 Looking for devices matching vendor ID

  • Pulling text from a .txt to a scroll pane or text area

    Hi- I'm sure there's a way to do this, but I'm not exactly fluent in ActionScript. Basically, my whole website's going to be in Flash, but I want to be able to update one page (sort of a news/blog page) without having to edit the Flash file every tim

  • How do I move from Mozilla Thunderbird to Apple Mail for email??

    Hi, I am currently using Thunderbird from Mozilla & I would like to use Apple's Mail application for sending and receiving my email. I tried to import Thunderbird but it did not work. I would also like to import the subfolders where I saved email mes

  • Do we need DVD Studio Express?

    Hi All, Since Apple chose to package it's Pro apps all together into Final Cut Studio there no longer seems to be a semi pro authoring solution. So people take the trouble of learning a more advanced application like Final Cut Express only to have to

  • Workflow - Send Mail

    I want send workflow notifications to external mail i.e. yahoo, lotus notes etc... i configured sendmail. System sending blank mails to the yahoo, not sending any hyper link or workflow informations  i.e. Purhchase order number etc... How to configur