Updating AP Invoice Question

Hi,
I am trying to write code to update an existing AP Invoice and cannot get it working. Basically the code I am using is:
Dim itemCode As String
            REM set the item code
            itemCode = "P-0004-SAP001-2" 'Not sure where to get this
            Dim Inv As SAPbobsCOM.Documents
            Dim InvLine As SAPbobsCOM.Document_Lines
            'Get Invoice Object
            Inv = vCmp.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oPurchaseInvoices)
            REM get the relevant invoice
            System.Console.WriteLine("Getting AP Invoice")
            Inv.GetByKey(168)
            'Add a line to the Invoice
            InvLine = Inv.Lines
            System.Console.WriteLine("Count(1): " & CStr(InvLine.Count))
            InvLine.Add()
            System.Console.WriteLine("Count(2): " & CStr(InvLine.Count))
            System.Console.WriteLine("Setting current line")
            InvLine.SetCurrentLine(InvLine.Count - 1)
            InvLine.ItemCode = itemCode
            InvLine.Quantity = 3
            InvLine.PriceAfterVAT = 666.0
            InvLine.TaxCode = "S"
            InvLine.VatGroup = "S"
            InvLine.Currency = "GBP"
            InvLine.ItemDescription = "This is an add item to existing test"
            'Add the Reserced Invoice
            retVal = Inv.Update()
            InvLine = Inv.Lines
            System.Console.WriteLine("Count(3): " & CStr(InvLine.Count))
            'Check the result
            If retVal <> 0 Then
                vCmp.GetLastError(ErrCode, ErrMsg)
                System.Console.WriteLine(ErrCode & " " & ErrMsg)
            End If
(Note: The System.Console.WriteLine... statements are just for debugging purposes)
The error I'm getting from this is:
ErrCode     -5002
ErrMsg     "Cannot add or update this document; rows are missing  [OPCH.DocNum][line: 0]"
Can someone explain what I am doing wrong or point me in the right direction.
Many thanks
Adrian

