Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

DEC, CURR in a Custom Screen

Former Member
0 Kudos

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

3 REPLIES 3

former_member156446
Active Contributor
0 Kudos

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.
else.
concatenate &1 &2 into &3 separated by &4.
endif.
END-OF-DEFINITION.

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

0 Kudos

Thank u Jay,

I would like to try your advice. But my issue is in the screen painter not just a simple report. I hope this is applicable.

Can you help me explain what would be that values of lf_line buf tab...

0 Kudos
LOOP AT p_final_table ASSIGNING <fs_record>.
DO.
ASSIGN COMPONENT sy-index OF STRUCTURE <fs_record> TO <fs_comp>.
IF sy-subrc <> 0.
EXIT.
ENDIF.
lf_buf = <fs_comp>.
IF sy-index = 1.
lf_line = lf_buf.
ELSE.

concat_nonull lf_line lf_buf lf_line c_tab <fs_comp>.
.............
..........