Display numbers without commas

I need a way to display a numeric column without commas.  We have a list of seven digit ID numbers that I want my users to be able to copy and paste into config files.  I can get rid of the decimal points easily enough, but not the commas.   Has anyone figured out a way to do this yet?

Hi,
For ID number with fixed-length, I suggest you to use Single line of text column instead of number column.
If you use Single line of text column, you can easily avoid the commas problem.
Hope the information can be helpful.
-lambert
Posting is provided "AS IS" with no warranties, and confers no rights.

Similar Messages

  • Calculator don't display numbers after comma in RPN mode

    Hello,
    In RPN mode, calculator don't display the numbers after the comma in the stack.
    Exemple :
    12345
    Enter
    0,12345
    Enter
    The calculator stack now shows :
    12345
    0 <-- should be 0,12345
    OSX : 10.5.1 (French)
    PowerBook G4 17" 1,5GHz
    Pascal

    I'm not going to create a new thread for this but the calculator has some SERIOUS problems.
    In scientific (yeah, right) mode, try dividing -1 by 2 and you'll see that it is, despite all the math you might think you know, POSITIVE one-half. (You probably thought dividing a negative number by a positive one would give you a negative number. You silly.)
    Also, while I'm resurrecting old and ignored threads, why can't the Programmer mode have a "word size" similar to the significant digits size for the other modes? Trying to do a series of shift operations on a 16 or 8 bit number is utterly inconvenient when it shows me 64 bit mode only.
    I suppose I can just keep my HP calculator next to computer for now since it's 17 years old, does RPN perfectly, and knows how to do basic math properly, but that seems to be missing the point that the Calculator should work right.

  • 6 random numbers without repeat

    I'm trying to make a 6 digit random number generator between 1 and 48. When the user click a button 6 random numbers show up in 6 different textFeilds. The problem is that I don't want the same number twice. How can I generate 6 different random numbers without using return and breaking out of the function?
    import flash.events.Event;
    stop();
    btn.addEventListener (MouseEvent.CLICK, random1);
    function random1 (evt:Event) {
              display1.text = "";
              display2.text = "";
              display3.text = "";
              display4.text = "";
              display5.text = "";
              display6.text = "";
              var r1 = Math.floor(Math.random()*(1+48-1))+1;
              var r2 = Math.floor(Math.random()*(1+48-1))+1;
              var r3 = Math.floor(Math.random()*(1+48-1))+1;
              var r4 = Math.floor(Math.random()*(1+48-1))+1;
              var r5 = Math.floor(Math.random()*(1+48-1))+1;
              var r6 = Math.floor(Math.random()*(1+48-1))+1;
              if (r2 == r1 || r3 == r2 || r4 == r3 || r5 == r4 || r6 == r5) {
                        return;
              var liste:Array = new Array();
              liste.push(r1,r2,r3,r4,r5,r6);
              liste.sort(Array.NUMERIC);
              display1.text = String(liste[0]);
              display2.text = String(liste[1]);
              display3.text = String(liste[2]);
              display4.text = String(liste[3]);
              display5.text = String(liste[4]);
              display6.text = String(liste[5]);

    Here's the code for the approach mentioned with your textfields included
    btn.addEventListener (MouseEvent.CLICK, random1);
    function random1 (evt:Event) {
        var nums:Array = new Array();
        // fill the array of numbers
        for(var i:uint=1; i<=48; i++){
            nums.push(i);
        shuffle(nums);
        // grab the first six in the shuffled array
        var liste:Array = nums.splice(0,6);
        // assign the values to the textfields
        for(var j:uint=1; j<=6; j++){
            this["display"+String(j)].text = String(liste[j]);
    function shuffle(a:Array) {
        var p:int;
        var t:*;
        var ivar:int;
        for (ivar = a.length-1; ivar>=0; ivar--) {
            p=Math.floor((ivar+1)*Math.random());
            t = a[ivar];
            a[ivar] = a[p];
            a[p] = t;

  • Format number without commas

    hi
    i have a webi report , in which i am using a year filter to restrict some values.
    so i need to show what is filtered , i used the below formula to show which year is filtered.
    =If(DrillFilters([Year])<>"")=0 Then "All Year" Else DrillFilters([Year])
    it is showing like 2,009 while selecting the year 2009,
    but i don't want commas between these numbers,
    i need like 2009 without commas
    how to format this number in above formula.
    regards
    Dineshkumar

    Instead of :
    Else DrillFilters([Year])
    You must write the next code:
    Else   Replace(DrillFilters([Year]) ; "," ;" " )
    The replace function will replace all commas so your numbers will be shown:
    2009 instead of 2,009
    Edited by: PadawanGirl on Jan 17, 2011 6:11 PM
    Edited by: PadawanGirl on Jan 17, 2011 6:13 PM

  • How to display numbers in triangle format

    Hi All,
    How do I display numbers in the following format;
    1
    1 2
    1 2 3
    1 2 3 4
    Your help will be more appreciated.
    Thank you.

    I couldn't resist:
    SQL> var N number
    SQL> exec :n := 10;
    PL/SQL procedure successfully completed.
    SQL> -- plane
    SQL> select * from (
      2  select lpad(' '||(case when level between :N/2 - (:N * 0.1) and :N/2 + (:N * 0.1)
      3                 then lpad('*',:N*2.5 - level - abs(:N/2-level),'*')
      4      end) --"left wing"
      5      ,50-level, ' ')
      6    || ltrim(sys_connect_by_path(level,' '))
      7    || (case when level between :N/2 - (:N * 0.1) and :N/2 + (:N * 0.1)
      8              then rpad('*',:N*2.5 - level - abs(:N/2-level),'*')
      9      end) -- "right wing"
    10    n
    11  from dual 
    12  connect by level <= :N
    13  order by level);
                                                     1
                                                    1 2
                                                   1 2 3
                              ********************1 2 3 4********************
                             ********************1 2 3 4 5********************
                              ******************1 2 3 4 5 6******************
                                               1 2 3 4 5 6 7
                                              1 2 3 4 5 6 7 8
                                             1 2 3 4 5 6 7 8 9
                                            1 2 3 4 5 6 7 8 9 10
    10 rows selected.
    SQL> exec :n := 6;
    PL/SQL procedure successfully completed.
    SQL> r
      1  select * from (
      2  select lpad(' '||(case when level between :N/2 - (:N * 0.1) and :N/2 + (:N * 0.1)
      3                 then lpad('*',:N*2.5 - level - abs(:N/2-level),'*')
      4      end) --"left wing"
      5      ,50-level, ' ')
      6    || ltrim(sys_connect_by_path(level,' '))
      7    || (case when level between :N/2 - (:N * 0.1) and :N/2 + (:N * 0.1)
      8              then rpad('*',:N*2.5 - level - abs(:N/2-level),'*')
      9      end) -- "right wing"
    10    n
    11  from dual
    12  connect by level <= :N
    13* order by level)
                                                     1
                                                    1 2
                                       ************1 2 3************
                                                  1 2 3 4
                                                 1 2 3 4 5
                                                1 2 3 4 5 6
    6 rows selected.
    SQL>

  • How can I see changes in table with insertrow();postchanges()without commit

    Hi friends;
    I use jdeveloper 10.1.3.1 with jheadstart 10.1.3.1.
    I create two view object.In the first page I create table with one view object.
    In the second page I create table (with tableselectmany) with other view.
    I select many rows in second page and in the managed bean,
    I insert selectted rows atributes to first pages tables attributes.
    I use this code.
    public String commandbuttonaction(){
    CoreTable table = this.getTable1();
    Set rowSet = table.getSelectionState().getKeySet();
    Iterator rowSetIter = rowSet.iterator();
    BindingContainer bindings = getBindings();
    DCIteratorBinding pr_dcib = (DCIteratorBinding)
    bindings.get("DeptIterator");
    int i=206;
    while (rowSetIter.hasNext()){
    Key key = (Key) rowSetIter.next();
    pr_dcib.setCurrentRowWithKey(key.toStringFormat(true));
    RowImpl prRow = (RowImpl) pr_dcib.getCurrentRow();
    String AM="model.AppModule";
    String CF="AppModuleLocal";
    ApplicationModule empSvc = Configuration.createRootApplicationModule(AM, CF);
    ViewObject emps = empSvc.findViewObject("EmpsView1");
    Row newEmp = emps.createRow();
    newEmp.setAttribute("Manager",new Number(1));
    newEmp.setAttribute("Department",new Number(1));
    newEmp.setAttribute("Depno",new Number(3));
    emps.insertRow(newEmp);
    try {
    newEmp.validate();
    catch (Exception ex) {
    System.out.println("validate catch");
    try {
    empSvc.getTransaction().postChanges();
    catch (Exception ex) {
    System.out.println("post catch");
    Configuration.releaseRootApplicationModule(empSvc,true);
    i=i+1;
    In this code I only postchanges() in first view and dont want to commit.
    But I cant see changes row in the page .If I press save I see transaction completed succesfully message.
    But in database not insertted any rows.
    If I write commit() after postchanges() code I see rows in the table .But I dont want to commit.Only post
    my changes and if necessary I press save button in page.
    How can I see changes in the page without commit???Thanks for all....

    You should NEVER use statements like this in managed beans:
    ApplicationModule empSvc = Configuration.createRootApplicationModule(AM, CF);
    This will create a separate application module instance, not shared by the the web pages. That's why you do not see the changes.
    Instead, you can use the following code:
    ApplicationModule am = (ApplicationModule)JsfUtils.getExpressionValue("#{data.MyAppModuleDataControl.dataProvider}");
    where MyAppModuleDataControl shoud be replaced with the name of your am data control.
    Steven Davelaar,
    JHeadstart Team.

  • "CSAP_MAT_BOM_MAINTAIN" can read material which is created without commit?

    hi:
      i want to create a material first with "BAPI_MATERIAL_SAVEDATA",then i want to add this material as a component
      to a existing BOM with "CSAP_MAT_BOM_MAINTAIN".
      1 I create the material using "BAPI_MATERIAL_SAVEDATA" without "BAPI_TRANSACTION_COMMIT".
      2 I use "CSAP_MAT_BOM_MAINTAIN" to add the material to a existing BOM.
      Before this test,i think "CSAP_MAT_BOM_MAINTAIN" will raise an exception:
      "The material XXX does not exist or is not activated"
      But the result is:Material is created successfully and the BOM is added a component with a commit implicitly.
      How can "CSAP_MAT_BOM_MAINTAIN" read the material which is not committed to the DB?
      BTW:Even if "CSAP_MAT_BOM_MAINTAIN" raise a exception,i can use "BAPI_TRANSACTION_COMMIT" to rollback both the
      created material and the changed BOM.
      I am confused!!
      Following is the sample code of this case:
    *& Report  Z_TESTYM23
    REPORT  z_testym23.
    DATA mat LIKE bapimathead-material VALUE '000000000000002814'.   "created material no
    DATA bom LIKE csap_mbom-matnr VALUE '000000000000002794'.
    DATA change_no LIKE aenrb-aennr.
    create ECN in sap
    PERFORM ecn_create.
    create material without commit
    PERFORM mat_create.
    *-- maintain BOM
    PERFORM maintain_bom.
    *&      Form  MAT_CREATE
          CREATE MATERIAL
    FORM mat_create .
      DATA headdata LIKE bapimathead.
      DATA clientdata LIKE bapi_mara.
      DATA clientdatax LIKE bapi_marax.
      DATA itab_makt LIKE TABLE OF bapi_makt.
      DATA wa_makt LIKE bapi_makt.
      DATA return LIKE bapiret2.
      headdata-material = mat.
      headdata-ind_sector = 'A'.
      headdata-matl_type = 'ROH'.
      headdata-basic_view = 'X'.
      clientdata-base_uom = '2X'.
      clientdatax-base_uom = 'X'.
      wa_makt-langu = sy-langu.
      wa_makt-matl_desc = 'TEST'.
      APPEND wa_makt TO itab_makt.
      CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'
        EXPORTING
          headdata            = headdata
          clientdata          = clientdata
          clientdatax         = clientdatax
        IMPORTING
          return              = return
        TABLES
          materialdescription = itab_makt.
      CHECK return-type <> 'S'.
      CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
      MESSAGE  return-message TYPE 'E'.
    ENDFORM.                    " MAT_CREATE
    *&      Form  MAINTAIN_BOM
          Maintain BOM
    FORM maintain_bom .
      DATA i_datum(10).
      DATA i_stko TYPE stko_api01.
      DATA t_stpo LIKE TABLE OF stpo_api03.
      DATA w_stpo LIKE stpo_api03..
      WRITE  sy-datum TO i_datum.
      w_stpo-item_categ = 'L'.
      w_stpo-component = mat.
      w_stpo-comp_qty = '2'.
      APPEND w_stpo TO t_stpo.
      CALL FUNCTION 'CSAP_MAT_BOM_MAINTAIN'
        EXPORTING
          material    = bom
          bom_usage   = '1'
          valid_from  = i_datum
          change_no   = change_no   "correct no:'500000000053';incorrect no:'500000000153'
          i_stko      = i_stko
          fl_complete = 'X'
        TABLES
          t_stpo      = t_stpo
        EXCEPTIONS
          error       = 1
          OTHERS      = 2.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE 'S' NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.   "Rollback BOM and material
      ELSE.
        CALL FUNCTION 'BUFFER_REFRESH_ALL'.          "Remained process of function:BAPI_TRANSACTION_COMMIT
        WRITE: / 'Everything is OK',
               / 'CHANGE_NO: ',change_no,
               / 'MATERIAL NO: ',mat,
               / 'BOM: ', bom.
      ENDIF.
    ENDFORM.                    " MAINTAIN_BOM
    *&      Form  ECN_CREATE
          Create ECN
    FORM ecn_create .
      DATA change_header LIKE aenr_api01.
      DATA object_bom LIKE aenv_api01.
      change_header-status = '01'.
      change_header-valid_from = '2007/06/01'.
      change_header-descript = 'test'.
      object_bom-active = 'X'.
      CALL FUNCTION 'CCAP_ECN_CREATE'
        EXPORTING
          change_header            = change_header
          object_bom               = object_bom
          FL_COMMIT_AND_WAIT        = 'X'
         FL_NO_COMMIT_WORK        = 'X'
        IMPORTING
          change_no                = change_no
        EXCEPTIONS
          change_no_already_exists = 1
          error                    = 2
          OTHERS                   = 3.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE 'E' NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    ENDFORM.                    " ECN_CREATE 
      Regards
      Ming

    I did another test as following:
    *& Report  Z_TESTYM23
    REPORT  z_testym23.
    DATA mat LIKE bapimathead-material VALUE '000000000000002816'.   "created material no
    create material without commit
    PERFORM mat_create.
    *&      Form  MAT_CREATE
          CREATE MATERIAL
    FORM mat_create .
      DATA headdata LIKE bapimathead.
      DATA clientdata LIKE bapi_mara.
      DATA clientdatax LIKE bapi_marax.
      DATA itab_makt LIKE TABLE OF bapi_makt.
      DATA wa_makt LIKE bapi_makt.
      DATA return LIKE bapiret2.
      headdata-material = mat.
      headdata-ind_sector = 'A'.
      headdata-matl_type = 'ROH'.
      headdata-basic_view = 'X'.
      clientdata-base_uom = '2X'.
      clientdatax-base_uom = 'X'.
      wa_makt-langu = sy-langu.
      wa_makt-matl_desc = 'TEST'.
      APPEND wa_makt TO itab_makt.
      CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'
        EXPORTING
          headdata            = headdata
          clientdata          = clientdata
          clientdatax         = clientdatax
        IMPORTING
          return              = return
        TABLES
          materialdescription = itab_makt.
    CALL FUNCTION 'MARA_SINGLE_READ'
       EXPORTING
        KZRFB                   = ''
        MAXTZ                   = 0
         matnr                   = mat
        SPERRMODUS              = ' '
        STD_SPERRMODUS          = ' '
        OUTPUT_NO_MESSAGE       =
      EXCEPTIONS
        lock_on_material        = 1
        lock_system_error       = 2
        wrong_call              = 3
        not_found               = 4
        OTHERS                  = 5.
    IF sy-subrc <> 0.
       CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
       MESSAGE ID sy-msgid TYPE 'I' NUMBER sy-msgno
               WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
      SELECT COUNT(*) FROM MARA WHERE MATNR = MAT.
      WRITE SY-DBCNT.
      CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
      WRITE return-message.
    ENDFORM.                    " MAT_CREATE
    SY-DBCNT = 1 and i can alse rollback the material

  • SAP ERP 6.0 - Problems displaying numbers in ALV (i.e tx. se16n)

    Hi, We've just upgraded our system from version 46C to version 6.0.
    As the result of the process we're experiecing a problem when displaying numbers with ALV reports, even with standard transactions.
    For example, when running the transaction se16n to display the content of the table CABN table, the value of the ATINN field (NUMC) is replaced by the value of other field ATNAM (CHAR 30).
    This situation doesn't happen when consulting data in se16 transaction (here we display the result in se16 standard list).
    We also experienced this problem in Z programs showing data in ALV reports..
    Any help on this would be appreciated.!!!
    Thank you

    ORA-00959: tablespace 'PSAPSR3ODS' does not exist
    Create the tablespace PSAPSR3ODS through brtools, or sql commands.
    Update the import_state.properties where you replace the "-" with "0" for the packages that you want to retry.
    Then set the JAVA_HOME environment, and  then run the import_monitor.sh.

  • My phone displays numbers instead of contact names for incoming calls and text - how do I fix?

    My phone displays numbers instead of contact names for incoming calls and text - how do I fix?  It used to display the names if there was a contact listed, now it just shows numbers regardless of whether or not the number corresponds to a contact name in the contact list.  Can anyone help?  I googled this problem and lots of folks have experienced it, however there is not a consensus for a resolution.

    Alexandribill, I have been having the exact same issue.  I got a new phone and restored my contacts.  If the # doesn't have the area code first then the name isn't shown.  I just added my husbands area code to my phone and called my phone from his and now his name shows up...Ugh, I have to go through and manually add the area code to all my contacts....
    I'd say Verizon needs to rewrite their program to include the area code in the restoring from backup process!

  • Need help: Sending mail to internet address without commit work statement

    Dear Experts,
            I have a problem in sending mails from sap to internet address.Am using the function module
    SO_NEW_DOCUMENT_SEND_API1 and am passing parameters like,
    CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'
         EXPORTING
              DOCUMENT_TYPE  = 'RAW'
              DOCUMENT_DATA  = DOC_CHNG
              PUT_IN_OUTBOX  = 'X'
         TABLES
              OBJECT_CONTENT = OBJCONT
              RECEIVERS      = RECLIST
         EXCEPTIONS
              TOO_MANY_RECEIVERS         = 1
              DOCUMENT_NOT_SENT          = 2
              OPERATION_NO_AUTHORIZATION = 4
              OTHERS                     = 99.
    submit rsconn01 with mode = 'INT'
                        with output = 'X'
                        and return.
    My problem here is,with the commit work statement after FM, the mail is triggering correctly.but if, am not using the commit work statement,at the very first time of execution mail is not triggering, and the second time of execution first mail is triggering like wise it is going.The status of the message is waiting in queue.
    i have refresh receiver's list also.I want to use this concept in badi.So anyone can pls help me,how to send a mail without commit work statement.
    Thanks in advance.

    There is a parameter Commit_Work pass it as 'X'
    <code>
    CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'
    EXPORTING
    DOCUMENT_TYPE = 'RAW'
    DOCUMENT_DATA = DOC_CHNG
    PUT_IN_OUTBOX = 'X'
    commit_work = 'X'
    TABLES
    OBJECT_CONTENT = OBJCONT
    RECEIVERS = RECLIST
    EXCEPTIONS
    TOO_MANY_RECEIVERS = 1
    DOCUMENT_NOT_SENT = 2
    OPERATION_NO_AUTHORIZATION = 4
    OTHERS = 99.
    submit rsconn01 with mode = 'INT'
    with output = 'X'
    and return.
    </code>
    Edited by: Saravanan Ramasamy on Nov 11, 2009 1:31 PM

  • How can I move columns in Numbers without distorting the formula in other cells?  In Excel I can cut and paste entire columns and the formula in other cells adjusts accordingly.  When I do it in Numbers, the formula messes up.  How can I do this?

    How can I move columns in Numbers without distorting the formula in other cells?  In Excel I can cut and paste entire columns and the formula in other cells adjusts accordingly.  When I do it in Numbers, the formula messes up.  How can I do this?
    For example: I have formulas in columns D and F that relate to columns C to CU
    If I want to move one column from one position to another (say S to T), the formula loses the colums that was moved, i.e. it doesn't recognize it has moved, rather sees it as deleted...  How can I do this without distorting the formula?

    Thanks for the feedback.
    If I often urge askers to look at the available resources, it's because  a large range of questions asked in the forums are already answered in these documents.
    As they are PDFs, they are easy to search in.
    CAUTION
    Download them while they are available.
    Given what is delivered with iBooks Author, I'm afraid that we will not get such easy to use documents.
    Searching infos in the  iBooks Author documentation available on line is awfully cumbersome and a lot of embedded links are wrongly flagged this way. In the Help files they aren't links but underlined strings.
    It seems that the tool used to generate the web pages was wrongly configured.
    Yvan KOENIG (VALLAURIS, France) dimanche 22 janvier 2012
    iMac 21”5, i7, 2.8 GHz, 12 Gbytes, 1 Tbytes, mac OS X 10.6.8 and 10.7.2
    My Box account  is : http://www.box.com/s/00qnssoyeq2xvc22ra4k
    My iDisk is : http://public.me.com/koenigyvan

  • Why is Mavericks Calendar not displaying numbers correctly?

    My Calendar application is not displaying numbers correctly, I have tried validating my fonts and found nothing there, so not sure what the problem is...

    Have yopu gone to Font Book
    Font Book is located in the Applications folder (in the Finder, choose Go > Applications). To manage or view fonts, open Font Book, or double-click a font file.
    High Light all the fonts    ( Shift and click 1st one  Shift and click last one) and
    then select File/Falidate Fonts
    Then making sure all the fonts get a green tick box.

  • MacBook Pro with Retina Display or without?

    I am an ametuer photographer and I want a Mac to edit my photos. I've heard that the MacBook Pro is better for RMD. I was wondering if, for editing photos, if I should get it with Retina Display or without? Thank you for your help.

    Do you currently use a Apple Mac computer or are you switching to Mac for photo editing?
    Keep in mind that no notebook has the proper screen size, even a 17" notebook, for good photo editing.
    And then you have the only people capable of viewing what you have edited on a Retina screen are those that have Retina screens. Otherwise everyone else will be viewing your edited images on standard screens.
    If you are going to switch to Mac for image editing there is nothing that special about a Mac for that. Photoshop runs just as well on Windows as it does on Mac. Mac uses the same graphic processors as Windows along with the same CPU.
    Personally I would not by a Retina screen in the current Macbook Pro design. Way to limited for me in the construction of the system. The Retina screen Mac's are basically sealed units that not even Apple can easily take apart and repair without replacing complete system groups. Everything is either soldered or glued in place. Even the barrteries are glued into the case.
    So I'd buy the standard model or If I used Windows I'd stick with that.

  • Random numbers without duplicates

    Hello,
    I'm having trouble locating an explained example for selecting a set of random numbers without duplicates. Specifically, I'm working on this example from Ivor Horton's Beginning Java, chapter 3.
    3. A lottery program requires that you select six different numbers from the integers 1-49. Write a program to do this for you and generate five sets of entries.
    This is not homework, I'm just trying to teach myself Java to eventually work my way up to servlets and JSPs.
    This is what I have so far. I tried to use array sorting but it didn't work (the first three numbers in my entries was always 0), so I commented out that part. I've included sample output after the code. I don't necessarily need the exact code although that would be nice; I just need at least an explanation of how to go about making sure that if a number has been picked for an entry, not to pick it again.
    Thanks for any help,
    javahombre
    package model;
    import java.util.Random;
    import java.lang.Math.*;
    import java.util.Arrays;
    public class Lottery {
    public static void main(String[] args) {
    // Lottery example.
    // We need the following data:
    // - An integer to store the lottery number range (in this case 59).
    // - A mechanism to choose a number randomly from the range.
    // - An array to store the entries (6 different numbers per entry).
    // - A loop to generate 5 sets of entries.
    int numberRange = 59;
    int currentPick = 0;
    int[] entry = new int[6]; // For storing entries.
    //int slot = -1; // For searching entry array.
    Random rn = new Random();
    for (int n = 0; n < 5; n++)
    // Generate entry.
    for (int i = 0; i < 6; i++)
    currentPick = 1 + Math.abs(rn.nextInt()) % numberRange;
    //Arrays.sort(entry);
    //slot = Arrays.binarySearch(entry, currentPick);
    //System.out.println("i: " + i + "\t| slot: " + slot + "\t| pick: " + currentPick + "\t| compare: " + (slot < 0));
    // Add the current pick if it is not already in the entry.
    //if (slot < 0)
    entry[i] = currentPick;
    System.out.println("pick entered: " + currentPick);
    // Output entry.
    System.out.print("Entry " + (n + 1) + ": ");
    for (int j = 0; j < 6; j++)
    System.out.print(entry[j] + "\t");
    System.out.println("");
    // Set the array contents back to 0 for next entry.
    Arrays.fill(entry,0);
    Sample output (notice duplicates, as in Entry 3):
    pick entered: 11
    pick entered: 29
    pick entered: 33
    pick entered: 8
    pick entered: 14
    pick entered: 54
    Entry 1: 11     29     33     8     14     54     
    pick entered: 51
    pick entered: 46
    pick entered: 25
    pick entered: 30
    pick entered: 44
    pick entered: 22
    Entry 2: 51     46     25     30     44     22     
    pick entered: 49
    pick entered: 39
    pick entered: 9
    pick entered: 6
    pick entered: 46
    pick entered: 46
    Entry 3: 49     39     9     6     46     46     
    pick entered: 23
    pick entered: 26
    pick entered: 2
    pick entered: 21
    pick entered: 51
    pick entered: 32
    Entry 4: 23     26     2     21     51     32     
    pick entered: 27
    pick entered: 48
    pick entered: 19
    pick entered: 10
    pick entered: 8
    pick entered: 18
    Entry 5: 27     48     19     10     8     18     

    NOTE: the array reference to [ i ] seems to be misinterpreted as italics by the posting form. I've reposted the message here, hopefully it will show the code properly.
    Thanks again,
    javahombre
    Hello,
    I'm having trouble locating an explained example for
    selecting a set of random numbers without duplicates.
    Specifically, I'm working on this example from Ivor
    Horton's Beginning Java, chapter 3.
    3. A lottery program requires that you select six
    different numbers from the integers 1-49. Write a
    program to do this for you and generate five sets of
    entries.
    This is not homework, I'm just trying to teach myself
    Java to eventually work my way up to servlets and
    JSPs.
    This is what I have so far. I tried to use array
    sorting but it didn't work (the first three numbers in
    my entries was always 0), so I commented out that
    part. I've included sample output after the code. I
    don't necessarily need the exact code although that
    would be nice; I just need at least an explanation of
    how to go about making sure that if a number has been
    picked for an entry, not to pick it again.
    Thanks for any help,
    javahombre
    package model;
    import java.util.Random;
    import java.lang.Math.*;
    import java.util.Arrays;
    public class Lottery {
    public static void main(String[] args) {
    // Lottery example.
    // We need the following data:
    // - An integer to store the lottery number range (in
    this case 59).
    // - A mechanism to choose a number randomly from the
    range.
    // - An array to store the entries (6 different
    numbers per entry).
    // - A loop to generate 5 sets of entries.
    int numberRange = 59;
    int currentPick = 0;
    int[] entry = new int[6]; // For storing entries.
    //int slot = -1; // For searching entry
    array.
    Random rn = new Random();
    for (int n = 0; n < 5; n++)
    // Generate entry.
    for (int i = 0; i < 6; i++)
    currentPick = 1 + Math.abs(rn.nextInt()) %
    numberRange;
    //Arrays.sort(entry);
    //slot = Arrays.binarySearch(entry, currentPick);
    //System.out.println("i: " + i + "\t| slot: " + slot +
    "\t| pick: " + currentPick + "\t| compare: " + (slot <
    0));
    // Add the current pick if it is not already in the
    entry.
    //if (slot < 0)
    entry[ i ] = currentPick;
    System.out.println("pick entered: " + currentPick);
    // Output entry.
    System.out.print("Entry " + (n + 1) + ": ");
    for (int j = 0; j < 6; j++)
    System.out.print(entry[j] + "\t");
    System.out.println("");
    // Set the array contents back to 0 for next entry.
    Arrays.fill(entry,0);
    Sample output (notice duplicates, as in Entry 3):
    pick entered: 11
    pick entered: 29
    pick entered: 33
    pick entered: 8
    pick entered: 14
    pick entered: 54
    Entry 1: 11     29     33     8     14     54
    pick entered: 51
    pick entered: 46
    pick entered: 25
    pick entered: 30
    pick entered: 44
    pick entered: 22
    Entry 2: 51     46     25     30     44     22
    pick entered: 49
    pick entered: 39
    pick entered: 9
    pick entered: 6
    pick entered: 46
    pick entered: 46
    Entry 3: 49     39     9     6     46     46
    pick entered: 23
    pick entered: 26
    pick entered: 2
    pick entered: 21
    pick entered: 51
    pick entered: 32
    Entry 4: 23     26     2     21     51     32
    pick entered: 27
    pick entered: 48
    pick entered: 19
    pick entered: 10
    pick entered: 8
    pick entered: 18
    Entry 5: 27     48     19     10     8     18

  • How can FS03 be made Display only without removing Create/Change Activities

    ECC 6.0 Release 700
    Our internal auditors have asked to limit access to change the Chart of Accounts. Currently our Functional team has access to do this via transactions FS00, FSS0, FSP0, etc. which needs to be removed.
    The issue is that if we assign display transaction FS03 to the functional team's role, the Change and Create buttons are still enabled due to the corresponding activities in the Authorization object F_SKA1_BUK, as it seems FS00 and FS03 are essentially the same. The same holds true for FSS3 and FSP3.
    Unfortunately, the functional team requires the create and change activity in F_SKA1_BUK for other transactions, so if we strip the activities for the purposes of FS03, they will lose functionality elsewhere.
    The standard reports S_ALR_87012327 and S_ALR_87012328 were deemed as insufficient replacements for the information in FS00.
    Is there any way to limit the functionality of FS03 to Display only without taking away the create and change activities?

    While researching F_SKA1_KTP, I found that without the change or create activities in both F_SKA1_KTP and F_SKA1_BUK, the buttons gray out. The functional team is currently researching if they need change/create in F_SKA1_KTP, as I sent them a list of transactions they have for which it is required.
    I tried to remove S_TCODE FS00, but when I ran FS03 it gave me a "not authorized for FS00" message and did not display the screens. I removed the dependency via SE97, but then FS03 essentially became FS00 and I was back at square one.
    Thank you both for your suggestions.

Maybe you are looking for

  • E60 lost wireless connection to network

    my E60 lost wireless connection to network. tried GPS, DUAL, automatic, manual search for network. Same SIM works fine with different phone. Any idea anyone?

  • Employee Master Data

    Hi, In Employee Master Data ... I had entered Starting Date as 01/05/05(2005) and DOB as 18/02/47(1947) at that time its giving error by saying DOB cant be greater than Start Date. How to sort out this...

  • Create excel in background with data sheet

    any way to create a excel with data sheet with specific name in background?

  • Custom alarm setting in iCal

    Hello, is there any way to set a custom alarm reminder setting when creating an event in ical on the iPhone? At the moment there is only a list of pre-set times and days for reminders. Ical on my Mac offers custom setting why not on the iPhone? Also,

  • Make Item Category "L" default

    Hi Friends,                                   my client wantsystem should suggest item category as "L" by default. So please convey how to make this? Regards,