Generate number

hi
i need to generate a field called REF for reports in apps
i am using oracle 6i report builder
function refFormula return Char is
peri DATE;
NAM VARCHAR(100);
begin
  SELECT start_Date into   peri FROM   HR.PER_TIME_PERIODS PRD WHERE prd.time_period_id in
  (SELECT  distinct time_period_id
from  napesco_payroll_lst v
WHERE PAYROLL_ACTION_ID =:p_Payroll_id );
--  = :p_TIME_period_id;
  nam := to_char(peri,'MM / YY')||' NBK - SAL';
  return(nam);
end;
output for REF in report would be Ref : 02 / 10 NBK - SAL
Similarly i need for another report REF as Ref:1131-CER-HE-024
1131-CER-HE  is constant ,i have to generate a number starting from 1 ie 001 and it should increment everytime a report is run
kindly help me

You can use a sequence in the database to generate the number between 0 and 100 or whatever. Other option is to store the last sequence in a table and pick it up from there and increment everytime report is run.
Regards
Gopal

Similar Messages

  • Creation of PO for an already generated number !!

    Hi All,
    The Requirement is to create a Purchase Order for an already generated number.
    Ex: The generated number is 4500026080.
          Now a purchase Order 4500026080 need to be created.
    Please let me know if more clarification required.
    Thanks & Regards,
    Deeba

    From where you are getting this no.? Because when you will create the PO it will automatically generates the PO # for you.
    I think you can find some enhancement option(User exit/badi/enhancement spot) at the place right after the system is generating the PO and then replace with the once you have created.

  • How to Create a Auto Generated number with some preceding text in Sharepoint 2010

    I am trying to create a auto generated number field in Sharepoint 2010 list item. My requirement is to have the following format number generated when new request is created in Sharepoint using form. Auto generated Ticket ID should be in the following format
    "IR13000" "IR13001" "IR13002"....... Please let me know how to get this done. I tried to use combination of default ID and Characters but its not working for new requests, its only reflecting for existing uploaded requests. I
    am trying this for taking up Ticket requests by filling up some fields in the form. Any quick help is much appreciated.
    Thanx

    Here are the steps:
    1 - Open your SharePoint site in SP Designer 2010.
    2 - Click Workflows and add a List workflow. Associate this workflow on the list where you want the Random Text to be generated.
    3 - Inside the workflow editor, select the Action "Update list item"
    4 -  Select 'Current Item'.
    5 - Click Add.. and select the field which needs to be updated with the Random Text. Make sure this column is not of type "Calculated" type, otherwise you won't see it in the list of the fields within the workflow.
    6 - Click "..." button in the next textbox which will open String Builder dialog box.
    7 - Type IR and then click 'Add or Change Lookup and select ID column from "Field from source". Hit OK.
    8 - It should look like IR[%Current Item:ID%]
    9 - Hit OK.
    10 - Save and publish the workflow. (Please note that currently this workflow is not set to auto run on creating new items. That's because we want to test it at this point of time).
    11 - Go to your list in SharePoint and create a new item. After creating, select the item and click Workflows and then run this workflow.
    12 - You should be able to see the text "IR1" in the designated column.
    13 - Once you see that it's working, go to SPD and set the workflow to run automatically on creation of the new item. Save and publish and then return to your list in SharePoint.
    14 - Create a new item there and you should see the Random value in the column.
    15 - You will also see the column in the New form. In order to remove it, go to List settings > content types > Item content type > and select Hidden for this column so that it doesn't showup in any form.
    Try it and let me know how it goes.
    Thanks,
    Ashish

  • Can I generate Number Range Type automatically?

    Hi everybody,
    is it possible to generate number range automatically, instead of using transaction 'snro'?
    Here 'automatically' means to call certain FM.
    Thanks in advace!
    Regards,
    Liying

    The problem is, this function NUMBER_RANGE_OBJECT_MAINTAIN also is capable of maintaining the number range object is a dialog program, so throws the screens where in the user can edit the data of a specific number.
    It still doesn't create a number range.
    NUMBER_RANGE_OBJECT_READ - just gets you the details of the object.
    Look at the documentation, they are very clear
    NUMBER_RANGE_OBJECT_INIT - This just intializes the memory of the project.
    Regards,
    Ravi
    Note : Please mark the helpful answers
    Message was edited by: Ravikumar Allampallam

  • Function module which generates number in sequence

    Hi All
    Is there any FM which generates number in a sequence. I am creating a bank file using DMEE. Now for detail records it should create a number say starting with 001, 002. 003....
    now every  time the bank file is created it should work in this way.
    Any help would be higly appreciated.
    C

    Hello
    1. Create interval: http://wiki.sdn.sap.com/wiki/pages/viewpage.action?pageId=50004015
    2. Use FM NUMBER_GET_NEXT: Re: how to create a number interval for a zprogram

  • Random generated number along with barcode in smartforms

    Hi All,
    Is it possible to add some random generated number by system to add along with the end of the barcode in smartforms. (what could be the field) If so how it can be done. Tanks in advance
    Regards
    GK

    Hi Tankx man 4 the valuable reply,
         I am able to get that, but what my problem is,
    Eg: In my GR a item with 10 qty, so i made the qty as input and based upon that i am printing 10 labels. for ur ref the code is below"
    menge = TRUNC( is_mseg-menge ).
    DO menge TIMES.
    header-slno = header-slno + 1.
    APPEND header TO itab.
    the complete program is like as follows;
    menge = TRUNC( is_mseg-menge ).
    DO menge TIMES.
    header-slno = header-slno + 1.
    APPEND header TO itab.
    CALL FUNCTION 'QF05_RANDOM_INTEGER'
    EXPORTING
    RAN_INT_MAX   = '999999999'
    RAN_INT_MIN   = '100000000'
    IMPORTING
    RAN_INT       = RANINT
    EXCEPTIONS
    INVALID_INPUT = 1
    OTHERS        = 2.
    IF SY-SUBRC EQ 0.
    ENDIF.
    WRITE :/ RANINT.
    ENDDO.
    but in my barcode all the label has the same random number, can u say how to solve this.

  • Generating number depending on the condition

    Dear All,
    I have table with following structure.
    formno          number(5)
    name          Varchar2(100)
    centreno     number(2)
    rollno          Varchar2(10)
    I want to generate rollno depending on the following condition.
    1. Roll number should be generated based on the centreno
    2. Roll number should be generated based on the alphabets but not in a sqeuence.
    For eg.
    my data is like
    form no     name     centreno     rollno
    200           A1      01           1
    206           A2      01           4          
    502           A3      02           6
    234           A4      03           10
    400           B1      01           2               
    501           B2      02           7
    788           C1      01 3
    100           C2 02           8
    343           C3      01           5
    130           C4      02           9
    232           C5      03           11
    i.e. first I need to sort names alphabetically by centreno. But then I need generate number in a sequence that first A, B, C...Z will be generated. Then it starts again from A, B, C...Z for that centre. Then it will run same process for other centres.
    Any ideas how to do this?
    Regards
    Trusha
    Edited by: trusha on Oct 10, 2008 3:53 PM

    Something like .. (for given sample data)
    SQL> select * from test;
            C1 C2 C3
           200 A1 01
           206 A2 01
           502 A3 02
           234 A4 03
           400 B1 01
           501 B2 02
           788 C1 01
           100 C2 02
           343 C3 01
           130 C4 02
           232 C5 03
    11 rows selected.
    SQL> select c1,c2,c3,
      2    row_number() over(order by c3,rn,c2) regno
      3  from(
      4  select c1,c2,c3,
      5   row_number() over(partition by c3,substr(c2,1,1) order by c2) rn
      6  from test)
      7  order by c2;
            C1 C2 C3      REGNO
           200 A1 01          1
           206 A2 01          4
           502 A3 02          6
           234 A4 03         10
           400 B1 01          2
           501 B2 02          7
           788 C1 01          3
           100 C2 02          8
           343 C3 01          5
           130 C4 02          9
           232 C5 03         11
    11 rows selected.
    Edited by: jeneesh on Oct 10, 2008 4:51 PM
    corrected                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • System generated number

    Hi all,
    I m developing a module pool with z table 1 Header & 1 Item table. Now I would like  to ask how I can get system generated number for the pk filed supose gate pass number and my filed type is char 10.
    When user enter a new entry then system will auto generqte the gpass number .
    so pls let me know if any one can help me to do this job.
    Thanks in advance.
    manju

    Hey Manju,
    first pre determine what range your number should be having , like  starting from 0000000001 like that or 1000000001 etc, after that  :
    Scenario 1 ( if you have to show the number as a field  on the screen)
    write a select query in the PBO of the screen as below
    let the field name be gateno.
    select max(gateno)
              from <dbtab>
              into < var1>.
    this will fetch the last number and then you can increase it.
    if syst-subrc is initial.
    var1 = var1 + 1.
    endif.
    move the value of var1 to the screen field name.
    Scenario 2 ( If you just need to update in the database table)
    write the above select query in the PAI module of the screen when the user performs some action like SAVE.
    Hope this helps,
    reward if useful,
    Regards ,
    RK

  • Auto-Generated Number For All Users

    We're on Lync Server 2013, running a front-end pool consisting of 3 front-end servers. Users are VoIP enabled. We're seeing some inconsistent behavior while right-clicking an user and selecting the "Call" option. Even though the respective target
    users don't have an "Other" phone number set in AD, the Lync client seems to be somehow auto-generating a normalized entry and presenting this as an "Other" entry in the contextual menu that allows calls. The entry always begins with +1
    (425). Strange enough, this is the prefix used in some sample normalization rules in a Microsoft article
    here.
    Even though Dial Plans - to my understanding - shouldn't alter this (they only apply normalization rules for manually dialed numbers only), I've searched through all the normalization rules but there's none that start with +1 (425). I've also tried running
    ABSConfig, yet this tool crashes systematically on multiple machines (the Lync servers have updates dating from less than 2 months ago).
    Also - there's no normalization .txt file created in the ABFiles in the Lync Share, as in
    this article. Taking a look in the local GalContacts.db file shows the regular phone numbers, but not this one - hinting that it's something the Lync client creates on the fly. Additionally, no Lync Address Book Web Query is visible in Fiddler when browsing
    through the users' phone numbers in the Lync client.
    Adding to the problem is that some users see the "Other" entries, while others don't - eg. user X right clicks user Z and sees a wrong "Other" entry, while user Y right clicks user Z and doesn't see any wrong entry containing "Other".
    First question is what could trigger this behavior in the client ? Secondly, has ABSConfig.exe become broken by a recent update ?

    According to the 2nd article - I've created an empty Company_Phone_Number_Normalization_Rules.txt file and placed it in the Lync file share, in order to avoid any suspicion that the built-in file might be used. I've updated the address book but unfortunately
    can't restart the FE services at this time. There's no still no change in the client.
    Yet - the problem here is the numbers shown aren't present in the files making up the Lync address book inside the local user's sip profile folder.

  • Number range interval doesnot exists - error message while generating numbe

    Hi Experts!,
                      I am getting error as " Number Range interval does not exists" while generating auto number for an custom defined tr cod
    The prg is as followos:
    INCLUDE MZFIRSTPAGETOP                          .    " global Data
    TABLES: ZCHP_CUST_INFO.
    DATA: OKCODE LIKE SY-UCOMM.
    DATA:   CNAME LIKE ZCHP_CUST_INFO-CREATED_BY,
            REQTYP LIKE ZCHP_CUST_INFO-REQUEST_TYPE,
            DESC LIKE ZCHP_CUST_INFO-SHORT_TEXT,
            PRIO_TYPE LIKE ZCHP_CUST_INFO-PRIORITY_TYPE,
            EFFECTIVE_DATE like ZCHP_CUST_INFO-REQUIRED_STR_DAT,
            COMM_TYP like ZCHP_CUST_INFO-MODE_OF_COMM,
            COMM like ZCHP_CUST_INFO-ADDRESS,
            REQ_NUM LIKE ZCHP_CUST_INFO-REQ_NUM.
    *&      Module  STATUS_0100  OUTPUT
          text
    MODULE STATUS_0100 OUTPUT.
      SET PF-STATUS 'FOR1000'.
      SET TITLEBAR '1000'.
    ENDMODULE.                 " STATUS_0100  OUTPUT
    INCLUDE MZFIRSTPAGEO01                          .  " PBO-Modules     *
    INCLUDE MZFIRSTPAGEI01                          .  " PAI-Modules     *
    INCLUDE MZFIRSTPAGEF01                          .  " FORM-Routines   *
    *&      Module  USER_COMMAND_1000  INPUT
          text
    MODULE USER_COMMAND_1000 INPUT.
    CASE SY-UCOMM.
      WHEN 'SUBMIT'.
    CALL FUNCTION 'NUMBER_GET_NEXT'
      EXPORTING
        NR_RANGE_NR                   = ' '
        OBJECT                        = 'ZREFNUM'
      QUANTITY                      = '1'
      SUBOBJECT                     = ' '
      TOYEAR                        = '0000'
      IGNORE_BUFFER                 = ' '
    IMPORTING
      NUMBER                        =
      QUANTITY                      =
      RETURNCODE                    =
    EXCEPTIONS
      INTERVAL_NOT_FOUND            = 1
      NUMBER_RANGE_NOT_INTERN       = 2
      OBJECT_NOT_FOUND              = 3
      QUANTITY_IS_0                 = 4
      QUANTITY_IS_NOT_1             = 5
      INTERVAL_OVERFLOW             = 6
      BUFFER_OVERFLOW               = 7
      OTHERS                        = 8
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
            ZCHP_CUST_INFO-REQ_NUM = REQ_NUM.
            ZCHP_CUST_INFO-CREATED_BY = CNAME.
            ZCHP_CUST_INFO-REQUEST_TYPE = REQTYP.
            ZCHP_CUST_INFO-PRIORITY_TYPE = PRIO_TYPE.
            ZCHP_CUST_INFO-SHORT_TEXT = DESC.
            ZCHP_CUST_INFO-CREATED_ON = EFFECTIVE_DATE.
            ZCHP_CUST_INFO-MODE_OF_COMM = COMM_TYP.
            ZCHP_CUST_INFO-ADDRESS = COMM.
    *ENDIF.
    INSERT ZCHP_CUST_INFO.
    COMMIT WORK.
    WHEN 'RESET'.
           CLEAR: CNAME,REQTYP,PRIO_TYPE,
    DESC,EFFECTIVE_DATE,COMM_TYP,COMM.
      WHEN 'CANCEL'.
            LEAVE PROGRAM.
    ENDCASE.
    ENDMODULE.                 " USER_COMMAND_1000  INPUT
    could any one help me out,.!!!
    Thanks in advance.
    Sunil
    [email protected]

    Hi,
    I suggest you to check the which document type has assigned for biiling document and against that document type , have to ssign the id for number range and check whethere internal assignment or external assignment.
    I hope this will make sense.
    Panneer

  • Generate Number Dynamically

    Hi Guys,
    I am working on smartform ,my requirment is,Every time when i gives printput unique number should generate and display at the top of smartform.
    Points will be rewarded
    Thanks

    Hi,
    Re: Random integer generator?
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/ca932ebc-0901-0010-68a0-b4dd81a4bf81
    Regards
    Adil

  • Need urgent help! How to check if the generated number is a whole number

    Hi,
    I have a simple issue but I need some assistance. I am
    calculating a number and the result number sometimes a whole number
    but in some cases decimals are present. Decimals do not need change
    but whole numbers need to change. So for example if the end result
    is "6" I need it to show it as "6.0" in a field beacuse that is the
    way the calculator should display it according to request.
    How can I check that the result number is a whole number and
    then add ".0" to it?
    I just included a simple script below.
    if (outputnumber == ?) {
    resultNum = Number(String(outputnumber+".0"));
    } else {
    resultNum = outputnumber;
    Thanks,
    Attila

    Hi reinhat,
    That means that "outputnumber" wasn't something that can be
    converted to
    a number. When you trace this value, what do you see?
    Regards,
    Patrick Bay
    BAY NEW MEDIA
    "reinhat" <[email protected]> wrote in
    message
    news:fndgeh$484$[email protected]..
    > The above mentioned example returns "NaN".
    > How can it return numeric value?

  • The system requirements for Mavericks used years of production for the computer requirements.  Why can't they use the generational number system?

    Office location where Mac Pro is located has a slow internet connection.  I downloaded Mavericks installer onto thumbdrive.  Attempted to install on a dual 3 core Xenon Mac Pro, model 2,1.  After a few hours, I figured out that the error message that was generated by the installer was telling me that my computer doesn't support Mavericks.  Do other people get confused with which generation of hardware is supported with software?  I understand the difference between PowerPC and Intel.  The tricky part is the difference between 32bit and 64bit with the EFI and the CPU instruction set.  Also, why can't they stick with a clear numbering system that is visible when you get info on the Mac? 

    If you are desperate you can use hackintosh tools to boot in 'legacy' mode which allows 10.9 to run on unsupported Macs. Chameleon bootloader & some google fu will get it running in an unsupported way (assuming your graphics card is supported).
    I think Apple dug this hole when they told everyone that these were '64bit Macs'. Sadly if they don't support 32bit EFI in their new OS it's not going to work by default. In other discussions I have read that drivers need to be rewritten for actual 64bit support on a 32bit EFI.
    I have run 10.8 on my 1,1 MP, but 10.6 was nicer, at some point I'll try 10.9 on it
    P.S. http://mactracker.ca and http://www.everymac.com are handy for working out what model supports what features etc.

  • Generating number range

    what is the tcode used to created number ranges?

    HEllo,
    Check the TCode SNRO
    Use the FM to get the number range
       CALL FUNCTION 'NUMBER_GET_NEXT'
             EXPORTING
                  nr_range_nr             = lva_range_nr
                  object                  = 'ZSTOCKCARD'
             IMPORTING
                  number                  = upa_scnum
             EXCEPTIONS
                  interval_not_found      = 1
                  number_range_not_intern = 2
                  object_not_found        = 3
                  quantity_is_0           = 4
                  quantity_is_not_1       = 5
                  interval_overflow       = 6
                  buffer_overflow         = 7
                  OTHERS                  = 8.
        IF sy-subrc IS INITIAL.
          EXIT.
        ELSE.
    If useful reward.
    Vasanth

  • 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.

Maybe you are looking for

  • How does IITTrackCollection handle ItemByName if there are multiple tracks by the same name?

    I am writing a program in C# that is trying to check if a track already exists in the iTunes Library before adding it (thus preventing duplicates).  The best method I have come up to do this with is to use 'MyPlaylist.ItemByName(SongName)' to retriev

  • How do I....

    Ok.... I set up my Apple TV to auto sync and now I want to change it to stream since my library is so large. Does anyone know how to do that?   Mac OS X (10.4.9)  

  • Automatically open newly added files in a folder?

    Hi there. I own a Nikon D80 and I want to have the images I take transfered directly to my Mac to be stored and displayed. I found this om flickr: http://www.flickr.com/groups/d80/discuss/72157603787246133/ where a user describes how to automatically

  • ACE real server rate liiting

    Hi, If the ACE is configured to rate limit the traffic to a given real server to a certain bandwidth, what happens to the traffic that exceeds the specified limit ? Does the ACE drop this traffic in all cases as the documentation says ? Or can we con

  • Making a dvd of a movie

    how do I make a dvd of a movie?