Document Number templates

How Gurus
I would like to have a document number that includes a fixed part and a changing part, for example PF/HCM/0001, i want PF/HCM/ to be fixed and then the number will always increase, how can i make this happen. I have tried checking on number assignements but i couldnt get anything meaningfull but i have a feeling that this is possible in SAP, pliz help me.
partson

Hi
You can have the number assignment 3 -Mixed Number assignment with Exit so that if you pass ABC as document number it appends a number to it . But while creation , document number field cannot be left blank.
If you want to automatically generate this number try implementing the BADI ,DOCUMENT_NUMBER01~DOCNUMBER_CHECK() .
make sure that the number assignment for the documenttype is either blank or 1 .
you can try something like this :
METHOD if_ex_document_number01~docnumber_check.
  DATA : tdwa TYPE tdwa.
  DATA: subrc    TYPE inri-returncode,
        number   LIKE draw-doknr,
        number1  LIKE draw-doknr,
        new_number  LIKE draw-doknr,
        new_num TYPE string,
        lv_docnum1 TYPE string.
  CHECK sy-uname = 'MSRO'.
  CHECK tcode = 'CV01'.
  CHECK  draw-doknr = '' OR draw-doknr = '*'.
  CALL FUNCTION 'CV200_DB_TDWA_SELECT'
    EXPORTING
      pf_dokar  = draw-dokar
    IMPORTING
      psx_tdwa  = tdwa
    EXCEPTIONS
      not_found = 1
      OTHERS    = 2.
  IF sy-subrc <> 0.
Implement suitable error handling here
  ELSE.
    CALL FUNCTION 'NUMBER_GET_NEXT'
      EXPORTING
        nr_range_nr             = tdwa-inumnr
        object                  = 'DOKUMENT'
      IMPORTING
        number                  = number
        returncode              = subrc
      EXCEPTIONS
        interval_not_found      = 4
        number_range_not_intern = 8
        object_not_found        = 12
        quantity_is_0           = 16.
    CONCATENATE 'ABC' '-' number INTO new_num.
    WRITE new_num TO doc_number.
    CONDENSE doc_number NO-GAPS.
  ENDIF.
ENDMETHOD.
This should work .
Best Regards,
Roopa

