Problem in creating purchase order document

Hi,
I created a new business document : Purchase request that once it is validated we can copy it to Puchase order.
when i save the purchase order doc and then launch the creation of the purchase order the operation succed.
But when i try to copy an already created purchase request i get the error :
Object reference not set to an instance of an object
Does any have a clue?
Thanks a lot.

This is my code
Form = _SboApplication.Forms.GetFormByTypeAndCount(pVal.FormType, pVal.FormTypeCount);
                                                        Documents _Documents =
                                                            (Documents)
                                                        _SboCompany.GetBusinessObject(BoObjectTypes.oPurchaseOrders);
                                                        // Add PO Header
                                                        _Documents.CardCode =
                                                            ((EditText) _Form.Items.Item("3").Specific).Value.ToString();
                                                        _Documents.CardName =
                                                            ((EditText)_Form.Items.Item("4").Specific).Value.ToString();
                                                        // Add PO Lines
                                                        Matrix matrix = (Matrix)Form.Items.Item("37").Specific;
                                                        if (_matrix.RowCount > 0)
                                                            _Documents.Lines.ItemCode =
                                                                ((EditText)
                                                                 _matrix.Columns.Item("35").Cells.Item(1).Specific).
                                                                    Value;
                                                            string value =
                                                                ((EditText)
                                                                 _matrix.Columns.Item("38").Cells.Item(1).Specific).
                                                                    Value.Replace(".", ",");
                                                            double val = Convert.ToDouble(value);
                                                            _Documents.Lines.Quantity =
                                                                double.Parse(
                                                                    ((EditText)
                                                                     _matrix.Columns.Item("38").Cells.Item(1).Specific).
                                                                        Value.Replace(".", ","));
                                                            _Documents.Lines.Price =
                                                                double.Parse(
                                                                    ((EditText)
                                                                     _matrix.Columns.Item("39").Cells.Item(1).Specific).
                                                                        Value.Replace(".", ","));
                                                            _Documents.Lines.DiscountPercent =
                                                                double.Parse(
                                                                    ((EditText)
                                                                     _matrix.Columns.Item("40").Cells.Item(1).Specific).
                                                                        Value.Replace(".", ","));
                                                            _Documents.Lines.VatGroup =
                                                                ((ComboBox)
                                                                 _matrix.Columns.Item("41").Cells.Item(1).Specific).
                                                                    Selected.Value;
                                                            _Documents.Lines.Price =
                                                                double.Parse(
                                                                    ((EditText)
                                                                     _matrix.Columns.Item("39").Cells.Item(1).Specific).
                                                                        Value.Replace(".", ","));
                                                            _Documents.Lines.DiscountPercent =
                                                                double.Parse(
                                                                    ((EditText)
                                                                     _matrix.Columns.Item("40").Cells.Item(1).Specific).
                                                                        Value.Replace(".", ","));
                                                                                _Documents.Lines.VatGroup =
                                                                ((ComboBox)
                                                                 _matrix.Columns.Item("41").Cells.Item(1).Specific).
                                                                    Selected.Value;
                                                                                for (int i = 2; i < _matrix.RowCount + 1; i++)
                                                                _Documents.Lines.Add();
                                                                _Documents.Lines.ItemCode =
                                                                    ((EditText)
                                                                     _matrix.Columns.Item("35").Cells.Item(i).
                                                                         Specific).
                                                                        Value;
                                                                _Documents.Lines.Quantity =
                                                                    double.Parse(
                                                                        ((EditText)
                                                                         _matrix.Columns.Item("38").Cells.Item(i).
                                                                             Specific).Value.Replace(".", ","));
                                                                _Documents.Lines.Price =
                                                                    double.Parse(
                                                                        ((EditText)
                                                                         _matrix.Columns.Item("39").Cells.Item(i).
                                                                             Specific).Value.Replace(".", ","));
                                                                _Documents.Lines.DiscountPercent =
                                                                    double.Parse(
                                                                        ((EditText)
                                                                         _matrix.Columns.Item("40").Cells.Item(i).
                                                                             Specific).Value.Replace(".", ","));
                                                                string val1 = ((ComboBox)
                                                                                _matrix.Columns.Item("41").Cells.Item
                                                                                i).Specific).
                                                                    Selected.Value;
                                                                _Documents.Lines.VatGroup =
                                                                    ((ComboBox)
                                                                     _matrix.Columns.Item("41").Cells.Item(i).
                                                                         Specific).
                                                                        Selected.Value;
                                                            int err = _Documents.Add();
                                                            GC.Collect();
thanks for your attention

