DI: Create Purchase Order from Multiple Sales Order - Lines

Hi all,
I am trying to group multiple lines from multiple Sales orders concerning One given Vendor/Supplier so as to generate One Purchase order for this Vendor/Supplier
oSalesOrder = (Documents)B1Connections.diCompany.GetBusinessObject(BoObjectTypes.oOrders);
oPurchaseOrder = (Documents)B1Connections.diCompany.GetBusinessObject(BoObjectTypes.oPurchaseOrders);
oPurchaseOrder.CardCode = 'Vendor1'
oSalesOrder.getByKey("13");
oSalesOrder.Lines.SetCurrentLine("4");
oPurchaseOrder.Lines.BaseEntry = oSalesOrder.DocEntry;
oPurchaseOrder.Lines.BaseLine = oSalesOrder.Lines.LineNum;
oPurchaseOrder.Lines.BaseType = (int)BoObjectTypes.oOrders;
oPurchaseOrder.Lines.Add();
oSalesOrder.getByKey("14");
oSalesOrder.Lines.SetCurrentLine("2");
oPurchaseOrder.Lines.BaseEntry = oSalesOrder.DocEntry;
oPurchaseOrder.Lines.BaseLine = oSalesOrder.Lines.LineNum;
oPurchaseOrder.Lines.BaseType = (int)BoObjectTypes.oOrders;
if (oPurchaseOrder.Add()!=0)
    MessageBox(B1Connections.diCompany.GetLastErrorDescription());     
I get the following Error: <i>Base Document Card and Target Document Card do not match</i>.
What more Should I do to avoid This?
Regards,
Emmanuel.

Hi Emmanuel,
As far as I know you cannot create a purchase order based on a sales order using the DI API. I know in SBO you can do this, but I don't think using the SDK. The reason why it's giving you the message "Base Document Card and Target Document Card do not match" is because one is a vendor and one is a customer.
Hope it helps,
Adele