Similar Messages

  • Unbale to create new document part with same document number

    Number range assigned to the X Document Type is internal. I have created new document (0001) with Document Part 000 & Version 00. For same Document Number when i tried to create New Document part by mentioning Document Numner 0001, Document Part 001 and Version 00, it says Document Type X can be assigned to internal number range only.
    Even I tried with following selection....
    Document Number = Blank
    Document Part = 001
    Document Version = 00
    Template:
    Document = 0001
    Document Part = 000
    Document Version = 00
    Now system is creating document with new number i.e. 0002.  But we want to create another document part with same Document Number. What is the problem with internal number range for Document Number?

    Hi Pradeep,
    Following are the config parameter of the document type.
    CM Relevnce = blank
    Number assignmt= 01
    Internal Number Range =02
    External Number Range= blank
    Number Exit =MCDOKZNR
    Vers. No. Incr. =0
    Version Sequence = blank
    AlternativeScreen = blank
    Let me know if you need anything more.
    Edited by: JJSingh76 on Dec 7, 2010 7:25 PM

  • Multiline variables are truncated in a Word task " Document from template"

    Hi everyone,
    I’d like to know if somebody have had the situation described below and how can I solve it.
    The problem is when I try to write in a word document (task created as a Document from template) a container element declared as a Abap dictionary referenced as TLINE-TDLINE (Char 132) with multiline flag activated, because when this variable has more than 3 lines during the execution of the workflow, the word document doesn’t gets the  whole value, it means the value is truncated and the word document just write or get 2 and a half lines (almost 350 or 400 characters)  and I don’t know why the rest of the value of this variable is missed.
    Does somebody knows what could be happen?, Does SAP have some kind of limit of the amount of characters to be written in a word document with a multiline variable? There’s a bug in the system and a “note”  to be applied? What can I do to write a variable wit multiple number of lines without missing any one?
    Thanks  a lot for your help.

    I have had a formal answer from SAP (OSS Note) for this issue, and It is no good at all to me (notes 375669, 559234, 724755);
    1.     There’s a restriction on the length for text variables 80 characters
    2.     to implement a long text you need to put several variables together
    If any one has another solution, I would appreciate your comments.
    Thanks a lot
    Felipe Uribe

  • 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

  • Free item reference document number not populated in MIGO item screen

    Hi
    I have a requirement where in I would need to populate the reference document number in the MIGO item when I am cancelling a goods receipt in case of free items.
    In standard SAP system we know that it would only be populated when GRbased IV is ticked in PO but in free item PO this is not ticked . So was enquiring if any body knows how we could populate the reference document number at GR cancellation in MIGO item level for free items .

    Hi,
    If you mean the field MSEG-SMBLN, then it is always populated at cancellation, no matter the GR-based IV flag.
    BR
    Raf

  • 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

  • Unable to capture fi document number using transaction ABUMN

    hello guys,
    I am trying to create a bdc for transsaction ABUMN which generates a fi document at the end.
    but in BDC the bdcmsgcoll table is empty.
    is there any way so that i can capture document number as soon as it is posted.
    Please help, Thanks in advance.
    Thanks & Regards,
    Deepak.

    can you run your BDC after call transaction method  if you get success message based  on your input  values, then   goto the document tables and pick that values  and pass the success message.
    CALL TRANSACTION tcode USING gi_bdcdata                "#EC CI_CALLTA
                       MODE   gv_ctumode
                       UPDATE gc_cupdate
                       MESSAGES INTO gt_messtab.
      l_subrc = sy-subrc.
      IF sy-subrc <> 0.
        WRITE: / 'CALL_TRANSACTION',
                 tcode,
                 'returncode:',
                 l_subrc,
                 'RECORD:',
                 sy-index.
        LOOP AT gt_messtab INTO gwa_messtab WHERE msgtyp = 'S'.
          CLEAR lwa_t100.
          SELECT SINGLE * FROM t100 INTO lwa_t100  WHERE sprsl = gwa_messtab-msgspra
                                    AND            arbgb = gwa_messtab-msgid
                                    AND            msgnr = gwa_messtab-msgnr.
          IF sy-subrc = 0.
            l_mstring = lwa_t100-text.
            IF l_mstring CS '&1'.
              REPLACE '&1' WITH gwa_messtab-msgv1 INTO l_mstring.
              REPLACE '&2' WITH gwa_messtab-msgv2 INTO l_mstring.
              REPLACE '&3' WITH gwa_messtab-msgv3 INTO l_mstring.
              REPLACE '&4' WITH gwa_messtab-msgv4 INTO l_mstring.
            ELSE.
              REPLACE '&' WITH gwa_messtab-msgv1 INTO l_mstring.
              REPLACE '&' WITH gwa_messtab-msgv2 INTO l_mstring.
              REPLACE '&' WITH gwa_messtab-msgv3 INTO l_mstring.
              REPLACE '&' WITH gwa_messtab-msgv4 INTO l_mstring.
            ENDIF.
            CALL FUNCTION 'FORMAT_MESSAGE'
              EXPORTING
                id        = gwa_messtab-msgid
                lang      = sy-langu
                no        = gwa_messtab-msgnr
                v1        = gwa_messtab-msgv1
                v2        = gwa_messtab-msgv2
                v3        = gwa_messtab-msgv3
                v4        = gwa_messtab-msgv4
              IMPORTING
                msg       = l_mstring
              EXCEPTIONS
                not_found = 1
                OTHERS    = 2.
            IF sy-subrc <> 0.
              MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                      WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
            ENDIF.
            CONDENSE l_mstring.
            IF NOT l_mstring IS INITIAL.
              WRITE: / gwa_messtab-msgtyp, l_mstring(250).
              MESSAGE l_mstring TYPE 'I'.
            ENDIF.
          ELSE.
            WRITE: / gwa_messtab.
          ENDIF.
    ENDIF.
        ENDLOOP.
        READ TABLE gt_messtab INTO gwa_messtab WITH KEY msgtyp = 'S'.
        IF sy-subrc NE 0.
          MESSAGE s069(msg class)
        ENDIF..

  • Last Purchase Order and FI-Document Number of an Vendor

    Hi,
    i need for an Vendor the last purchase Order and FI-Document Number.
    For purchase Order i read EKKO sort this and get the last one.
    For FI-Document Number i read BSIK and BSAK sort this and get last one.
    Question: is there any faster way (CLASS, FM or TABLE) to get what i need??
    Thanks.
    Regards, Dieter

    HI Dieter,
    You can use transaction code ME2L , where you can list of PO issued a particular vendor. List list shows Po no. indecending order. You can double click select the latest PO and through PO history you can get the FI Document no.
    I hope this ansers you query.
    Regards
    Harish

  • Purchase order and FI Document Number - R/3 extractor

    Hello Experts -  I have a question on the BW extractors on the R/3 side. Are there any standard extractors out there where I can get Purchase Order information and related FI document number information. In case if I have to create one what tables do I need to reference to create generic extractor. Thanks for your help.
    Regards,
    Venu.

    Hi Venu,
    This could be better done on a standard FI extractor by enhancing it with purchase order information.
    Atleast, this is the way we did in our scenario.
    Have 0FI_GL_4 enhanced with data from EKKO, EKPO tables, with required feilds. This enhancement may not be quite detailed.
    Also if you are interested in a complete gen extr. then the above two tables along with BSEG should do.
    Naveen.A

  • Report with Invoice and Accounting Document Number

    Dear Experts,
    Here i have a requirement.
    I wanna a report which gives a Invoice (MIRO) and its accounting documents (Follow on document) in one page. Because If I view a MIRO document, for checking the accounting document, I need to click on Follow on doc, then I'll get.
    But If wanna see for 1000 MIRO documents with accounting document number, then I don't want to click 1000 times to see the account doc for respective Invoice number.
    The approximate format is,
    Column 1                              Column 2     Column 3        .......................              Column n
    MIRO  (Invoice number)                             Accountting Doc Number
    5100000099                                              5100000011
    Which tcode will give the both in one screen?
    Thanks in advance
    Regards,
    navahsek

    Hi,
    Enter Sork Key 002 for Vendor Master Record.
    and also you can check the Report in ECC 6.0
    MIR5 - Display List of Invoice Documents
    There you select Export Mode --> Display Accounting Document Number.
    You can get Report FI and MM Document Numbers.
    Hope It will Clear.
    Regards,
    Kishore

  • Reference document number of 103 movement not seen in 105 movement documnt

    Dear all,
    I have made a material document with movement type 105 with reference to 103 document.
    After creation, the field LFBNR in the 105 document is not updated with the 103 document number.
    In all other cases the document number of 103 movements are updated in the the field of 105 document.
    Can anybody can share me if you have any information about this scenario and what would be the solution.
    Thanks....
    Hari.

    Hi Murugan,
    I am giving you more clarification.
    I have created a Good Receipt through MIGO using 103 movement.     Later I have created 105 movement with respect to 103 movement reference through release blocked stock.
    After creation of documents, when checked the document created through 105 movement there is no reference number of 103 document number found in the document number of 105 movement.
    In the table MSEG  field LFBNR is supposed to get updated with the reference number of the document created through 103 movement.
    In this case, this reference number is not updated in the table MSEG-LFBNR.
    My question is that how the document with 105 movement get posted without the reference of document of 103 movement and what would be the reason.
    Hope the question is clear.
    Awaiting for your replies.
    Thanksss....Hari.
    Edited by: Harikrishnan_sap on Nov 13, 2009 2:02 AM

  • Report invoice document number againt PO line item

    Hi Forums,
    Can any body so kind to tell me is there any standard report in SAP 4.7 C where we can get the list of invoice document number against each line item of PO.
    I have tried the ME2N & ME2L report. If I double click the POH then only it give me the invoice document report. But i want a report where I get invoice document no against each line item wise in PO.
    Thanks in advance.
    Regards,
    sp sahu

    Hi sp sahu,
    I am sorry, but I am not aware of any report which might suit your requirements, this is the reason why I addressed you to the table EKBE. You might build your own report out of this table.
    Sorry!
    Esther.

  • Dunning Block per document number

    Hi SAP Guru,
    Need your help.
    Scenario is like this:
    We are running the dunning letter and it always gives us no output.  Also, checked the Customer Master,  under Correspondence tab and field for Dunning Block is empty while payment methods under u201CPayment Transactionsu201D tab is also empty which is I think it should be to run the dunning. 
    Upon further investigation,  I found out that the invoices are tag as u201CDunning Blocku201D via FBL5N per document number.  Can you explain how this happened? And why does per document number is tagged as u201CDunning Blocku201D despite the correct set up in Customer Master.  And how can we delete the tag per document or is there any mass update for this. 
    Appreciate your thoughts on this.
    Thanks,
    Julie

    Hi,
    Thanks for the info.  As I checked if dunning block has been tagged in SO via Header --> Accounting Tab,  the field for Dunning block set to Freed for Dunning which I supposed should be. 
    Any other solution on this.
    Thanks,
    Julie

  • Document Number Not Generate In FEBA ( Bank Reconciliation)

    Dear All,
    We have configured all the required details for Manual Bank Statement for Bank Reconciliation .
    Steps :
    1 ) Take converted file from Bank
    2 )  Upload that file in Text format into System then system automatically update FF67.
    3)  Go into FEBA , then we got cleared items but we are not able to get Accounting Document Number .
    How we can get Accounting Document Number in FEBA ??
    Regards,
    Kaushal Shah

    Hi,
    Sorry, just today I checked your message.
    Instead of processing BDC, you have to post through FEBA.
    ie. Download the statement with the option Do not post or post online.
    Then process the error lines or all documents through FEBA. Then you can able to see the document number.
    If the posting is done at the background through batch jobs, then there will not be any document number visible through FEBA.
    Let me know if you need any more information.
    Regards,
    Prabha

  • P.O number for a billing document number

    Hi Experts,
    From  which table we can find a PO number for corresponding billing document number(VF03)?

    hi RAVI,
    Go to T.code SE16
      enter table name VBRK-->enter
       billing doc type,billing doc no,s.org,d.channel
      execute
    waiting for reward points
    mcm

Maybe you are looking for

  • Questions on JarEntry and File

    Hi, I am wondering what a JarEntry represents? All files and directories inside a JarFile? I can get the number of JarEntries using the following: int numOfEntries = jarFile.size();Then if I extract this jar and use a small program to recursively vis

  • Mouse arrow has changed to straight line - how do I get the arrow back?

    Help! When I sat down to use my computer yesterday, I noticed the mouse arrow that is usually there has changed to a line (similar to a curser in a word document). I want to change it back to the arrow, but am unsure how. I'm hoping it's just a setti

  • Wallpaper not showing up in "Change Desktop Background" window

    I just noticed an odd issue today on my Mac Pro. When browsing the built-in wallpaper folders (Nature, Plants, etc) in the Change Desktop Background window they are empty. My "Pictures Folder" one shows all the images correctly as well as browsing th

  • Modify initial screen of transaction cj02

    hello everyone, i need to modify the first screen of the transaction CJ02, in case of having a preject definition and wbs element, i need to have two more fields .so there is a way to do this. please help.

  • Listbox with XML Question.

    I went through Lee Brimelow's XML video playlist tutorial, and I wanted to add a feature. I wanted to add a graphic on the stage that would change along with the video when a selection was made from the listbox. Getting the first graphic to appear wa