Problem with decimal numbers..

hi i posted the other day with a problem I had. I thought it was all sorted but I have just realised that there is another problem.
I have the following code for an applet:
import java.applet.*;
import java.awt.*;
import java.awt.event.*;
public class TextFieldExample extends Applet implements ActionListener {
TextField textInput;
String text = "";
public void init() {
textInput = new TextField (20);
add(textInput);
textInput.addActionListener(this);
public void actionPerformed(ActionEvent e) {
text = textInput.getText();
repaint();
public void paint(Graphics g) {
     int x = Integer.parseInt(text);
     double y = Math.abs(x);
g.drawString("You wrote " + text,20,500);
     g.drawString("The absolute value is: " + y,20,100);
I am trying to do the applet so when you type in an angle, it tell you the sine, cosine etc. I can get it to work with whole numbers like 1,10,300, but it won't work when i try to use decimal numbers. Can anyone help?
Thnk you in advance!
     

Hi,
you are using Integer.parseInt() to convert the input, so it will only work if the text is an integer. Use Double.parseDouble() instead.
Andre

Similar Messages

  • Application Express 3.1 + BI-Publisher + problem with formating numbers

    Hello together!
    I use the Oracle BI Publisher Template Builder for Word (10.1.3.4) to generate RTF-Templates. I upload these templates in Oracle Apex (Advanced support-->BI-Publisher/OC4J as print service).
    It works well, but I have a problem with formating numbers.
    In Template Builder I define following number formats, for example: #.##0 for numbers like 1.454.234 and #.##0,00 for numbers like 54,80
    In Template-Builder Preview it looks well.
    But whatever I do, in use with Oracle Apex dots and comma are allready interchances in the printout.
    That means,
    1.454.234 become 1,454,234 in PDF-Report
    54,80 become 54.80 in PDF-Report
    Other than that, the layout is exactly the same like in Template Builder defined.
    What's wrong?
    Do I have to change any country parameter?
    Juliane

    I also had the same problem. I tried with normal formating of 99g99g999d99 instead of ##,##,##0.00 and it has resulted correct way.

  • Problem with page numbering in Acrobat XI Pro

    Hello community,
    I got a problem with page numbering with certain documents in Acrobat XI Pro.
    The next error comes up:
    Translated in English:
    There is an error occured when getting up of page-content.
    This is occured with certain pdf-documents (i cannot uploading this file).
    Is someone have similar problem, or has someone hev a sollution for this?
    Greetings,
    Bart

    This usually means the file is corrupt, probably because it was not created
    using a standard application like Adobe Acrobat.

  • Problem with decimal

    Hi Experts,
    I'm having a problem with decimal.
    I have a alv data grid that can be edited.Once I press enter the value for the decimal fields are changed.
    Example: If i input 5.00 in the field then I press enter it converts it to 0.05
    And If I input 2.01 in the field it shows an error Too many decimal places(Maximum 0)
    DATA INPUT for my internal table:
    DATA: BEGIN OF it_data OCCURS 0,
       docno LIKE zit_haul_line-docno,
       line  LIKE zit_haul_line-line,
       eqpno LIKE zit_haul_line-eqpno,
       rpt LIKE zit_haul_line-rpt,
       notrip LIKE zit_haul_line-notrip,
       trc LIKE zit_haul_line-trc,
       escfee LIKE zit_haul_line-escfee,
       tollfee LIKE zit_haul_line-tollfee,
       repr LIKE zit_haul_line-repr,
       others LIKE zit_haul_line-others,
       tba LIKE zit_haul_line-tba,
       dik LIKE zit_haul_line-dik,
       locorg LIKE zit_haul_line-locorg,
       locdes LIKE zit_haul_line-locdes,
    END OF it_data.
    DATA: wa_data LIKE it_data.
    Here is my code in change ALV Change.
    FORM data_changed USING ir_data_changed TYPE REF TO cl_alv_changed_data_protocol.
       DATA ls_modi TYPE lvc_s_modi.
       DATA: ratepertrip LIKE zit_haul_line-rpt,
             nooftrip LIKE zit_haul_line-notrip,
             lv_value TYPE lvc_value ,
             totalrent LIKE zit_haul_line-trc,
             escortfee LIKE zit_haul_line-escfee,
             tollfee LIKE zit_haul_line-tollfee,
             represent LIKE zit_haul_line-repr,
             others LIKE zit_haul_line-others,
             lv_value1 TYPE lvc_value,
             totalbill LIKE zit_haul_line-tba.
       DATA: eqpno LIKE equi-equnr,
             gv_equnr LIKE equi-equnr.
    * Check each modification:
       LOOP AT ir_data_changed->mt_mod_cells INTO ls_modi.
          CASE ls_modi-fieldname.
           WHEN 'EQPNO'.
             CONDENSE ls_modi-value.
             SELECT SINGLE equnr
               INTO gv_equnr
               FROM equi
               WHERE equnr EQ ls_modi-value.
             IF sy-subrc NE 0.
               CALL METHOD ir_data_changed->add_protocol_entry
                 EXPORTING
                   i_msgid     = '00'
                   i_msgty     = 'E'
                   i_msgno     = '398'
                   i_msgv1     = 'Equipment Number does not exist:'
                   i_msgv2     = ls_modi-value
                   i_msgv3     = ''
                   i_msgv4     = ''
                   i_fieldname = ls_modi-fieldname
                   i_row_id    = ls_modi-row_id.
             ENDIF.
         ENDCASE.
       CALL METHOD ir_data_changed->get_cell_value
         EXPORTING i_row_id = ls_modi-row_id
         i_fieldname = 'RPT'
         IMPORTING e_value = ratepertrip.
       CALL METHOD ir_data_changed->get_cell_value
         EXPORTING i_row_id = ls_modi-row_id
         i_fieldname = 'NOTRIP'
         IMPORTING e_value = nooftrip.
       CLEAR totalrent.
         ls_modi-fieldname = 'TRC'.
         IF ratepertrip = ''.
           ratepertrip = 1.
         ELSEIF nooftrip = ''.
           nooftrip = 1.
         ENDIF.
         totalrent = ratepertrip * nooftrip.
         CALL METHOD ir_data_changed->modify_cell
           EXPORTING i_row_id = ls_modi-row_id
           i_fieldname = ls_modi-fieldname
           i_value = totalrent.
       CALL METHOD ir_data_changed->get_cell_value
         EXPORTING i_row_id = ls_modi-row_id
         i_fieldname = 'ESCFEE'
         IMPORTING e_value = escortfee.
       CALL METHOD ir_data_changed->get_cell_value
         EXPORTING i_row_id = ls_modi-row_id
         i_fieldname = 'TOLLFEE'
         IMPORTING e_value = tollfee.
       CALL METHOD ir_data_changed->get_cell_value
         EXPORTING i_row_id = ls_modi-row_id
         i_fieldname = 'REPR'
         IMPORTING e_value = represent.
       CALL METHOD ir_data_changed->get_cell_value
         EXPORTING i_row_id = ls_modi-row_id
         i_fieldname = 'OTHERS'
         IMPORTING e_value = others.
       CLEAR totalbill.
         ls_modi-fieldname = 'TBA'.
         totalbill = escortfee + tollfee + represent + others.
         totalbill = totalrent + totalbill.
         CALL METHOD ir_data_changed->modify_cell
           EXPORTING i_row_id = ls_modi-row_id
           i_fieldname = ls_modi-fieldname
           i_value = totalbill.
       ENDLOOP.
    ENDFORM.                    "data_changed

    Hi,
    Can you check my code. I've tried changing the data types of my internal table and my output is stll same when I press enter.
    The output should be 2.00 3.00 5.00 7.00
    Also if I enter 12345.00 the output should be 12,345.00.
    Thank you so much for the help.
    * ALV required data objects.
    TYPE-POOLS: sdydo, icon, slis.
    DATA: w_title     TYPE lvc_title,
           w_repid     TYPE sy-repid,
           w_comm      TYPE slis_formname,
           w_status    TYPE slis_formname,
           x_layout    TYPE slis_layout_alv,
           ls_events   TYPE LINE OF slis_t_event,
           t_events    TYPE slis_t_event,
           t_fieldcat  TYPE slis_t_fieldcat_alv,
           x_sort      type LINE OF slis_t_sortinfo_alv,
           t_sort      TYPE slis_t_sortinfo_alv,
           ls_heading  TYPE slis_listheader,
           t_heading   TYPE slis_t_listheader,
           ls_fieldcat TYPE slis_fieldcat_alv,
           gs_variant  LIKE disvariant,
            gt_events            TYPE slis_t_event,
            gs_events            TYPE slis_alv_event.
    DATA:
       wa_layout     TYPE slis_layout_alv,
       wa_events         TYPE slis_alv_event,
       wa_sort TYPE slis_sortinfo_alv.
    TYPES: BEGIN OF t_header,
            line01(555) TYPE c,
            line02(555) TYPE c,
            END OF t_header.
    DATA: is_print TYPE slis_print_alv,
           gset TYPE lvc_s_glay,
           %runmode TYPE aqlimode.
    data: it_sortcat   type slis_sortinfo_alv occurs 1.
    DATA: gw_header  TYPE t_header.
    " END OF ALV DATA
    "========================================================================================================================
    DATA: BEGIN OF it_data OCCURS 0,
       docno LIKE zit_haul_line-docno,
       line  LIKE zit_haul_line-line,
       eqpno LIKE zit_haul_line-eqpno,
       rpt TYPE p DECIMALS 2,  "LIKE zit_haul_line-rpt,
       notrip TYPE p DECIMALS 2,
       trc TYPE p DECIMALS 2,
       escfee TYPE p DECIMALS 2,
       tollfee TYPE p DECIMALS 2,
       repr TYPE p DECIMALS 2,
       others TYPE p DECIMALS 2,
       tba TYPE p DECIMALS 2,
       dik LIKE zit_haul_line-dik,
       locorg LIKE zit_haul_line-locorg,
       locdes LIKE zit_haul_line-locdes,
    END OF it_data.
    DATA: wa_data LIKE it_data.
    DATA: it_modified TYPE STANDARD TABLE OF zit_haul_line WITH HEADER LINE.
    DATA: wa_modified TYPE STANDARD TABLE OF zit_haul_line WITH HEADER LINE.
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME.
    PARAMETERS: r_create RADIOBUTTON GROUP rad1  USER-COMMAND a DEFAULT 'X'.
       SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME.
       PARAMETERS: r_proj RADIOBUTTON GROUP rad2 MODIF ID A.
       PARAMETERS: r_cost RADIOBUTTON GROUP rad2 MODIF ID A.
       SELECTION-SCREEN END OF BLOCK b2.
    PARAMETERS: r_post RADIOBUTTON GROUP rad1.
    PARAMETERS: r_rev RADIOBUTTON GROUP rad1.
       SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME.
         PARAMETERS: p_docno LIKE mseg-belnr MODIF ID B,
                     p_post LIKE sy-datum MODIF ID B.
       SELECTION-SCREEN END OF BLOCK b3.
    SELECTION-SCREEN BEGIN OF BLOCK b4 WITH FRAME.
    PARAMETERS: p_trand LIKE sy-datum,
                 p_cost LIKE csks-kostl,
                 p_proj TYPE string,
                 p_wbs TYPE string,
                 p_nwa TYPE string.
    SELECTION-SCREEN END OF BLOCK b4.
    SELECTION-SCREEN END OF BLOCK b1.
    AT SELECTION-SCREEN OUTPUT.
    LOOP AT SCREEN.
       IF r_create = 'X'.
         IF screen-group1 = 'A'.
            screen-active = 1.
         ENDIF.
       ELSE.
         IF screen-group1 = 'A'.
            screen-active = 0.
         ENDIF.
       ENDIF.
       IF r_post = 'X' OR r_rev = 'X'.
         IF screen-group1 = 'B'.
            screen-active = 1.
         ENDIF.
       ELSE.
         IF screen-group1 = 'B'.
            screen-active = 0.
         ENDIF.
       ENDIF.
       MODIFY SCREEN.
    ENDLOOP.
    START-OF-SELECTION.
    PERFORM get_data.
    PERFORM display_report.
    FORM get_data.
    it_data-line = '001'.
    APPEND it_data.
    it_data-line = '002'.
    APPEND it_data.
    it_data-line = '003'.
    APPEND it_data.
    it_data-line = '004'.
    APPEND it_data.
    it_data-line = '005'.
    APPEND it_data.
    it_data-line = '006'.
    APPEND it_data.
    it_data-line = '007'.
    APPEND it_data.
    it_data-line = '008'.
    APPEND it_data.
    it_data-line = '009'.
    APPEND it_data.
    it_data-line = '010'.
    APPEND it_data.
    ENDFORM.
    "ALV DISPLAY ====================================================================================================================================
    "&      Form  PF_WRITE_FIELDCAT
    *&      Form  pf_write_fieldcat
    *       text
    *      -->FNAME      text
    *      -->TNAME      text
    *      -->TEXT       text
    *      -->LEN        text
    FORM pf_write_fieldcat  USING fname
                                   tname
                                   text
                                   len
                                   edt.
    *                              key
    *                              sum.
       ls_fieldcat-fieldname     = fname.
       ls_fieldcat-tabname       = tname.
       ls_fieldcat-seltext_l     = text.
       ls_fieldcat-outputlen     = len.
    *  ls_fieldcat-key           = key.
    *  ls_fieldcat-do_sum        = sum.
       ls_fieldcat-edit = edt.
       IF len = '0'.
         ls_fieldcat-outputlen     = '1'.
         ls_fieldcat-no_out = 'X'.
       ENDIF.
       APPEND ls_fieldcat TO t_fieldcat.
       CLEAR ls_fieldcat.
    *  To set ENTER Event!
       gs_events-name = 'CALLER_EXIT'.
       gs_events-form = 'CALLER_EXIT'.
       APPEND gs_events TO gt_events.
    *   To change the ALV Changed Protocoll
       gs_events-name = 'DATA_CHANGED'.
       gs_events-form = 'DATA_CHANGED'.
       APPEND gs_events TO gt_events.
    ENDFORM.                    " PF_WRITE_FIELDCAT
    *&      Form  display_report
    FORM display_report.
       is_print-no_print_selinfos = 'X'.
       is_print-no_print_listinfos = 'X'.
       is_print-print_ctrl = 'X'.
       PERFORM pf_write_fieldcat USING:
    *  'DOCNO'                  'IT_DATA'  'Line'                   ' ' '',
       'LINE'                  'IT_DATA'  'Line'                   ' ' '',
       'EQPNO'                 'IT_DATA'  'Equipment No.'          ' ' 'X',
       'RPT'           'IT_DATA'  'Rate per Trip'          ' ' 'X',
       'NOTRIP'              'IT_DATA'  'No of Trip'             ' ' 'X',
       'TRC'             'IT_DATA'  'Total Rental Charges'   ' ' '',
       'ESCFEE'             'IT_DATA'  'Escort Fee'             ' ' 'X',
       'TOLLFEE'               'IT_DATA'  'Toll Fee'               ' ' 'X',
       'REPR'             'IT_DATA'  'Representation'         ' ' 'X',
       'OTHERS'                'IT_DATA'  'Others'                 ' ' 'X',
       'TBA'               'IT_DATA'  'Total Billable Amount'  ' ' '',
       'DIK'              'IT_DATA'  'Distance in KM'         ' ' 'X',
       'LOCORG'             'IT_DATA'  'Location Origin'        ' ' 'X',
       'LOCDES'             'IT_DATA'  'Location Destination'   ' ' 'X'.
    * Layout
       x_layout-zebra = 'X'.
       x_layout-no_keyfix = ' '.
       x_layout-colwidth_optimize = 'X'.
    * GUI Status
       w_status = 'SET_PF_STATUS'.
       w_repid = sy-repid.
    * User commands
       w_comm = 'USER_COMMAND'.
    *  gs_variant-variant = p_var1.
    *  gs_variant-handle  = space.
    *  gs_variant-report  = sy-repid.
       gs_variant-report  = sy-repid.
       gs_variant-username = sy-uname.
       gset-no_colwopt = 'X'.
    * Displays the ALV grid
       CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
         EXPORTING
           i_callback_program = sy-repid
           it_fieldcat        = t_fieldcat
           is_layout          = x_layout
           "it_sort            = t_sort
           it_sort                 = it_sortcat
    *      i_callback_pf_status_set = w_status
           "i_callback_user_command  = w_comm
           I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
    *      i_callback_html_top_of_page  = 'TOP_OF_PAGE'
           i_callback_top_of_page  = 'TOP-OF-PAGE'
    *      i_callback_html_end_of_list = 'END-OF-PAGE'
           is_variant         = gs_variant
           i_save             = 'A'
           is_print           = is_print
           it_events          = gt_events
    *      i_grid_title       = w_title
         TABLES
           t_outtab           = IT_DATA
         EXCEPTIONS
           program_error      = 1
           OTHERS             = 2.
    ENDFORM.                    " display_report
    FORM data_changed USING ir_data_changed TYPE REF TO cl_alv_changed_data_protocol.
       DATA ls_modi TYPE lvc_s_modi.
       DATA: ratepertrip LIKE zit_haul_line-rpt,
             nooftrip LIKE zit_haul_line-notrip,
             lv_value TYPE lvc_value ,
             totalrent LIKE zit_haul_line-trc,
             escortfee LIKE zit_haul_line-escfee,
             tollfee LIKE zit_haul_line-tollfee,
             represent LIKE zit_haul_line-repr,
             others LIKE zit_haul_line-others,
             lv_value1 TYPE lvc_value,
             totalbill LIKE zit_haul_line-tba.
       DATA: eqpno LIKE equi-equnr,
             gv_equnr LIKE equi-equnr.
    * Check each modification:
       LOOP AT ir_data_changed->mt_mod_cells INTO ls_modi.
          CASE ls_modi-fieldname.
           WHEN 'EQPNO'.
             CONDENSE ls_modi-value.
             SELECT SINGLE equnr
               INTO gv_equnr
               FROM equi
               WHERE equnr EQ ls_modi-value.
             IF sy-subrc NE 0.
               CALL METHOD ir_data_changed->add_protocol_entry
                 EXPORTING
                   i_msgid     = '00'
                   i_msgty     = 'E'
                   i_msgno     = '398'
                   i_msgv1     = 'Equipment Number does not exist:'
                   i_msgv2     = ls_modi-value
                   i_msgv3     = ''
                   i_msgv4     = ''
                   i_fieldname = ls_modi-fieldname
                   i_row_id    = ls_modi-row_id.
             ENDIF.
         ENDCASE.
       CALL METHOD ir_data_changed->get_cell_value
         EXPORTING i_row_id = ls_modi-row_id
         i_fieldname = 'RPT'
         IMPORTING e_value = ratepertrip.
       CALL METHOD ir_data_changed->get_cell_value
         EXPORTING i_row_id = ls_modi-row_id
         i_fieldname = 'NOTRIP'
         IMPORTING e_value = nooftrip.
       CLEAR totalrent.
         ls_modi-fieldname = 'TRC'.
         IF ratepertrip = ''.
           ratepertrip = 1.
         ELSEIF nooftrip = ''.
           nooftrip = 1.
         ENDIF.
         totalrent = ratepertrip * nooftrip.
         CALL METHOD ir_data_changed->modify_cell
           EXPORTING i_row_id = ls_modi-row_id
           i_fieldname = ls_modi-fieldname
           i_value = totalrent.
       CALL METHOD ir_data_changed->get_cell_value
         EXPORTING i_row_id = ls_modi-row_id
         i_fieldname = 'ESCFEE'
         IMPORTING e_value = escortfee.
       CALL METHOD ir_data_changed->get_cell_value
         EXPORTING i_row_id = ls_modi-row_id
         i_fieldname = 'TOLLFEE'
         IMPORTING e_value = tollfee.
       CALL METHOD ir_data_changed->get_cell_value
         EXPORTING i_row_id = ls_modi-row_id
         i_fieldname = 'REPR'
         IMPORTING e_value = represent.
       CALL METHOD ir_data_changed->get_cell_value
         EXPORTING i_row_id = ls_modi-row_id
         i_fieldname = 'OTHERS'
         IMPORTING e_value = others.
       CLEAR totalbill.
         ls_modi-fieldname = 'TBA'.
         totalbill = escortfee + tollfee + represent + others.
         totalbill = totalrent + totalbill.
         CALL METHOD ir_data_changed->modify_cell
           EXPORTING i_row_id = ls_modi-row_id
           i_fieldname = ls_modi-fieldname
           i_value = totalbill.
       ENDLOOP.
    ENDFORM.                    "data_changed
    FORM caller_exit USING is_data TYPE slis_data_caller_exit.
    * Switch to OO_ALV:
       DATA: lr_alv TYPE REF TO cl_gui_alv_grid.
       CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
         IMPORTING
           e_grid = lr_alv.
    * Register ENTER as edit event:
       CALL METHOD lr_alv->register_edit_event
         EXPORTING
           i_event_id = cl_gui_alv_grid=>mc_evt_enter.
    * pls. use MC_EVT_MODIFIED if leaving the cell should trigger the edit event!
    ENDFORM. "CALLER_EXIT
    *&      Form  TOP-OF-PAGE
    *       text
    FORM top-of-page.
    *ALV Header declarations
       DATA: t_header TYPE slis_t_listheader,
             wa_header TYPE slis_listheader,
             t_line LIKE wa_header-info,
             ld_lines TYPE i,
             ld_linesc(10) TYPE c.
       DATA: text TYPE sdydo_text_element,
             a_right   TYPE REF TO cl_dd_area.
       DATA: tran TYPE string,
             send TYPE string,
             wbs TYPE string,
             nwa TYPE string.
       text = 'Create Hauling Charges for Project'.
       wa_header-typ  = 'S'.
       wa_header-info = text.
       APPEND wa_header TO t_header.
       CLEAR: wa_header.
       gw_header-line01 = text.
       CONCATENATE 'Transaction Date: ' p_trand INTO tran SEPARATED BY space.
       text = tran.
       wa_header-typ  = 'S'.
       wa_header-info = text.
       APPEND wa_header TO t_header.
       CLEAR: wa_header.
       gw_header-line01 = text.
       CONCATENATE 'Sender Cost Center: ' p_cost INTO send SEPARATED BY space.
       text = send.
       wa_header-typ  = 'S'.
       wa_header-info = text.
       APPEND wa_header TO t_header.
       CLEAR: wa_header.
       gw_header-line01 = text.
       CONCATENATE 'Receiver WBS: ' p_wbs INTO wbs SEPARATED BY space.
       text = wbs.
       wa_header-typ  = 'S'.
       wa_header-info = text.
       APPEND wa_header TO t_header.
       CLEAR: wa_header.
       gw_header-line01 = text.
       CONCATENATE 'Receiver Network and NWA: ' p_nwa INTO nwa SEPARATED BY space.
       text = nwa.
       wa_header-typ  = 'S'.
       wa_header-info = text.
       APPEND wa_header TO t_header.
       CLEAR: wa_header.
       gw_header-line01 = text.
       CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
         EXPORTING
           it_list_commentary = t_header.
    ENDFORM.                    "top-of-page
    FORM pf_set_top_page_heading  USING typ
                                         key
                                         info.
       ls_heading-typ = typ.
       ls_heading-key = key.
       ls_heading-info = info.
       APPEND ls_heading TO t_heading.
    ENDFORM.                    " PF_SET_TOP_PAGE_HEADING
    *&      Form  PF_SET_TOP_PAGE_EVENTS
    FORM pf_set_top_page_events  USING name
                                        form.
       ls_events-name = name.
       ls_events-form = form.
       APPEND ls_events TO t_events.
       CLEAR ls_events.
    ENDFORM.                    " PF_SET_TOP_PAGE_EVENTS
    *&      Form  REUSE_ALV_GET_VARIANT
    FORM reuse_alv_get_variant
       USING    value(iv_repid)   TYPE  sy-repid
                value(iv_handle)  TYPE  slis_handl
       CHANGING iv_variant        TYPE  disvariant-variant.
       DATA: lv_exit(1) TYPE c,
             ls_variant TYPE disvariant.   " Structure for Variant
       MOVE: iv_variant TO ls_variant-variant,
             iv_handle  TO ls_variant-handle,
             iv_repid   TO ls_variant-report.
       CALL FUNCTION 'REUSE_ALV_VARIANT_F4'
         EXPORTING
           is_variant    = ls_variant
           i_save        = 'A'
         IMPORTING
           e_exit        = lv_exit
           es_variant    = ls_variant
         EXCEPTIONS
           not_found     = 1
           program_error = 2
           OTHERS        = 3.
       IF sy-subrc <> 0.
         MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                 WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
       ENDIF.
       IF lv_exit = space.
         MOVE ls_variant-variant TO iv_variant.
       ENDIF.
    ENDFORM.                    " REUSE_ALV_GET_VARIANT                 "
    FORM user_command USING w_ucomm LIKE sy-ucomm
    rs_selfield TYPE slis_selfield.
    CASE w_ucomm.
    WHEN '&DATA_SAVE'.
    *  READ TABLE it_data INTO wa_data." INDEX rs_selfield-tabindex.
       DELETE it_data WHERE eqpno IS INITIAL.
       LOOP AT it_data INTO wa_data.
         CONDENSE wa_data-eqpno.
         MOVE-CORRESPONDING wa_data TO wa_modified.
         APPEND wa_modified TO it_modified.
       ENDLOOP.
       MODIFY zit_haul_line FROM TABLE it_modified.
    ENDCASE.
    ENDFORM. "user_command

  • Problem with decimal point in Korea and Japan

    Hi all,
    I have one problem with decimal points.
    I need to change in my out put cuurency values as per japan or korea standards.
    Please help me is there any function module for this one.
    program using alv grid display.
    i use write statement but it is not working. Because
    data: L_AMT  type glpca-hsl,
             G_AMT  TYPE CHAR15.
    CURR this value is 'JPY'.
    WRITE L_AMT CURRENCY CURR TO G_AMT.
    here i need to do
    L_AMT = G_AMT.   "" going to runtime error.
    if i taken like
    data: L_AMT  TYPE CHAR15,
             G_AMT  TYPE CHAR15.
    CURR this value is 'JPY'.
    WRITE L_AMT CURRENCY CURR TO G_AMT.   "" it is not working
    Regards
    margani

    Hello,
    This is pretty basic, whenever you've currency & quantity fields you need to pass the corres. reference fields.
    In your case you need to populate the cfieldname & ctabname fields of the FieldCat.
    BR,
    Suhas

  • Problems with decimal places and formatting

    Hi , we are having problems with an add on running on different localization companies. Decimal places separatd by "," differ from other localizations. We dont know if this is a SQL collation setting or somethng related to code or requirements to run add ons on different servers and languages.
    Any ideas??
    Thanks

    Hello
    Follow up with this thread:
    [Re: How to get the numeric value of DocTotal from UI API]
    Regards,
    J.

  • Problem with decimal in Japan currency

    Hi Gurus,
    I have a problem with Japan currency that when When i take the printout of  document with JPY 5,168,277 it is wrongly printing as 51,682.77 but in document  display it is showing correclty as 5,168,277.  But when i check this in BSEG  table it was wrong updated as 51,682.77 (WRBTR field) i hope it is picking the amount from this field for printing .
    For the above i made changes in OY01  but i find there was no use.
    In OY01 the decimal place setting is 1,234,567.89 the middle one of the three.
    When i post the same amount to japan co code in currency JPY and if i check in BSEG table
    Amount in LC                                      51,682.77
    Amount          (WRBTR)                       51,682.77
    Orig.reduction                                      0.00
    G/L amount                                         5,168,277
    When i post the same amount in non japan co code in JPY Currency and check in BSEG(area where i am facing problem)
    Amount in LC                                      47,550.22
    Amount          (WRBTR)                       51,682.77
    Orig.reduction                                      0.00
    G/L amount                                         5,168,277
    Please tell me how to correct this.

    May ne u can check this OSS note also 137626
    Summary
    Symptom
    1. Which currencies have to be defined separately with regard to the number of decimal places?
    2. What do I need to observe when maintaining decimal places for currencies?
    3. Which Customizing presettings does SAP deliver in table TCURX (decimal places for currency codes)?
    4. Does SAP deliver the Customizing presettings of decimal places for currency codes (Table TCURX) for upgrade installations?
    5. Which information does SAP use for the specification of these Customizing presettings?
    Solution
    1. question: Which currencies have to be defined separately with
                regard to the number of decimal places?
    Answer:
    The number of decimal places can vary for currencies. Currencies which do not have two decimal places must be defined in table TCURX (decimal places for currency codes).
    You can maintain this table via the R/3 Implementation Guide (Global Settings -> Currencies, Transaction OY04).
    If a currency is not defined in Table TCURX (decimal places for currency codes), this currency is regarded as currency with two decimal places.
    2. question: What do I need to observe when maintaining decimal places
                for currencies?
    Answer:
    During operation, you must neither delete currencies used nor change their definition of decimal places. Amounts in posted documents could become invalid or incorrect as a result.
    3. question: Which Customizing presettings does SAP deliver in table
                TCURX (decimal places for currency codes) ?
    Answer
    At present, SAP delivers the following Customizing presettings for table TCURX:
    ISO Currency Decimal places
    Code
    ADP   Andoran Peseta                            0
    AFA   Afghani  Afghani                          0
    BEF   Belgian franc                             0
    BHD   Bahraini dinar                            3
    BIF   Burundi franc                             0
    BYB   Belorussian rubel (old)                   0
    BYR   Belorussian rubel (new)                   0
    CLP   Chilean peso                              0
    COP   Columbian peso                            0
    DEM3  (Internal) German Mark (3 Dec.)           3
    DJF   Djibouti franc                            0
    ECS   Ecuadorian sucre                          0
    ESP   Spanish peseta                            0
    GNF   Guinea franc                              0
    GRD   Greek drachma                             0
    HUF   Hungarian forint                          0
    IDR   Indonesian rupiah                         0
    IQD   Iraqui dinar                              3
    ITL   Italian lira                              0
    JOD   Jordan dinar                              3
    JPY   Japanese yen                              0
    KMF   Comoros franc                             0
    KRW   South Korean won                          0
    KWD   Kuwaiti dinar                             3
    LAK   Laos new kip                              0
    LUF   Luxembourg franc                          0
    LYD   Libyan dinar                              3
    MGF   Madagascan franc                          0
    MZM   Mozambique metical                        0
    OMR   Omani rial                                3
    PTE   Portugese escudo                          0
    PYG   Paraguay guarani                          0
    ROL   Roumanian Lei                             0
    RWF   Rwanda franc                              0
    TJR   Tadzhikistani rubel                       0
    TMM   Turkmenistani manat                       0
    TND   Tunesian dinar                            3
    TPE   Timor escudo                              0
    TRL   Turkish lira                              0
    TWD   New Taiwan dollar                         0
    UGX   Uganda shilling                           0
    USDN  (Internal) US Dollar (5 dec.pl.)          5
    VND   Vietnamese dong                           0
    VUV   Vanuata vatu                              0
    XAF   CFA Franc BEAC                            0
    XOF   CFA Franc BCEAO                           0
    XPF   CFP Franc                                 0
    4. question: Does SAP deliver the Customizing presettings of decimal
                places for currency codes (Table TCURX) for upgrade
                 installations?
    Antwort
    Table TCURX (decimal places for currency codes) is a client-independent table of the delivery class "C" (Customizing table). Therefore the table contents for this table can only be delivered with new installations.
    For upgrade installations, new or changed contents of Table TCURX are not delivered.
    5. question: Which information does SAP use for the specification of
                 these Customizing presettings?
    Answer
    Currency codes and decimal places for currency codes are defined in ISO standard 4217. For the specification of decimal places for currency codes, SAP uses this ISO standard.
    For some currencies, for example, for the "Turkish lira", the decimal places which are used in reality deviate from the ISO definition. In many of these cases, SAP decided to adhere to the definitions generally used.
    Example:
    ISO standard 4217 defines two decimal places for the Turkish lira (TRL), however in reality zero decimal places are being used for the Turkish lira. SAP delivers zero decimal places as Customizing presetting for "Turkish lira".
    Header Data
    Release Status: Released for Customer
    Released on: 14.08.2007  13:12:09
    Priority: Recommendations/additional info
    Category: FAQ
    Primary Component: XX-CSC-XX Country specific Customizing & Functionality (Standard R/3)
    Secondary Components: FI Financial Accounting
    Releases
    Release Independant
    Related Notes
    434349 - Change of decimal places of currencies
    126531 - Collective note preliminary availability Colombia
    Print Selected Notes (PDF)

  • Problem with decimal fields using BADI For PD Infotypes

    Hi,
    I'm implementing BADI  HRBAS00INFTY.
    For reading the fields of infotype , I'm using the substring
    of the field NEW_INNNN-VDATA .
    I have a problem with fields of type DEC.
    In field NEW_INNNN-VDATA it looks like this :  '####'
    I believe that the possible reason for this is conversion from DEC to CHAR
    But I don't know how to fix it.
    Thank you .
    Message was edited by: Alon Lozinsky

    Hi Alon,
    We had same issue. Use following code.
    data: hri1011_str type hri1011.
    move new_innnn-vdata to hri1011_str.
    HRI1011_STR fields will have decimal values.
    Let me know if you still have any issues. If solution works, kindly do Point Recognition.
    -Bharat

  • Problems with line numbers (building via ant).

    We use ant for our builds and are having a problem with getting line numbers into call stacks. When running on linux we do not get the lines for our projects (not all projects have debug option), just (Unknown Source), however we do see line numbers for the tib jars. Eclipse is fine, we can see all line numbers as appropriate.
    I have tried "lines", "lines,source" and "lines,var,source" - all build a different sized jar which suggest something is getting added. However as we see line nums for tib it suggests it's some strange java runtime option. We're using sunjdk 1.5.10 and also jrockit.
    Any ideas/answers most appreciated.
    Many thanks, Declan
    Ant task
    <target name="compile" depends="init">
         <javac target="1.5" destdir="${classes}" debug="on" debuglevel="lines,source">
              <src path="${src}"/>               
              <classpath refid="default.classpath"/>
         </javac>     
         <javac target="1.5" destdir="${classes-test}" debug="on" debuglevel="lines,source">
              <src path="${testsrc}"/>
              <classpath refid="default.classpath"/>
              <classpath location="${classes}"/>
         </javac>
    </target>
    Example output
    java.lang.IllegalArgumentException: Field data is null
    at com.tibco.tibrv.TibrvMsg._addImpl(TibrvMsg.java:1503)
    at com.tibco.tibrv.TibrvMsg.add(TibrvMsg.java:1020)
    at com.lehman.fid.jdt.channel.tibrv.TibrvMessage.putObject(Unknown Source)
    at com.lehman.cmd.etrading.orderbook.dp.DefaultDepthPublisher.buildSubMessage(Unknown Source)
    at com.lehman.cmd.etrading.orderbook.dp.DefaultDepthPublisher.buildSubMessage(Unknown Source)
    at com.lehman.cmd.etrading.orderbook.dp.DefaultDepthPublisher.publishDepth(Unknown Source)
    Cmd line
    VM_OPTS="-Dlogfile=../../log/CmdOrderBook.log"
    VM_OPTS="${VM_OPTS} -Dcom.sun.management.jmxremote"
    VM_OPTS="${VM_OPTS} -Dcom.sun.management.jmxremote.authenticate=false"
    VM_OPTS="${VM_OPTS} -Dcom.sun.management.jmxremote.password=false"
    VM_OPTS="${VM_OPTS} -Dcom.sun.management.jmxremote.ssl=false"
    PARAMS="-springcfg orderbook-context.xml -instancename CmdOrderBook"
    exec ${JAVA_HOME}/bin/java -DappInstance=CmdOrderBook -server -Xmx500M -Xms250M -Xincgc ${VM_OPTS} com.lehman.cmd.etrading.orderbook.CommoditiesOrderBook ${PARAMS} >> ../../log/Cm
    dOrderBook.out 2>&1

    We use ant for our builds and are having a problem with getting line numbers into call stacks. When running on linux we do not get the lines for our projects (not all projects have debug option), just (Unknown Source), however we do see line numbers for the tib jars. Eclipse is fine, we can see all line numbers as appropriate.
    I have tried "lines", "lines,source" and "lines,var,source" - all build a different sized jar which suggest something is getting added. However as we see line nums for tib it suggests it's some strange java runtime option. We're using sunjdk 1.5.10 and also jrockit.
    Any ideas/answers most appreciated.
    Many thanks, Declan
    Ant task
    <target name="compile" depends="init">
         <javac target="1.5" destdir="${classes}" debug="on" debuglevel="lines,source">
              <src path="${src}"/>               
              <classpath refid="default.classpath"/>
         </javac>     
         <javac target="1.5" destdir="${classes-test}" debug="on" debuglevel="lines,source">
              <src path="${testsrc}"/>
              <classpath refid="default.classpath"/>
              <classpath location="${classes}"/>
         </javac>
    </target>
    Example output
    java.lang.IllegalArgumentException: Field data is null
    at com.tibco.tibrv.TibrvMsg._addImpl(TibrvMsg.java:1503)
    at com.tibco.tibrv.TibrvMsg.add(TibrvMsg.java:1020)
    at com.lehman.fid.jdt.channel.tibrv.TibrvMessage.putObject(Unknown Source)
    at com.lehman.cmd.etrading.orderbook.dp.DefaultDepthPublisher.buildSubMessage(Unknown Source)
    at com.lehman.cmd.etrading.orderbook.dp.DefaultDepthPublisher.buildSubMessage(Unknown Source)
    at com.lehman.cmd.etrading.orderbook.dp.DefaultDepthPublisher.publishDepth(Unknown Source)
    Cmd line
    VM_OPTS="-Dlogfile=../../log/CmdOrderBook.log"
    VM_OPTS="${VM_OPTS} -Dcom.sun.management.jmxremote"
    VM_OPTS="${VM_OPTS} -Dcom.sun.management.jmxremote.authenticate=false"
    VM_OPTS="${VM_OPTS} -Dcom.sun.management.jmxremote.password=false"
    VM_OPTS="${VM_OPTS} -Dcom.sun.management.jmxremote.ssl=false"
    PARAMS="-springcfg orderbook-context.xml -instancename CmdOrderBook"
    exec ${JAVA_HOME}/bin/java -DappInstance=CmdOrderBook -server -Xmx500M -Xms250M -Xincgc ${VM_OPTS} com.lehman.cmd.etrading.orderbook.CommoditiesOrderBook ${PARAMS} >> ../../log/Cm
    dOrderBook.out 2>&1

  • Problem with a numbered list

    I recently upgraded to RoboHelp 8 and I opened my old project to update an HTML online help. Whenever I generated the online help and I clicked to view the result on the PC with RoboHelp 8, everything looked fine. Then, I copied all generated files to a server to be part of a web application. Today, I found out that when I viewed the online help on the server using the same PC with RoboHelp 8, all numbers of numbered lists displayed against the left side of the main body of the help are not displayed correctly. Part of each number got chopped off. Again, if I go to the !SSL! folder and display the online help that I generated, it looks fine. I also found out that when I used another PC to view the same online help file from the server, all the numbered lists looked fine. The PC with RoboHelp 8 runs with Windows 7 Enterprise 64 bit and the PC that I could see the numbered lists correctly runs with Windows 7 Professional 64bit. I don't understand why the two PCs do not display the same online help the same way. I asked someone to use his PC running Windows XP with IE7 and the numbered lists were not displayed correctly.
    I read some discussions and there were a suggestion to use the "Convert RoboHelp Edited Topics to HTML" option to correct some problems with RoboHelp 8, so I tried it and it seemed to help. When using the option, I could see the numbered lists correctly. I am still wondering why two PCs did not display the same online help the same way. I am trying to see if there is an option with IE that can be used to solve this problem instead of deploying a new version of the online help. Does anyone know what the "Convert RoboHelp Edited Topics to HTML" option actually does. Will I be introducing more problems using this option?
    RJ

    Thank you very much for replying. The convert option seems to fix the problem and I will probably redo my lists later because I did not seem to be able to make any changes to them.
    I am still puzzled why one PC running the 64 bit Windows 7 Pro is able to display all numbered lists correctly and the other PC running the 64 bit Windows 7 Enterprise using the same version of Internet Explorer is not able to display any numbered lists correctly. I looked around with all the options for Internet Explorer and they are the same. I also noticed that when I used Google Chrome and FireFox, the numbered lists are displayed fine. I also noticed that if all the online help files are saved locally on the PC that is not able to displayed the numbered lists correctly, when I display the online help, the numbered lists look fine. It does not work when displaying the online help from a server. If you know an option that might make the online help to work properly with Internet Explorer without deploying a new version, please let me know.
    Thanks,
    RJ

  • I want to be able to write lists with decimal numbers 1.0, 1.1, 1.2, 1.3, 2.0,etc

    Hi,
    I am trying to use Pages to write an important document with tiered numbers. I want to be able to structure it like this:
    1.0 SECTION ONE
    1.1 A
    1.2 B
    1.3 C
    1.4 D
    2.0 SECTION TWO
    2.1 E
    2.2 F
    And so on...
    I can't find how you do it? Is it possible and if so how?
    This is on Pages, on iWork 09
    Thanks very much in advance!

    Peter is right. Pages v5.2.2 isn't as smooth with numbered lists, and in particular to the included image, tiered numbers.
    Text Indent is only remembered in the same indent level by pressing return. Each new indent level requires manual adjustment of the Text Indent. Out-denting (Shift-tab) retains the Text Indent of the prior indent level, not the previous member at current indent level — so more manual intervention is needed with Text Indent. Basically, a time wasting PITA.

  • Why does the sum function not work when I try to add a column of decimal numbers?  The value is always returned as 0.  No problem with whole numbers but decimals do not work!

    just bought a MacBook Air and using Numbers to make a spreadsheet for financial purposes.  The sum function is working ok for whole numbers but when I try to sum a column of 2 decimal place numbers the result always comes back as 0.  Can anyone help?

    Hi laura,
    I suspect that your 2 decimal place numbers are formatted as text. Change the format of the column to currency and see it that works.
    Also You might want to update your profile to reflect your current systems!
    quinn

  • Problem with decimal stepSize in the spark NumericStepper

    Hi together,
    I get problems when I define a decimal stepSize for a spark NumericStepper:
    <s:NumericStepper id="numericStepperRange" x="318" y="104" width="65"
                                                        maximum="20000.0" minimum="0.1"
                                                        stepSize="0.1" value="0.1" />
    When I click on the Up Arrow following numbers will be displayed: 0.1  >  1.1  >  11.1  >  111.1  >  1111.1  >  11111.1  >  20000.
    If I exchange the spark NumericStepper with the one from the MX component set, the problem does not occure.
    <mx:NumericStepper id="numericStepperRange" x="318" y="104" width="65"
        maximum="20000.0" minimum="0.1"
        stepSize="0.1" value="0.1" />
    0.1  >  0.2  >  0.3  >  0.4  >  0.5  > ...
    Maybe someone else had the same problem?
    Thanks!

    I tried spark numericStepper and it works correctly.
    <s:NumericStepper minimum="0.1" maximum="20000.0" stepSize="0.1"  value="0.1" />

  • Another problem about decimal numbers

    hi,
    i have a code and inside my code, i declared a variable called 'subtotal' as a double. This variable is to hold the amount of money to be paid for a particular type of item. The part of code is as below:
    double subtotal = 0.00, price;
    int quantity;
    (statements)
    subtotal = price * quantity;Then i tested my code. But i found out that, if i entered a price, for example, $2.3, and 3 for quantity, instead of having a value of $6.9 for my subtotal, the value became $6.8888888889. Why is that so? How to solve this problem?
    Thanks for help!

    @OP: as you might know by now: not every decimal finite fraction can be represented
    exactly by a finite binary fraction. Computers represent fractional numbers as a
    finite series of negative powers of two, i.e. 1/2, 1/4, 1/8, 1/16 and so on. It only
    can store a finite number of those negative powers of two in a 'double' value.
    Think of it this way: there are negative powers of two on the table (1/2, 1/4, 1/8 ...)
    and you've given the opportunity to pick any combination of them so you can add
    them up and equal 0.1 (decimal 1/10). You're only allowed to pick up any number
    at most once; here we go:
    You pick 1/16 because 1/8 is too big and 1/32 doesn't make sense. You now
    have to reach the number 1/10-1/16= 3/80 in order to close the gap.
    You pick 1/32 because 1/16 is too big and 1/64 doesn't make sense. You now
    have to reach the number 3/80-1/32=1/160 in order to close the gap.
    You pick 1/256 because 1/128 is too big and 1/512 doesn't make sense. You now
    have to reach the number 1/160-1/256=3/1280 in order to close the gap.
    You pick 1/512 because 1/256 is too big and 1/1024 doesn't make sense. You now
    have to reach the number 3/1280-1/512=1/2560 to close the gap.
    etc.etc. etc.
    You end up picking the numbers sum(i= 1, ...)(1/2^(4*i)+1/2^(4*i+1)) and you
    have to stop after, say, 64 tries and you never reach 1/10 (decimal) exactly.
    This is what that FPU has to do and it can't reach the number 1/10 exactly
    either, i.e. it picks the number closest to it.
    There are an infinit amount of decimal fractions that can not be represented
    as a finite sum of negative powers of two. The opposite is true also.
    Learn to live with that truth and let a DecimalFormat pick the correct rounding
    value for you, it makes life much easier, because you only want to represent
    the 'correct' values (mind the quotes).
    kind regards,
    Jos

  • UiXML: dataBinding problem with decimal validator

    I'm trying to use the decimal validator inside a uit template and dataBind the minValue, maxValue, maxScale and maxPrecision attributes to the ui:rootAttr dataObject like so:
    <textInput ...>
    <onSubmitValidater>
    <decimal
    data:minValue="minValue@ui:rootAttr"
    data:maxValue="maxValue@ui:rootAttr"
    data:maxPrecision="maxPrecision@ui:rootAttr"
    data:maxScale="maxScale@ui:rootAttr"/>
    </onSubmitValidater>
    </textInput>
    However that doesn't seem to work the validation never executes.
    But when I don't use dataBinding it works fine.
    Example:
    <textInput ...>
    <onSubmitValidater>
    <decimal
    minValue="0"
    maxValue="10"
    maxPrecision="2"
    maxScale="3"/>
    </onSubmitValidater>
    </textInput>
    Could it be that there is some bug with the decimal validator? I'm using the dateValidator in just the same way and it works fine.
    Guido

    We'll at least warn you of the problem starting in 9.0.5.
    Getting full databinding support in there may not happen
    by then.
    But there is a workaround today: databind the
    onSubmitValidater attribute:
    <textInput data:onSubmitValidater="decimal@someBean"/>
    ... to point to code that directly creates the
    DecimalValidater.
    public ClientValidater getDecimal()
    DecimalValidater validater = new DecimalValidater();
    validater.setMinValue(1.0);
    // etc...
    return validater;

Maybe you are looking for

  • How do i merge two different itunes accounts

    I have a slight problem.  I have an account where i have purchased games as well as music.  My laptop fried so my wife not knowing my account to sign back in started a new one for me.  Thoughtful yes, helpful no.  Now i have things that she purchased

  • Purchase Requisition workflow issue

    Hello  friends, i have created a workflow for PR release by copying standard  WS20000077  . the WORKFLOW trigeers properly  , but when it created it goes to all users of  applied release strategy  , before release of previous one  what may be problem

  • HT201270 need a newer version of ios ...have 4.3 cant download anthing...how do I do this update

    my ipad has ios 4.3 and will not let me upate to a newer version unable to download facebook, games etc because of this older version help!!!

  • Vista x64

    Has anyone tried using the Iphone with 64-bit Vista. I heard about and saw an installer on the website for 64-bit Vista.

  • Can't sync iPad with iTunes after W7 clean install

    i had some PC problems & had to do a clean install. i had no problems at all with itunes & my iPad before that. my iPhone 4 synced perfectly fine (except for a few apps being lost, but no biggy), but my iPad 2 won't sync at all. i'm okay with losing