Similar Messages

  • Several purchase requsitions from one sales order

    Hi,
    I am using item category TAB to create a purchase requsition from a sales order, this works fine.
    What I really want to do is to create one purchase requsition for each condition type of a special kind from the TAB position in the sales order.
    Another possibility is to create several purchase orders from one purchase requsition, split on the earlier mentioned condition types. In any case, the end result should be several POs from one SO, split on condition types.
    Can this be done in config or do you have a suitable user-exit for me?
    Thanks in advance!
    Best Regards
    Viktor

    HI,
    The Cost Center Determination settings is in OVF3, the standard works only at the header level though, so it would not work if cost center is needed on the line item.
    For this case I suggest to try from CO view:
    A material is linked to a profit center. From this profit center you can determine a cost center using txn OKB9
    In combination with the material's account assignment field and account determination customizing, an alternate revenue account can be determined for this material. ("Normal" revenue accounts are to be used in combination with CO-PA).
    If this account is a cost element with category type "1" you need the entries in OKB9.
    Hope this help!
    Regards!

  • Single delivery from multiple Sales Orders

    Can you let me know how to create a Single DN if there are different parts to be shipped if the below satisfies,
    same ship-to-party
    same ship date
    thx,

    Hi Pri,
    To have single delivery from multiple Sales Orders you have 2 waysto do it.
    The prerequisites are,
    A. All sales orders should have same ship to Party
    B. Delivery due dates should be same.
    C. Incoterms should also be same.
    D. Shipping Point should be same.
    Once this is ensured, you can either
    1. Go to Tr. Code VL10A and execute the delivery document creation for the list of sales orders
    Or,
    2. Go to VL01N. Give 1st order no. enter into the overview screen
    Here, go to main menu, Outbound Delivery ---> Collective Processing- Del. Creation
    This will also take u to the same VL10A screen.
    Hope, this is helpful. Award points if found helpful.
    Regards,
    Niketan

  • How to create one delivery for multiple sales order

    Hi!! Friends,
    Can some one explain the steps to be followed in creating one delivery for multiple sales order in SAP SD.
    Regards
    AKASH
    Message was edited by:
            AKASH TAMBI

    Hi.,
                  You can combine different orders in to one delivery ,But for the customer Order combination should be checked in  the sales area data of the shipping tab,we can combine orders but the ship to party,Route,Inco terms,Shipping date,shipping point should be same,you can do in T.code VL04 & VL10
    REWARD if helpfull
    Thanks & Regards
    Narayana

  • How to create planned order from the sales order for a processing item

    In the MTO sceanrio, assembly order is created directly from the sales order. I would like to create a planned order from the sales order.
    I tried the Planning strategy group 81 in the material master but it didnt work.
    Could you please let me know how to do it? Is it Schedule line config that controls whether planned order is created?
    Thanks
    Harish

    Narayana,
    Planning strategy 82 is the best & standard way of getting production order created on sale order create.
    just assign this strategy  in MRP 3 view under strategy group.
    If not then using sale order reqt type ( KMFA- Assembly with production order) & assigning this to your sale order item category is also another way to create prodcution order without using planning strategy in material master.
    Follow steps in SPRO-->Sales & dist --> basic functions >avail check &transfer of requirements> transfer reqts-->determination of reqt type using transaction
    Here you may select the item category you in sale orders & assign KMFA to your item category. this will then give option in sale order create to change reqt type to KFMA for assebly orders.
    If you need KFMA to be default assign it to Item cat/ MRP type ( PD) combo.
    Regards
    Ritesh

  • How to create an invoice from multiple sales doc.

    Hi,
    how to create an invoice from multiple sales doc.
    thanx,
    sourav

    hello, friend.
    assuming that your settings in VTFA and VTFL allow, you can create 1 invoice for many sales orders or deliveries by using VF04.  choose all documents that apply and click "collective billing document". 
    you can also click on "simulation" if you want to test if the combination is possible and the system will give you a split analysis if this is not possible.
    regards.

  • Wrong VL-367 error while creating delivery from multiple sales orders

    Hi,
    We have a Z program* that runs BAPI_OUTB_DELIVERY_CREATE_SLS with multiple sales order items to create one delivery.
    The program runs as a job. The problem is sometimes Bupi turns "VL367 - an item with no delivery quantity..." error for some of the items. But actually we have no availability problem, after a minute in the next job the delivery is being created for those items.
    We couldnt find the the state that causes this wrong error. Have any ideas, is there any problem with the bapi ?

    Hi,
    You should check if you got other Sales Order that might be have items with quantities confirmed. Quantities confirmed in a sales order will be appear as unrestricted stock, although is reserved, and therefore for example:
    Sales Order A: item 10, quantity 10
    Unrestricted stock: 10
    Sales Order B: item 10 (Same material as Sales Order A), quantity 2
    Creating outbound delivery for Sales Order B will generate the message, because that stock is being taken for the Sales Order A already.
    Hope it helps.

  • Create Shopping Cart from a Sales Order

    Hi All,
    Does anyone know if it is possible to create a Shopping Cart from demand driven by Sales Orders i.e. how to create a shopping cart from a Sales Order?
    Please post any suggestion. I will reward all responses with points.
    Thanks,
    Ashwani

    Hi,
    Once the SC goes to Sourcing Cockpit,its status is already "APPROVED" .So you approval of SC is not possible.However you can have the approval process for PO (follow on doc).
    See these very useful threads which explain different workarounds for your requirement:
    Re: Carry Out Sourcing transaction in SRM
    Re: Transfer SC to SRM trigger Workflow
    BR,
    Disha.
    Do reward points for useful answers.

  • Error while creating a production order from a sales order

    Hi
       Even though the product has BOM when i try to create order with a sales order reference it is showing a warning message " NO BOM FOUND" . How to correct this error .
    regards,
    PradeepM.

    Dear ,
    Goto -CS02-Enter FG -Goto Header -Staus Long Text -Check wether BOM status is set to 1 -Active .
    Check the usage of the BOM -Should  be 1-Production .
    Check wether BOM is locked and Deltion Flag set -Header Status Long txt tab
    Check the valididty of the BOM and Sales Order Schedule delivery date
    Try and come back
    Regards
    JH
    Edited by: Jiaul Haque on Jul 6, 2010 9:03 AM
    Edited by: Jiaul Haque on Jul 6, 2010 9:04 AM
    Edited by: Jiaul Haque on Jul 6, 2010 9:04 AM

  • How do you create a purchase order from a sales order?

    Is there a specific patch level for B1 2005 that implements this, is it a feature only in B1 2007 or does it have to be custom coded?
    If this has to be custom coded, does anyone either have sample code or a module that could be purchased that implements this?
    Thanks,
    Derek
    Running SAP B1 2005A SP:01 PL: 31

    Derek,
    SAP Business One has this functionality out of the box.  This functionality has been there for ever.
    You can very well use this functionality in your current SBO 2005 A Patch 31 version.
    What  business scenario are you planning to use this?  The reason for my asking this is because there are couple of ways to approach this.
    1.  You are creating a PO from an SO as Part of a Dropship requirement then in SAP you can define a Dropship warehouse and create the SO Item from this dropship warehouse.  Doing so SAP automatically Opens the Purchase Order Confirmation screen when you Add the Sales Order.  Here you can select your Vendor / Vendors and confirm the PO creation.
    2.  The second way is to create a SO from a regular warehouse and then manually go the logistics tab of the SO and check Purchase Orders.  This will Open the PO Confirmation and rest is the same as above.
    Let me know if you need further help
    Regards
    Suda

  • Delivery Split from multiple sales order with signle ship to party

    Dear All,
    I have multiple sales oreder with different Sold to party and single Ship to Party.
    I want to combine all sales order into a single delivery but here deliver split due to different sold to party which I have checked through report ZLE_ANALYZE_DELIVERY_SPLIT.
    Can any body suggest me, whether i can write any copy control routine so that it will stop in splitting delivery.
    Please suggest if any other way of possibility.
    Regards
    Prashant

    All partners which stand in the partner schema of the delivery and which are copied from the preceding document are part of split criteria. The only mandatory partner of the outbound delivery however is the ship-to party.
    You can delete the sold-to party from the partner schema for deliveries with order reference and it is then no included in splitting criteria.
    Furthermore you can control split criteria in copy control routines -> field ZUKRL is used for this purpose. You can check standard routine FV50C001 for that.
    Your Z* code means that you have applied custom logic to define split criteria. But most probably it is called by copy control routines and the mechanism should be the same.
    For more details you can also check OSS notes:
    SAP Note 546668 - FAQ: Delivery split when creating deliveries
    SAP Note 166397 - Delivery split according to customer field ZUKRL
    Regards,
    Dominik Modrzejewski

  • In VA01, how to automatically create a PO from a Sales Order

    In VA01, I create a sales order using item.cat. TAS; then, system generates a PR for the sales order.
    Is it possible to make the system create PO instead of PR?
    In item.cat. configuration, I tried to check the check box "Create PO Automatic."; however, the system still geerates a PR for me w/o generating any PO.
    Any idea would be appreciated.

    Hi Vitthavat
    In VOV6 for schedule line category CS  check wheather the following data has been maintained or not
    Order Type: NB
    Item Category: X
    Account assignment cat: 1
    In VOV7 , for item category TAS
    Check the box - Automatic PO generation
    Billing Relevance - F
    In MM02 , in Purchasing tab , check the automatic purchasing tab
    Use  ME59N for  Automatic PO creation
    Regards
    Srinath

  • Error while creating a delivery from a sales order

    Hi Folks,
    when i try to create delivery of a sales order, i am getting following error:
    " Item 000030: delivery split due to conflicting header data (FKARV: ZF2C <-> F8) "
    please help me in correcting this error.
    thanks in advance.

    Hi,
    The field FKARV is for Proposed billing type for a delivery-related billing doc.
    Now here in your case billing document if ZF2C and another is F8 so it is splitting, check this
    Kapil

  • Changing Sales Order from using Sales Order Stock to Std Unrestricted

    Hi
    We have set up some materials to default to an Item Category/Schedule lines that creates the Sales Order with relevance to Sales Order Stock.
    However in some instances we need to change the Sales Order to a Std Item Category that just uses Unrestricted stock.
    When we test this currently, we are unable to update the original Line Item as it is GREY.
    So we have been adding a "reason for rejection" then copying information into a 2nd line with a Std Item Category.
    But it is still sitting in MD04 under the Sales Order Stock configuarion and not reducing Unrestricted Stock . .. .
    What are we doing wrong?
    I had assumed that changing the Item Category would remove the Sales Order Stock requirement and use normal Unrestricted.
    Thanks
    Hayley

    Hi,
    In VOV4, has the standard item category been assigned under Manual Item Category column? If the value is assigned, then you can change the item category in sales order.
    Regards,

  • Auto-create delivery for multiple sales orders

    I would like to ask how to create auto-create 'single' delivery
    for multiple sales order during release sales order in R11i.
    It is found in my example during release sales order, multiple
    sales orders fulfill release sales order criteria, a single pick
    slip is generated but it is found that each sales order have
    individual delivery with it. It will casue multiple pack slips
    for a singles pick slip. Is it normal feature for auto-create
    delivery, or any setup to solve it?
    Thanks in advance.

    Am not able to do Single Delivery for Muktiple sales orders
    Have you searched the forum for this question as to why you were not able to generate ??  It could be due to multiple reasons.  Please search the forum and update here what steps you have taken after taking the inputs from here, if the problem is still not resolved.
    thanks
    G. Lakshmipathi

