How to get a random number in a range?

as title
how to get a random number in a range?
like 2000~3000 thks :)

int between 10 and 20 with the method Math.random():
public class Rnd
     // Test
     public static void main(String[] args)
         int start=10, end = 30;
         for (int i = 0; i < 10; i++)
            int n = (int)(start + Math.random() * (end-start));
            System.out.println(n);
}best regards.

Similar Messages

  • How to get a Random number from a list

    Dear Experts,
    I have a list in which I have 24 employee number, and from this I have to select 4 employees number Randomly,
    So please suggest how can I achieve this.
    Warm Regards
    Upendra Agrawal

    Hello
    do 4 times.
    CALL FUNCTION 'QF05_RANDOM_INTEGER'
         EXPORTING RAN_INT_MAX = 24
                   RAN_INT_MIN = 1
         IMPORTING RAN_INT     = ind.
    read table itab index ind.
    " do anything here
    enddo.

  • SsRandom or another way to get a random number

    In iDocScript, I need to get a random number between 0 and 4, or it could be between 1 and 5. I found ssRandom, but am unsure how to use that number to get the range I want. Any other ways or advice?

    I found the answer, below is some iDocScript for generating random numbers.
    [!--$randomIndex = ssRandom()--]
    [!--$if randomIndex lt 0--]
    [!--$randomIndex = randomIndex * (-1)--]
    [!--$endif--]
    [!--$randomIndex = randomIndex % 5--];

  • How to get the total number of pages printed in a report?

    Hi All,
    I have a requirement where I need to print a frame of fields only in the last page. Unfortunately I cannot use the 'Print Object On' property as it doesnt work in my case. So, I am planning to write a format trigger on the frame to return TRUE if the page is the last physical page. Now, I need to know how to get the total number of physical pages that will get printed in the report so that I can use this to manipulate the frame. I was planning to use the 'Total Physical Pages' built-in, but it seems like I can just use it to print in a field and I can't use this field's value anywhere in the plsql code (formula column function/format trigger) in the report. Is there anyway to get the total number of pages printed in the report which can be used in the report plsql code?
    Thanks,
    Srini.

    i found the solution, thanks

  • How to get the page number in the break section?

    Hi expert,
    The user wants the page number came right after the Break group name if the break section contains more than 1 page. E.g.
    ABC Compnay
    XXXXXXXXXXX XXXXXXXX
    XXXXXXXXXX XXXXXXXXXXXX
    BCD Company, p 1
    XXXXXXXXXXX XXXXXXXX
    XXXXXXXXXX XXXXXXXXXXXX
    BCD Company, p 2
    XXXXXXXXXXX XXXXXXXX
    XXXXXXXXXX XXXXXXXXXXXX
    CDE Company
    XXXXXXXXXXX XXXXXXXX
    XXXXXXXXXX XXXXXXXXXXXX
    How to get the page number in section break level?

    Hi Wes
    * Create a Field on the margin.
    * Set its "Source" to "Page Number"/"Physical Page Number".
    * Click "Page Numbering" button.
    * In "Reset At" list box, choose the Repeating frame that surrounds your detail group in the layout.
    This should cause Reports to increment the page number until the "Company" repeating frame resets.
    Regards
    Sripathy

  • How to get payment document number from paid column in monthly invoice

    Dear experts
    I use SBO japan version and i need to know how to get payment document number from paid column in monthly invoice ?
    in table MIN1, only contain invoice and credit note document number, there is no payment document number
    thank you for your help
    Best Regards
    JeiMing

    Dear Gordon
    Yeah, you are right, i can use field MIentry in RCT2
    thank you
    Best regards
    jeiming

  • How to get purchase order number from delivery number?

    hi all,
    how to get purchase order number and item if i have only delivery.
    and in same way how to get po number and item if i know only batch number.
    kindly give me some solution i need this urgently.
    thanks in advance.

    Check the logic below:
    * Selecting the Sales Documents from VBFA for corresponding Invoice
        SELECT vbelv
                     posnv
          FROM vbfa
          INTO TABLE gt_itab3
         WHERE vbeln EQ gt_itab5-vbeln
           AND posnn EQ gt_itab5-posnr
           AND vbtyp_n EQ 'J'.
        IF sy-subrc EQ zero.
          SORT gt_itab3 BY vbelv posnv.
        ENDIF.
      ENDIF.
      IF NOT gt_itab3 IS INITIAL.
    * Selecting the Purchase Orders from VBFA for corresponding Sales Documents
        SELECT vbeln
               posnn
          FROM vbfa
          INTO TABLE gt_itab4
       FOR ALL ENTRIES IN gt_itab3
         WHERE vbelv EQ gt_itab3-vbelv
           AND posnv EQ gt_itab3-posnv
           AND vbtyp_n EQ 'V'.
        IF sy-subrc EQ 0.
          SORT gt_itab4 BY vbeln posnn.
        ENDIF.
      ENDIF.
    Batch number will be there in delivery item.
    Regards
    Kannaiah

  • How to get Contract Account Number in Service Ticket

    Hi Experts,
    How to get Contract account number in Service Ticket, we are working in ISU environment. when i create the service ticket the contract account number is there in Business agreement number field in service tiket.
    Can anyone tell me how to retrieve that field.
    Answer will be appreciated.
    Praveen

    check tables tfk_buag_ref and fkkvkp

  • How to get the Page Number in CS3 with VB?

    Hi, Everybody
    I use the Visual Basic to read the words and their page number where the Words are at. I want to do it according to Story. Some TextFrame of the Story waw placed in other pages: How can I get the Page number according to the Word that is selected?
    For myStoryCounter = 1 to Document.Stories.Count
    Set myStory = Document.Stories.Item(myStoryCounter)
    For myWordCounter = 1 to myStory.Words.Count
    Set myWord = myStory.Words.Item(myWordCounter)
    myWordContents = myWord.Contents
    Rem ** How to Get the Page Number according to the Word ***
    Next
    Next

    > But I don't understand why Item(1) are set.
    because Word can have more than one parent TextFrame - when split across TextFrames
    only Character have one ParentTextFrame accessed also by ParentTextFrames.Item(1)
    > why Story.TextFrames.Count alway is 0, Is it bug?
    no - it's not bug
    in older IDs - Story.TextFrames collection refer to all TextFrames as containers for Story text
    but in CS3 - collection Story.TextFrames contain all TextFrames inserted as InLine/Anchored objects - same like Story.Rectangles or Story.Ovals
    in CS3 - when you want to refer to TextFrames as containers for Story text - you need to use Story.TextContainers - because now you can link TextFrame and Text-On-Path as Story - Text-On-Path isn't TextFrame
    robin
    www.adobescripts.com

  • How to Get last page number in report 10g

    I want to get last page number in report but Current page number found from srw.get_page_num(n)
    but i want to get last page number for conditional formating like this
    srw.get_page_num(current_page)=last_page
    pls help me how can get last page number;
    pls help;
    thanks in advanced;

    Hi,
    you can use the Property Print Object On for this.
    Regards
    Rainer

  • How to get the document number for a ware house order.

    Hello gurus,
    how to get the document number for a ware house order. [if GI is posted refering that WH order] .. is there any report?
    Thanks in advance

    There are several options.  When you post a Goods Movement, you can use LB12 -display Transfer Requirement for material document or LB11 Display TR for material.
    Depending on how your system is set up you may have gotten a Transfer Order automcatically.  In this case you can look at LT24 - Transfer Order for material.

  • I'm trying to load a student version of Acrobat XI Pro but not sure how to get the serial number to validate I'm a student

    I'm trying to load a student version of Acrobat XI Pro but not sure how to get the serial number to validate I'm a student

    Hi ,
    Could you please tell me form where did you purchase the Student version of Acrobat ?Is it through Adobe or some outside vendor ?
    Is it the first time you are trying to access it ?
    If yes ,then you must have received your serial number along with your product .
    If not ,then how how did you manage to get your serial number and access Acrobat before ?
    Regards
    Sukrit Dhingra

  • How to get/view document number for KP06 Planning upload

    Hi,
    I have uploaded excel for Cost center/cost element Planning in KP06 using exccel planning.Now i want the document number which for which i have posted in KP06-Plan values using excel upload.
    Kindly advice me how to get the document number for CO-OM(Cost center/Cost element planning) in KP06?
    Thanks
    Supriya

    Hello,
    Please execute report KSBL. It should be useful.
    Regards,
    Ravi

  • How to get this kind number?

    I have a float number,e.g myfloat=123.34???. When the first "?">=5,
    myfloat=123.35,or myfloat=123.34.Can anyone tell me how to get this kind number.
    Thanks in advance.

    In fact, not very clear of your problem.
    Supposing you want to get fix position's value after ".",
    you could firsly convert it to a string,
    then position "." ,use subString() to get the value.
    compare it, reconvert it back.

  • How to get sales order number before saving in VA01 by using parameter

    Hi,
    Please let me know how to get sales order number in transaction VA01 before saving it by using parameter in SU3.
    I tried to set parameter in SU3 "AUN", but it is not working as required, means sales order number is not appearing before saving.
    can you please suggest how to do it?
    Thanks & Regards.
    Rahul Verulkar

    Hi,
    In case of Support project, we get the high severity issues from users and needs to be closed withn 2 hours... so what we do we get the requirement from user and checking the same in production from our id, but we can not save the sales order as we are not authorized to do the same, so in such cases it is required to get the sales order number before saving... where we can guide the users.... but actuallly it is not getting saved in the table until and unless u save it manually. It works like a material master... when u create material master, the material number appears in advance in material number field "MATNR"
    If it is possible can you please suggest step by step to work on parameter in SU3 for sales order number before saving.
    Thanks & regards,
    Rahul Verulkar

