Delivery based on salesorder

Hi there.
I've tried to create delivery notes based on sales orders via the DI, with no success. My code is as follows:
for (int t = 0; t < salesordersLines->Count; t++){
salesordersLines->SetCurrentLine(t);
deliveryLines->BaseEntry = salesordersDoc->DocEntry;
deliveryLines->BaseLine = t;
deliveryLines->BaseType = SAPbobsCOM::oOrders;
if (t != salesordersLines->Count - 1){
   deliveryLines->Add();
deliveryDoc->CardCode = salesordersDoc->CardCode;
The error message I get when I run deliveryDoc->Add() afterwards is that ItemCode is missing. But from the examples, the baseentry should be enough..
And If I try to set deliveryLines->ItemCode = salesordersLines->ItemCode too, I just get [DLN1.BaseEntry][line: 1] 'Ingen overensstemmende dataposter ble funnet (ODBC -2028)'
I hope someone can help me with this, as it is quite urgent.

Hm, after some more testing, I actually got my code to work on some other salesorders. So it might just have been something odd with the salesorders I was testing on.. I will test it some more....

Similar Messages

  • Delivery based on qty specified in delivery schedule in Scheduling Agreemnt

    Hi,
    We have a scenario where we need to create delivery based on the quantities entered in the delivery schedule in Scheduling Agreement, eg.
    on 10.11.2011 qty to be delivered is 10
    on 15.11.2011 qty to be delivered is 20
    We have sufficient stock and the entire qty of 30 (10+20) is confirmed. Now when we create the delivery on 10.11.2011 the system is delivering the entire qty of 30, whereas the requirement is that on 10.11.2011 only qty 10 should be proposed by the system in delivery. Please help.
    Regards,
    Abhishek.

    Hi,
    1.Please check is there two schedule lines are present.
    2. Check the expected delivery date/check the from to date for delivery creation.
    or
    you can change the expected delivery date between 10-14 and check it should work.
    Gajanan

  • PGI and Delivery based on FIFO

    Dear All,
    I have a requirement that while GR we enter the batch based on the manufacturing date. I want PGI and delivery on FIFO based on the GR date of the material. Moreover, we have two company codes using the same material codes. I want to have FIFO based delivery applied in only one company code.It should not affect the other company.Is it possible at plant level. I also dont want automatic batch creation at GR time. I want PGI and Delivery based on the GR date. Please suggest

    create a batch search strategy in VCH1 with strategy  type as SD02- and select the key combination as customer, plant & material so that you can restrict the batch search strategy in plant level.
    or
    use MBC1 - select the strategy ME01, select the key combination as Movement type, plant & material

  • Moment type in delivery based on PO

    Hi Gurus,
    Please guide me that in the replenishment delivery based on PO, how the moment type is coming in to delivery document.
    Thanks & Regards,
    Savi

    Hi
    In Normal sales process
    With sales doc type + Item category group  in MMR system determines Item category (T code VOV4)
    With Item cate + MRP type in  in MMR  system determines schedule line category  (T code VOV5)
    In schedule line category we have the movement type (which we all know)   (T code VOV6)
    For STO or PO in MM settings we assign delivery type to PO type
    So system picks the delivery type
    The item category determination happens with delivery type + Item category group  in MMR system determines item category in delivery document (T code 0184  or zero184 )
    For this item category + MRP type in  in MMR  system determines schedule line category  (T code VOV5)
    For this schedule line category  we maintain movement type  (T code VOV6)
    This is how movement type is getting determined
    For normal Sales flow is-->   (T code VOV4)(T code VOV5)-- (T code VOV6)
    For PO or STO--> Link between PO type and delivery type-- (T code 0184  or zero184 )--(T code VOV5)-- (T code VOV6)
    Hope you are getting the difference
    There is a big logic difference is applied
    I have tried to explain to the best of my abilities
    Regards
    Raja

  • How to produce different outbound delivery based on different schedule line

    Hi,
    I want to create different outbound delivery based on different schedule line time,but system automatically create a combining delivery document with a sum number.
    For example,
    schedule line
    date               goods issue time   qty
    2011.08.24     08:00:00                1
    2011.08.24     10:00:00                1
    when I create the outbound delivery, system create only one document with quantity 2.
    But I need two documents with quantity 1 in every document.
    How to solve this requirement?
    Thanks.

    Hi,
    I viewed the item requirement in VOFM, found that they are status check for the copy control, not the split control.
    Could you please give me a example?
    In the copy control--header--conditions----order requirement ( or combination requirement )
    They are like this :
    (001)
      bp_subrc = 0.
    Check that reference document is an order (if not, issue error)
      if cvbak-vbtyp cn vbtyp_auft.        "Auftrag?
        perform message_handling in program (programmname)
                                           using cvbap-posnr
                                             '003'
                                             'E'
                                             'VL'
                                             cvbak-vbeln
                                             space
                                             space
                                             space.
        bp_subrc = 1.
        check 1 = 2.
      endif.
    Check the status of the Fonds-Management
      IF CVBUK-FMSTK EQ 'A'.
        PERFORM MESSAGE_HANDLING IN PROGRAM (PROGRAMMNAME)
                                           USING CVBAP-POSNR
                                             '889'
                                             'E'
                                             'VL'
                                             CVBAK-VBELN
                                             SPACE
                                             SPACE
                                             SPACE.
        BP_SUBRC = 1.
        CHECK 1 = 2.
      ENDIF.
    Check that order is not blocked by the automatic credit check
      if cvbuk-cmgst ca 'B' and
         cvbuk-abstk ne 'C'.
    Credit check is irrelevant for correction deliveries
        if v50agl-sofauftrag eq charx       and
           tvak-lisof       eq space       and
           likp-lfart       eq tvak-korli.
        else.
          perform message_handling in program (programmname)
                                             using cvbap-posnr
                                               '060'
                                               'E'
                                               'VL'
                                               cvbak-vbeln
                                               space
                                               space
                                               space.
          bp_subrc = 1.
          check 1 = 2.
        endif.
      endif.
    Check the user status from the order header
      if not cvbak-objnr eq space.
        call function 'SD_STATUS_VBAK_CHECK_INTERN'
          exporting
            i_objnr              = cvbak-objnr
            i_vrgng              = vrgng_sddn
          exceptions
            allowed_with_warning = 01
            not_allowed          = 02
            object_not_found     = 03
            others               = 99.
        if sy-subrc ne 0.
    Fehler nicht bei MODKZ = '2' (Erlaubt mit Warnung)
          if sy-subrc gt 1.
            bp_subrc = 7.
    Else ist nötig, da Routine mit "changing sy-subrc" gerufen wird
          elseif sy-subrc eq 1.
            bp_subrc = 0.
          endif.
    Check Global delivery flags
    line deleted: "n_911988
            perform message_handling in program (programmname)
                                               using cvbap-posnr
                                                     sy-msgno
                                                     sy-msgty
                                                     sy-msgid
                                                     sy-msgv1
                                                     sy-msgv2
                                                     space
                                                     space.
    Bei Fehler: Bedingung verlassen
          check bp_subrc ne 7.
        endif.
      endif.

  • Combined order based and delivery based billing

    Hey Gurus,
    We are using ZTAN items and ZTAD items on the sales orders.  We are trying to figure out how to combine these two together to create one invoice.  Can you guys help us with what the configuration should be in order do this?  I woudl like to knwo what settings I need to make in item category and also what settings need to be changed in the copy controls?  Do I need to change them for F2 and other settings in VTFA?
    Please let us know.
    Sincerely,
    Nina

    Hi,
    Delete the Assignment number and Reference number in the copy control at the header level details in VTFA.
    For this message and try it .
    We are using order based billing for the ZTAD items right now and using delivery based billing for the ZTAN items. So, to answer your question, we do want to combine these two together.
    I have tried setting the VTFA copy control settings to 001, and I still can't seem to get the two line items to combine.
    Note, I only created a new copy control for the ZTAD items.
    I looked to see if the header data was different and this was the log that was outputted but I can't seem to figure out what this means:
    Fld Name $000000001 $000000002
    Combination criteria in the bi 0013030 00330308000000064
    Assignment number $
    I am not sure how to analyze this. If you have any suggestions, I would be really appreciative. Thanks for all of your help Shivaji.
    Sincerely,
    Nina

  • Add items to inbound delivery based on PO

    Is it possible to add new items to an inbound delivery based on a purchase order? i.e. materials which were not present on the previous purchase order?

    Actually, what I mean is the opposite. Is it possible to add additional materials which were not present in the purchase order?

  • Split delivery based on partner type

    Hi Forum Colleagues
    I have a scenario where in I need to split delivery based on partner type at line item level.
    I am aware I need to look into copy control routine to be able to address this concern, however I am unable to find the solution.
    Could someone guide me.
    Regards
    Kalpesh
    Edited by: Kalpesh Mirchandani on Mar 31, 2009 7:07 AM

    Hi
    I am getting the following error
    Item 000002: delivery split due to conflicting header data (Function Y2: Partner Number: 5100001701 <-> 5100001154)
    I have created new delivery type in which I have checked "Delivery Split Part" which should ideally address this issue but it is not.
    I would like to create delivery for each line item having different partner number. I am unable to locate the routine in which I could include the logic to separate the deliveries based on line item.
    Pls guide.
    Regards
    Kalpesh
    Edited by: Kalpesh Mirchandani on Mar 31, 2009 2:01 PM
    Edited by: Kalpesh Mirchandani on Apr 1, 2009 6:59 AM

  • Split the Delivery based on Storage location

    HI all,
    How to Split the Delivery based on Storage location when creating delivery.  is  there any functional setting ?
    Thanks
    Krupali

    Hi KR and Lakshmipathi,
    I am having exactly the same requirement.  My requirement is that i need to split one Sale Order line into multiple line items in delivery based on the stock in a particular storage location at the time of delivery creation.
    Eg.
    Line item 10 in Sale order for quantity 100.
    Storage location stock  in the priority
    ST01 = 40
    ST02 = 25
    ST03 = 2000
    I wish to have 3 line items in delivery like
    Line item           Storage Location             Qty
    10                     ST01                                40
    20                     ST02                                25
    30                     ST03                                35
    I was able to do the same in the BADI LE_SHP_DELIVERY_PROC ~ SAVE_DOCUMENT_PREPARE
    But i am facing problems regarding the inconsistency in delivery document such as Picking status update etc
    Suggest if there is any better method to do.
    Thanks in advance.

  • TO split from one customer return delivery based on storage type

    Hello,
    How TO can be split from one customer return delivery based on storage type?
    For example,
    If I have 3 storage type,  ST1, ST2, ST3 then and how can I divide the items in to three different TOs of respective storage types from one customer return delivery? Can I use u201Ccontrol for performance data configuration? If yes then provide detail steps.
    Thanks,
    Milind

    Hello,
    Any thoughts/ideas?
    Thanks
    Milind

  • Restricting delivery based on Volume

    Hi All,
    Can i know what steps need to be followed to check the delivery based on volume of the material.  The reqt. is that if the volume exceeds certain ccm, then,the delivery should not happen. can i know what settings need to be done.
    All answers will be rewarded.
    Thanks & Regards
    Aravind

    Hi
    Can I understand what you mean by maintaining the sale order properly, as the volume is calculated from the material master and the qty maintained in the sale order, if it is maintained in sale order, based on it how the delivery could split if it exceeds a given volume.
    Thanks & Rewards
    Aravind

  • Generating Inbound delivery based on Vendor Confirmation for Purchase order

    Is there a way to create Inbound deliveries based on Vendor confirmation for a purchase order.
    Here is the complete scenario.
    Buyer Creates the PO for qty 100 and Date August 29
    Vendor Confirms that he can supply a qty of 50 for August 29 and remaining 50 for Sep15th
    Based on vendor confirmation, Buyer creates 2 vendor confirmations (AB) to match with the data received from Buyer, without modifing the PO.
    Requirement:
    Inbound deliveries should get created based on the vendor confirmation.
    As MRP looks at Inbound delivery for Planning purposes once they are available, Inbound delivery should match with vendor confirmation data.
    Is it possible to get this requirement met with standard config available in SAP.

    could you eventually get the answer from the docu Set Up Confirmation Control

  • Creating Delivery based on the Inbound IDOC received.

    Hi all,
    I have a requirement where in, Outbound Delivery for Sales order is to be created based on the inbound IDOC received from a third party.  The standard idoc type DELIVERY03, requires the Delivery Number for updating the order but it cannot create a delivery number.
    Can any one suggest which IDOC type can be used for this or if there is any alternative solution?

    Hi,
    You can use FM IDOC_INBOUND_WRITE_TO_DB to create an inbound IDoc.
    CALL FUNCTION 'IDOC_INBOUND_WRITE_TO_DB'
        EXPORTING
          PI_STATUS_MESSAGE       = I_EDIDS
        IMPORTING
          PE_IDOC_NUMBER          = DOCNUM
          PE_STATE_OF_PROCESSING  = STPROC
          PE_INBOUND_PROCESS_DATA = I_TEDE2
        TABLES
          T_DATA_RECORDS          = I_EDIDD
        CHANGING
          PC_CONTROL_RECORD       = I_EDIDC
        EXCEPTIONS
          IDOC_NOT_SAVED          = 1
          OTHERS                  = 2.
    Check the following link:
    http://www.sapbrain.com/TUTORIALS/TECHNICAL/IDOC_tutorial.html
    <b>Reward points</b>
    Regards

  • Stored Procedure for Delivery based on Sales Order Title UDF

    Dear All,
    I have made a  UDF in the Sales Order Title as U_SOApproved which has been set with valid Values for the field as 1 - Yes and 2 - No and set default value for field set as 2.
    Now I want to have Stored Procedure by which whenever a delivery is made based on a Sales Order for Document Series Named Retail if in the above udf which is there in Sales Order is not set as 1 - Yes the system should not allow the add the delivery in the system.
    I know there is a option in Sales Order itself having a approved tick box but if I implement it then it would be applicable for all document series which I don't want. I want to have a check on a particular document series e.g Retail only.
    Please help in this regard.
    Regards,
    Kamlesh

    I'm actually looking for a complete block , I want to force the user to type a value in the GrossBuyPr.
    I have the following SP that I tried to modified to work for invoices but is not working
    DECLARE @numlinii int
    IF @transaction_type IN (N'A', N'U') AND (@Object_type IN (15)) AND (@num_of_cols_in_key = 1)
    BEGIN
    IF (@Object_type = 15)
    BEGIN
    SELECT TOP 1 @numlinii = (LineNum +1) FROM DLN1 INNER JOIN OITM ON DLN1.ItemCode = OITM.ItemCode AND (OITM.InvntItem N'N')
    WHERE DLN1.DocEntry = @list_of_cols_val_tab_del AND (ISNULL(GrossBuyPr, 0) = 0)
    ORDER BY Linenum ASC
    IF (ISNULL(@numlinii, 0) 0)
    BEGIN
    SET @error = 10
    SET @error_message = N'Value of field NNNNN in line No. ' + CONVERT(nvarchar(4), @numlinii) + N' is = 0 !'
    GOTO error_mesg
    END
    END -- ODLN (15)
    END
    Any ideas ?

  • Splitting of delivery based on Multiple TO's in ware house

    Hi,
    We have implemented SD and WM modules.
    We created a sales order for say 100 nos and created a delivery of the same quantity. System creates 2 TO's for the above quantity since we are using TO split functionality based on material lying in 2 bins say TO1 for 60 and TO2 for 40 which is happening automatically on saving the delivery.
    There are some details which we need to pass from TO details to delivery line item and hence delivery should get also split as per TO quantity.
    Is there some additional configuration which needs to be done to split the delivery or we need to do so through some user exit?
    Request an urgent help.
    Rgds,

    Hi Avinash,
    Can u tell us how are you creating a Sales Order with Materials from 4 different divisions?
    I have a solution for ur issue but first answer this query.
    Regards,
    Vinod

Maybe you are looking for

  • How do I get rid of ITunes 10 upgrade screen so I can use ITunes Store?

    How do I get rid of ITunes 10 ad, so I can use the iTunes store.   I can't download 10 on this computer and have purchased from iTunes store in past.  Not anymore, any search doesn't work, screen keeps coming back to Upgrade ad.

  • Correlating S_ALR_87013537 tcode to underlying report

    How can I correlate the S_ALR_87013537 tcode to underlying report? I would like to change the settings on the report (using tcode cje2) , but I do not know which report is associated with  the S_ALR_87013537 tcode. I'm trying to change the "Output Ty

  • Hong Kong Tax Forms IR56B SAP standard Layout

    Hi All HK statutory annual tax form IR56B (transaction PC00_M27_CTXB)  is generated once annually. There is a SAP standard layout HR_HK_IR56B2002 for this. However, notice that the layout settings is different from the government layout.  A few examp

  • Invalid input massage error

    dear all I want a solution to my problem . the problem is when ever i trying to use publish ios app i receive an invalid input massage my p12 and cer files are good and thy work on windows copy of flash now i am using mac copy (mac 10.7.1 ) i already

  • How to CLOSE directory Utility 10.8.5

    Guys have a really stupid problem here. I cant connect my Mac Mini to a Domain controller but I just want to close off the directory utility so I can get to it later but will not close. I cannot even shut down the machine as it holds it up. Can someo