Skip to Content
author's profile photo Former Member
Former Member

DEC, CURR in a Custom Screen

hi guys,

I have this custom screen that displays DEC 12,2 CURR, and DATE. I am struggling to solve for some issues:

1. For DEC type, The value moves in 2 decimal places. The correct value from the code is 12.34, but it is displayed as .1234

2. For the 2 data types, how can I remove the default zeroes (for empty values) ? I know that this is already a characteristic of a data type. I have doubts of changing the values to CHAR it may affect negative and decimal values.

need your professional advice.

thank u

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Posted on Nov 11, 2008 at 05:59 PM

    Ans 2:

    *Macro for assigning space rather than 0.00 for numeric fields
    DEFINE concat_nonull.
    describe field &5 type w_type.
    if 'PND' cs w_type and &5 is initial.
    concatenate &1 '' into &3 separated by &4.
    concatenate &1 &2 into &3 separated by &4.

    using the macro
    concat_nonull lf_line lf_buf lf_line c_tab <fs_comp>.

    Add a comment
    10|10000 characters needed characters exceeded

    • LOOP AT p_final_table ASSIGNING <fs_record>.
      ASSIGN COMPONENT sy-index OF STRUCTURE <fs_record> TO <fs_comp>.
      IF sy-subrc <> 0.
      lf_buf = <fs_comp>.
      IF sy-index = 1.
      lf_line = lf_buf.
      concat_nonull lf_line lf_buf lf_line c_tab <fs_comp>.

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.