Creating a purchase document based on a sales document via DI-API ?

Hello evrybody!
I would like to create a PurchaseOrder based on an existing SalesOrder.
I do that by copying and setting the propertys of those DI-API Document-Objects.
I also set the Document_Lines.
BaseEntry-
BaseLine-
BaseType-
propertys to the type and corresponding numbers of the base document.
But I get an error of the DI-API when adding the document, which tells me that the CardCode of the new document does not match the base documents CardCode.
Thats true: the CardCodes do not match. But that's what we want when purchasing some items for a customer
In the database (DocLines) I found a field "BaseCard". This is set to the CardCode of the source document when creating a purchase order by a sales order with standard SAP-functionality.
But "BaseCard" is not exposed through DI-API and I can't test if it works if I could set this value.
So isn't it possible to use the base***-propertys when copying from Sales- to PurchaseDocumnets?
Thanks in advance,
Roland

Hello Roland,
This is not possible. You cannot create PO from SO by DI ÍAPI.
You can create only Via GUI, Using the Purchase Orders chekcbox
Regards,
J:

Similar Messages

  • MRP creating additional purchase requisitions for the existing sales order

    Hi,
    We have scenario where we switch materials from POD material to ARP material. POD material is just like make to procurement which creates purchase requisition and purchase order upon saving the sales order. ARP (Auto replenishment) material creates purchase requisition based on sales order and re-order point while running MRP.
    When the material is POD title, it created purchase requisition and purchase order (example: 4500000110) while saving the sales order (example: 1000000010) for the quantity 10. After some time this material is switched to ARP and it has open sales order (1000000010) and purchase order (4500000110).
    We have special MRP run for ARP materials based on MRP type, which creates purchase requisition.. What is happening is when we run MRP; it is creating new purchase requisition for the old sales order (1000000010) for the quantity 10. But old sales order (1000000010) is already having purchase order (4500000110) to fulfill. So we donu2019t want to create new purchase requisition for the old sales orders. It should create purchase requisition only for new sales orders.
    Please advise
    Thanks in advance
    Srinivas

    Mangesh,
    If the components are Inhouse production then you can think of using collective orders by assigning special procurement key 52. If raw material exists then your requirement cannot be met..as i think your scenario is of assembly processing. The idea of assembly processing is that component materials will always be available and only assembly will be done based on Sale Order.
    Regards,
    Prasobh

  • Creating a delivery note based on a sales order in SBO2005

    Hi
    I am using the diapi to create a delivery note based on a sales order. Everything works well apart from I have 3 user defined fields on the sales order lines, 2 numeric and one which is a combo box.
    The 2 numeric values as copied across ok but the combo is not.
    I don't know what the delivery number is as I guess SAP assigns that after I save the delivery note.
    Can anyone help me with this please ?
    Regards Andy

    Hi Paul & Gilbert,
    As you assumed, the docentry is created at the moment when you are saving the document.
    The docentry for the last created document can be retrieved from the Company object. There are two alternative methods for this: GetNewObjectCode and GetNewObjectKey. Please see the DI API reference for more details. These are the only reliable way to get the last created docentry. A query might work nicely in 95% of the cases, but in a multi-user environment it will sooner or later produce incorrect results.
    Henry

  • 2007A PL8 UOMs are missing when creating a document via DI-API

    If a document is created via DI-API the UOMs are missing.
    The behavior till PL8 was that UOMs were taken from the item master when creating a new document.
    Regards

    This is a confirmed Bug. The DI-Api always uses the Inventory UoM. As work around you have to put the Sales UoM into the Inventory UoM.
    I hope they we will fix this soon.
    Regards

  • Send Purchasing Documents via email/fax to vendor

    Hi all,
    I have a customer requirement wherein Purchasing documents such as RFQ, PO etc need to be sent to vendors via email/fax. To cater to the customer's form requirements, we developed smartforms instead of using the standard MM purchasing smartforms. To call these smartforms in the print programs, we copied the standard print program SAPFM06P and commented out the function module ME_PRINT_PO  in the routine ENTRY_NEU and added the our own code to call the custom smartform. The custom code segment in the print program is attached for reference.
    Now, when we are trying to generate messages for the purchasing documents using output type External Send, the custom program does not pick up the email address maintained in the vendor master and instead picks up email address maintained in RFQ or PO initiator's user profile. We have made the required configuration for SCOT and SOST tcodes.
    We tested the same scenario requirement using the standard print program and got the desired results i.e. the print program picked up the email address maintained in the vendor master. But with this approach, we cannot use our custom smartform.
    Any help in this matter will be appreciated.
    Regards,
    Saad

    Hi Biju !
    Thanks for the response but I think you missed the point here. I am using different output types for RFQ and PO as well as different custom smart forms and we are using the same custom print program to generate output for both.
    The issue is with the print program and not the output type as I mentioned that I have already got this thing working on our IDES using the standard print program and standard forms.
    Tomas Talpa's response seems to be helpful. I'll get my technical consultant to amend the code accordingly and see if it works.
    Regards,
    SaaD Karim Mallick.

  • Purchasing Documents via Email

    Hi all,
    We send our vendors purchase orders via email.
    The mail used is the one maintained in the vendor's Master record.
    Does anyone know how can we send the PO to multiple email addresses - also
    maintained in the vendor's Master record?
    Thank's,
    Dan

    Hi,
    You can not do that, because normally in SAP system one vendor only has single email address which can be used to receive the email from SAP system, that is standard solution, if you want to send out to multiple email addresses, you should develop your own ABAP program of sending purchasing document in the system.
    Good day
    Tao

  • Printing marketing documents via DI API

    Hello everybody?
    I've been looking for some information about how to print marketing documents through DI API using the layout assigend in the PLD. Until now i have not found a way to do this, so I want to know if anyone has found a solution either using ALD?
    I've seen some workaround using the DI API but it's not useful for me, so it's a definitive answer to say that it's not possible to do this?
    Thanks

    Hi,
    When i had a similar requirement i used Crystal reports to preview and print my custom reports, I opened the Report on the Print Preview menu icon click.
    Hope it helps,
    Vasu Natari.

  • How Billing doc.created from purchase invoice in Third Party Sale

    Hi All
    Our client requirement  has been mapped as sap third party sales process .
    But if the vendor is delivering less qty .  than the qty. for which Sales ordered  has been  created, How to create the  Sales billing Doc.  according to the purchase invoice so that Sales Billing  Doc. should be created for the delivered qty. only .
    Please suggest the configuration  & how the data is flowing from the Purchase Invoice to the Sales Invoice.
    Thanks in advance
    Ashok

    Hi
    you can achieve your requirement by following
    T-Code  VTFA (copy control Order to Billing)
    use you Third party order type and billing type
    Go to Item category (if Standard use TAS)
    there is a option "BILLING QUANTITY"
    user there "E" Goods receipt quantity less invoiced quantity"
    Hope it will solve your problem
    Cheers
    Shambhu Sarkar

  • Problem while creating a custom document using JAVA API in the current Folder

    I am trying to create an instance of a custome type from the API. I have created a custom type via XML. I have associated a JSP with the custom type thru iFS manager. This jsp provides an interface for the user to enter various data. On submit I call some other jsp also loaded into the /ifs/webui/jsps which calls a method in the java class to create an instance of the above mentioned type. This instance needs to be created in the current directory and not in the home directory of the user. I have written a java program which when run from JDeveloper connects to the repository and creates the object, but not as a foldered object. If I load this class into custom_classes directory, I get an exception. I am attaching the code also here which does the actual processing.
    package cms;
    import oracle.ifs.agents.common.*;
    import oracle.ifs.agents.manager.*;
    import oracle.ifs.agents.server.*;
    import oracle.ifs.beans.*;
    import oracle.ifs.common.*;
    public class ContentModule extends Object {
    public static final String CLASSNAME = "CONTENT";
    public static final String TOPICID_ATTRIBUTE = "TOPICID";
    public static final String SITEID_ATTRIBUTE = "SITEID";
    LibrarySession m_session;
    public ContentModule() {
    connectToRepository();
    createDocument("AM5","s");
    public void connectToRepository(){
    try{
    LibraryService l_service=new LibraryService();
    CleartextCredential l_credential = new CleartextCredential("system","manager");
    ConnectOptions l_options=new ConnectOptions();
    l_options.setServiceName("IfsDefault");
    l_options.setServicePassword("ifssys");
    m_session=l_service.connect(l_credential,l_options);
    }catch(IfsException ex){
    ex.setVerboseMessage(true);
    ex.printStackTrace();
    public void createDocument(String p_docName,String p_docContent){
    try{
    DocumentDefinition l_doc=new DocumentDefinition(m_session);
    l_doc.setClassname(CLASSNAME);
    long newId1=5;
    long newId2=5;
    FolderPathResolver l_currentPath=new FolderPathResolver(m_session);
    Folder l_currentFolder=l_currentPath.getCurrentDirectory();
    l_doc.setAddToFolderOption(l_currentFolder);
    l_doc.setName(p_docName);
    l_doc.setContent(p_docContent);
    AttributeValue av1 = AttributeValue.newAttributeValue(newId1);
    l_doc.setAttribute(TOPICID_ATTRIBUTE,av1);
    AttributeValue av2 = AttributeValue.newAttributeValue(newId2);
    l_doc.setAttribute(SITEID_ATTRIBUTE,av2);
    Document l_document=(Document) m_session.createPublicObject(l_doc);
    }catch(IfsException ex){
    ex.setVerboseMessage(true);
    ex.printStackTrace();
    public static void main(String[] args) {
    ContentModule contentModule = new ContentModule();
    Any help will be highly appreciated.
    Thanks

    Please print out the Verbose Stack Trace generated when you run this application.
    I suspect that you FolderPathResolver is not pointed at the directory you think it is. You might want to try printing out
    I_CurrentFolder.getAnyFolderPath();
    and I_CurrentFolder.getName();
    null

  • Error -1116 when creating a Sales Order via DI API

    Hi All,
    We have an developed EDI AddOn that creates Sales Orders in SBO 2007 PL13, in one of our clients.
    This AddOn is responsible for the creation up to 100 orders each day on SBO.
    However, sometimes (3 to 4%) during the Sales Order creation, the system return an error -1116 when the Sales Order is created - via oSalesOrder.Add() method.
    The problem is that the order is created anyway, although this error is raised.
    I've searched in the forums and it seems the solution is somehow related with SBO transactions.
    However, the AddOn only created the Sales Order, nothing more.
    Does any body know a solution for this problem?
    Regards,
    Manuel Dias

    Hi,
    see this links,
    Error -1116 when creating delivery note
    Could not commit transaction, ReturnCode:-1116
    Regards,
    siva

  • Create a purchase order linked to sale order with DI

    Hello all,
    I tried to create a purchase order based on a sale order with the DI but I get an error message "the business partner selected in base document is different than the target document"
    As you understand, this is normal to have a different business partner. So my question is : is it possible to create with the DI a purchase order linked to a sale order or is this a missing functionality ?
    Thank you
    Sebastien

    Hi sébastien,
       oDoc.Lines.ItemCode = "A00001"
        oDoc.Lines.Quantity = 1
        oDoc.Lines.BaseType = 17
        oDoc.Lines.BaseEntry = 213
    A Purchase document's BaseType can only be a Purchase document itself.
    A Sales document's BaseType can only be a Sales documento itself.
    To create a Purchase Order based on a Sales Order you must go through each row of the Sales Order and copy the values (ItemCode, Quantity, Discounts, VatGroup, etc.) to the Purchase Order.  And remember the VATCode used in a Sales document cannot be the same as the one used in a Purchase document.
    Best Regards,
    Vítor Vieira

  • 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

  • Cannot create AR Invoice negative amount with WithHolding Tax negative amount via DI API

    Hi All,
    I tried to create AR Invoice Document via DI API, but with negative amount and negative withholding tax amount.
    Document added successfully, but when i open the document in SAP, and i open WTax Table information, withholding tax amount become zero,
    Please see image below.
    But when i add the same document through SAP Screen, i can fill WTax Amount with negative amount.
    SAP Version 9.0 PL 5
    Please kindly help,
    Thanks
    Best Regards
    Siddharta

    Hello.
    If this is different to the behavior of the B1 application it should be considered a bug - like any such difference between DI API and app.
    HTH

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

  • Create purchase order with reference to Sales order Line item

    Hi All,
    i had a requirement that i need to create the Purchase order with reference to sales order line item...
    In T.code me27 client requied a input field for sales order no and with that order reference he want the data of line item to PO creation line item screen.....
    please sujjust......how to proceed......
    regards,
    Ravi Nemani

    Hi
    Go to SPRO->Logistic general->Tax on goods movement->India->Movement types.
    Here you will find the group of movement types check which movement types is mantained for the out side movement groups or inward movement.
    also check the Material Master in MRP view if the collective requirements (02) is mantained.
    Regards
    Sri

Maybe you are looking for

  • Using the Hard drive space

    I want to buy a classic iPod either 80 or 160gb, but my question is my setup. I have a laptop with only a 60gb hard drive with an external 500gb hard drive. Will I be able to use my external drive to house my itunes files so I can use all 160gb?

  • Adobe Form in Modal Window

    Hi all, I am displaying an Adobe Form in a pop up modal window. The display type of the Adobe form is native. However when the popup window shows up, the adobe form is not shown properly. There is no problem if i set the displayType of the adobe form

  • Upgrade from trial version to full

    I wonder if someone can assist, although this is not a tech query.  I am currently using Elements 7 and considering upgrading to Photoshop CS5.  I can take the upgrade path and save nearly £100.  Further, if I order the boxed version from Adobe inste

  • System (Runtime) execute command for copying the file

    Can any one tell me what is wrong with this - it throws an IOException String sourcepath = "C:"+File.separator+"pbx"+File.separator+"mantra"+File.separator+"vvvvv.mp3"; String destinationpath = "C:"+File.separator+"rrr"+File.separator+"mantra"+File.s

  • ThrColFixHdr.css problem in FF

    Hi, I have used the template css in dreamweaver and have edited the third column out(deleted) in the three column fixed header, now in IE the content of maincontent stays within the box, but in FireFox it does not. The text goes out of the surroundin