SDK-DI - Add purchase order based on sales order through DI-API

Today it is only possible to add a purchase order based on a sales order though the UI. This option should also be supported in the DI-API.

hi,
try removing the double quotes for basetype, baseline, baseentry.
if it doesn't solve the problem
make sure that you are assigning the docentry only but not the docnum of the sales order to the purchase order lines' baseentry.
rgds,laks.

Similar Messages

  • Purchase order based on Sales order

    Hi,
    I try to create Purchase order based on Sales order.
    The error message :
    "Base document card and target document card do not match"
    My code:
    oPurOrder.Lines.BaseEntry=oSalesOrder.DocEntry
    oPurOrder.Lines.BaseLine=oSalesOrder.Lines.Linenum
    oPurOrder.Lines.BaseType=17
    Could you help me please ?
    Tks.
    Laetitia

    Hi,
    Looking at your code I will check how you fill the fields in the oPurOrder object because the code you copied is only for the document lines and the error refers to the document itself (maybe you forgot to assign the cardcode property).
    If you are basing the document, a good and reliable method is to export the base to a xml file and load the target using this file. This way you garantee that all the info of the document is copied. After that you could use your code to update the info you want to change the same way you pasted it in your post.
    Hope it helps,
    -M

  • Restriction for items from Purchase Order based on Sale Order

    Hi !
           We create PO directly from Sale Order ( by ticking Option under Logistic tab, 'Purchase Order') for customer C01 (for eg).
    From the PO created, we post GRPO.
    Now our need is,
    Assume if 10 Qty is been ordered in such a way and been received (GRPO posted). it 'll add on to the stock account i.e will increase stock qty at our whse.
    is it possible to restrict these 10 qty of item from being sold to any other Customer other than whom hav ordered i.e if we create sale order for C02 the SBO should not take the items received from PO created based on Sales Order created for C01?
    Meera.

    Meera,
    Which version of SBO are you using 2005 or 2007?
    I don't think Serial numbers can help in this scenario.  There is no hard allocation or blocking possible using Serial numbers.
    This is the Work around I am thinking about.
    Set the items to be Batch Managed - On Every Transaction
    When performing Goods Receipt, enter the Sales Order Number as the Batch Number
    When creating the delivery, using SBO_SP_TransactionNotification we can easily check the Batch of the Item being selected and verify it with the BaseRef of Delivery lines to match with Sales Order number.
    If the numbers don't match we can warn user with message, "The items batch reserved for Sales Order xyz"
    Even if you make a mistake when entering the batch number same as Sales Order number when doing a goods receipt. It can still be traced and blocked during delivery.
    Hint: The Batch table records the Goods Receipt transaction along with the BaseDocument number, Base Ref, etc
    If you decide to go this route, I could help you further.
    Let me know
    Suda

  • Create Purchase Order based on Sales Order through DI

    Hi All,
    As per my requirment i need to create PO based on Sales Order by Using DI object.
    By using the UI i am able to create a PO. i.e,.  in the Sales Order Form , in logistic tab when the purchase check box is checked and when the SO is added there is a work around form poped up where we give the vendor information and create PO.
    Code:
          objPurchaseOrder = objSBOAPI.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oPurchaseOrders)
                                        objPurchaseOrder.CardCode = "V1010"
                                            objPurchaseOrder.CardName = "Far East Imports"
                                            objPurchaseOrder.DocDate = "02/24/05"
                                            objPurchaseOrder.DocDueDate = "02/24/05"
                                        objPurchaseOrder.Lines.BaseType = "17"
                                        objPurchaseOrder.Lines.BaseLine = "0"
                                         objPurchaseOrder.Lines.BaseEntry = "35"  
                                             objPurchaseOrder.Add()                                                          
    Error Description : Base Doc Type donot match with target Doc type
    PLease help me
    Thanks and Regards
    Sandeep

    hi,
    try removing the double quotes for basetype, baseline, baseentry.
    if it doesn't solve the problem
    make sure that you are assigning the docentry only but not the docnum of the sales order to the purchase order lines' baseentry.
    rgds,laks.

  • How to Add Delivery Note based on sales Order

    How to add a delivery note based on sales order.
    say i have a order no. 10 and linenumber 0 to 3.
    each time i book with order no 10 and line no.3,i need to add to delivery note.
    i also in need of adding just one Header and Multiple lines(Header for order Number - 10 and multiple lines for each Booking ).
    How can i achieve this.

    Hi
    You can search the samples....C:\-->Program files->SAP----->SDK->Samples->DiAPI----->OrderandInvoice...
    Here invoice is added for a particular sales order.....the same can be done for delivery.....
    Hope it helps

  • Search Production Orders based on Sales Order

    HI,
    Ours is MTO scenario.
    How to find Production Order number(s) based on Sales Order.
    We are getting in AFPO, but if the process starts from Enquiry or Quotation then there is difficulty.
    Because there can be multiple documents of enquiry or quotation.
    Kindly suggest.
    Thanks
    Ramakanth

    Ramakanth
    Did you try T code  COOIS - Order Information System?
    Here you can enter the sales order # ( Single values, range etc.) and get a list pf Production Orders?

  • Purchase orders based on sales orders.

    Hello Experts!
    I am using MRP in order to create purchase orders based on my sales orders, thats the easy part. My problem is that i need to create a report matching the sales orders with the corresponding purchased orders created through the MRP wizard.
    Where can i find such a link between POR1 and RDR1? is there a way I can obtain such report?
    Thanks in advance.
    Best Regards.
    Javier.

    Hi Rakesh, thanks for your reply. Well i was trying to use the POR1.BaseType and POR1.BaseEntry in order to match them with RDR1.ObjType and RDR1.DocEntry, but POR1.BaseType and POR1.BaseEntry have NULL as their value.
    I thought creating orders using MRP was supossed to set the corresponding values to those fields. Is there any other way i can link a purchase order created via the MRP wizard to the base sales order?.
    Best regards.

  • Incorrect sort order of rows in Purchase Order based on Sales Order

    Hello Experts.
    I have this problem on SAP B1 8.81 PL 04:
    I create a Purchase Order based on a Sales Order with 10 item rows, ticking the purchase order box in the logistic tab.
    The sort order of rows is different between PO and SO.
    I need the same order of SO on PO.
    Is there something I can do or it's a problem of this patch?
    I saw the Sap Note nr. 824822 but it's related to SAP B1 version 2004 A...
    Regards
    Silvia Reggiani
    Edited by: Silvia Reggiani on Oct 11, 2011 12:26 PM

    Hi,
    Are you able to reproduce the issue in the DEMO Database on the 8.81 PL04?
    Also, have you checked the issue in the latest patch of the 8.81?
    Kind Regards,
    Jitin
    SAP Business One Forum Team

  • Consumption of sales orders based on Sales order Doc Date

    Hi Guys
    I am using 40 Strategy currently. The consumption of sales orders now happens based on requirement delivery date. But my customer want to serve his customers based on first come first serve as the production is always getting delayed. Now irrespective of req. del date, the stock should be consumed based on the sales order document creation date to fulfill first come first serve concept.
    I am not finding suitable requirement class in SAP. Please help
    Regards
    KP

    Hi Krishna,
    The scenario is quite not clear...Could you please brief it out further.
    Because, in strategy 40, if a sales order comes in then sytem checks for any avaliable stock is there or not. If not then it looks for any open proposals available for PIR's, if so then it consumes the PIR based on consumption mode and period defined in material master or MRP group. If no open proposals, then system creates the new one.
    So always the first come sales order will be consuming the stock or PIR, until the next MRP run.
    Today a sales order has been coming in for 100 qty on 07.09.2014 delivery date and consumes the available stock of 100.
    Tomorrow, another sales order has een coming in for same qty but delivery on 05.09.2014, then in next MRP run system will consume the 100 qty for 05.09.2014 and a proposal will be generated for
    07.09.2014
    If the business scenario is something like above, then to avoid this, a PGI job can be scheduled always as next step to MRP run so, that PGI will be done for all the sales order which has stock and rest will be in error log. By this way one production plant can ensure that always the first incoming sales order is delivered.
    Also an another option would be is to run the transaction V_V2 to reschedule the sales order before delivery, this will work out if the sales order line items are not account assigned. In this reschedule transaction, priorities can be given for item date of creation as 1 and followed by delivery priority and rest....
    Please check out and let us know even if you have diffrent solution as well.
    Regards,
    Chinna

  • Return sales order based on sales order urgent..................

    Hi,
      I have to create return order for sales order. I am trying to create through bapi BAPI_SALESORDER_CREATEFROMDAT2. But i am getting eroor like "Unpermitted combination of business object BUS2032 and sales doc. category H".
      If i create normal sales order it is creating sales order through this bapi.
      In my case i have to create return sales order with reference to sales order. If any body is using this kind of sernario please send me with parameters..
    Thanks in advance,
    praveen

    Hi Praveen,
    The BAPI_SALESORDER_CREATEFROMDAT2 is orginally not designed for creating return sales orders.
    Way around: create BIM processing or copy FM and remove the check (which is risky, since integrity is no longer guaranteed).
    Regards,
    Frank Umans

  • Exclude sales orders based on sales order type from CTM planning run

    Dear people,
    We have sales orders in R/3 with custom sales order types, like ZE01, ZE02 etc.
    These sales orders are CIFed to APO and all sales orders have ATP category BM. We use CTM and we want to exclude sales order with sales order type ZE01, is this possible?
    Which enhancement could be used to exclude sales orders with selection on sales order type?
    Edited by: Peter237 on Jan 19, 2012 12:35 PM

    Dear,
    Check the requirement type of your sales order line item in VA02 procurement tab it should be Reqmt type of customer reqmt   KSL
    Also check the strategy assign in material master and MRP group OPPR and then check the setting of strategy 10 in OPPS there should be
    Customer Requirement planning
    Reqmt type of customer reqmt   KSL  Sale frm stck w/o ind.req.red.
    Requirements class  030  Sale from stock
    Allocation indicat.     No consumption with customer requirements
    No MRP   :-               1 Requirement not planned, but display.
    Please try and come back.
    Regards,
    R.Brahmankar

  • Retrieving Purchase orders based on Sales Organization

    Hi,
    Can anyone let me know how to retrieve Purchase orders based on Sales organization ( Input) , please
    Thank you .
    Regards,
    Ry

    hi ,
    SD.
    VBAK - sales document header
    VBAP - Sales document line item
    VBEP - Sales document schedule lines
    VBUK - Sales document header status
    VBUP - Sales document line item status
    VBFA - Sales document document flow
    LIKP - Delivery header
    LIPS - Delivery line item
    VBRK - billing document header
    VBRP - Billing document line item
    regards,
    venkat.

  • Link a Purchase order to a sales order

    I am looking for a way to link a specific Purchase order to a Sales Order so that when the Purchase Order is received the items are allocated to that specific Sales Order and another sales person cannot sell the murchasedise.  I know you can create a po from a sales order but it seems like when the po is copied to a goods receipt, anyone can invoice those items on a different sales order/ a/r invoice?
    Thanks,
    Don Shields

    Hi Don,
    What you are looking for is more of a hard allocation of Items to a SO.  This functionality does not exist in B1 today.
    If you want to manually create some processes and validation for this, it could be done. 
    1.  Use Batch numbers management for items and linking a Batch to a SO and use the same Batch number in the Goods Receipt.
    I have provided an ellaborate solution for this on this forum last year
    You may check this thread in the meanwhile
    Suda! Again to restriction of items from PO based on SO

  • Cost analysis through Purchase Order created from Sales Order

    Hi Experts,
    This is the scenario: There is an Item No. which is not stocked in warehouse and is purchased only when customers ask for it. The cost of the sales order line having this item is calculated by the Purchase Order line on which the item is there. (The PO have items for other Sales Orders as well. And, Sales Orders have multiple item types) The Sales Order have the PO no. against it and Purchase Order has SO no. against the line. This is all done using MS Access and Sage Accounts. Lots of free typing and manual cost analysis involved.
    I have gathered from this forum that we can create Purchase Order from the Sales Order. The Document No. information can be pulled from one another using Formatted Search. Can we do the accounting and cost analysis as well?
    Please let me know if I have not made myself clear.
    Thank you in advance and kind regards.
    IC
    Edited by: iancameron03 on Sep 20, 2011 4:35 PM

    Hi Ian,
    I concur with Faraz, it is better if you use procurement document facility in doing back to back transaction from SO to PO.
    However, in your case, I'm afraid you can't analyze the gross profit and recording the accounting related activity as your request using standard SAP B1 function.
    As for gross profit case:
    Since you're actually using workaround in order to evade all hassles in maintaining all item master data related to this case, you create just one item code called S1 right?
    SO DocEntry - SO Line # - Item Code - Item Name - Quantity - Price
    1001 - 0 - S1 - Table - 2 - 100
    1001 - 1 - S1 - Chair - 8 - 25
    1001 - 2 - S1 - Cloth - 3 - 10
    PO # - PO Line # - PO BaseEntry (SO DocEntry)  - PO BaseLine (SO Line #) - Item Code - Item Name - Quantity - Price
    2001 - 0 - 1001 - 0 - S1 - 2 - 100
    2001 - 1 - 1001 - 1 - S1 - 8 - 25
    2001 - 2 - 1001 - 2 - S1 - 3 - 10
    Note that standard B1 gross profit calculation is that system will compare selling price for each item with item cost / certain price list of each respective item. However, in your case, you put all item as a single item master. Thus, system couldn't compare Table to Table, Chair to Chair, Cloth to Cloth since the item cost for these 3 items will be the same, the price list for these 3 items will also be the same since it is actually only one master data. Of course you could update the gross profit calculation manually for each SO, but to be honest it seems rather weird to do this manually.
    So, in order to simulate the gross profit calculation, you need to create a custom query and comparing PO line no with SO line no.
    As far as accounting related recording concern, I'm afraid you can't do it
    1. SO 1 : Item Table - Selling price 130 ; Item Chair - Selling price 30
    2. PO 1 (linked to SO 1) : Item Table - Purchase price 100 ; Item Chair - Purchase price 25
    3. SO 2 : Item Table - Selling price 150 ; Item Chair - Selling price 40
    4. PO 2 (linked to SO 2) : Item Table - Purchase price 110 ; Item Chair - Purchase price 30
    Correct me if I'm wrong, you want to record accounting wise that CoGS of Delivery based on SO 1 is 100 for Table and 25 for Chair, isn't it? No matter what costing method you use, you can't achieve this.
    If you use moving average, system will average both Table and Chair cost price, since it is actually one item master data. Even if you distinguish each item as a master data, system will average the cost price for Table and Cloth by the time GR for PO 1 and PO 2 occurred.
    Example (order by sequence of event):
    1. GR based on PO 1 - Table - Purchase price = 100, therefore Item cost = 100
    2. GR based on PO 2 - Table - Purchase price = 110, therefore Item cost = 105 (considering quantity only one for both PO)
    3. Delivery based on SO 1 - Table - CoGS incurred will be 105, not 100
    To certain extent, same thing could be said with FIFO costing method
    1. GR based on PO 1 - Table - Purchase price = 100 (qty 1)
    2. GR based on PO 2 - Table - Purchase price = 110 (qty 1)
    3. Delivery based on SO 1 - Table - CoGS incurred will be 100 (qty 1)
    4. Delivery based on SO 2 - Table - CoGS incurred will be 110 (qty 1)
    At first glance, it seems right since the CoGS for SO 1 is 100, tied up with purchase price for PO 1. And CoGS for SO 2 is 110, tied up with purchase price for PO 2. But we're using assumption here, we're assuming the sequence of Goods Receipt of PO and Delivery of SO occurred in the very same sequence as the issuance of SO and PO.
    1. GR based on PO 1 - Table - Purchase price = 100 (qty 1)
    2. GR based on PO 2 - Table - Purchase price = 110 (qty 1)
    3. Delivery based on SO 2 - Table - CoGS incurred will be 100 (qty 1)
    4. Delivery based on SO 1 - Table - CoGS incurred will be 110 (qty 1)
    If above scenario / sequence that happened, you will get the wrong figure of gross profit since the Delivery of SO 2 will take the item cost based on GR of PO 1. Since we're actually talking about real life business process, who can guarantee that above scenario wouldn't happen? It is possible that you send goods to customer who ordered late in real life, too much possibility that it is better for you to mitigate such result.
    My suggestion would be that you record the accounting transaction based on standard business process, no need to really capture the actual cost and actual gross profit for certain SO and PO. Too complicated, and the software itself doesn't cater this kind of requirement. Best thing you could do only create custom query for gross profit simulation calculation, but for very accurate accounting recording, IMO you should forget it. Hope this help.
    Best Regards,
    Hendry Wijaya

  • Revenue Account Determination based on Sales Order Document Type & Service Order Type

    Hi Expert,
    I have Customer Service Module with Resource Related Billing for services attached with SD.
    When DP90 runs sales document debit memo request is created & then debt memo is created.
    I need to configure Revenue Account Determination based on Sales Order Type and also based on Service Order Type.
    I did not see any field catalogue in revenue account determination for order type, For communication structure KOMKCV Header and KOMPCV Item level there is no field for sales order type nor service order type.
    Is it possible to bring in both order types? Can ABAP person do it?
    How to bring these fields?
    Is it possible & recommendd to have service order type filed AURAT for service order into this sturcture?
    Is this configuration is OK acceptable by SAP? If so is there any chnace for issues errors & wrong determination from FI CO view?
    Your valued input is highly appreciated.
    Thanks
    Prakash Parikh

    Hi Prakash,
    Yes, you can certainly add new table fields into the field catalog KOMKCV and KOMPCV and use it during account determination. You will also have to add these new fields in the user exit RV60AFZZ for it to work. I believe you will need ABAPer's help to make this work. The abaper will have to crate a ZZFIELD (ZZAUART for example) and put it in the structure and use the same in the user exit to pass the values.
    In your case, what I am not sure is, are you looking to modify the existing standard tables or creating new ones. My suggestion is to create the new condition tables with these new fields (like document type) after adding it to the field catalog. Only modify the access sequence (KOFI) in such a way that your new tables are access first before it goes into standard tables (or you can adjust it according to your scenario.
    We have done it in our company and it is working fine. Basically what we have done is to create new tables instead of modifying the standard ones. We have adjusted the access sequence in such a way that some of our custom tables are accessed first before the standard SAP tables (C001 to C005).
    I found a similar requirement on SCN. This might help.
    Adding New Field in Account Determination
    Hope this helps.
    Regards,
    Mukund S

Maybe you are looking for

  • How to print multiple PDF attachments from report

    Hello experts, I have developed an ALV report that is having some PDF attachments and I have push button(Print all) as shown in below image. When I click on print all button all the pdf attachments should be send to printer. I did check in the SCN bu

  • [SOLVED] flashplugin video freezing while audio is fine

    I saw a post about this on this forum, but I've been searching the forum for about 5 hours now and I can't find it, so I'll post a new topic. When I do almost anything with adobe flash (in firefox or chromium) after about five seconds the visual free

  • The Ultimate Problem!!! iTouch not even recognized AT ALL!!!

    As my title clearly states, my Ipod Touch 2 Gen is not even recognized by my computer AT ALL, no USB device, camera, nada furthmore it can't even recharge via my computer And to avoid any meaningless crap: Yes , my USB cable works, iTunes somewhate w

  • Battery expanded and burst open-What caused this?

    Hello, I have an early 2008 MacBook Pro.  It still had  the original battery in it which a few months ago started expanding.  At  first I thought it wasn't a big deal but later on it started getting  much bigger until the actual casing of the battery

  • Allocation by team leader of tasks to different team member (standard Badi)

    Hi All, Service request.:- I have a requirment that i need to allocate the taskto team members in sap crm through a Badi. Can any one let me know any standard badi in sap crm for allocation of task by team leader to team members. thnks.