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

Similar Messages

  • 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

  • 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.

  • Project code based  Sales Order and Purchase Order - Item wise Report

    Dear all,
    Scenario:
    We are doing business based on Projects.  So, for every Sales , Project code is created and Sales order is booked with Project code and subsequently Purchase Order is booked with Project code. (Note:Some cases, few items might not be purchased since stock is available.)
    We want report like
    SO Project code
    SO Posting date
    SO Sales Employee
    SO Customer Name
    SO Item code
    SO Quantity
    SO Unit price
    SO Row Total
    PO Project code
    PO Posting date
    PO Sales Employee
    PO Customer Name
    PO Item code
    PO Quantity
    PO Unit price
    PO Row Total
    *SO line item and PO line item for same project should be parallel , that is important and challenge (certain cases, item in SO might not be in PO, for such cases Blank field should appear for PO Item code.)
    Thanks in advance,
    Regards,
    Dwarak.

    Hi Dwarak.......
    Your Report is right but a small change you have to make Left join RDR1 with POR1........
    Try this.......
    SELECT T0.PrjCode, T1.Project, T0.PrjName, T1.DocNum, T1.DocDate, T1.CardName, T2.ItemCode, T2.Dscription, T2.Quantity, T2.Price, T2.LineTotal, T3.Project, T4.ItemCode, T4.Dscription, T4.Quantity, T4.Price, T4.LineTotal FROM OPRJ T0 INNER JOIN ORDR T1 ON T0.PrjCode = T1.Project INNER JOIN RDR1 T2 ON T1.DocEntry = T2.DocEntry LEFT JOIN OPOR T3 ON T0.PrjCode = T3.Project LEFT OUTER JOIN POR1 T4 ON T3.DocEntry = T4.DocEntry AND T2.ITEMCODE = T4.ITEMCODE INNER JOIN OITM T5 ON T2.ItemCode = T5.ItemCode WHERE T0.PrjCode ='[%0]' AND
    T5.ItmsGrpCod in ('108', '110') GROUP BY T0.PrjCode, T1.Project, T0.PrjName, T1.DocNum, T1.DocDate, T1.CardName, T2.ItemCode, T2.Dscription, T2.Quantity, T2.Price, T2.LineTotal, T3.Project, T4.ItemCode, T4.Dscription, T4.Quantity, T4.Price, T4.LineTotal
    Regards,
    Rahul

  • How to get sales order number based on purchase order

    hi,
    what is the transaction code to find the sales order number based on the purchase order number
    Regards,
    Murali

    Hi,
    Go to Se16 (data browser), see the table VBKD, enter the PO number, if any, execute.
    Prase

  • How to get Sales Text & Purchase Order Text in MM based on (MSEG-MATNR)

    Hi
      Am working on a Report based on Purchase order & Sales, Could any body tell How to get Sales Text & Purchase Order Text in MM based on (MSEG-MATNR).
    the Field i need to get are : SALES TEXT, PO TEXT.
    Sunil.

    Hi Sunil,
    For getting Material PO text and sales text, you have to rely on Purchase Order and Sales Order. And use READ_TEXT function module to fetch the text.
    Below are examples of PO text and Sales Text:
    1. PO text:
        CALL FUNCTION 'READ_TEXT'
         EXPORT
           ID = 'F03'
           LANGUAGE = SY-LANGU
           NAME = '450000011200010' conacte PO number and line item number
           OBJECT = 'EKPO'
         TABLES
           LINES = INT_TLINES "you will get text in this table
    2. Sales order text:
            CALL FUNCTION 'READ_TEXT'
         EXPORT
           ID = '0001'
           LANGUAGE = SY-LANGU
           NAME = '0000000036000010' conacte SO number and line item number
           OBJECT = 'VBBP'
         TABLES
           LINES = INT_TLINES "you will get text in this table
    ref: STXH and STXL tables.
    Hope it will solve the problem.
    Regards
    Krishnendu

  • FM to find Sales Order based on Purchase Order Number

    Hi All,
    I have a Purchase Order number and based on this I want to find out the corresponding Sales Order Number.
    Can anyone help me find any FM for this (I have tried RV_ORDER_FLOW_INFORMATION but its not of much help).
    Regards,
    Shoeb

    Check my reply here.
    Re: Purchase order number from Sales order

  • 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.

  • 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.

  • 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

  • Sales order based on purchased order

    Hi,
    How can do a sales order based on a purchase order? I will see all the document workflow on the purchase order history?
            Thanks in advance...
                  Best Regards
                         João Fernandes

    Hello Fernandes,
         I don't think there would be a process where in we place a purchase order to our vendors and then create a sales order based on it for a customer.. Its not at all a common business process..
    Generally we will purchase if required, if we have any sales order, for which we don't have enough stock or doesn't manufacture those products; but the vise versa may not happen in general.
               And even SAP doesn't support that, you can never see the Sales order in the Purchase order history.
       We can create the Sales order based on the purchase order that was placed by the customer .
    Please confirm your business requirements, and let us know to help you in a better way.
    Regards,
    Ajai
    Don't forget to reward points if helpful.

  • 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.

  • Workflow issue when create Purchase Order automaticlly based on Sales Order

    dear experts,
    I got a problem when create purchase order automatically once the Sales Order created, the field ERNAE of the Purchase Order creatd is WF-BATCH, but we want this field to be the user log in the system, like John. Smith
    it seems this is a configuration issue, but i am not familar with workflow, do you experts have any solutions?
    thank you in advance.
    Hongtao

    thank you for you reply my friend.
    yes, i mean the PO creator.
    I just create a SO in VA01, then change the Schedule line category from CN to CP, then SAVE, then Confirm the Delivery Proposal. after all this, the PO will be created automatically by Workflow. Because when I display the PO via ME23N, it displays [Standard PO XXXXX  created by Workflow-System] on the top of the screen.
    But i do not know which workflow is trigered to create the PO. and i tried SWEL like you said, there is no record listed.
    do you have any other suggestions? thank you so much, friend.

  • Error adding Goods Receipt PO based on Purchase Order

    I am working on an add-on that was working against a 2005A version of SAP Business One and I am upgrading it to run against a 2007A Company (PL41)
    I am receiving strange errors when testing the add-on.
    I can add a Purchase order not based on a Goods Receipt PO without any problems but as soon as I specify a base type, entry and line I get either -1 General Error, or the Tried to Read/Write Protected Memory Error.  The error I receive seems to arbitrarily change between the two.
    I have read a few notes on the forums about this but none of them have proven useful in solving my problem.  I have checked the DI-API version on my PC and it is definitely using 8.0.177.0 which matches the version of SBO that I am running.  I have re-installed the DI etc without any success.
    The following is the code snippet which I am using to test:  I have verified that the referenced purchase order is open, contains the correct item, customer etc
    int iResult = -1;
    string sResult = string.Empty;
    string sOutput = string.Empty;
    try
    sOutput += Environment.NewLine + "Connecting to company...";
          sbocoy = new SAPbobsCOM.Company();
          sbocoy.Server = "<insert server name here>";
          sbocoy.CompanyDB = "<insert database name here>";
          sbocoy.LicenseServer = "<insert server name here>:30000";
          sbocoy.UseTrusted = true;
          sbocoy.DbServerType = SAPbobsCOM.BoDataServerTypes.dst_MSSQL2005;
          sbocoy.UserName = "manager";
          sbocoy.Password = "<inser sap user here>";
          iResult = sbocoy.Connect();
          sOutput += Environment.NewLine + "Connected";
          SAPbobsCOM.Documents PO = (SAPbobsCOM.Documents)sbocoy.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oPurchaseOrders);
          SAPbobsCOM.Documents GoodsReceiptPO = (SAPbobsCOM.Documents)sbocoy.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oPurchaseDeliveryNotes);
          sOutput += Environment.NewLine + "Get Purchase Order";
          PO.GetByKey(1402);
          sOutput += Environment.NewLine + String.Format("DocNum: {0}; DocEntry: {1}; ItemCode: {2}; LineNum: {3}", PO.DocNum, PO.DocEntry, PO.Lines.ItemCode, PO.Lines.LineNum);
          GoodsReceiptPO.CardCode = PO.CardCode;
          GoodsReceiptPO.CardName = PO.CardName;
          GoodsReceiptPO.Lines.ItemCode = PO.Lines.ItemCode;
          GoodsReceiptPO.Lines.ItemDescription = PO.Lines.ItemDescription;
          GoodsReceiptPO.Lines.Quantity = 1.0;
          GoodsReceiptPO.Lines.BaseType = int.Parse(PO.DocObjectCodeEx); // If I comment out this and the next two lines the document will add
          GoodsReceiptPO.Lines.BaseEntry = PO.DocEntry;
          GoodsReceiptPO.Lines.BaseLine = PO.Lines.LineNum;
          sOutput += Environment.NewLine + "Adding Goods Receipt...";
          iResult = GoodsReceiptPO.Add();
          sResult = sbocoy.GetLastErrorDescription();
          sOutput += Environment.NewLine + string.Format("Result [{0}] {1}", iResult, sResult);
    catch (Exception ex)
    sOutput += string.Format(Environment.NewLine + "Exception: {0}{1}SBOError: {2}", ex.Message, Environment.NewLine, sbocoy.GetLastErrorDescription());
    The results when I try and reference the purchase order are:
    Connecting to company...
    Connected
    Get Purchase Order
    DocNum: 301396; DocEntry: 1402; ItemCode: SEANTESTITEM; LineNum: 1
    Adding Goods Receipt...
    Exception: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
    If I comment out the 3 lines that reference the base document the Goods Receipt Adds and the following is the output...
    Connecting to company...
    Connected
    Get Purchase Order
    DocNum: 301396; DocEntry: 1402; ItemCode: SEANTESTITEM; LineNum: 1
    Adding Goods Receipt...
    Result [0]
    The above code will work correctly if we base a Delivery Note on a Sales Order so it appears to be specifically related to the Purchasing Documents.
    Edited by: Sean Archer on Feb 2, 2009 2:23 PM

    Hi Ganesh,
    Thank you for the reply.
    I ran the add-on against another database and it is working.
    I also verified that the document was failing to create if done via the Data Transfer Workbench so it would appear the issue affects the DI-API irrespective of add-on.
    I will need to do more testing to confirm whether this is a bug with PL41 of 2007A or a corrupt database as you suggest.
    Cheers,
    Sean

  • Open Purchase Order, Sales Order and WIP Jobs

    Hello,
    Can some one help me with the query to find all open sales order, open purchase orders and open WIP jobs for an organization.
    Is there any way i can fetch this information from Oracle forms directly without running any backend query ? If yes, please help me with the navigation and other details.
    Thanks,
    Shilpa.

    XtreMe Imperium - Retailer sales reporting, a centralized reporting system for a malls POS data. It provides access to detailed, consolidated reporting of all retailers. We collect your data, and deliver it through reports that are customized to meet your needs.
    XtreMe Imperium Retailer Sales Reporting allows you to
    Manage master information of all retailers
    Web based daily / optional intraday* reporting of POS data
    Accurate sales information from retailers. No Misreporting
    Analytical Information of brand & category performance
    Average spend size with daily trends
    MIS to strategize and implement Mall promotions
    How it works
    It all starts with the client software running on each location’s POS server. This client is a small application that is set up to execute using Windows Scheduler. This gives you full control over how frequently the data is sent to the server. Once the data is loaded to the server, using secure FTP over a broadband internet connection, it is loaded in to a MS SQL database. Once there, it is available for reporting using an interface that is simple and easy to navigate.
    for more: [http://pftec.com/MallManagement/retailer-sales-reporting.aspx|http://pftec.com/MallManagement/retailer-sales-reporting.aspx]

Maybe you are looking for

  • OSB project deployment problem with MFL file

    Hi, I have created a OSB project to transform a xml message into a text file. For this I have created a mfl and the necessary proxy/business service. I can generate the sbconfig.jar from OEPE tool. But while trying to deploy the sbconfig.jar (generat

  • Help compiling a package

    Hello Java peeps, I have been having troubles compiling a package in Java... My school assessment project was pretty big so I decided to cut into multiple java classes, but instead of having unclean code, I decided to add them all to one package, so

  • HT1665 when will apple be selling accessories for the IPhone 5

    When will Apple start selling accesories for the New Iphone 5, such as cases and or screen protectors ?

  • Remove direct update of database table for VBUk and VBRK

    hello, we are updating  database table only for thse two single fields VBRK-FKDAT_RL and VBUK-RELIK using direct UPDATE statements. Could you please suggest some function modules or BAPI ? BDC is not possible as some fields are not editable. Awaiting

  • Enable Attachment function on my Custom form

    Dear All, I am unable to enable attachment function on my Custom Sales Order form. Our form is just like standard form with some minor changes. Please, help me in this regards. Regards, Arsalan