Reg - sap generated document number

hi all,
      In fv60 transaction code,if u save a document,sap will generate a documnet number,how to find to which table the generated document number is saved???????
plz help me with this regard,
                      very very urgent....
regards,
balaji.s

hi madhavi,
                thx,it worked,thanks a lot.....
regards,
balaji.s

Similar Messages

  • BAPI_ACC_DOCUMENT_POST & generated document number

    Hi,
    I am using BAPI function BAPI_ACC_DOCUMENT_POST to post financial documents in the system. My question is, how properly retrieve generated document number (BKPF-BELNR). We are using internal document number generation so the function generates document number. But, function itself, does not return generated document number. Currently, after commit I try to locate a record of generated document using reference key ... Isn't there any better way how to get generated document number?
    Tkank you.

    Yes, I found this code ... as I wrote, there is not problem if I set curtp = '10'. BUT, there is another problem, with different currencies. Then, when I try to post document in different currency that the currency of company code is, function raises error "Inconsistent currency information" ...
    here is an example, how I fill tax information, as requested:
    DATA:   docHeader     TYPE BAPIACHE09,
            accGL         LIKE BAPIACGL09 OCCURS 0 WITH HEADER LINE,
            accReceivable LIKE BAPIACAR09 OCCURS 0 WITH HEADER LINE,
            accAmnt       LIKE BAPIACCR09 OCCURS 0 WITH HEADER LINE,
            accTax        LIKE BAPIACTX09 OCCURS 0 WITH HEADER LINE,
            extension     LIKE BAPIACEXTC OCCURS 0 WITH HEADER LINE,
            tax_account   TYPE STRING,
            tax_code      TYPE STRING,
            tax_trans     TYPE STRING,
            tax_spec      LIKE ZIFPRMS-VALUE,
            itemno        TYPE N LENGTH 10.
    * initialize document header
      docHeader-bus_act    = 'RFBU'.
      docHeader-username   = sy-uname.
      docHeader-header_txt = fin_data-text.
      docHeader-comp_code  = header-company_code.
      docHeader-doc_date   = header-document_date.
      docHeader-pstng_date = fin_data-posting_date.
      docHeader-ref_doc_no = header-id_sale.
      docHeader-doc_type = params-doc_type.
    * process document items, in loop
      LOOP AT fin_items INTO fin_item.
    * initialize AR (line 1)
         accReceivable-itemno_acc = itemno.
         accReceivable-customer   = cus_data-id_contact.
         accReceivable-comp_code = header-company_code.
         CONCATENATE fin_item-text ' (receivable)' INTO accReceivable-item_text.
         accReceivable-pmnttrms = params-payment_term.
         accReceivable-pmnt_block = params-payment_block.
         IF doc_type = 'APR'.
            accReceivable-sp_gl_ind = 'F'.
         ENDIF.
         APPEND accReceivable.
    * initialize receivable amount
         accAmnt-itemno_acc = itemno.
         accAmnt-currency = fin_data-currency.
         accAmnt-curr_type = '10'.
         accAmnt-amt_doccur = fin_item-vat_base + fin_item-vat.
         IF doc_type(2) = 'CR'.
            accAmnt-amt_doccur = accAmnt-amt_doccur * ( -1 ).
         ENDIF.
         APPEND accAmnt.
         itemno = itemno + 1.
    * do not continue when posting a down payment request
         CHECK doc_type < > 'APR'.
    * initialize GL account line item
         accGL-itemno_acc = itemno.
         accGL-gl_account = params-doc_gl_account.
         CONCATENATE fin_item-text ' (revenue)' INTO accGL-item_text.
         accGL-pstng_date = fin_data-posting_date.
         accGL-tax_code = tax_code.
         accGL-doc_type = params-doc_type.
         accGL-costcenter = fin_item-cost_centre.
         APPEND accGL.
    * initialize GL amount
         accAmnt-itemno_acc = itemno.
         accAmnt-currency = fin_data-currency.
         accAmnt-curr_type = '10'.
         accAmnt-amt_doccur = - ( fin_item-vat_base ).
         IF doc_type(2) = 'CR'.
            accAmnt-amt_doccur = accAmnt-amt_doccur * ( -1 ).
         ENDIF.
         APPEND accAmnt.
         itemno = itemno + 1.
    * initialize TAX account line item
         IF STRLEN( tax_code ) > 0.
            accTax-itemno_acc = itemno.
            accTax-gl_account = tax_account.
            accTax-tax_code   = tax_code.
            accTax-cond_key   = 'MWAS'.
            APPEND accTax.
    * initialize tax amount
            accAmnt-itemno_acc = itemno.
            accAmnt-currency = fin_data-currency.
            accAmnt-curr_type = '10'.
            accAmnt-amt_doccur = - ( fin_item-vat ).
            accAmnt-amt_base = - ( fin_item-vat_base ).
            IF doc_type(2) = 'CR'.
               accAmnt-amt_doccur = accAmnt-amt_doccur * ( -1 ).
               accAmnt-amt_base = accAmnt-amt_base * ( -1 ).
            ENDIF.
            APPEND accAmnt.
            itemno = itemno + 1.
         ENDIF.
      ENDLOOP.
    * translate customer field to BAPI format
      CALL FUNCTION 'MAP2E_BAPICOBL_CI_TO_BAPIEXTC'
         TABLES    INTERNAL_CI_COBL      = cust_ext
                   EXTENSION_CODINGBLOCK = extension.
    * call BAPI function to create customer invoice
      CALL FUNCTION 'BAPI_ACC_DOCUMENT_POST'
         EXPORTING DOCUMENTHEADER = docHeader
         IMPORTING OBJ_TYPE = obj_type
                   OBJ_KEY  = obj_key
                   OBJ_SYS  = obj_sys
         TABLES    ACCOUNTGL = accGL
                   ACCOUNTRECEIVABLE = accReceivable
                   ACCOUNTTAX = accTax
                   CURRENCYAMOUNT = accAmnt
                   EXTENSION1 = extension
                   RETURN = returnTab.
    Edited by: Rastislav Mojzis on Jul 9, 2008 7:18 AM

  • Error when Generating Document Number

    Hi Friends,
    I am trying to generate Document Number which uses C1-DOC-NBR and generate Document Number . when i click on Freeze/Complete button of bill ,the following error is coming .
    Document Sequence for Issuing Center HITECH with Branch 1011 and Document Type C1IN
    not found
    But i already attached issue center to the user ,SA characterstic type ie(public/non public),and all other parameters for that algorithm.
    pls help to solve this error.
    Thanks&Regards
    sivaram

    You need to verify the configuration of "Issuing Center", also ensure that "HITECH" Issuing Center is part of the User's Characteristic Value as defined under Document Number Details algorithm on the Installation Record.

  • Delete generated document number of Transaction ABAVN

    Hi,
    My problem is that user run the BDC for ABAVN - Asset Retirement, inplace of F-92 BDC with correct file (means with F-92 flat file).
    After that system shows 1 generated number is 0100003616.
    How can i reverse/ delete this genertaed number. Because it's a wrong generated number.
    Regards,

    Dear
    AB08 is the T-code for reversal of asset document. Once you have given the asset number it will give you the list of documents posted on the said asset. Select the document you want to reverse and a new no. for reversal doc will be generated.
    Do the same for all the assets posted against the said document.

  • How to generate unique document number ?

    Hi All,
    We need to generate Document Number where there should be any gap, so that we cannot use sequence. For example : Invoice Number.
    one possible approach like : Select MAX(InvoiceNumber)+1 from invoice, what if that table has millions of rows, is this reliable enough ?
    How to avoid two user do the same query at same time that lead to dupplicate number ?
    Anybody has done it this way in production? or any other approach ?
    Thank you for your info,
    xtanto

    I strongly second Justin's strong suggestion about re-considering the requirement.
    Be aware that for any of the schemes suggested to have a chance of working, all access to the table must be through stored procedures that use a SELECT FOR UPDATE on the counter table. No user in the database can have insert privileges on the document table except the owner. The owner's password should be kept in a locked safe and be unknown to anyone. If for some reason the owner needs access to the database, then remove the password from the safe, do what needs to be done, then get some guy off the street to set a new password, write it down and lock it in the safe again.
    If you really need a gap-free number, it needsto be another column, separate from the PK. Use a sequence to generate the pk gaps and all, then create a procedure that runs periodically to update the gap free column. Soemthing like:
    SQL> CREATE PROCEDURE fix_gap_free AS
      2     l_v NUMBER;
      3     TYPE id_tbl IS TABLE OF number INDEX BY BINARY_INTEGER;
      4     l_ids  id_tbl;
      5     l_id2s id_tbl;
      6  BEGIN
      7     SELECT MAX(NVL(id2,0)) INTO l_v FROM t;
      8     SELECT id, ROW_NUMBER() OVER (ORDER BY id)
      9     BULK COLLECT INTO l_ids, l_id2s
    10     FROM t
    11     WHERE id2 IS NULL;
    12
    13     FORALL i IN 1 .. l_ids.COUNT
    14        UPDATE t
    15        SET id2 = l_id2s(i) + l_v
    16        WHERE id = l_ids(i);
    17     COMMIT;
    18  END;
    19  /
    Procedure created.
    SQL> SELECT * FROM t;
            ID        ID2
             1
             2
             5
             7So, id2 is going to be the gap-free column.
    SQL> exec fix_gap_free;
    PL/SQL procedure successfully completed.
    SQL> SELECT * FROM t;
            ID        ID2
             1          1
             2          2
             5          3
             7          4So first pass is fine. Now lets add a few rows, so the table now looks like:
    SQL> SELECT * FROM t;
            ID        ID2
             1          1
             2          2
             5          3
             7          4
             8
             9
            25and generate more gap free number:
    SQL> exec fix_gap_free;
    PL/SQL procedure successfully completed.
    SQL> SELECT * FROM t;
            ID        ID2
             1          1
             2          2
             5          3
             7          4
             8          5
             9          6
            25          7If there may be deletions in the table, and you need to maintain the gap free nature, then just skip the WHERE id2 IS NULL predicate.
    John

  • Regarding creation of document number for user defined form

    Hi all,
    we had created a form , but we don't no how to generate document number as in sap
    we created but it is not creating automatically
    after adding only it is showing that number in series
    but i need that number at the time of opening only

    hi srvanth
    Use this code in a data binding of the form to load automatically the doc numbers
        ds = oform.DataSources.DBDataSources.Add("@TODACT")
            oform = oapp.Forms.ActiveForm
            Dim reset As SAPbobsCOM.Recordset
            Dim qsr As String
            reset = ocompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)
            qsr = "SELECT max(T0.DocNum) as c  FROM [dbo].[@TODACT]  T0"
            reset.DoQuery(qsr)
            If reset.Fields.Item("c").Value <= 0 Then
                a = 1
            Else
                a = (reset.Fields.Item("c").Value) + 1
            End If
            oitem = oform.Items.Item("doct")
            oedit = oitem.Specific
            oedit.DataBind.SetBound(True, "@TODACT", "DocNum")
            oedit.Value = a
    this will load document number everytime you load the form at the edit box with unique id "doct"
    hope this helpful
    you have to bind this edit box with DocNum Userfield of the table.
    report back if there is any error
    Regards
    Cool Ice
    Edited by: Cool Ice on Aug 19, 2008 7:20 AM

  • Alphanumeric Document number for Sales order

    Dear Experts,
    I got a requirement, The sales order number after saving the document the SO document number should be SO ( Alphabetic) 00012074 (Numeric) ie. SO00012074,
    The numeric portion will come from the number range assigned for that document and Alphabatic portion should come depending on the transaction code and document type.
    in SAPMV45AFZZ  User-exit
    FORM USEREXIT_NUMBER_RANGE USING US_RANGE_INTERN.
    This exit triggers before call function 'NUMBER_GET_NEXT'  that generates document number for the current document and return to the field vbak-vbeln and finally this is the document number, In the debug mode if I change the number for example 0000012074 to SO00012074 runtime I can get the expected number and also it is saved in the system. But in the real time it is not possible as this coding in not any user-exit.
    So I can't use this user-exit for the to get alphanumeric number in the document.
    FORM USEREXIT_SAVE_DOCUMENT
    This exit triggers after the generation of document number. In this user exit if we change the document number for example 0000012074 to SO00012074, it shows the expected number after saving the sales order but it is not actually saving in the database. Means if we try to open the same SO for example SO00012074 in va02/va03 it is showing
    SD document SO00012074 is not in the database or has been archived but if we try open 0000012074 in va02/va03, we can get the document.
    We can use this user-exit but if we change the value of vbak-vbeln in this user-exit finally it is not saving in the system.
    Can anybody help me how I can achieve the requirement ?

    bro...
    You have got an option to copy the program the standard program into zprogram....
    goto se38 and copy the program into a z program....and in doing so copy everything from the ctandard program ie vaients,documentation and function module etc.
    now change this z program to meet your need....
    both way if you dont make lot of changes you will get same performance with your work done
    regards

  • Document number not available in BSAD Table even after clearing

    Dear Experts,
    with the FM posting_interface_start, posting_interface_clearing, posting_interface_end iam able to post the document with clearing using Tcode f-30/fb05 and can see the document number getting generated and when i see the BSAD table with the same generated document number it say no table entires for that document number BUT is still available in BSID table even after getting cleared. Can any body explain me why the document  is not getting moved from BSID Table to BSAD Table.
    Your inputs will be highly appreciated.
    Regards,
    Jyothsna Reddy

    Hi experts,
    when iam clearing the open item with posting_interface_clearing getting the message like :" Documnet number xxxxx posted in company code xxxx". when i checked that particular document in table bsad it says no table entries for that particular document. iam confused whether my document got cleared or not.
    Thanks
    Jyothsna Reddy
    Edited by: Rob Burbank on Dec 30, 2011 11:56 AM

  • Document Number generation as per the client requirment

    Hi,
    I would like to generate the document no as per our client's document numbering logic. This is not available in standard.
    In additional data tab am collecting information from user (Characteristics values) to generate document number.
    E.G.
    I have 2 characteristics
    1. Part Type:
        Values: A - Type 1
                    B - Type 2
    2. Part Code:
        Values: 01- Part 1
                    02 - Part 2
                    03 - Part 3
    When am creating document am selecting Part Type = A & Part code = 02 so my document number is A-02. ("-" : constant).
    I am planning to use BADI "DOCUMENT_MAIN01" - method "ASSIGN_NUMBER".
    In this method how can i get the characteristics values which filled user on screen ? Is there any Function Module for that ?
    I tried Function Module "CTMS_DDB_CLOSE" but this is not released also this is not working in Easy DMS.
    Is there any other way i can take i/p from user to generate document number ?
    Regards,
    Sunny
    Edited by: Sunny on Sep 25, 2008 9:09 PM

    Hi Sunny,
    An experienced ABAPer can capture the required information from the sub screen(additional data) number (4000) and the subscreen program (SAPLCTMS). This data can be used  in the method of the BADI.
    Regards,
    T T Subudhi

  • How to send sap generated invoice numbers using rffoedi1 program

    Hi all
    we are generating PEXR2002 IDocs using RFFOEDI1 program . The program is populating the invoice number field in IDoc with the value from reference number field in MIRO screen. Is there any way that we can populate the SAP generated invoice number also in the IDoc.

    Hi Steve,
    Have you tried the user-exits or BADi available.
    Regards,
    Atish

  • Document number for price change

    Good day!
    Is there a separate t-code such that i could view the generated document number from MR21? The number series starts with 3. (e.g., 3000000001)
    Thank you!

    Hi,
    Use t code CKMPCSEARCH & select the matl numbers & execute u will find a list in that u select a doc number & view details ur requirment will bo solved
    Pandari

  • Question on linkage of idoc with document number created in SAP R/3

    Hi all,
    I have a query related to IDOC.
    When inbound IDOC is posted into SAP R/3 it creates Material document number or billing document number is generated in SAP R/3.
    Question: <b>Do we have interface monitor in SAP R/3 Where I can see the linkage of Idoc number with the document number created in SAP R/3.</b>
    Need your help on this any suggestion will be greatly appreciated.
    Thanks & Regards
    Prabhat

    I'm not sure if this is what you are asking for, but you can look at the IDOC in WE02/WE05 and look at the header segments to get the document number.

  • We have only GL SAP document number. how to find Vendor clearing document by these GL Document number please suggest and suggest Tcode.

    We have only GL SAP document number. how to find Vendor clearing document by these GL Document number please suggest and suggest Tcode.

    Hi Mahesh,
    To display a document, proceed as follows:
    Tcode : FBL1N (Vendor Line Item Display)
    1-Select option's.
    2- List
    Regard's.
    Cem Ates

  • Reg: Billing Document Number Range Missing

    Dear all,
    in the system some billing documents are missing, when i try it to display it is showing no billing documents exsists.
    if it is deleted, it  should have shown cancellation docs atleast.
    also no auto-archiving is active in the system.
    pl help to trace those missing numbers.
    Thanx

    Hi,
    Please check the OSS notes 24279 - Missing billing document numbers in VBRK and reasoning for the issue in Note 19050 - Gaps in document number sequence for billing docmts.
    They might be of help to resolve your issue. The below thread also addresses similar issue.
    http://scn.sap.com/thread/3257408
    Thanks,

  • Three same material document number generated for single PO line item.

    Hi,
    I found three same material number has been generated for single PO line item. Is there any specific reason for this.
    Here is the detail.
    PO
    LN   qty
    10    100
    PO history for LN 10
    Mat doc          qty               price
    5000000000     100               100
    5000000000     100               100
    5000000000     100               100

    see aditya , tables having document number as a primairy key will have a single entry , where as tables having primary key other then material documnet number is having multiple entries . as far as material document is concern , it is only one document in system , now we have to find why it is appearing 3 times . i will test this in my system and let you know .
    well thanx for your Cooperation . i will definatly get back to you .
    regards
    ravikant dewangan

Maybe you are looking for