Create an AP Invoice based on a Purchase Order using SDK

Hi,
What are the steps to create an AP Invoice based on a Purchase Order using DI API?
Which methods of which objects to use and what parameters to pass?
Thanks.

Hi Rajesh,
Here is a sample to create an Invoice based on a Sales Order. The same way you can change as per your requirement:
SAPbobsCOM.Documents oInvoice = default(SAPbobsCOM.Documents);
            oInvoice = (SAPbobsCOM.Documents)SBO_Company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oInvoices);
            oInvoice.CardCode = "C000003";
            oInvoice.DocDueDate = DateAndTime.Now;
            oInvoice.Lines.BaseType = Convert.ToInt32(SAPbobsCOM.BoObjectTypes.oOrders);
           oInvoice.Lines.BaseEntry = Convert.ToInt32(3616);
           oInvoice.Lines.BaseLine = 1;
            oInvoice.Lines.Quantity = 3;
            oInvoice.Lines.Add();
            oInvoice.Lines.BaseType = Convert.ToInt32(SAPbobsCOM.BoObjectTypes.oOrders);
            oInvoice.Lines.BaseEntry = Convert.ToInt32(3616);
            oInvoice.Lines.BaseLine = 2;
            int kth = 0;
            kth = oInvoice.Add();
            if (kth != 0)
                int irrcode;
                string errmsg;
                SBO_Company.GetLastError(out irrcode, out errmsg);
                Program.oMainSAPDI.ShowMessage(errmsg, BoStatusBarMessageType.smt_Error);
The main thing to remember is Base Type, Based Entry and Base Line.
Hope it helps.
Thanks & Regards
Ankit Chauhan

