Internal Error -5000 when creating AP Credit Memo

hi all, i've some problem when trying to create AP Credit Memo  using VB.Net via SAP B1 SDK.
My application keep throwing error "Internal Error -5000 Occured"
My friend suggest me to create AP Credit Memo using SAP B1 application first, then try using the same parameter that i inputed into the system to create AP Credit Memo using SDK, he said it ussualy works.
I already try my friend suggestion to create AP Memo using SAP B1 Screen and it
was worked.
The information that i input when creating AP Memo via SAP screen are :
- Vendor
- Item/Service Type ="Service"
- Item/Service Description
- G/L Account
- Tax Code ="VNC"
- WTaxLiable =No
But when I try to create AP Memo using VB.NET using SAP SDK, it still
throwing the same exception as before (Internal Error -5000 Occured) even
I passing the same parameter.
Bellow is my code :
For the master :
                        vAPmemo.DocObjectCode =
SAPbobsCOM.BoObjectTypes.oPurchaseCreditNotes
                        vAPmemo.DocType =
SAPbobsCOM.BoDocumentTypes.dDocument_Service
                        vAPmemo.CardCode = "V001" ' txtCcode.Text
                        vAPmemo.DocDate = Now 'DatePosting.Value
                        vAPmemo.DocDueDate = Now ' DateDue.Value
                        vAPmemo.DocCurrency = "IDR"
                        vAPmemo.Comments = "Based On Tagihan  No. " &
dtTable.Rows(j)("JurnalMemo").ToString.Trim & "."
For The Detail :
                   vAPmemo.Lines.AccountCode =
dtTable.Rows(j)("AccountCode").ToString.Trim
                        vAPmemo.Lines.BaseType = 18 'basetype = 19 (a/p
credit memo)
                        vAPmemo.Lines.ItemDescription = "Test"
                        vAPmemo.Lines.WTLiable = SAPbobsCOM.BoYesNoEnum.tNO
                        vAPmemo.Lines.TaxCode = "VNC"
vAPmemo.RowTotalFC= CDbl(dtTable.Rows(j)("Credit").ToString.Trim)
Is there anything wrong in my code ?
or missing parameter?
Regards,
Herfin
Edited by: Herfin Jodana on Aug 28, 2008 3:29 AM
Edited by: Herfin Jodana on Aug 28, 2008 3:30 AM

HI,
if you want ot create a A/P Credit memo, you do not have to give the basetype/BaseLine/BaseEntry fields between document lines.
the correct is:
vAPmemo.Lines.AccountCode =
dtTable.Rows(j)("AccountCode").ToString.Trim
vAPmemo.Lines.ItemDescription = "Test"
vAPmemo.Lines.WTLiable = SAPbobsCOM.BoYesNoEnum.tNO
vAPmemo.Lines.TaxCode = "VNC"
vAPmemo.RowTotalFC= CDbl(dtTable.Rows(j)("Credit").ToString.Trim)
if you want to create a A/P Credit memo based on Existing Invoice, you must have to provide the basetype/BaseLine/BaseEntry  which means:
vAPmemo.Lines.BaseType = 18 'APInvoice
vAPmemo.Lines.BaseEntry = 'Refrence docentry for A/P Invoice
vAPmemo.Lines.BaseLine = 'reference to A/P Invoice linenumber
Try this, it is now working.
Best Regards,
J.