Maybe you are looking for

  • Major Problem w/ USB Sound Interface Driver

    I want to start off saying that I have Parallels Desktop installed w/ a Windows 7 Guest OS. I have the Audio 8 DJ driver installed on Windows 7 AND OSX Lion. However when I plug the Audio 8 DJ interface in, it allows me to choose whether it will be c

  • Acrobat Pro 7 Keyboard Shortcut to select multiple bookmarks

    I am looking for the keyboard shortcut equivalent of ctrl-left mouse to select multiple bookmarks. Either it can't be done or it is something obscured to my mind.

  • HOW TO RUN THE APPLET IN JAR?

    Hi, I have an simple applet . I have created the jar file for the applet using the jar utility. 1. I would Like to make my applet run simply by double clicking of the jar file. 2. I have included in the manifest file manifest.inf the main-class file.

  • How to use of variable sized parameter in plsql procedures

    Hello, We will write a procedure which has a fixed parameter and which has other variable count parameters. How can we implement with this in pl - sql., which structure(varray, nested table, collections vb) should we use? For example: I want to use i

  • Why did the Virus known as Bing infect my computer and refuse to leave?

    A few days ago the Virus known as BING infected my computer and refuses to leave.  It has usurped my homepage and my browser and will not permit me to reset my defaults to Google.  It has stolen my computer.  BING is haunting me.  It appears that the