How to keep the zero after decimal

Hi,
I'm trying to store numbers into one of the custom table column. This column must contain unique value for each record.
Now the issue is if i want to insert a record with zero after decimal point its removing that zero.
Emp Id (number)
1234.1
1234.2
1234.9
1234.10 --> 1234.1 (this is what is getting stored in table)
1234.11
...I want to store 1234.10 not 1234.1, is there any way that i can store zeros as well after decimal point for NUMBER data type column.
Thanks in advance,

Hi,
Your appending sequence number should be with leading zeroes like
1.001
1.002
1.003
1.009
1.01
1.011 etc
based on the numbe rof records you haveTry this and see if this fits for you
DECLARE
   CURSOR c1 IS SELECT * FROM custom_table1;
   i              NUMBER;
   l_len          NUMBER;
BEGIN
   SELECT LENGTH (COUNT (*))+(LENGTH(some_seq.currval)-1) INTO l_len FROM custom_table1;
   FOR c1_rec IN c1
   LOOP
      i           := some_seq.NEXTVAL;
      INSERT INTO test_tab (ID, NAME, amount, create_date)
           VALUES (c1_rec.ID || '.' || TO_CHAR (i, rpad ('0', l_len, '0') || '9')
                  ,c1_rec.NAME
                  ,c1_rec.amount
                  ,c1_rec.create_date);
   END LOOP;
END;G.