Similar Messages

  • I need output type NEU automaticaly for create purchase order document type

    Dear Experts,
    I need output type NEU automaticaly for create purchase order document type NB
    when transaction code MN04, I am doing the following:
    (1) I selected the third option Purchasing Output determination: Document type
    (2) I selected the output type NEU.
    (3) In condition records in document type , i have chosen NB.
    (4) In name its automatically coming as Purchase requisition
    Please suggest how Purchase Order NB will come

    Hi,
    Check & press F4, NB Purchase Order (for catagory F) will be there after entering PO output type NEU & then maintaion the condition record in MN04.
    Output type NEU automaticaly defaulted during purchase order creation with document type ,then just fine tune the output (message) type in following path:
    SPRO--->MM->Purchasing>Message>Output control->Message types> Define message type for Purchase Order----->Fine-Tuned Control: Purchase Order
    Now here select the check box corresponding to your output(message) type NEU to have print output automatically displayed & save.
    Now try to creating Purchase Order & you will have default message type NEU.
    Regards,
    Biju K

  • Problem in creating Purchase order Using BAPI

    Dear ABAPers,
             I am creating the Purchase order Using BAPI_PO_CREATE1. In that the Purchase order Line item i am giving the Net Price for the Material.But While creating the purchase order the system creates the puchase order with the net price which is already available in the memory.So how to solve this problem.
    Thanks & Regards,
    Ashok.

    Hi,
        Try to pass the value NO_PRICE_FROM_PO in the BAPI and see
    NO_PRICE_FROM_PO = 'X'
    Regards
    Bala Krishna

  • Error on creating Purchase order document using DI API

    Dear all,
    I am getting an error "<b>Server threw an exception</b>"  at the time of initializing object of Purchse order document. code is
    vDrafts = GOD_Company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oDrafts)
    I am using SBO 2005B SP 0 PL-20.
    Reply as soon as possible.
    Regards,
    Manish Jha

    Hi Manish,
    I am not sure if I am right, but I remember something about a bug in SBO SDK that gave an error when trying create draft object. Not sure on which patch this was though and am not sure if this is your problem too. Maybe someone else can remember what patch it was on?
    Hope it helps,
    Adele

  • Problem in creating Purchase order through Idoc

    Hi ABAPers,
    I am trying to post PO document through WE19 t-code using inbound function module BAPI_IDOC_INPUT1 which is calling BAPI_PO_CREATE1 internally.And i am getting below error messages.
    1. Characteristic  does not exist in operating concern AC01
    2. This function only possible for subcontracting items
    3. No instance of object type PurchaseOrder has been created. External reference
    passing data to IDOC:PORDCR102
    Header Segment : E1BPMEPOHEADER and E1BPMEPOHEADERX
    company code    0814
    doc_type            NB
    vendor                0000400001
    poprg-                EPRO
    pgroup               U01
    Item Segment : E1BPMEPOITEM and E1BPMEPOITEMX
    Item                  00010
    material             000000000000000263
    plant                 0374
    Qty                   22.000
    Delivery Segment E1BPMEPOSCHEDULE and E1BPMEPOSCHEDULEX
    Item                  00010
    Schedule line     0001
    delivery date      01.12.2008
    Qty                   22.000
    Note: i am able to create PO successfully, through SE37 by using FM BAPI_PO_CREATE1  with given above data.
    Please confirm me, what else i need to pass to post PO through WE19 t-code using inbound function module BAPI_IDOC_INPUT1.
    Please reply me ASAP.
    Thanks and Regards,
    Sekhar Raju.

    must be data format issue. when you use Function_module/BAPI from SAP GUI, convertion exit is applied automatically. hence data is converted to proper format & submited.

  • Problem in creating Purchase Order

    when i am going to create PO error is coming that Plant closed on delivery date.
    can any one help me .
    thanks in advanced.
    Laxman sankhla

    Hi,
    Please check the calandar assignment at table T001K for that plant.Please go to that date calandar at SCAL and check the related holiday calandar for that factory calandar.If the delivery date you gave is a holiday or not.
    Please change the delivery date  in the PO.it should have been a warning during po ctreation--is it not?
    If not make it a work day at SCAL by a special rule.
    Regards,

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

  • Create purchase order from shipment cost document

    Hi Experts,
    I would like to know how a purchase order type is linked to a shipment cost document so as to create purchase orders automatically when I do transfer posting to the vendor from the shipment cost document. How system automatically finds out the PO type and creates purchase order.
    Thanks,
    Emaya

    Hi,
    Thanks. I have made all those mentioned changes already, and infact I am able to create purchase orders(PO Type NB) automatically when I do transfer posting, but I would like to know, why NB type only? why not some other purchase order types? Suppose if I create a new PO type by copying NB with new number ranges, how to link it to my shipment cost document?
    Please comment.
    Regards,Emaya
    Edited by: Emayavaramban S on Dec 11, 2008 3:06 PM
    Edited by: Emayavaramban S on Dec 11, 2008 5:12 PM

  • Problems creating an order document

    Hi,
    I'm creating an order document via DIAPI. My problem is with document lines, the data I want to introduce is ItemCode, Discount, Quantity and Price. The thing is that my price is the price before discount, but in DIAPI there is no way to add data to the field pricebefdi and the only price you can add is price after discount, so my total and the one shown in SBO is not the same.
    What I do at the moment is calculate the price after discount and assign it to the field price, but with this operation I loose decimals.
    Any idea of how to do it?
    Thanks in advance,
    vane

    Hi,
    This is a major flaw in DI API currently. I don't think there's much you can do about it in addition to what you've already done. In 2005 SP1, there will be available some new ways of calculating price/discounts. You might want to check it out.
    Henry

  • Purchase order Document date in AP Downpayment invoice PLD

    Dear All,
    Is it possible to capture purchase order Document Date in AP Down payment invoice PLD.My client want like this.I have tried,but i am not able to capture this field in AP Down payment invoice PLD.please give me the solution for this,If it is possible.
    Thanks,
    Silpa.N

    hi silpa,
    Create a user defined field in row level of marketing documents.
    Apply formatted search using query
    Select $[OPOR.TaxDate]
    select auto refresh
    when changing field Document Date in header level.
    On copying purchase order to ap downpayment invoice Document date will copy to it.
    U can also bring it to PLD by creating database field with table DPO1,column U_XXX
    Hope it will solve problem.
    Jeyakanthan

  • Could not create Purchase Order Stock Transfer Order

    Hi Expert!
    Need your help.
    User could not make Could not create Purchase Order Stock Transfer Order for new plant 1075 & 1076 at P05 with error message Not posible to determine shipping data for material. Our new vendor are 510022060 for new plant 1075 and 510022061 for new plant 1076.
    The problem was caused by the missing STO setup for these two plant 1075 and 1076, as no customer code being referred.
    Now i got the customer number for these two plants but how to set it up in configuration? Please guide me step by step.

    Hi Crystal,
    The following customising need to be carried out for Inter Company Stock Transfer.
    Path : sproMaterials ManagementPurchasing-Purchase OrderSet up Stock Transport Order
    Define Shipping Data for Plants :
    For the Supplying plant (1) the Sales Org data to be maintained.
    For the Receiving plant (2) the Customer No to be maintained.
    Create Checking Rule - U can use existing one Eg : B
    Define Checking Rule : Use Standard one Eg :01 linked to B.
    Assign Delivery Type and Checking Rule -- For the Supplying Plant (1) and document type NB use the delviery type NLCC and Checking Rule B.
    Assign Document Type, One-Step Procedure, Underdelivery Tolerance :
    For the supplying Plant (1) and Receving Plant (1) ; assign the document type : NB.
    Points to be noted :
    The Material should exists in both the plants ( 1 & 2 ) with the sales view maintained . Note that the Loading grp / Transporting Grp is mantaory in Sales Views.
    The Vendor is to be assigned to the supplying Plant (1 ) in Purchasing View of Vendor Master.
    For that click on Extras - Add Purchasing data in Purchasing view of Vendor Master (XK02 )
    Do maintain the customer in Control data of Vendor Master.
    Do maintain the Vendor in Control data of Customer Master.
    Also note that shipping conditions are maintained in the Customer Master . The same can be found in Sales Area - Shipping Tab.
    Shipping Point determination :
    SPROLogistics ExecutionShippingBasic Shipping FunctionsShipping Point and Goods Receiving Point Determination--Assign Shipping Points ( For a particular Shipping condition/ Loading Grp /Plant - the shipping point is assigned ).
    Regards
    Ramesh Ch

  • Purchase order document row is not change (document stutas is OPEN)

    Hi all,
    I am created one purchase order that are not any base or targeted document ,not any approval   procedure and  purchase order document status is steel open . Then how  I a cannot change the document row.
    thanks
    arabinda pal

    Hi Deepa,
    I think if you want to restrict the further editing of a particular row, then you just need to follow the simple procedure.
    1. create the purchase order with your desired items & vendor & add this document
    2. Now reopen it & goto that row which you want to restrict. Right click on that row & select "Close Row".
    3. Select yes to confirmation message.
    4.Now update the document.
    Now you an check it out, in that document you will not be able to edit that row contents.
    I hope this solves your issue.
    Regards.
    ShriX.

  • Good receipt problem for subcontracting purchase order

    Good receipt problem for subcontracting purchase order
    with account assignment type ‘E’.
    After update to ECC 6.0. Do good receipt for subcontracting purchase order with account assigment 'E'.The system show the error message(KI235)----Two cost elements (Change in Stock (Subcontracting)&Outside processed fee) haven't CO account assignment.but the field status  for sale order is option entry , when I default cost center for the cost element  in OKB9.the system post the material document and generate the following accounting document.
    Doc.Type : WE ( Goods receipt ) Normal document
    Doc. Number    5000056065       Company code    1000         Fiscal year     2007
    Doc. date      2007.12.04       Posting date    2007.12.04   Period          12
    Calculate Tax
    Doc.currency   HKD
    tm PK Account    Account short text   Tx Cost Ctr   SaleOrder               Amount
    1 89 13500000   Stock-Work in proces                   1007823  10             274.4
    2 96 21210010   GR/IR Clearing                             1007823  10             205
    3 91 41010102   Chg in Stock(Subcon)    10901099  1007823  10            274.4
    4 86 41031000   Outside processed fe     10901099  1007823  10            205  
    5 99 13500000   Stock-Work in proces                    1007823  10            69.4
    6 81 41010101   Cost of Prod (Subco)                      1007823  10           69.40
    My problem is:
    When use MIGO to do good receipt for subcontracting Purchase order, for consumption account((Change in Stock (Subcontracting)-41010102&Outside processed fee--41031000) ,why the system don’t recognize the sale order filled as CO account assignment?

    Dear fanny chen
    Did you get a solution for your open question?
    I`m facing the same problem, so any help yould be appreciated.
    Regards

  • [Request] Special user-exit we need during creating purchase order

    Hi, Gurus!
    We need to make specific User-Exit during creating Purchase order.
    When user creates/change a PO document (ME21N/22N), SAP has to check the u2018CUSTOMERu2019 filed whether it is BLANK or NOT in Delivery Address tab at ITEM LEVEL.
    If there is no value in that field, system will automatically input right value with useru2019s business logic.
    Thatu2019s what we want to implement in the future.
    If you have any solution or recommendation for this, Please help us.
    I really appreciate your help in advance.
    Best Rgds;
    Ian

    For checking user exit - SMOD, you need to activate this exit via CMOD
    For Badi - SE18 to check & SE19 to implement
    Take the help of your abaper, give him / her your logic.
    Hope the above answers your query.
    Regards,
    Vivek

  • Authorization based on plant and Purchase order document type

    Hi
    My client has a requirement wherein a user will have authorization for transactions only in his plant. But only for Purchase order document type UB (Stock Transport Order) the user should be allowed to create for all plants.
    In short, if Purchase order document type is UB, should be allowed for all plants
                 if Purchase order document type is NB, should be allowed to only one particular plant.
    My Basis person says that such a restriction is not possible.
    Kindly suggest me on how to provide a solution to this.
    Thank U.

    Hi,
    This is possible.In this case you need to create two seperate roles.
    1)Create purchase order for all plants (This can be used in long text)
    2)Create purchase order for <plant no> plants.
    For case 1:--
    i)Populate field BSART of M_BEST_BSA with UB.
    ii)Populate field WERKS of M_BEST_WRK with '*'. SAP reccomends to fill up organizational data through organizational level tab only.So while doing this step you need to put * from organizational level tab only.
    For case 2:--
    i)Populate field BSART of M_BEST_BSA with NB.
    ii)Populate field WERKS of M_BEST_WRK with 'plant no'.
    Dont worry about the objects i mentioned those are maintained through SU24 and will be automatically pulled once you insert ME21 transaction code.
    Let me know if it helps.
    Thanks,
    Aveek

Maybe you are looking for

  • Reversal of goods receipt of an asset

    Dear, We have several goods receipts posted on fixed assets for which already depreciations has taken place. Now this goods receipt should be reversed via MR11 because the vendor invoice for this good receipt will never come due to several reasons. (

  • IPhone 4 - Usage (Other) Varies Wildly: 4gb mysteriously disappearing

    Never had this problem before. I am using an iPhone 4 (16gb)  with iOS 7.1.1. I use iTunes Match to manage my music. Until recently, whenever my available space would start dwindling, I would go into Settings > General > Usage and delete the music th

  • J1INCHLN-Post-Error

    Hi, When I am posting vendor challan in "J1INCHLN-Post" getting below erro "Number group not maintained for CO code IN07 section IN07 and business place 194I" I have checked setting I have maintained number ranges, but not find reason for peculiar er

  • Account Postings in case Subscontarcting and Stock Transport Order.

    Hi All, Please help in understanding what account keys(G/L Accounts ) will be hit in the follwoing scenerios: 1. Standard Subscontarcting Process during GR. 2. Stock Transport Order , Delivery Type NL     Movement Type , 641 and 101. 3. Stock Transpo

  • Specials characters in subject mail

    Hello, We created a procedure in Oracle to send html mails. All is allright in the body, the only problem is in the subject : we can't have characters like "é è à"... Our database is Oracle 9i.. so we don't have the UTL_ENCODE.MIMEHEADER_DECODE funct