11-11-2008 5:50 PM
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
11-11-2008 5: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.
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>.
11-11-2008 6:06 PM
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...
11-11-2008 6:10 PM
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>.
.............
..........