Similar Messages

  • How to cut the zeros after the decimal point ?

    Hello everybody,
    does anyone know a solution how to cut the zeros after the decimal point at at CHAR data field?
    For example the field
    &RM06P-PRMG1&
    This is a char field in the database, so that the command
    &RM06P-PRMG1(.0C)&
    doesn't work.
    At the moment the output on the form is like that
    124,000
    It shoud be like that
    124
    It would be great if anyone could help me!
    TIA!
    Strobbel

    Hi Strobbel,
    If you are working on standard sapscript, first make a zcopy of it, do the modifications in that and assign the new form to the output types in tcode NACE.
    First you need to create a program to write the logic, so go to tcode SE38 , create a new program (say zremove_zero) with Program type Executable.
    Now you will see ABAP Editor with statement;
    Report zremove_zero.
    Add the following lines below the report statement.
    *&      Form  remove_zero
    *       text
    *      <--lv_AMT  text
    FORM remove_zero  CHANGING lv_amt.
      DATA p_amt TYPE p.
      MOVE lv_amt TO p_amt.
      MOVE p_amt TO lv_amt.
    Condense lv_amt.
    ENDFORM.
    Now save and activate the program.
    Now open the zcopy of your script and Just above the statement  &RM06P-PRMG1& write the following lines;
    /: perform remove_zero in program zremove_zero
    /: changing &RM06P-PRMG1&
    /: endperform.
    Now you can see your amount printing without decimals.
    Try and let me know, hope i have guided you clearly.
    Regards
    Karthik D
    P.S.: I advice you to take help from an ABAPER.

  • How to elininate the Zeros after the decimal

    Hi,
    I columns in the scheduler table has BEGIN_DAY BEGIN_MONTH BEGIN_YEAR and the values are coming like 12.00, 11.00, 2009.00.
    In the database there is no zeros after the decimal but when the tables are imported to OBIEE the see the zeros in the above columns. Is there any way to eliminate the zeros after the decimal points in the RPD.
    Rgds,
    Amit

    It should not display zeroes if you set the column type to INT in Physical.. probably you might have forgotten to refresh the Server Metadata...
    Other way you can give a try is - In Answers, go to Column Properties => Data Format and check 'Override Default Data Format' then choose 'Decimal Places' to '0'..
    Note: this eliminates 0s only in this report..

  • How to delete trailing zeros after decimal ?

    Hi,
    i want to delete trailing zeros after decimal.
    Example:
    if it is 22.000 then output will be 22
    if it is 22.010 then output will be 22.01.
    plz let me know hw to do this ?

    DATA:
      lv_decimal TYPE f DECIMALS 3,
      lv_string  TYPE string.
    lv_decimal = '22.010'.
    WRITE lv_decimal TO lv_string.
    SHIFT lv_string RIGHT DELETING TRAILING '0'.
    CONDENSE lv_string NO-GAPS.
    * now no trailing zeros are in the decimal stored in LV_STRING
    <REMOVED BY MODERATOR>
    Edited by: Alvaro Tejada Galindo on Jan 30, 2008 12:10 PM

  • How to keep the cellEditor after remove/add table columns

    The cellEditor/render will be invalid after fireTableStructureChange event. How to make the cellEditor work properly as before the structure changed?

    After a fireTableStructureChange event the TableColumnModel is recreated and the default renderers and editors are used. If you are using custom renderers or editors you need to reinstall them for the appropriate column.

  • How to remove zero after decimal point.

    hi friends
    how to remove the zero after decimal points.
    example :
    123.450 -- if print only 123.45
    45.600  - 45.6
    any body help me.
    thanks
    pauldhama

    go through this example
    it may help u
    DATA: T(14) VALUE ' abcdefghij',
    STRING LIKE T,
    STR(6) VALUE 'ghijkl'.
    STRING = T.
    WRITE STRING.
    SHIFT STRING LEFT DELETING LEADING SPACE (or use 0 to detete 0).
    WRITE / STRING.
    STRING = T.
    SHIFT STRING RIGHT DELETING TRAILING STR or 0.
    WRITE / STRING.
    Output:
        abcdefghij
    abcdefghij
            abcdef

  • Zeroes after decimal getting trimmed after 1:1 mapping of EDIFACT

    hi all
    i have created 1:1 mapping for XML->EDI.
    i took the output from XI and gave it as input.However, in the output of the mapping, the zeroes after decimal are getting deleted.
    for example if the input contain 2500.000, the output of the mapping contains 2500.
    I want 2500.000 in the output.
    Any suggestions as how to overcome the problem?

    hi Kai
    sorry ..i think i didnt convey properly my prob.
    This is what i want.
    My scenario is IDOC->EDIFACT using XI.
    i did a XI graphical mapping from IDOC ->to->EDIFACT_XML.Here for a particular field i got the output as 2500.000.
    Now this EDIFACT_XML is converted into EDIFACt using 1:1 mapping of BIC MD.
    When i give 2500.00 as an input to this 1:1 Mapping of BIC MD, the output contains only 2500.
    I'm not having problem in XI but in BIC MD.
    kindly suggest how i can get decimal output from BIC MD.

  • Zeroes after Decimal

    Hi,
    I am having a value as  '6009.12300 ML'  belongs to type C.
    Now i don't want the zeroes after decimal such as 6009.123 ML .
    how cud i do this?
    i tried search ,split,shift,trailing zeroes but could nt get it?
    Thanks,
    Ponraj.s.

    Hi,
      I tested the following code segment, it works well to suit your requirement.
    Just look at the code.
    DATA C(20) VALUE '6009.12300 ML'.
    DATA:  LEN TYPE I,
               FLAG TYPE I.
    LEN = STRLEN( C ).
    DO LEN TIMES.
      LEN = LEN - 1 .
      IF ( C+LEN(1) EQ '0' ) .
        C+LEN(1) = ' ' .
        FLAG = 1 .
      ELSE.
        IF FLAG = 1 .
          EXIT .
        ENDIF .
      ENDIF .
    ENDDO.
    CONDENSE C NO-GAPS.
    WRITE C.
    Reward if helpful.
    Regards,
    Sandhya

  • How can i retain the trailing zeroes after decimal

    how can i retain the trailling zeros after decimal?
    values are showing in table like( 4.50,5.00) but i am trying to do some processing with these values then ithe zeroes are truncated like (4.5,5),
    how can i get values with zeroes

    If the values in the table have trailing zeroes, it's a character type column.
    Once you perform operations on them, they're implicitely converted to the number type, hence "losing" trailing zeroes.
    To get the trailing zeroes back, you have to convert them back to character data:
    TO_CHAR(1.5*3, '90d99')Have fun,
    K.

  • How to keep the filtered output in a page after user navigates back?

    How to keep the filtered output in a page after user navigates back to all records from another page.
    Currently it clears the search

    Hi,
    user13091824 wrote:
    How to keep the filtered output in a page after user navigates back to all records from another page.
    Currently it clears the search---While returing from page AM Return status should be True in pageContext.setForwardURL.:::
    pageContext.setForwardURL("OA.jsp?page=/XXX/oracle/apps/po/msg/webui/SearchPG",
    "SUPP_SEARCH",
    OAWebBeanConstants.GUESS_MENU_CONTEXT,
    null,
    null,
    true, // Retain AM
    OAWebBeanConstants.ADD_BREAD_CRUMB_NO,
    OAWebBeanConstants.IGNORE_MESSAGES);
    ---After setting AM Status to true u can able to c the values.
    Regards
    Meher Irk

  • How to keep the current http session after returning from external web site

    Hi,
    When I use the response.sendRedirect api to redirect the web page to the external payment site, after payment and return back to the current application, I found that the current http session is lost.
    How to keep the current http session after returning from external web site?
    Thanks

    You should make your sidebar1 and sidebar2 fixed positioned. Make your content DIV fluid.
    This should help you: http://www.glish.com/css/7.asp

  • Eliminating zeroes after decimal

    HI all,
      I have a requirement to delete the trailing zeroes after decimal.
      It is a interest rate and it is denoted in EUR.
      i.e the number is 0,739000 % Internal declaration of this number is in DEC.
      the data type is AZINSSATZ.
    i want it to be displayed as 0,739 %
    How can i eliminate these zeroes?
    Thanx in Advance
    Regards,
    Hamsa Priya

    Hi Hamsa Priya,
    To remove leading zeros and leading blanks
    Please use FM
    CONVERSION_EXIT_ALPHA_INPUT Conversion exit ALPHA, external->internal
    CONVERSION_EXIT_ALPHA_OUTPUT Conversion exit ALPHA, internal->external
    Ex :
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
                EXPORTING
                  input  = wf_version
                IMPORTING
                  output = wf_version.
    Hope this resolves your query.
    Reward all the helpful answers.
    Regards

  • To Remove zeroes after decimal in screen field

    I need to remove the zeroes after a decimal like for a field of the type VBAP-KWMENG the is shown as 200.000 i need to show it as 200.I have to display this value inside a Table Control.

    hi,
    you can user "write to" statement with formating option.
    In your case,
    write  VBAP-KWMENG to l_var1 DECIMALS 0.
    so you will get l_var1 without any decimals and now you can populate this variable in your control.
    Please reward points if you find it useful.
    Regards,
    Jigs.

  • HT202213 how to keep the songs on your iphone

    i have itunes home sharing i would like to know how to keep the songs on your iphone after you turn home sharing off or get out of range.

    You sync them via iTunes.
    You canot copy them to the iPhone using Home Sharing.

  • Suppressing zeroes after decimal

    Hi
    I need to suppress the zeroes after the decimal places in my form output if 00 appears after decimal.
    eg 123.00 shd be displayed as 123 .
         123.23 shd be dispalyed as 123.23.
    Could anyone help me with this
    TIA
    Regards

    hi Ankur do this way
    data: wa_input  type i,     
          wa_output type i.
    wa_input = '1.000'.
    CALL FUNCTION 'ROUND' 
      EXPORTING   
        INPUT              = wa_input
      IMPORTING  
        OUTPUT             = wa_output
      EXCEPTIONS
       INPUT_INVALID       = 1
       OVERFLOW            = 2
       TYPE_INVALID        = 3
       OTHERS              = 4.
    IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    * WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    write:/ wa_output.

