How to catch accounting Document Number in SE37 for  BAPI_ACC_DOCUMENT_POST

HI Frds,
My ReQ is i have to post Customer Invoice from Legacy to ECC through PI interface. So i am using one BAPI , ' BAPI_ACC_DOCUMENT_POST''. I had customized this BAPI by adding 2 fields (1.zstatus, 2.zsaprefno) as i have to send the status(1. Success/Fail, 2.Account Document Number) back to Legacy.
For PI i have to give the BAPI structure. So when i am executing in SE37 zstatus field is catching the value as 'Success'. But the ZSAPREFNO is not catching the account document number. Bez we have to execute BAPI_TRANSACTION_COMMIT after this BAPI(in test sequence from Menu bar). So directly updating in Database tables.
when i was excuting in SE38 the Accounting Document Number is returned in RETURN parameter of MESSAGE_V2 as we are checking the return parameter after BAPI_TRANSACTION_COMMIT.
when i am trying in SE37 its not catching the value in MESSAGE_V2(catching as $).  After COMMITing we have no option to check the RETURN parameter.
So, any idea how to get the Account Document Number  in SE37.......Or any other way to do..........
Edited by: priya tavanam on Sep 3, 2010 7:02 AM

Hi,
if standard BAPI did not return the Acc. document number before BAPI_COMMIT then create wrapper FM
1) call actual BAPI and BAPI_COMMIT with in that.
2) retrun the account document back.
otherwise you can try sync proxy as well.
Regds,
Suresh