Similar Messages

  • Cannot query AR invoices based on the purchase order number in R 12 1.3

    Hi,
    We need to query invoices based on the purchase order number, However when we try to Ct+F11 get the message *"Please fill in selective criteria in at least one of the following fields for performance reasons: GL Date, NUmber,Bill to etc."*
    Is this a new feature or a bug?
    Thanks and Regards,
    MPH

    Hi All,
    I found the solution in the following note.
    *How to prevent Blind Query or Query on Non Indexed Column in Transaction, Receipts, Collections forms? [ID 753222.1]*
    Thanks and Regards,
    MPH

  • Enhancement on MRRL - Create MM ERS Invoice based on Head Office

    Hello Experts,
    There will be multiple vendors who supply materials.  However, the Invoice should be created only on the Head Office Vendor. This is standard functionality.
    Supply vendor 1 - Head Office - X
    Supply vendor 2 - Head Office - X
    While creating invoices on the head office, the system should create only one invoice for all the purchase orders / GRs from all the supply vendors who have the same Head Office ( partner function PI).
    Standard possible options are
    1. Document selection per vendor
    2. Document selection per purchase order
    3. Document selection per order item
    4. Document selection per delivery document/service entry
    MM space replied
    Hi,
       Refer the note: 520814 - MRRL: System behavior during document selection which explains the system design and the note: 159455 - Documentation: Enhancement MRMH0001 (MM-IV)  which explains the exits and the trigger points.  You may check the feasibility.
    Regards,
    AKPT
    I saw there is an exit MRMH0001, but I am stuck to proceed further.
    Anyone implemented for the same requirement.
    Regards,
    Vadamalai A

    Thanks for your reply.
    How to get the selection screen value 'Doc. selection' in the program Include ZXM08U20.
    Below are the values are exist in selection screen
    1. Document selection per vendor
    2. Document selection per purchase order
    3. Document selection per order item
    4. Document selection per delivery document/service entry
    Regards,
    Vadamalai A.

  • Create MM ERS Invoice based on Head Office-MRRL

    Hello MM Experts,
    There will be multiple vendors who supply materials.  However, the Invoice should be created only on the Head Office Vendor. This is standard functionality.
    Supply vendor 1 - Head Office - X
    Supply vendor 2 - Head Office - X
    While creating invoices on the head office, the system should create only one invoice for all the purchase orders / GRs from all the supply vendors who have the same Head Office ( partner function PI).
    Standard possible options are
    1. Document selection per vendor
    2. Document selection per purchase order
    3. Document selection per order item
    4. Document selection per delivery document/service entry
    Is there any settings to achieve or any development needed?
    Can you please anyone worked on this scenario?
    I appreciate your earliest response.
    Regards,
    Vadamalai A

    Hi,
       Refer the note: 520814 - MRRL: System behavior during document selection which explains the system design and the note: 159455 - Documentation: Enhancement MRMH0001 (MM-IV)  which explains the exits and the trigger points.  You may check the feasibility.
    Regards,
    AKPT

  • Invoice Value tolerances based on the Purchase Order type..

    Hi Gurus,
    Can anyone please tell me if there is a way to assign the variance (tolerance limit) to the Invoice document based on the Purchase Order? What I want to do is that when the Invoice is posted in the system, the system should be able to check the document type of the Purchase Order and then based on that the tolerance limits should be applied on the Invoice. for example PO document type NB- tolerance for Invoice plus/ minus 10%, Document type FO- tolerance limit plus/minus 5%.
    I know we can do it based on the Vendor but we use the same vendors for a number of purposed ( a number of PO types)hence can use that.
    Thanks in advance
    Anoop

    Hi,
    Check on it:-
    Purchase Order Tolerance
    http://wiki.sdn.sap.com/wiki/display/ERPSCM/MM-IV-LIV-CRESetTolerancesforIncoming+Invoice
    pherasath

  • Track documents based on a purchase order

    Hi,
    One of my customers asked me yesterday if there is a good way to follow the steps from a purchase order to goods reciept and AP invoice? If you have a large purchase order with many items and only a few of them are copied to goods reciept PO at a time, and you have several goods reciepts PO and many invoices. How can one best track all of these documents and get a good overview?
    I tried using Drag & Relate, but it's not good enough to get the whole picture. So I would really appreciate if you have some tips, or if there could be a way to create a report for which documents are based on a purchase order.
    Best regards,
    Lena-Marie

    Hello Lena-Marie - welcome to the forum.  You might want to start with this and add some more into and/or change the WHERE clause to pull up the information you need.   Such as T2.DocNum =
    This SQL was restricted to display only some open items...
    If you need more help changing this particular SQL, just contact me directly through my business card's alternative...
    Regards - Zal
    --E-PU Audit Review of Purchase Orders to AP Invoices Workstation Ver 1 ZP 2011 02 14
    --DESCRIPTION:  SQL shows ONLY those lines from the Purchase Orders or Goods Receipts or AP Invoice that are still open and needing to be worked.
    --AUTHOR(s):
    --Version 1 Zal Parchem 14 Feb 2011
    SELECT
    T2.DocNum AS 'Purch Ord',
    T2.DocDate AS ' Ord Date',
    T1.ShipDate AS 'Expected',
    T1.ItemCode AS 'Product',
    CASE
    WHEN T1.[LineStatus] = 'O' THEN 'Open'
    WHEN T1.LineStatus = 'C' THEN 'Closed'
    ELSE 'Error'
    END AS 'Row Stat',
    CASE
    WHEN T2.Canceled = 'Y'
    THEN 'Yes'
    ELSE ' '
    END AS 'Cancelled?',
    T1.LineNum+1 AS 'Line',
    T1.Quantity,
    T1.OpenQty AS 'Open Qty',
    T4.DocNum AS 'Goods Rcpt',
    T4.DocDueDate AS 'Rcpt Date',
    CASE
    WHEN T3.[LineStatus] = 'O' THEN 'Open'
    WHEN T3.LineStatus = 'C' THEN 'Closed'
    ELSE ' '
    END AS 'Row Stat',
    CASE
    WHEN T4.Canceled = 'Y'
    THEN 'Yes'
    ELSE ' '
    END AS 'Cancelled?',
    T3.LineNum + 1 AS 'Line',
    T3.Quantity,
    T6.DocNum AS 'Return',
    T5.LineNum +1 AS 'Line',
    CASE
    WHEN T5.[LineStatus] = 'O' THEN 'Open'
    WHEN T5.LineStatus = 'C' THEN 'Closed'
    ELSE ' '
    END AS 'Row Stat',
    CASE
    WHEN T6.Canceled = 'Y'
    THEN 'Yes'
    ELSE ' '
    END AS 'Cancelled?',
    T5.Quantity,
    T8.DocNum AS 'AP Invoice',
    T7.LineNum + 1 AS 'Line',
    T7.Quantity,
    T10.DocNum AS 'AP Cred Memo',
    T9.LineNum + 1 AS 'Line',
    T9.Quantity
    FROM POR1 T1
    LEFT OUTER JOIN OPOR T2
    ON T1.DocEntry = T2.DocEntry
    LEFT OUTER JOIN PDN1 T3
    ON T2.DocEntry = T3.BaseEntry
    AND T1.LineNum = T3.BaseLine
    AND T1.ItemCode = T3.ItemCode
    LEFT OUTER JOIN OPDN T4
    ON T3.DocEntry = T4.DocEntry
    LEFT OUTER JOIN RPD1 T5
    ON T4.DocEntry = T5.BaseEntry
    AND T3.LineNum = T5.BaseLine
    AND T3.ItemCode = T5.ItemCode
    LEFT OUTER JOIN ORPD T6
    ON T5.DocEntry = T6.DocEntry
    LEFT OUTER JOIN PCH1 T7
    ON T4.DocEntry = T7.BaseEntry
    AND T3.LineNum = T7.BaseLine
    AND T3.ItemCode = T7.ItemCode
    LEFT OUTER JOIN OPCH T8
    ON T7.DocEntry = T8.DocEntry
    LEFT OUTER JOIN RPC1 T9
    ON T8.DocEntry = T9.BaseEntry
    AND T7.LineNum = T9.BaseLine
    AND T7.ItemCode = T9.ItemCode
    LEFT OUTER JOIN ORPC T10
    ON T9.DocEntry = T10.DocEntry
    WHERE
    (T1.LineStatus = 'O' OR T3.LineStatus = 'O' OR T5.LineStatus = 'O')
    ORDER BY
    T2.DocNum,
    T1.LineNum,
    T4.DocNum,
    T3.LineNum,
    T6.DocNum,
    T5.LineNum,
    T8.DocNum,
    T7.LineNum,
    T10.DocNum,
    T9.LineNum
    FOR BROWSE

  • "Material  Invoice Cycle- field" in the Invoice tab of the Purchase Order?

    Hi,
    Does somebody has a clue on the field "Material  Invoice Cycle- field" in the Invoice tab of the Purchase Order?
    What are the functions, dependencies and the scenarion one can use this field.
    Regards

    Hi
    Here in Is-oil we have invoice cyles. Provisional invoice, Final invoice, interested invoice, settlement invoice etc..
    So in sales at first provisional invoice has been created than the final invoice based on the Provisional invoice.. and further invoices like  interest invoice & settlement invoice ..
    So here we are using 4 invoice cycle.. hence you have to define in the Spro-->industry solution -->oil & gas  > cross component application>maintain the invoice cycle numbers... 4
    And this data has to be used in Condition type
    Spro--> industry solution -->oil & gas  > cross component application> MM split invoice -->Enter the data in additional invoice .
    These is the function of Material invoice cycle field...
    Thanks and regards
    Raja

  • Uncheck Invoice receipt indicator in Purchase Order Local

    We want to uncheck invoice receipt indicator in Purchase Order Local ( field BBP_PDSET-IR_IND) when a Shopping Cart is complete and PO Local is created automatically by system.
    We are using BADI BBP_DOC_CHANGE_BADI with Method BBP_PO_CHANGE but no changes are made. BADI is not accessed when PO Local is created automatically but only when we modify PO Local with transaction BBP_POC.
    What we can do?
    Regards.

    Hi David,
    the BBP_DOC_CHANGE_BADI is actually accessed during automatic creation. You can see this by putting an external breakpoint in the badi for user WF-BATCH.
    The IR_IND is based on the vendor data, if you clear the invoice receipt indicator there it will not be set in the po. The vendor data is checked later on, so that's why you don't see any change. As it will clear the ir indicator in the badi, but then sets it again later on.
    Regards,
    Robin

  • How to create purchase order using SharePoint Custom List

    Hi All,
    Can you please provide some example or link to create Purchase Order using SharePoint List / SharePoint Designer.
    Thanks

    Hi,
    It would be difficult to achieve what you want with the OOTB features of only one list.
    Per my understanding, there would be two main functionalities in the solution you want:
    1. Calculate and display the “Balance Qty” dynamically based on the values of “Order Qty” and “Deliver Qty”;
    2. Trace the “Deliver Date” and “Deliver Qty” as per “Purchase No”;
    As a workaround, I would suggest you create two lists as below:
    1. List “Orders”: Saving the upcoming orders per “Purchase No”, one “Order Qty” related to one unique “Purchase No”.
    Columns in this list:
    Purchase No(Number);
    Order Date(Date);
    Order Qty(Number);
    2. List “Deliveries”: Recording each delivery, one “Deliver Qty” to one unique existing “Purchase No” in list “Orders”.
    Columns in this list:
    Purchase No(Lookup “Purchase No” in list “Orders”);
    Order Date(Additional Lookup column along with “Purchase No”);
    Order Qty(Additional Lookup column along with “Purchase No”);
    Deliver Date(Date);
    Deliver Qty(Number);
    Balance Qty(Number);
    More information about
    Lookup column in SharePoint List:
    http://msdn.microsoft.com/en-us/library/office/ff728095(v=office.14).aspx
    http://zimmergren.net/technical/sp-2010-how-to-relational-lists-in-sharepoint-2010
    In the “Deliveries” list, we can trace each “Deliver Qty” and “Deliver Date” easily by filtering the “Purchase No” column in the list view page.
    For the dynamic values in “Balance Qty” column, Event Receiver with custom code would be needed as we will need to query the “Order Qty” in “Orders” list and all the
    existing “Deliver Qty” value per “Purchase No” in “Deliveries” list.
    An idea about
    how to implement a Purchase Order system in this blog would be helpful:
    http://ethan-deng.blogspot.jp/2013/03/purchase-order-management-system.html
    Best regards,
    Patrick
    Patrick Liang
    TechNet Community Support

  • How to create item wise invoice with reference to sales order.

    Hi ,
    Please let me know how to create item wise invoice with reference to sales order.
    Ex : Sales order has 2 line items .
              When creating invoice system should create two invoices for each line items.
    I have tried with copy control but I am not able to do it.
    Please advise.
    Regards

    Hi,
    Please let us know your exact requirement. Whether you want it to be fixed like only one line item to be billed every time ot it to be based on selection you do every time.
    As per my understanding it should not be fixed and in that case it should like as follows,
    In VF01 you will select Del. document/S.O. number and click on selection list and will take you to next screen as mention below,
    and select desire line item to be billed and click on copy and will take you to billing screen.
    Regards,
    Ajit K Singh

  • Material Statuses based on the Purchase order Document type

    Hi Experts,
    We need to maintain the Plant material status based on the purchase order document type.
    Example - If I am using NB for normal purchase orders and ZB for STO procurement then, there should be a material status which should give warning message - 'do not use ' for ZB STO purchase orders and it should allow to create NB purchase orders for that same materials.
    Please advise what are the possibilities?
    Thanks
    Regards
    MM

    Hi Gurus,
    Thank you for  your reply, Please find my replies below
    @@ - Mallinath - We need this restrictions for some type of materials ( with specific Material types) which should not be procured through inter company STO process, buying plant should use the normal purchase. for other Material types they should be able to use the inter company STO process.
    @@ DEV - We are already using the Spl. Procurement keys for inter company STO process.
    Example - Material type ZXYX should not use the inter company STO process, but it should be allowed all other processes.
    Please advise how we can control this process?
    Thanks
    Regards
    Raja

  • Invoice Recipt document for Purchase order

    Dear Gurus,
    I have a requirement to extract Invoice Recipt Document number & Invoice date for every purchase order into BW.
    I know that For purchase order details we used 2 datasources 1. ) 2LIS_02_SCL & 2.) 2LIS_02_ITM. Both the datasource do not have Material document number (BELNR) field. But these datasource read data from EKKO, EKPO & EKBE table and material document number field is availble in EKBE.
    I also know that this field along with PO purchase order category (BEWTP)= 'Q' we can get the invoice document no. But I am not sure if we can enhance this 'Material document number' field to datsources 2LIS_02_SCL & 2LIS_02_ITM.
    If we can, should the field be apended to both the datasource or can this requirement be facilitated by appending to any one of the datasource. Not sure about this. Can somebody help me or guide with how to proceed with this requirement.
    Thanks in advance,
    Sandeep.

    Hi Sandeep,
    I have not worked on this datasource but yes technically you can do it.
    As I understand, 2LIS_02_SCL is for header details of PO and PO has one to one relationship with Material Doc number.
    Therefore, if you requirement is to only bring in the header details for this Material doc, only enhance this datasource.
    Append this field to the datasource, then write the customer exit for this datasource.
    In this customer exit, you can write your code for deriving the Material doc number from EKBE based on the details available in e_t_data (for this datasource).
    But, if your requirement is to fetch line item details as well, you need to append the other datasource as well. And by writing the exit you can again derive the details from the table.
    Please note that the appended fields cannot be used to trigger any deltas, so if your requirement includes to trigger the delta if your material document changes, it cannot be done.
    Hope this helps.

  • Create a Purchase order using the BAPI using the data in the XML file.

    Hello Gurus,
    here is the scenario can anyone help me how to proceed explaining the procedure?
    Create a Purchase order using the BAPI using the data in the XML file.
    comprehensive explanations are appreciated.
    thanks in advance.

    hi,
      first use fm "bapi_po_create".
      then use fm "BAPI_ACC_GL_POSTING_POST"
    The demo environment was made with real business scenario in mind, but following subjects need to be addressed in a live implementation:
    •     No exceptions and error handling is implemented, except the order rejection (e.g. partly delivery);
    •     In Navision both XML Ports and the XML DOM has been used to integrate with SAP XI, because XML ports has some drawbacks regarding to Namespaces in XML Documents (mandatory in SAP XI);
    •     A minimum of SAP and Navision customization is required to implement this solution. (e.g. user exit in SAP, Navision XML DOM).

  • Creating a Purchase Order using ORDERS05 Idoc

    Hi Experts,
    I need to create a purchase order using ORDERS05 Idoc, with the data I am using a sales order is gettig created but I need to create a PO insted of SO.
    Please let me know what is difference between a PO and SO while using ORDERS05. Also please let me know what are all the fields that needs to chaged in the Idoc.
    Thanks,
    Suma

    Hi,
       I'm looking at a similar problem, can we use ORDERS05 IDOC basic type to create a Purchase Order?
       What is the inbound processing FM?  I tried IDOC_INPUT_ORDRSP, but it seem to only allow changes to a PO, and not creation of a PO.
       For IDOC_INPUT_ORDERS FM this one seem to only create Sales Orders?
       Which inbound FM should i be using?
    Regards.

  • What is the  FM/BAPI  to get the Goods Receipt  Based on the Purchase Order

    Hi ,
    I want FM/BPI  to get the Goods Receipt  Based on the Purchase Order in MM.
    Thnx in advance

    Hi
    BAPI_GOODSMVT_CREATE
    Thanks & Regards
    Kishore