Maybe you are looking for

  • Icloud storage purchase...

    So I got 25 gigabytes (5 free and 20 for 40$) in May and now the same amount would cost $12? ..... Does the 20 Gig for 0.99 a month actually give you 25 or just 20 Gig??   If it is 25 Gig, is there any way to get the current pricing??? 

  • CRM survey - FM , methods  :-)

    hi, anyone has any experience with CRM survey interfaces? if there any way to update data in them via <b>Function modules</b> or object <b>methods </b>? thanks for any help (names of modules, code samples etc.) Regards, michal

  • Cannot mount external drives

    Hi all! I have an 2010 imac i5 32GB RAM, running on 10.9.2. All of a sudden my machine does not mount ANY extrenal hard drive. It recognises them in Disk Utility, but they appear greyed and cannot be mounted. Not even disk repair. Last week though th

  • What has happened to the zoom feature in the iPhone photos?

    I recently updated my i-Phone software, and now I can no longer find the zoom bar when I try to take a photo.  It used to appear when the screen was tapped.  Can someone tell me if there is a new way to access zoom, or is that no longer possible?

  • HI REGORDING BDC URGENT

    HI EXPERTS CAN U HELP ME FOR THIS <b>IF  SUPPOSE THERE ARE 10 RECORDS IN FLATFILE THEN HOW MANY TIMES BDC_OPEN_GROUP.BDC_INSERT,BDC_CLOSE_GROUP EXCUTED </b>