Similar Messages

  • How to get Accounting document number from billing document number

    Hi,
    How to get Accounting document number from billing document number i.e. from VBAK- VBELN.
    Cheta Pant

    Hi,
    VBAK is the Sale Order header table, Billing document table is VBRK.
    Sales tables (VBAK,VBAP,VBRP,VBRK) do not store accounting document numbers.
    You do other way around. Just go to SE16 and enter the Billing document number in field Billing document VBELN in BSEG or BSID or BSAD table and execute, you will find the accounting document number.
    If you just want collect this information once then you can use table BSEG, but if you think to develope a report then use table BSID and BSAD.
    Regards,
    Chintan Joshi

  • How to fetch accounting document number from known material document number

    Hi,
    Using MIGO transaction, by giving mblnr(material document number) as input, I get accounting document number by clicking FI document.I have to add this accounting document number in my report for corresponding known mblnr(material document number) values.
    My question is how to fetch the accounting document number present in MIGO to add in my report program.
    I used the xblnr(Reference Document Number) which is present both in mkpf and bkpf tables to fetch values.
    I extracted xblnr values with known mblnr values from mkpf (Header: Material Document table).
    and then extracted belnr(accounting document number) from bkpf (Accounting Document Header table) by using xblnr values.
    But the query is running for a long time.
    Is there any other method  to extract the values in a simpler way.
    Kindly advise.
    Thanks and Regards,
    Sanjeev

    I had the values of xblnr and some other fields such as mblnr, budat etc in wi_item table.
    I created a new internal table i_xblnr and got down those values.
    And then created a new internal table i_belnr and tried to get values of belnr in it.
    The code I wrote is given below:
    IF not wi_item[] is initial.
    loop at wi_item.
       at new xblnr.
        ws_xblnr-xblnr = wi_item-xblnr.
         append ws_xblnr to i_xblnr.
       endat.
    endloop.
      select belnr xblnr from bkpf into table i_belnr for all entries in i_xblnr where xblnr = i_xblnr-xblnr.
    ENDIF.
    Kindly look after it.Thank you.
    Regards,
    Sanjeev

  • How to send Sales Document Number and Item to BAPI_ACC_DOCUMENT_POST?

    Hello SAPients,
    We are using BAPI_ACC_DOCUMENT_POST to create an accounting document similar to what FB01 does, in FB01 you can type the number and position of a Sales Document even if you are using an Account Receivable account number. But in the BAPI, the  ACCOUNTRECEIVABLE table doesn't have a field to include those numbers. How should I pass the sales order number and item to the BAPI? I have tried several things but every time I receive more complicated error messages.
    Thank you in advance for your kind help.

    Let me know if you have any questions:
    Loop through your records and fill in the appropriate structure based on record type (GL, Vendor or Customer)
    IF NOT pcard_post_rec-zlsapac IS INITIAL.
        gt_gl_item-itemno_acc   = ls_posnr.
        gt_gl_item-gl_account = pcard_post_rec-zlsapac.
        gt_gl_item-comp_code = pcard_post_rec-zlsapco.
        "gt_gl_item-pstng_date = pcard_post_rec-zlgpsdt.
        gt_gl_item-pstng_date = gv_posting_date.
        gt_gl_item-doc_type = doctype.
        gt_gl_item-alloc_nmbr = ls_assignment.
        gt_gl_item-ref_key_3 = pcard_post_rec-zlgvend.
        IF pcard_post_rec-zlsapac < 500000.
          gt_gl_item-item_text    = ''.
        ELSE.
          gt_gl_item-item_text    = pcard_post_rec-zlguser.
        ENDIF.
        gt_gl_item-costcenter = pcard_post_rec-zlsapcc.
        gt_gl_item-orderid = lv_ordnum.
        APPEND gt_gl_item.
      ELSEIF NOT pcard_post_rec-zlsapven IS INITIAL.
        gt_ap_item-itemno_acc = ls_posnr.
        gt_ap_item-vendor_no = pcard_post_rec-zlsapven.
        gt_ap_item-comp_code = pcard_post_rec-zlsapco.
        gt_ap_item-alloc_nmbr = ls_assignment.
        gt_ap_item-ref_key_3 = pcard_post_rec-zlgvend.
        IF pcard_post_rec-zlsapac < 500000.
          gt_ap_item-item_text = ''.
        ELSE.
          gt_ap_item-item_text    = pcard_post_rec-zlguser.
        ENDIF.
        APPEND gt_ap_item.
      ELSEIF NOT pcard_post_rec-zlsapcus IS INITIAL.
        gt_ar_item-itemno_acc = ls_posnr.
        gt_ar_item-customer = pcard_post_rec-zlsapcus.
        gt_ar_item-comp_code = pcard_post_rec-zlsapco.
        gt_ar_item-alloc_nmbr = ls_assignment.
        gt_ar_item-ref_key_3 = pcard_post_rec-zlgvend.
        IF pcard_post_rec-zlsapac < 500000.
          gt_ar_item-item_text = ''.
        ELSE.
          gt_ar_item-item_text    = pcard_post_rec-zlguser.
        ENDIF.
        APPEND gt_ar_item.
      ENDIF.

  • Table relations between vbrk and bkpf for  Accounting Document Number

    hello,
    i am using 4 tables to get data into my programs.
    vbrk,vbrp konv and bkpf.
    i want to get belnr from bkpf.i found relation between vbrk and belnr.but in vbrk table belnr's value is initial.
    can anybody tell me that how should i relate vbrk and bkpf or how to get Accounting Document Number(belnr) from bkpf for Billing Document(vbeln).
    regards,
    soniya s.

    hi,
    chekc this. its working for me.
    data : WA_AWKEY LIKE BKPF-AWKEY.
    data :  WA_BELNR LIKE BKPF-BELNR.
    data : LENGTH TYPE I.
    *BREAK MTABAP.
    LENGTH = STRLEN( IT_VBRK-VBELN ).
    if  LENGTH = '10' .
    MOVE it_vbrk-VBELN TO WA_AWKEY.
    SELECT SINGLE BELNR FROM BKPF INTO WA_BELNR
      WHERE AWKEY = WA_AWKEY
      AND AWTYP = 'VBRK'
      and blart = 'RV'.
    it_final-acc_doc = WA_BELNR.
      CLEAR WA_BELNR .
      CLEAR WA_AWKEY .
    else.
    CONCATENATE '0' it_vbrk-vbeln INTO wa_awkey.
    SELECT SINGLE BELNR FROM BKPF INTO WA_BELNR
      WHERE AWKEY = WA_AWKEY
      AND AWTYP = 'VBRK'
      and blart = 'RV'.
    it_final-acc_doc = WA_BELNR .
      CLEAR WA_BELNR .
      CLEAR WA_AWKEY.
    endif.

  • How to find Invoice number linked to FI accounting document number ??

    Hello All,
    I have been looking around for all possible combinations to find the link between FI accounting document number (BSEG-BELNR) and Intercompany Invoice number (for which billing corr. to STOs' or POs' is done).
    The requirement is that during ERS posting, we have accounting document numbers (BSEG-BELNR) and associated STOs' for this (BSEG-EBELN), but we are unable to map the Intercompany Billing Invoice number(s) (where the billing corr. to STOs' obtained from BSEG-EBELN) to this accounting document number (BSEG-BELNR).
    Any pointers or detailed view solution would be of great help.
    Thanks,
    Ansh

    Hello DPM,
    Thank you for the descriptive help. But my requirement is to look for Intercomapny Billing number (VBRK-VBELN) linked to an accounting document number (BSEG-BELNR) and not Invoice Receipt Number.
    The steps that I am following are:
    From BSEG, found EBELN (Stock Transfer Order) and XREF3 (Reference Key, combination of fiscal yr., some ref. number, maybe GR no. and ref item no.), based on BELNR (Accounting document number).
    From EKBE, found XBLNR (Reference Delivery Number or Direct Intercompany Billing Number on which GR is done) based on
    EKBE - EBELN = BSEG - EBELN
    EKBE - BELNR = BSEG - XREF3 (only ref and item no., considering it to be a GR no.)
    EKBE - VGABE = '1' and EKBE - BEWTP = 'E'.
    From VBRP, found VBELN (Intercompany Billing No., which is a desired number) based on
    VBRP - AUBEL = EKBE -EBELN (Stock Transfer Order)
    VBRP - VGBEL = EKBE - XBLNR (Delivery number)
    Here, I am not sure about 2 things:
    Whether the reference no in BSEG-XREF3 will always be Goods Receipt number for Stock Transfer Order or not. If not, then what it can be and how I will have to proceed further then.
    Secondly, If in case for an accounting document number, I have 2 Stock Transfer orders (BSEG - EBELN) and same reference number (BSEG-XREF3), then from History table (EKBE) I get only single delivery based on which GR was doen for both STOs', then I shall be getting single Intercompany Billing Invoice from VBRP or different ?
    Kindly provide your inputs.
    Thanks,
    Ansh

  • How to find the invoice number from accounting document number?

    Hi
    I am using the bapi BAPI_AP_ACC_GETSTATEMENT and trying to get the invoice numbers of all the payments.
    but i am unable to find the link between the accounting document number from the bapi and the vendor invoice number.
    i have tried the tables BSE_CLR, BSEG and BKPF. the field AWKEY in BKPF has the combination of BELNR & BUKRS & GJAHR when the document type is anything other than RE.
    How can i get the invoice numbers from the accounting doc. numbers?
    Regards
    Sujai

    I am unable to find the link between BKPF-BELNR and RBKP-BELNR from the bapi return values.
    XBLNR is blank when i check the table.
    the output of the bapi is something like this                                                                               
    COMP VENDOR   CLEAR_DATE CLR_DOC_NO ALLOC_NMBR   FISC   DOC_NO     ITE
                                                                                    1000    1100 ........ .........................................  20020123           2002 1900000202   002
    1000    1100 ........ .........................................20020123           2002 1900000203   002
    1000    1100........ .........................................20020123           2002 1900000204   002
    1000    1100........ .........................................20020123           2002 1900000205   002
    now i try passing the doc_no (1900000XXX) and the fiscal year (2002) and company code to BKPF
    the XBLNR field is blank. This document number sequence doesn't seem to be the accounting document number of the invoice coz that starts with 51XXXXXXXXX.
    If i try passing the number with sequence 51XXX... to BKPF i get the invoice number there in the AWKEY field.
    I am not sure what this sequence (19___) represents.
    Sujai
    Edited by: Sujai S on Nov 5, 2008 7:22 PM
    Edited by: Sujai S on Nov 5, 2008 7:22 PM

  • How to get an accounting document number from an Invoice number

    Dear All,
    I have a requirement where I need to know which accounting document is created against a  particular invoice. As we know that in the document flow of invoice we can see the Accounting document also. But to develop the report I need to pick the accounting document by the invoice document. Please suggest me a table where this value is getting stored. I already tried VBFA and VBKD but nowhere I am getting such information from which I can pick a accounting document number for a particular invoice.
    Please give me your suggestions.
    Regards,
    Sanju

    Dear,
    For Billing document create no. range by Tcode-VN01 and assign it to in Tcode-VOFA
    For Accounting document create no. range by Tcode-FBN1 and activate the External Field and assing it to in Tcode- OBA7
    but Assign the same no. range to both Document types for exp 1000000 to 1999999.
    Regards
    AJIT K SINGH
    HAPPY TO HELP U

  • How to get MM Invoice number from FI Accounting document number

    Hi,
    I am writing a query (OPEN ITEMS FOR ACCOUNT PAYABLE)through SQVI. We need to display MM Invoice number from FI Accounting document number . Please let me know the table name from where I can join FI document number and can retreive MM Invoice number.
    Thanks
    Rama

    hi,
    use this.
      SELECT belnr
               awkey
               INTO TABLE it_bkpf
               FROM bkpf
               FOR ALL ENTRIES IN it_mkpf
               WHERE awkey = it_mkpf-awkey.

  • For BSID- Accounting Document Number corresponding PO Number is required

    Hi Gurus,
                 I have got a requirement to develop a report similiar to 'FBL5N' . I am getting the details of open and cleared items of a customer from BSID and BSAD tables respectively. My requirement is also to fetch the corresponding PO number of the LINE items displayed in the report.
                Can any one suggest how can I fetch PO number with Accounting document number(BSID-BELNR)  or (BSAD-BELNR).
               Your efforts in this matter are deeply appreciated and <<removed_by_moderator>>.
    Thanking You,
    ZIa.
    Edited by: Vijay Babu Dudla on Jan 28, 2009 11:07 PM

    If you have fields BSID-VBEL2 and BSID-VPOS2 are populated with the sales order, than access VBKD with the Sales Order to get the Customer PO (VBKD-BSTKD)
    Or
    First, You need to get the Billing document. Access BKPF with the BSID-BELNR to get the AWKEY where AWTYP = 'VBRK'
    Now, you can go to SD document flow with the billing document to find out the Sales Document. Access VBKD with the Sales document to get the Customer PO
    Regards,
    Naimesh Patel

  • Invoice & Accounting Document Number

    Dear Experts,
    We are facing number range problem. When we are saveing an invoice then Invoice number and accounting document number showing different. It should come same number. Can you pls advice why this is happening and how I can resolve this issue.
    Thanks in advance for your kind support.
    Best Regards.
    Ripon Kumar Paul

    Dear Ripon,
    Please check the below which will help you achieve same document number:
    SAP gives you customizing options to make both document numbers the same. The solution lies in the number range assignment of the MM and FI document. You need to configure the MM document number assignment as internal and external for the FI documents. (FI documents are set up with external-assigned numbering, while the MM document has internal, or system-generated, numbering.) In this case, the MM document number is passed on to the FI document, which means that the number of the FI document is identical to the MM document.
    Because the document number assignment in MM is not company code-specific, in contrast to the FI document, you need to take the following points into consideration before using external document number assignments for FI documents. They have the following effects on your system:
    Continuous number assignments for FI documents are not guaranteed, especially if you have more than one company code.
    The document number ranges in MM and FI have to be the same for all company codes.
    In Release 4.6C, you need to use internal number assignments for revaluation documents, invoice reduction documents, Evaluated Receipt Settlement (ERS) postings, or reversal documents. There are no restrictions as of SAP Enterprise 4.70.
    Use a different number range assignment for FI invoice posting (FB60), because FI invoice postings usually use internal number range assignments and the postings originate in FI, not MM.
    If you use document parking and the number range intervals are fiscal year-dependent, you cannot change the posting date of the document if the fiscal year is different to that determined for the previous posting date. In this case you have to delete the document and re-enter it. There are no restrictions for fiscal year-independent number ranges.
    What do you do if you have already posted thousands of invoices in your system and the numbers are already different? In this case, you need to find unused number range intervals in MM and FI. Since most companies do not change the SAP standard delivered number ranges during the original implementation, number range interval 52 is usually available in MM and FI.
    Now let's look at the detailed customizing steps. With the following customizing steps, you can align the MM and FI document numbers going forward only. No fix is available for invoices already posted in your system, since SAP does not allow the change of document numbers.
    Step 1. Maintain FI document number range. Use transaction OMR4 and go to Number range for document types in FI. Select the company code for which you want to create the new number range interval and click on the change interval button. Insert a new document number range by clicking on the insert interval button on top of the screen. In this example, I created number range interval 52 with the document numbers 5200000000 u2013 5299999999. Don't forget to set the external number range check box (Ext).
    Step 2. Assign FI number range to FI document types. The second step is to assign the number range created in step 1 to the FI document type for invoices. Again use transaction OMR4 and go to Document type. Double-click on the document type, which you are using for LIV invoices. In my example, I used the SAP standard document type RE. In the number range field, assign the new number range interval 52.
    Thanks!!!
    Murlidhar Khatri

  • Link to find Accounting document number from Material document number / PO

    Hi
    We are working on a custom report, in which we need to print purchasing details (from EKPO, EKKO & EKBE) as well as accounting details (from BSEG & BKPF). We need to hit BKPF/BSEG with the accounting document number, since it is the only key field (though PO number is there in BKPF, we can not use this because it is not a key field)
    My question from which table we get the accounting document number ? We need to provide a link between purchasing & accounting through accounting document number, but how to find the accounting document number. ?
    Thanks
    Venkat.

    Venkat,
      I guess you are trying to fetch Accouting Documents for goods receipt against PO.
      To do this, you need to look at the PO History table (EKBE) and find out the Corresponding material document (VGABE = 1 for good receipt).
      Get the value of BELNR and GJAHR.
      Concatenate BELNR and GJAHR into your refernce key (like BKPF-AWKEY).
      Then use this key to read table BKPF with the following key
       AWTYP = 'MKPF' for Material document
       AWKEY = reference key generated above.
       AWSYS = the value of the logical system (if used) or blanks
    This will get you quicker access as compared to what you've described below. In this case, the system uses a standard SAP Index "Index by application type and key" to fetch the relevant records.
    Hope this helps.

  • Incremental records for accounting document number

    I am facing a problem where I need to get incremental upload. I have to get the Accounting document number posted for an asset. I was thinking of using ANLP-BELNR, forming the AWKEY from it, and then getting the BKPF-BELNR. This way I thought I would get incremental records, as BKPF has CPUDT and CPUTM. But my confusion is:
    1) is that date and time the time when the document was posted?
    2) this date and time differs from the date(CPUDT) and time(CPUTM) in ANEK table? Does that make any difference?
    3) Also I checked CDPOS, and for OBJECTCLAS = BELEG, adn TABNAME = BKPF, there is no entry with Changeid = 'I'. That means the new documnets posted are not being captured in CDPOS?
    Please tell me a way how can I get the incremental data?
    Thanks a lot,
    Nalini

    Here you go....
    RF_BELEG
    Regards,

  • Related Accounting Document Number for an SO

    Hi,
    How will I determine the Accounting Document number related to a Sales Order?
    I know the flow is in VBFA but, I can't seem to see the Accounting Document number in there be cleared/completed or not cleared.
    Is there a function module, bapi that I could use?
    Thanks,
    KLL

    Hi,
      If you to check whether the accounting document is cleared of not ..Check the field BSEG-AUGBL not initial..
      If the field BSEG-AUGBL is initial.
         accounting document not cleared.
      elseif the field BSEG-AUGBL not initial.
         accounting doucment is cleared.
      endif.
    Thanks,
    Naren

  • G/L Account number using accounting document number...

    Hi,
    How do I find the G/L Account number with the help of Accounting Document number (BELNR) ?
    -Rajesh

    HI,
    Use tables BSAS,BSIS  and pass the docuemnt number you will get the GL account.
    Thanks
    Mahesh
    Message was edited by:
            I Can Solve It

