Additional expenses on existing delivery

Im trying to add additional expenses on delivery which is created already and has no invoice (customer direction).
I have code
Dim odocument As SAPbobsCOM.Documents
            odocument = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oDeliveryNotes)
            If odocument.GetByKey(docentry) Then
                odocument.Expenses.Add()
                odocument.Expenses.SetCurrentLine(1)
                odocument.Expenses.ExpenseCode = 1
                odocument.Expenses.LineTotal = value
                Dim err_code As Integer
                err_code = odocument.Update()
                Dim err_msg As String
                If err_code <> 0 Then
                    oCompany.GetLastError(err_code, err_msg)
                    MsgBox(err_msg)
                End If
            End If
but it alwazs ends with internal error after .update. Is it even possible to update existing delivery with expenses through DI?

Have you tried manually update this existing delivery with additional expenses? If you can, update should work from DI too. Otherwise, it is not possible.
Thanks,
Gordon

Similar Messages

  • Internal Error (-5002) on adding Additional Expenses in a sales-document

    Hi All,
    I try to add an additional expense in a sales-document. I receice an internal error (-5002) What is the problem ?
    I want to transfer the additional expense from a sales-order to my target delivery note.
    See my example in C#:
                   oDlvNote.CardCode = cuno;
                    oDlvNote.DocDueDate = oDate;
                    string queryvx2 = "Select ExpnsCode, LineTotal, Comments,
    DocEntry, LineNum From " + tablenameexp + " Where DocEntry
    = " + origornov;
                    using (System.Data.SqlClient.SqlDataReader sqlReadervx2 =
    SwissAddonFramework.B1Connector.GetB1Connector().ExecuteQuery(queryvx2))
                        while (sqlReadervx2.Read())
                            expcode = sqlReadervx2.GetInt32(0);
                            linetotexp =
    Decimal.ToDouble((Decimal)sqlReadervx2.GetSqlDecimal(1));
                            remarksexp = sqlReadervx2.GetString(2);
                            docentryexp = sqlReadervx2.GetInt32(3);
                            linenumexp = sqlReadervx2.GetInt32(4);
                    oDlvNote.Expenses.BaseDocEntry = docentryexp;
                    oDlvNote.Expenses.BaseDocLine = linenumexp;
                    oDlvNote.Expenses.BaseDocType = objectnr;
                    oDlvNote.Expenses.ExpenseCode = expcode;
                    oDlvNote.Expenses.LineTotal = linetotexp;
                    oDlvNote.Expenses.Remarks = remarksexp;
              --->    oDlvNote.Expenses.Add();
                    oDlvNote.Lines.ItemCode = Artikel;
    Regards,
    Roland

    Hi Roland,
    I think it's the same issue as here:
    -5002,if you reference production in a row,so all rows should be refer prod
    Regards,
    Frank
    PS: Expenses are a "lines" type oject - just like Document_Lines - which are handled in the TB1300
    Message was edited by:
            Frank Moebius

  • Inserting new line item into existing delivery using BAPI

    Hi
    can you send me the code for inserting new line item into existing delivery either using BAPI or
    Function module.
    We are using SAP 4.7 version

    Hi Sreekanth,
    Refer to this links
    New item for outbound delivery via FM/BAPI?
    /message/3976349#3976349 [original link is broken]
    BAPI_OUTB_DELIVERY_CHANGE Help - Add new line item
    hope it is useful to you.
    Regards!

  • Existing delivery schedules in ME32L and new MRP

    Hello,
    We are using purchase schedule agreements, now we are planning to run the MRP.
    So that based on the customer demands, system can create the new schedules for purchased parts in the schedule agreement after MRP run.
    But we have existing delivery schedules in the scheduling agreements for the purchase parts. I believe after the MRP it would mess it up.
    Is there anyway i can delete the existing delivery schedules and after the MRP, schedule aggreement should have only new delievry schedules.
    Kind regards,
    JPS

    Hi
    Before MRP run 
      1. Go in ME38
      2. Enter Scheduling Agreement Number
      3. Close open schedule lines 
      e.g.
    1. Schedule qty is 200  GR Qty- nil , Open qty -200
          then make schedule qty 0 means this schedule line is close.
    2.  Schedule qty is 200  GR Qty-125l , Open qty -75
          then make schedule qty 125 means this schedule line is close.
    Like this close all open schedule lines before MRP run.
    After that MRP run,
    In system new schedule lines will be generate .
    Best Regards
    Chandrajit Patil

  • Additional Expenses In GRPO

    Hi All,
    We are using SAP 8.8 PL 15.
    We take following steps for a import cycle.
    PURCHASE ORDER
    GOODS RECEIPT PO
    LANDED COST
    AP INVOICE
    WHEN WE RECEIVE FREIGHT , CLEARING , INSURANCE ETC BILLS (The additional expenses occured in import) we book them .
    After that we are interested in knowing raw material cost. Because we are unable to link our freight bills to the LANDED COST
    DOCUMENT which is pulled from GRPO.
    Any help would be greatly appreciated.
    Thanks
    Malhaaar.

    Hi Rahul,
    Our inventory is getting re valuated properly.
    Only thing is that , when we see a service invoice let us say for clearing charges in A/P Invoice then we are unable to make out against which shipment we paid this clearing charges.
    Or to put it in other words , If in a financial year we pay X amount towards clearing charges to S.J Thacker then we do not know the shipments associated with the bills.
    Through Form Settings, I displayed base ref , base type etc columns but no trace. They are blank.
    Thanks
    Malhaar

  • Activation of Additional actions for existing Pers. Nos

    Hi Frdz,
    We have a scenario on additional actions that is; activation of additional actions for existing personnel numbers.
    1. Actually we uploaded personnel actions data without activating the additional actions in T529A. Then we came to know that can activate existing personnel numbers by maintain activation of additional actions T code OG00.
    I tried to activate per above procedure but SYS thrown error Pers.no XXXX X Error while creating additional actions.
    2. As well as I’m facing one more issue in Ad hoc query. When ever I transport query form DEV server to other servers I can’t execute query using assigned T code directly but once we execute query through SQ01, can execute with T code but this procedure can’t follow because in PRD I don’t have any access.
    Hence, kindly let me know the solutions to overcome these issues.

    Hi,
    1. While activating Additional Personnel Actions u vl find the node where in for already created personnel numbers u can activate. So maintain that node.
    2. Usally Adhoc Query authorization vl not be given to one particular user as its related with All The Users authorization as its related with client Administration.
    So Check vth ur basis guy
    Regards
    Pavani

  • List of invoices where some additional expenses were posted

    Dear All ,
    Is there any reports to list the of invoices, where some additional expenses were posted ?
    Thanks,
    Dash

    I assume you have a specific document type for your invoice posting.  If you have, a simple GL line item list will suffice for your requirement.  Use the Document Type and the Expense GL account as parameters.

  • How Can You Add an Item to an Existing Delivery? (Function Module?)

    We are currently using function module GN_DELIVERY_CREATE to create deliveries (shipping notifications) from ASN data. 
    We're also using function module BAPI_INB_DELIVERY_CHANGE to change quantities on existing deliveries and to delete line items on existing deliveries.
    Does anyone know if there's a function module to add a new line item to an existing delivery?
    Best Regards, Scott

    Is BAPI_DELIVERYPROCESSING_EXEC what you need?
    Rob

  • Adding items on an existing Delivery.

    Which function module or BAPI should I use to add Material and qty to an existing delivery ? Any suggestions ?
    Thanks.

    Hi,
    Try with this FM 'BAPI_OUTB_DELIVERY_CHANGE 
    if find usefule for , kindly reward me points

  • Hi, How much creative cloud storage can I purchase in addition to the existing 20Gb

    Hi,
    How much creative cloud storage can I purchase in addition to the existing 20Gb & what are the various plans & fees?
    Regards,
    Iain.

    Individual CC allocates 20GB of space. If you want more space you can buy CC for Team with one seat as each seat provides you 100 GB of space.
    Membership plans: Pricing | Adobe Creative Cloud
    Regards
    Rajshree

  • Add Additional Expenses to Invoice

    Hi,
    I have a problem that I hope you can help me with. See description below:
    Workflow
    1. User genrates delivery in B1 and adds info. Performs external process to calculate shipping expenses.
    2. The expenses calculated in step get filled in a UDF on the Delivery.
    3. User opens A/Rinvoice and converts the delivery added in Step 1 to an invoice.
    At this stage, I would like to be able to pull the expenses from the UDF on the delivery to the invoice.
    Please advise on best solution.
    This is a big problem for us. Any help is appreaciated.
    Thanks.

    Hi,
    I think you can try this approach:
    1. Create a UDF in the Invoice to store the info (if its already created just for testing create another one).
    2. In the Invoice UDF create a Formatted search that based on the BaseType and BaseEntry of the first line of the invoice (Table INV1), query the UDF Field in the delivery (ODLN).
    If the invoice is based in more than one delivery this approach will not work and you will have to develop a solution for this (that is not that difficult).
    Hope it helps :-D
    -M

  • Add additional params into existing SP

    Hello,
    please, how can I add additional params: @LastName and @FirstName into existing procedure that starts:
    @PIN nvarchar(13)
      AS
    DECLARE @v_exist int
    set @v_exist=0;
    Namely, upon adding additional params:
    @PIN nvarchar(13)
    @LastName nvarchar(20)
    @FirstName nvarchar(20)
      AS
    DECLARE @v_exist int
    set @v_exist=0;
    and adding additional table that comprises columns FirstName and LastName into existing Select statement(referenced table that comprises all possible values of PIN) by creating corresponding relationship, the SP freezes, fails without any output....
    Note: SP checks for PIN that is entered into WEB application, in certain T1. If exists, it informs user that PIN already has been entered and new one must be of different type. But, I would like the First and Last name to be checked, too, i.e., in newly
    added table T2 I would like LastName and FirstName to be extracted based on entered PIN and, upon that, to have checked these couple LastName AND FirstName in T1 (because, there are rows with missing PIN and fact that result could be more then one line is
    not problem because T1 comprises only cca 300 rows... ) 
    Tables T1 and T2 are not changeable but reference tables...The data entered via interface goes into some other tables...

    Must be because, one person with it's belonging PIN can be entered only once into e.g., T1. Evaluation in the SP checks if entered  PIN is in the T2, which comprises forbidden PINs, LastName, FirstName...etc...But, in some cases i.e., some rows, there
    is missing PIN which is to say that I had to involve new table that comprises all possible values for PINs based on which I would like to extract LastName AND FirstName and check it against T2...i.e., check T3.LastName with T2.LastName AND T3.FirstName with
    T2.FirstName...
    But, like Mr.Sorna advised, without table scripts and sample data ...etc...my thread is too ambiguous...I am afraid...

  • Additional tab in outbound delivery

    Good day,
    I'm looking for  the way of creating an additional tab in header details of outbound delivery.
    Could you let me konw any porper solution?
    Thanks for your quick response in advance.

    Dear Eun-Cheol Han,
    If you want create an additional tab in delivery header you have to go for  a screen exit.
    Please consult your technical team .
    Please find below threads to get more exploration.
    http://sapsdforum.com/category/sd-user-exits/
    http://sap.niraj.tripod.com/id21.html
    Please let me know if you have any further clarifications
    Thanks&Regards
    Raghu.k

  • Upload additional data into existing material number.

    Hi Experts,
    I want to upload an additional info about Material (valuation category and valuation type), where the material ids are already exists.
    There are 87 data which i have to upload to their corresponding material numbers from notepad.
    So please suggest what should i follow to upload BDC or LSMW and also suggest how to do ...
    Thanks,
    Deepanshu Mathur
    Moderator message: please do more research before asking, show what you have done yourself when asking.
    Edited by: Thomas Zloch on Jun 24, 2011 10:07 AM

    Hi,
    MANDT is always added as one of the fields to make the table client specific and it has to be a primary key.
    As rest of your fields are non-primary key fields, your table will have duplicate records for all the fields. You shall not get any error even if you enter duplicate entries.
    As a general practice, it is always good to have at least one primary key on a a table apart from MANDT. This ensures faster data access and provides uniqueness for each record.
    Also, if your table does not have at least one primary key apart from MANDT, you shall not be able to maintain the table via SM30 even if you create a Table Maintanence.
    Regards,
    Danish.

  • Additional expenses in a documents

    Hi
    I need to add the additionalexpenses (with SDK) before to save the invoice with the client. I try to use the documentadditionalexpenses object but I have some problems to use this object.
    The first problem is that there isn't the docentry of the document that is the key of the inv3 table.
    Can you help me?
    thanks
    Rita

    try something like this
    oInvoice = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oInvoices)
    oDelivery = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oDeliveryNotes)
                        'Looping through the expenses
                        For y = 0 To oDelivery.Expenses.Count - 1
                            'Setting the Delivery expense
                            oDelivery.Expenses.SetCurrentLine(y)
                            If y > 0 Then
                                oInvoice.Expenses.Add()
                            End If
                            'Checking if the total is NOT 0
                            If oDelivery.Expenses.LineTotal <> 0 Then
                                oInvoice.Expenses.BaseDocEntry = iDeliveryNote
                                oInvoice.Expenses.BaseDocLine = oDelivery.Expenses.LineNum
                                oInvoice.Expenses.BaseDocType = 15
                            End If
                        Next y

Maybe you are looking for

  • How can I use my iPhone 4 as a numeric keypad for my ipad?

    I am a teacher that uses my ipad for entering and keeping tracks of grades.  The one thing that would make this perfect, is if I could use my iPhone as a numeric keypad.  I have found many ways to use the iPhone/ipad as a keypad with a PC but not ipa

  • Mouse Over Format Control for Series

    I have a combination chart and would like to display the column portion with no digits after the decimal.  I would like to display the line portion with 1 digit after the decimal. Will Xcelsius allow individual formatting of series or only global for

  • Bind a new shortcut to "save an image as" when mouse is hovering over a certain image

    In Opera, if on a page you see several pics, you only need to move mouse pointer to an image you wanna save and press "ctrl+alt+left click" and then a dialogue to save an image pops up. I already tried a few addons - none of them did what I need. So,

  • Classification View in MMR

    Hi What is the use of the classification view of MMR? Under what scenarios do we use it? What settings have to be done in SPRO with respect to this view? Regards Syed

  • Error in calling action method

    This is produced when I run my code.. and press a certain button.. I kind of no what happens but I can't seem to be able to fix it.. It throws a property not found exception.. My code calls a been that creates a string then calls a function from anot