Maybe you are looking for

  • Problem with a Checkbox

    Hi Experts, i have a new problem. I'm using Netveawer V 7.0.09 and i have created a static checkbox element in my View. This element is showed in the portal at runtime but it is locked. So i can't check it. I have setted the checked property as a boo

  • Open PDF in IE8 with Acrobat, not Reader ?

    Hi Chaps, I used to be able to open a PDF from a HTML link, which would then open in Internet Explorer 8 using Adobe Acrobat. Since installing Adobe Reader, all PDFs open in IE8 using Reader, instead of Acrobat, so now I cannot edit the PDF. I've sea

  • XML-RPC simple server

    I wan't to make a simple XML-RPC server. public class JavaServer      public JavaServer()      public static void main(String[] args)           try                WebServer server = new WebServer(8080);                server.addHandler("test", new Ja

  • CCFL Bulb

    From what I know from most Apple Portables....It has a CCFL Bulb...My problem is this...I have a Macbook and it seems that the this CCFL bulb is not turning itself on whenever I try to start the Macbook. In other words I have a dim background. I know

  • Purchase order one particular condition type vale should not inventorised

    Dear All,                    I have a scenario in the purchase order particular one condition type value should not get inventorised that should goes to a seperate account. it should not added with material cost i have created a seperate condition ty