cancel
Showing results for 
Search instead for 
Did you mean: 

Printing Character value with decimal

Former Member
0 Kudos

While printing a character value, I need to have decimal value also eventhough the decimal value is empty. eg. 15.00. Now If I have some value in it, it is printing properly. eg. 15.1

Let me know how to proceed for this.

Accepted Solutions (0)

Answers (2)

Answers (2)

naimesh_patel
Active Contributor
0 Kudos

Try with this little piece of code:

REPORT  ZTEST_NP.

DATA: P_TEST TYPE P,
P_CHAR(20).

P_TEST = '12'.

WRITE: P_TEST TO P_CHAR DECIMALS 2.
WRITE: P_CHAR.

Regards,

Naimesh Patel

Former Member
0 Kudos

Move it to a character field and it should print as you need.

Davis