HI all,
see [Update A/P Invoice;
for credit memo
this is sales process, replace document types with A/P
Regards
J.

Similar Messages

  • Can someone plz confirm me that how i can change or update the security questions related to my apple id? as i have been never put them since i create my apple id but now due to some security reasons its asking me again and again the answers. i am unable

    can someone plz confirm me that how i can change or update the security questions related to my apple id? as i have been never put them since i create my apple id but now due to some security reasons its asking me again and again the answers. i am unable to go through the process. thanks.

    Some Solutions for Resetting Forgotten Security Questions: Apple Support Communities

  • Updating REBZG (Invoice Reference) from Legacy system

    Need help with updating REBZG (Invoice Ref.) for credit memos.  We are using the BAPI_ACC_DOCUMENTxx series of function modules to post invoices from our legacy system.  It correctly places a u2018Vu2019 in REBZG.  We would like to replace this with the document number from the original invoice. 
    I can create a table of  all credit memos to be updated, but do not know where to insert code to update this field. (both open & closed invoices)
    Any help would be appreciated.

    i think it is either the user exit or the BTE FM. You can use one of these 2 options to update REBZG. I would prefer to use the BTE then the CMOD user exit.
    Where ever you call the bapi add the REZBG value to extension1. Only when extension1 is populated in the BAPI it will hit the exit or the BTE FM.  Here you can move the extension value to rebzg and set check to N.

  • How to update excise invoice values after migo.

    Hi Guru's,
    I have checked the forum. but did not get exact solution.
    Here im having the problem with  bapi  BAPI_GOODSMVT_CREATE . This bapi don't have the structure to update excise invoice values.
    I have one bapi  'BAPI_EXCINV_CREATE_FROMDATA'  to update the excise duty, but in that also i didn't find the structure
    'J_1IEXITEM'  to update the ECS value ( field is 'total_ecs').
    Please help me on this,Thanks in Advance...
    Regards
    Naren

    Hi Krishna
    Do not do excise invoice capture during 103. At that time select the option "No excise entry". Then capture excise invoice during 105.
    The system messge " No selectable items for this document" is prompted since the preceeding document is already assigned with invoice.
    Try this and give feedback.
    regards
    sairam akundi

  • When trying to download apps on my new iPad I keep getting prompted to update my security questions for my safety. When I choose this option it freezes and won't load the questions, however, when I hit not now it won't let me download. What do I do?

    When trying to download apps on my new iPad I keep getting prompted to update my security questions for my safety. When I choose this option it freezes and won't load the questions, however, when I hit not now it won't let me download. What do I do?

    Reboot your iPad and then see if you can set the security questions.
    Reboot the iPad by holding down on the sleep and home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider - let go of the buttons.

  • AP - updating unpaid invoices payment priority

    all:
    Any one have suggested script which to use to update unpaid invoices payment priority code on ap_invoices_all table.
    there is ap_invoices_pkg.update_row api but do not have adequate information on this api to make this script.
    Will appreciate anyone who has done similar or another column update to unpaid invoices using this api to provide guidance.
    thanks

    Hi
    Thanks for the reply.
    We are using Oracle Applications : 12.1.1.
    we dont have approval for direct update,
    and updating through ap_invoices_pkg.Update_Row is not feasible.
    update me with the feasible solution
    Thanks and Ragards
    Dhananjaya

  • MR 11 not updating the invoicing for services

    Hi All,
    I have a scenario where the client uses MR11 for clearing the invoices.
    He does not use MIRO for invoicing.
    During our observation it is found that using MR11 does not update the invoices for services but the invoices for the material received is updated while checking the reports like ME2N.
    I have checked the Service based IV and the GR based IV in the  invoice tab of PO.
    Can you please advice me as to why this is happening only in case of services.
    Thanks and Regards
    Sridhar.

    Hi Charlie,
    Thank you very much for the response.
    Actually I am looking for the IR reduction and not the GR reduction.
    The note you have mentioned applies for GR reduction.
    Also we are in the ECC 6 environment.
    Please update me with further information.
    Regards
    Sridhar

  • HT5312 How or where do I go to update my security questions?

    How or where do I go to update my security questions?

    Go to:
    https://appleid.apple.com/
    Click "Manage My Account", sign in, and go to the Password and Security section. Answer the security questions and you'll be taken to a screen where you can then change them. If you've forgotten your answers, there should be a link just under the security questions fields where you can have a reset email sent to your Rescue email address. If the link for the email doesn't appear, as can happen if you didn't set a rescue email address or (apparently) have a .Mac email address, go here:
    http://www.apple.com/emea/support/itunes/contact.html
    to report the issue to the iTunes Store.
    Regards.
    Forum Tip: Since you're new here, you've probably not discovered the Search feature available on every Communities page, but next time, it might save you time (and everyone else from having to answer the same question multiple times) if you search a couple of ways for a topic, both in the relevant forums and in the Apple Knowledge Base, before you post a question.

  • I receive an error message when I update my secuirity questions saying it could not save my information'

    I receive an error message when I update my security questions saying an error has occured and we cannot save your information.

    Clear the cache and the cookies from sites that cause problems.
    * "Clear the Cache": Tools > Options > Advanced > Network > Offline Storage (Cache): "Clear Now"
    * "Remove the Cookies" from sites causing problems: Tools > Options > Privacy > Cookies: "Show Cookies"
    * http://kb.mozillazine.org/The_page_is_not_redirecting_properly

  • Update AR Invoice - Distribution Account - Class Revenue

    Hi,
    I want to update AR Invoice - Distribution Account - Class Revenue. The transaction is completed but not posted into GL. From front-end I can do it easily, but I have 1000 + transactions.
    Is there any API available to update AR Invoices Distribution Accounts?
    Thanks
    Waqas Hassan

    Hi,
    There is no update API available. I have uploaded AR Invoices and all that invoices are complete. But our Financial Consultant send me the request to change to Distribution Account.
    It can be, if I do the invoices to incomplete and then delete it.
    This could be the logic to re-create the invoices.
    Please guide me how could I do it incomplete?
    Thanks

  • When attempting to buy an app, iam asked to update my security questions. When I submit these I get an error message saying unable to save data.

    When attempting to buy an app, I am asked to update my security questions. When I submit theses I get an error message saying unable to save data.

    Hi,
    Go here:
    https://appleid.apple.com/
    Then click on "Manage my Apple ID" so you can update these security questions and ensure all your data is up to date. Including rescue emails.
    Regards,
    C

  • To find a user exit which update the Invoice header data

    Hi,
    I need a user exit which will update the invoice header data. For eg I need to update the fields RBKP_V-ESRNR and RBKP_V-ESRRE in table RBKP_V. I was using this user exit EXIT_SAPLMRMP_010 (Program ZXM08U16).But this is not working fine as this has no exporting parameter nor tables of structure RBKP_V.
    I need for transaction MIRO.
    Kindly help ...
    Points will be rewarded
    Thanks in advance

    Hi jayasree,
    with the help of the below given program you can find out the requried user exit by giving the T code (MIRO).
    *& Report Z_USEREXIT_DISPLAY *
    Title : Display UserExits *
    Transport Request No : *
    Modification Log *
    ModNo Date Consultant Description of Change(s) *
    REPORT z_userexit_temp
    NO STANDARD PAGE HEADING
    LINE-SIZE 200
    MESSAGE-ID zz.
    T A B L E D E C L A R A T I O N S *
    TABLES: tftit,
    e071,
    e070.
    S T R U C T U R E D E C L A R A T I O N S *
    TYPES: BEGIN OF x_tstc,
    tcode TYPE tcode,
    pgmna TYPE program_id,
    END OF x_tstc.
    TYPES: BEGIN OF x_tadir,
    obj_name TYPE sobj_name,
    devclass TYPE devclass,
    END OF x_tadir.
    TYPES: BEGIN OF x_slog,
    obj_name TYPE sobj_name,
    END OF x_slog.
    TYPES: BEGIN OF x_final,
    name TYPE smodname,
    member TYPE modmember,
    include(15), "Include name
    END OF x_final.
    I N T E R N A L T A B L E D E C L A R A T I O N S *
    DATA: it_tstc TYPE STANDARD TABLE OF x_tstc WITH HEADER LINE.
    DATA: it_tadir TYPE STANDARD TABLE OF x_tadir WITH HEADER LINE.
    DATA: it_jtab TYPE STANDARD TABLE OF x_slog WITH HEADER LINE.
    DATA: it_final TYPE STANDARD TABLE OF x_final WITH HEADER LINE.
    V A R I A B L E S D E C L A R A T I O N S *
    U S E R I N P U T S S C R E E N *
    S E L E C T I O N S C R E E N *
    SELECTION-SCREEN: BEGIN OF BLOCK blk01 WITH FRAME TITLE text-t01.
    PARAMETERS: p_tcode LIKE tstc-tcode OBLIGATORY.
    SELECTION-SCREEN END OF BLOCK blk01.
    S t a r t o f S e l e c t i o n *
    START-OF-SELECTION.
    PERFORM get_tcodes. "Get Tcodes
    PERFORM get_objects. "Get Objects
    E n d o f S e l e c t i o n *
    END-OF-SELECTION.
    PERFORM display_results. "Display Results
    *& Form get_tcodes
    Get Tcodes
    FORM get_tcodes.
    SELECT tcode
    pgmna
    INTO TABLE it_tstc
    FROM tstc
    WHERE tcode = p_tcode.
    IF sy-subrc = 0.
    SORT it_tstc BY tcode.
    ENDIF.
    ENDFORM. " get_tcodes
    *& Form get_objects
    Get Objects
    FORM get_objects.
    DATA: l_fname LIKE rs38l-name,
    l_group LIKE rs38l-area,
    l_include LIKE rs38l-include,
    l_namespace LIKE rs38l-namespace,
    l_str_area LIKE rs38l-str_area.
    DATA: v_include LIKE rodiobj-iobjnm.
    DATA: e_t_include TYPE STANDARD TABLE OF abapsource WITH HEADER LINE.
    DATA: l_line TYPE string,
    l_tabix LIKE sy-tabix.
    IF NOT it_tstc[] IS INITIAL.
    SELECT obj_name
    devclass
    INTO TABLE it_tadir
    FROM tadir FOR ALL ENTRIES IN it_tstc
    WHERE pgmid = 'R3TR' AND
    object = 'PROG' AND
    obj_name = it_tstc-pgmna.
    IF sy-subrc = 0.
    SORT it_tadir BY obj_name devclass.
    SELECT obj_name
    INTO TABLE it_jtab
    FROM tadir FOR ALL ENTRIES IN it_tadir
    WHERE pgmid = 'R3TR' AND
    object = 'SMOD' AND
    devclass = it_tadir-devclass.
    IF sy-subrc = 0.
    SORT it_jtab BY obj_name.
    ENDIF.
    ENDIF.
    ENDIF.
    *- Get UserExit names
    LOOP AT it_jtab.
    SELECT name
    member
    INTO (it_final-name, it_final-member)
    FROM modsap
    WHERE name = it_jtab-obj_name AND
    typ = 'E'.
    APPEND it_final.
    CLEAR it_final.
    ENDSELECT.
    ENDLOOP.
    *- Process it_final contents.
    LOOP AT it_final.
    l_tabix = sy-tabix.
    CLEAR: l_fname,
    l_group,
    l_include,
    l_namespace,
    l_str_area.
    l_fname = it_final-member.
    CALL FUNCTION 'FUNCTION_EXISTS'
    EXPORTING
    funcname = l_fname
    IMPORTING
    group = l_group
    include = l_include
    namespace = l_namespace
    str_area = l_str_area
    EXCEPTIONS
    function_not_exist = 1
    OTHERS = 2.
    IF sy-subrc = 0.
    IF NOT l_include IS INITIAL.
    *- Get Source code of include.
    CLEAR: v_include, e_t_include, e_t_include[].
    v_include = l_include.
    CALL FUNCTION 'MU_INCLUDE_GET'
    EXPORTING
    i_include = v_include
    TABLES
    e_t_include = e_t_include.
    IF sy-subrc = 0.
    LOOP AT e_t_include.
    IF e_t_include-line CS 'INCLUDE'.
    CLEAR l_line.
    l_line = e_t_include-line.
    CONDENSE l_line NO-GAPS.
    TRANSLATE l_line USING '. '.
    l_line = l_line+7(9).
    it_final-include = l_line.
    MODIFY it_final INDEX l_tabix TRANSPORTING include.
    ENDIF.
    ENDLOOP.
    ENDIF.
    ENDIF.
    ENDIF.
    ENDLOOP.
    ENDFORM. " get_objects
    *& Form display_results
    Display Results
    FORM display_results.
    FORMAT COLOR COL_HEADING.
    WRITE:/1(150) sy-uline.
    WRITE:/ sy-vline,
    2(23) 'Extension Name',
    24 sy-vline,
    25(39) 'Exit Name',
    64 sy-vline,
    65(74) 'Description',
    140 sy-vline,
    141(9) 'Include',
    150 sy-vline.
    WRITE:/1(150) sy-uline.
    FORMAT RESET.
    SORT it_final BY name member.
    LOOP AT it_final.
    CLEAR tftit.
    SELECT SINGLE stext
    INTO tftit-stext
    FROM tftit
    WHERE spras = 'EN' AND
    funcname = it_final-member.
    WRITE:/ sy-vline,
    it_final-name COLOR COL_KEY, 24 sy-vline,
    25 it_final-member, 64 sy-vline,
    65 tftit-stext, 140 sy-vline,
    141 it_final-include, 150 sy-vline.
    WRITE:/1(150) sy-uline.
    ENDLOOP.
    Regards
    Srinivas

  • TS3297 I just need to update my security questions as I forgot the answers so how do I go about that so that I can make purchases?

    Hello.  I am trying to make my first purchase on itunes and cannot remember answers to security questions that I may have established some time ago.  They said if I forgot the answers that I need to contact customer support and this has been a challenge in its own (why is it so difficult?!).  At any rate, can I PLEASE get some help as to what I need to do so that I can make some purchases?  How do I update my security questions as this seems to be the only reason I cannot go any further on itunes?
    Thank you in advance!!!

    Alternatives for Help Resetting Security Questions and/or Rescue Mail
         1. If you have a valid rescue email address, then use this procedure:
             Rescue email address and how to reset Apple ID security questions.
         2. Fill out and submit this form. Select the topic, Account Security. You must
             have a Rescue Email to use this option.
         3. This is the only option if you do not already have a valid Rescue Email.
             These are telephone numbers for contacting Apple Support in your country.
             Apple ID- Contacting Apple for help with Apple ID account security. Select
             the appropriate country and call. Ask to speak to the Account Security Team.
         4. Account security issues almost always require you to speak directly to an
             Apple representative to securely establish your identity as the account holder.
             You can set it up so that Apple calls you, either immediately or at a time
             convenient to you.
                1. Go to www.apple.com/support.
                2. Choose Contact Support and click Contact Us.
                3. Choose Other Apple ID Topics and choose the appropriate topic for
                    your issue.
                4. Follow the onscreen instructions.
             Note: If you have already forgotten your security questions, then you cannot
             set up a rescue email address in order to reset them. You must set up
             the rescue email address beforehand.
    Your Apple ID: Manage My Apple ID.
                            Apple ID- All about Apple ID security questions.

  • HT201303 I tried to update my security questions this morning but got timed out.  Ive just tried to get into my account but the system does not recognise the answers to my question.  How can I rectify this problem please

    I was trying to update my Security Questions this morning but got 'Timed Out' I've just tried again to get into my security settings but the system does not recognise the information I'm putting in. Can anyone tell me how I can correct this problem.  I can still log-in.
    Best wishes

    Welcome to the Apple Community.
    You might try to see if you can change your security questions. Start here, change your country if necessary and go to manage your account > Password and Security.
    I'm able to do this, others say they need to input answers to their current security questions in order to make changes, I'm inclined to think its worth a try, you don't have anything to lose.
    If that doesn't help you might try contacting Apple through Express Lane (select your country, navigate to iCloud help and enter the serial number of one of your devices)

  • Hi All,  I am not able to change the email address to update my secret question and answer.  Instead it directs the email to my work address where I cannot access now.  Thoughts?

    Hi All,  I am not able to change the email address to update my secret question and answer.  Instead it directs the email to my work address where I cannot access now.  Thoughts?

    Call Apple Care and ask for the Account Security Team. They can assist you with your issue.

Maybe you are looking for