Maybe you are looking for

  • How do the application servers connect the new database after failing over from primary DB to standby DB

    How do the application servers connect the new database after failing over from primary DB to standby DB? We have setup a DR environment with a standalone Primary server and a standalone Physical Standby server on RHEL Linux 6.4. Now our application

  • T61 Soundmax Install/Post-Install Problem XPSP3

    T61 with Lenovo-supplied XP downgrade installed (now SP3). The Soundmax drivers need to be reinstalled periodically. On some boots the drivers load and the sound functions are usable, on other boots a message is displayed that the Soundmax drivers mu

  • OFA & Grid Infrastructure home

    Hi! I am experiencing some difficulty understanding where to install install GI According to "Oracle® Grid Infrastructure Installation Guide 11g Release 2 (11.2) for Oracle Solaris", http://docs.oracle.com/cd/E11882_01/install.112/e24616/presolar.htm

  • Why I need to restart my my server to update my servlet in WL5.1

              Hai           We have servlets and ejbs in our acchitecture and using weblogic5.1. For EJBs           weblogic have given hot deploy. But for every change of servlets currently we           are stopping the server and replacing the servlet

  • Updating Target Table using DBMS_Scheduler for every 10 seconds

    Hi All, Am new to DBMS_Scheduler Package, Based on the examples I have written an anonymous block to create job,,, It needs a correction in repeat_interval value, I have two table emp (Source) and sk_emp (Target), I want sk_emp table to be update for