How can I print number value without thousand separator?
See Eg.
data mqty type p decimals 3 value '1234.45'.
write:/ mqty .
Result is : 1,234.45
And I want to print it like 1234.45
I usually using the REPLACE Command,
mqty = '1,234.45'.
REPLACE ',' WITH '' INTO mqty.
Or
REPLACE ',' WITH SPACE INTO mqty.
ABAP Tips by: Nurmansah
For thousand separator, you should write this program.
You can also write this program as function. You can call when it require.
ex:
DATA : x TYPE i,
chspec(10).
MOVE it_comm1-fobval TO chspec.
CONDENSE chspec.
x = STRLEN( chspec ) .
IF x LE 3.
chspec = ''.
ELSEIF x = 4.
chspec = '_,___'.
ELSEIF x = 5.
chspec = '__,___'.
ELSEIF x = 6.
chspec = '_,__,___'.
ELSEIF x = 7.
chspec = '_,__,___'.
ENDIF.
WRITE: 89(12) it_comm1-fobval RIGHT-JUSTIFIED USING EDIT MASK chspec.
it_comm1-fobval = '1234'
result
1,234
ABAP Tips by: Siva
Fast Links:
Get help for your ABAP problems
Do you have a ABAP Question?
ABAP Books
ABAP Certification,
BAPI, Java, Web Programming, Smart Forms, Sapscripts Reference Books
ABAP Programming Tips
ABAP Forum for Discussion and Samples
Program Codes for Abapers
Best regards,
SAP Basis, ABAP Programming and Other IMG Stuff
http://www.sap-img.com
All the site contents are Copyright © www.sap-img.com
and the content authors. All rights reserved.
All product names are trademarks of their respective
companies. The site www.sap-img.com is in no way affiliated with
SAP AG.
Every effort is made to ensure the content integrity.
Information used on this site is at your own risk.
The content on this site may not be reproduced
or redistributed without the express written permission of
www.sap-img.com or the content authors.