Maybe you are looking for

  • How can I tell if I need a Dual-Band Wi-Fi Dongle ...

    Hi I've just placed an order for BT Infinity 1 and have been advised I will be receiving the new BT Home Hub 5. Can someone explain if it would be advantageous for me to order a Dual-Band Wi-Fi Dongle 600 or not? How can I check if my laptops - Dell

  • Transaction BP start in sales area - status view screen

    I'm calling from outside of R/3 (from CRM). I want to start online transaction BP started, but I want to start up in the sales area, and the screen status. This is crucial because it is must be done several times by the users. I have tried to see exa

  • What's the best way to do many NAT translations for WWW farm?

    Hello all, I hope this finds you in good spirits. I have recently upgraded my ASA 5510 to 8.3 code and honestly I am confused on the best and most efficient way to do many nat translations through it.  I have a group of about 100 IP's that need http/

  • Hide a column in BPS layout ?

    Hi, Is it possible to hide a column in a BPS layout (Web Excel) ? When I hide a column in the layout definition, saving it resets the hidden column. Any idea if it will be included in a future release ? Thanks

  • CS4 Printing Problems / No Problems with CS3

    Hi, I use and RELY upon InDesign CS4 heavily for my job in desktop publishing. We just got CS4 at our office after having CS3 for about a few months and I'm having a great deal of trouble. Every now and then (completely at random it seems) some docum