Similar Messages

  • Internal Error (-5000)

    Hi,
    I am getting the error message "Internal Error (-5000)"  when I select the BP in Incoming Payment.  Can anybody help me to resolve this issue ?

    hi,
    try to check the ff. note at sap Portal
         1227605,      1234446,      1077994
    hope it helps.
    bst regards
    fidel

  • Error while creating a credit memo with reference to invoice

    HI aLL,
    I am facing one issue while creating a credit memo request in VA01 with reference to invoice.
    Our project stock is valuated stock.
    When we try top copy the error pops up" Valuated project stock not allowed with customer stock." and the line item is not copied in the credit memo.
    Diagnosis:The entered wbs manages a valuated project stock,at the same time sales order stock is maintained on sales order line item.this combo is not allowed as different valuation methods within a project is not allowed.
    Tarun Kapur

    Dear Tarun!
    1.Within a project we can get stock only in PROJECT or in SALES ORDER STOCK.....a single material can not be a both place at particular time ..so keep only one
    Project Stock or Sales Order Stock..
    2.Check DIP PRofile (ODP1) in usage BILLING AND RESULT ANALYSIS -Charectiristic -SDOC TYPE CMR.....are you selecting right document to which you want to copy .....
    Rewards Points if usefull
    Regards
    SMITH

  • Error while creating an Credit memo in AR + R12

    Hi All,
    I am trying to create a credit memo in AR, based on the transaction i.e., an invoice of AR.
    But i am not able to create.
    I am encounter the following error
    "Your credit memo transaction can only credit an invoice or a debit memo line
    Failure encountered in AR_CREDIT_MEMO_API_PUB.Create_request call to arw_cmreq_cover.ar_request_cm".
    My code is as follows:
    DECLARE
    l_dummy varchar2(240);
    l_customer_trx_id ra_customer_trx.customer_trx_id%type;
    l_line_credits_flag ra_cm_requests.line_credits_flag%type;
    l_line_amount number;
    l_freight_amount number := 0;
    l_cm_lines_tbl arw_cmreq_cover.cm_line_tbl_type_cover;
    l_cm_reason_code varchar2(150);
    l_comments varchar2(150);
    l_msg_count number := 0;
    l_msg_data varchar2(20000) := null;
    l_return_status varchar2(1);
    l_request_id NUMBER;
    l_batch_source_name varchar2(150) default null;
    cm_trx_id number;
    BEGIN
    fnd_global.apps_initialize(1018094,50559,222,0);
    mo_global.set_policy_context('S',204);
    arp_global.init_global;
    l_customer_trx_id := 549724 ; --527689;
    l_comments := 'Creation of Credit memo';
    l_batch_source_name := 'Invoice';
    l_cm_lines_tbl(1).customer_trx_line_id := 833940;
    l_cm_lines_tbl(1).quantity_credited := -1;
    l_cm_lines_tbl(1).price := 1000.00;
    l_cm_lines_tbl(1).extended_amount := -1000.00;
    l_cm_lines_tbl(2).customer_trx_line_id := 833941;
    l_cm_lines_tbl(2).quantity_credited := -2;
    l_cm_lines_tbl(2).price := 1000.00;
    l_cm_lines_tbl(2).extended_amount := -2000.00;
    AR_CREDIT_MEMO_API_PUB.CREATE_REQUEST(
    P_API_VERSION => 1.0,
    P_INIT_MSG_LIST => FND_API.G_TRUE,
    P_COMMIT => FND_API.G_FALSE,
    P_VALIDATION_LEVEL => FND_API.G_VALID_LEVEL_FULL,
    P_CUSTOMER_TRX_ID => l_customer_trx_id,
    P_LINE_CREDIT_FLAG => 'N',
    P_CM_REASON_CODE => 'DAMAGED PRODUCT',
    P_CM_LINE_TBL => l_cm_lines_tbl,
    P_SKIP_WORKFLOW_FLAG => 'Y',
    P_CREDIT_METHOD_INSTALLMENTS => null,
    P_CREDIT_METHOD_RULES => null,
    P_BATCH_SOURCE_NAME => l_batch_source_name,
    P_ORG_ID => 204,
    X_REQUEST_ID => l_request_id,
    X_RETURN_STATUS => l_return_status,
    X_MSG_COUNT => l_msg_count,
    X_MSG_DATA => l_msg_data);
    FND_MSG_PUB.count_and_get (
    p_encoded => FND_API.g_false,
    p_count => l_msg_count,
    p_data => l_msg_data );
    dbms_output.put_line('Return Status ==> '||l_return_status);
    dbms_output.put_line('Credit Memo request_id ==> '||l_request_id);
    dbms_output.put_line('l_msg_count ==> '||l_msg_count);
    FOR I IN 1..L_MSG_COUNT LOOP
    DBMS_OUTPUT.PUT_LINE(SUBSTR(FND_MSG_PUB.GET(P_MSG_INDEX => I, P_ENCODED => 'F'), 1, 254));
    END LOOP;
    IF l_return_status <> 'S' THEN
    NULL;
    ELSE
    select cm_customer_trx_id
    into cm_trx_id
    from ra_cm_requests_all
    where request_id = l_request_id;
    dbms_output.put_line(' CM trx_id = '|| cm_trx_id );
    END IF;
    EXCEPTION
    WHEN OTHERS THEN
    dbms_output.put_line('exception error!');
    dbms_output.put_line(substr(sqlerrm, 1, 80));
    fnd_message.retrieve(l_dummy);
    dbms_output.put_line(l_dummy);
    END;
    Please advise me where i am wrong .... Thanks in Advance.
    Regards,
    Basha.
    Edited by: zaheer on Aug 1, 2011 8:43 PM

    I am encounter the following error
    "Your credit memo transaction can only credit an invoice or a debit memo line
    Failure encountered in AR_CREDIT_MEMO_API_PUB.Create_request call to arw_cmreq_cover.ar_request_cm".Please see these docs.
    Listing of AutoInvoice Error Messages and Troubleshooting Tips to Resolve each Error [ID 1138254.1]
    Credit Memo Errors During Autoinvoice Process - Invalid reference line attribute value (REFERENCE_LINE_ATTRIBUTE1-15) [ID 405445.1]
    Thanks,
    Hussein

  • Different G/L accounts are hitting when a create a credit memo.

    Hi Experts,
    This scenario is a Fixed Bid Contract (Fixed Bid value).
    When I create the Credit memo with reference to Invoice it is hitting the wrong accounting entries like  Unbilled Revenues instead of Unearned Revenue.
    The process here is:
    1. Creation fo contract
    2. Invoice creation with ref. to Contract.
    Customer Account -DR
    UNearned Rev -CR
    3. Credit Memo Request
    4. Credit Memo.
    When do the Credit Memo my accounting entries are:
    Domestic customer -CR
    UnBilled Revenues -DR.
    Thanks
    ANGKS

    Have you checked in Account Determination analysis in VF02- Environment - Account determination analysis- Rev. Accounts.
    It will show , why & which combination this Invoice is posted into specific G/L accounts.

  • Create a Credit Memo from invoice

    Hi,
    When I Create a Credit Memo from invoice, I get the next error : -5002 , "-"
    What is that?
    regards

    Hi Joe,
    I have tested your code and it seems to me that it is working fine. Make sure that the numbers of the document that you are using is correct and that you are doing it for the same business partner. Try doing the exact same thing in SBO. Please remember that you can have different document numbers and document entries for every document. The BaseEntry refers to the DocEntry field in the OINV table and not the DocNum field. The DocNum field is the one you see on screen in top right corner of AR Invoice screen.
    Hope it helps,
    Adele
    PS: Sorry for previous text that was in this message. I had it all wrong
    Message was edited by: Adele le Roux

  • Internal error occured when writing

    Hi all
    I successfully imported an APO planning area into the quality systems, however the same request ends with error 12 in the production system. Landscape is SCM 5.0 sp8 with BI 7.0 sp12. When i checked the import job RDDEXECL (user DDIC), it shows:
    Date Time Message text Message class Message no. Message type
    07/08/2007 00:02:57 Job started 00 516 S
    07/08/2007 00:02:57 Step 001 started (program RDDEXECL, variant , user ID DDIC) 00 550 S
    07/08/2007 00:02:57 All DB buffers of application server <server_name> were synchronized PU 170 S
    07/08/2007 00:03:17 <b>Internal error occurred when writing</b> D0 054 E
    07/08/2007 00:03:17 Job cancelled after system exception ERROR_MESSAGE 00 564 A
    I thought there will be an ABAP dump, I found this internal error (in bold in the log above). I tried searching for info on this but no help, it does not says error writing to what? Please help.
    Thanks
    Ali

    It seems a syncronization problem..
    You can create a customer message providing the following information:
    1. The symptoms that occurred
    2. The highest Support Package
    3. The current SAP_BASIS Support Package level
    4. The queue that is currently selected
    Header Data

  • Create a Credit Memo from purchase invoice

    Hi everyone,
    I am trying to create a credit memo from a purchase invoice, but it retuns the following error:
    "RFC is missing"
    I am using the JCO classes to develop this application. this is a sample of my code:
    IDocuments document = SBOCOMUtil.newDocuments(company,new Integer(19));
    document.setCardCode("P00055");
    document.setDocDate(new java.util.Date());
    document.getLines().setBaseEntry(new Integer(2852));
    document.getLines().setBaseLine(new Integer(0));
    document.getLines().setBaseType(new Integer(18));
    int lRetCode = document.add();
    if(lRetCode != 0){
        System.out.println(company.getLastError().getErrorMessage() );
    Do you have any idea about what is the problem?
    Many Thanks.

    Hi everyone,
    the problem was solve. I had to specified the FederalTaxID field on the document.
    just added the following field:
    document.setFederalTaxID("000000000000");
    Thanks.

  • Manually create --- Rebate Credit memo

    Hi Gurus,
    How Can I create a Credit Memo manually which can fuction like a Rebate Credit memo in posting the credit to the G/L Accounts for rebate expenses.
    we donot want to use the  Rebate agreements. As of standard SAP we cannot create any rebate credit memo manually with VA01, you will get an error. The reason for this is -- In order to track all payments within the rebate agreement, they have to originate from that rebate agreement.
    Is there any possibility?
    Thanks
    Ram

    Yes, you can do but you will need to look for appropriate user exit where system is checking for the reference to rebate agreement and need to by-pass that check then you should be able to do this.
    See for the user exit which is getting called for rebates. Let me know if you are not able to find it.

  • Internal error occured when processing parallel RFC

    Dear Experts,
    I have created one FM and calling that FM as prallel process in a report program.
    CALL FUNCTION 'ZHR_TIME_EVAL_PARALLEL_PROCESS'
          STARTING NEW TASK first_task
          DESTINATION IN GROUP srv_grp
          EXPORTING
            p_job     = sub_job
          TABLES
            rspar_tab = rspar_tab.
    In development system its working fine. In quality it throwing a dump saying "Internal error occured when processing parallel RFC" . Error mesage number - BT 857.
    Any body came across this problem.Please help me to resolve.
    Thanks in advance

    Hi chen,
    I have executed the function modules.Its throwing the floowing exceptions.
    SPBT_INITIALIZE     is throwing the exception INVALID_GROUP_NAME  Message number  BT  - 831.
    Function modules SPBT_GET_CURR_RESOURCE_INFO , SPBT_FIND_FREE_SERVER, SPBT_GET_CURR_RESOURCE_INFO are throwing the exception PBT_ENV_NOT_INITIALIZED_YET  message number BT - 838 .
    How to resolve this problem.
    Thanks in advance.

  • What is tcode to create a credit memo ?

    What is tcode to create a credit memo ? please tell me the steps ?

    Hello,
    <b>Credit memo: Document type - G2</b>
    1.     Credit memo is generally issued in two cases - either when customer returns goods previously purchased and requires a credit or customer is credited without reference to any return of goods when goods sent to him are found to be defective and a return delivery or a repair would exceed the cost. in this case the customer is requested to scrap the material sent and is given an account credit.
    2.     Another case is when the customer is over charged for goods he purchased and we only realise that after billing.
    3.     when configuring the sales document type “credit memo request” G2 – you can automatically set a billing block that can be released by an authorised person during processing prior to billing.
    4.     It is the billing in the finance dept, which in turn is the actual creation of a credit note that is sent to the customer.
    5.     It is suggested to make the rejection reason, reference to billing document (invoice) and billing block in credit memo a mandatory field to ensure the traceability.
    6.     standard item category used is G2N; order related billing type – G2 (invoice)
    7.     Items in contracts and credit memo requests do not have schedule lines as there is no movement of material involved.
    8.     Update document flow is activated when using copy control rules for copying from an invoice to a credit memo request.
    <b>REWARD POINTS IF HELPFUL.</b>
    Regards
    Sai

  • Is it possible to create a Credit memo without reference doc

    Hi,
    I need to create a billing document (VF01) without passing the refernce document number. Is there any way to create this? While creating the billing document i just want to pass only items.
    Thanks In Advance,
    Regards,
    Raj

    the answer is that you can create a Credit Memo request (sales document) without a reference to a billing document. The settings for this are maintained in
    SPRO>Sales and Distribution>Sales>Sales Documents>Sales Document Header>Define Sales Document Types
    In the sales document type, the field that controls whether a reference document is necessary is in the General Control pane and is called "Reference Mandatory" - BEZOB
    If that field is blank you don't need a reference number. You can also generate the actual Credit Note (billing document) without any problems. All accounting entries are carried out as normal.
    SAP help says:
    Reference mandatory
    Indicates whether, when you create a sales document, a reference document is mandatory. If so, the indicator also specifies which type ofreference document you should use.
    Use
    When you try to create a sales document that has a mandatory reference document, the system automatically prompts you for the number of the reference document.

  • Internal error occurred when writing

    Hi,
            We have a brand new sandbox setup and I am trying to create a planning Object Structure. I added the objects and checked for errors, I got no errors. But when I try to activate the POS, I am getting the following error:
    Internal error occurred when writing
    Message no. D0054
    Can somebody help me identify what the problem is?
    Thanks.

    Hello Raj -
    Look at the following note
    647603 if you are using SCM 4.0.
    Apply the corrections this might help.
    Also if you are using SCM 5.0 try to go thru the post installation steps and you will come across activation of infoobjects that are relevant and are needed for POS.
    Perform the steps as described and the message shud go away.
    Hope this helps.
    Regards,
    Suresh Garg

  • Error while adding A/P Credit Memo!

    Error while adding A/P Credit Memo..........
    'G/L Accounts' (OACT) (ODBC-2028) Message - 131-183
    Please advice me .....
    Thanks...

    Hi
    Check this thread this may help you.
    [Re: AP Invoice - No Matching Account Error]
    Regards
    Balaji

  • Creating a credit memo by referring Billing document

    Hi All,
          I am creating a Credit memo Say <b>CM</b> by reffering a Billing document say <b>B</b>.The Billing document has been created from a Contract say <b>C</b>.
          Now while creating the CM the contract dates need to be copied from C to the contract data screen of CM.
          I have used <b>Copying control Billing Document to Sales Document</b> for achieving this.
         I have edited the VEDA(Contract data) in the routines 302,303,402 etc. but its not reflecting in Contract data of CM screen.
         Please help me in resolving this.
    Thanks and Regards,
    Siva

    Hi,
    Create a new pricing procedure without the condition type you donot wish to appear in the credit note. create/ use a different document pricing procedure for the credit note, do the required assignments.. this will meet the requirements
    Regards,
    Ajit

Maybe you are looking for

  • How To Customize Existing Web Photo Gallery?

    I copied one of the existing Web Photo Galleries (Simple - Vertical Thumbnails) and have customized it. What I'm needing to change now is the Options within the Web Photo Gallery dialogue box. Under "General" I'm needing to have the "Use UTF 8 Encodi

  • Error : BPM

    Hi , I am following this blog.. /people/sudharshan.aravamudan/blog/2005/12/01/illustration-of-multi-mapping-and-message-split-using-bpm-in-sap-exchange-infrastructure Configuration and design is finished , In monitoring its showing successful for sen

  • I keep getting error msg "Oops! Firefox could not find..." a lot!

    On websites that I visit often, I have started to receive "Oops! Firefox could not find xlforum.net", etc. This is happening a lot. I've already done a virus/malware scan and the problem still exists. Any idea what's going on? == URL of affected site

  • MIRO ACTIVITY FOR VENDOR PAYMENT

    SAP IS SUCH A BIG SOFTWARE. ENHANCEMENTS ARE REQUIRED IN MANY FIELDS SO THAT THE USER CAN WORK SMOOTHLY. THE MIRO ACTIVITY WHICH IS MANUAL. ONLY IF YOU SELECT GR BASED INVOICE VERIFICATION THAN MIRO RETRIEVES DATA. ENHANCEMENT TO BE MADE IN SUCH A WA

  • I am trying to update my ipad

    Hello, I am trying to update my ipad to the lates ios6, is there any help for me? Thanks