10-20-2008 11:18 AM
Hi,
In my pgm,I declared one variable(stores the amount value) which s of type 'BAPICURR-BAPICURR'(in order to put the commas in the amount).Now the requirement is,I have to put only the commas not the decimal place.
EX:
input:1234325
expected o/p:1,234,325.
Output I m getting is :1,234,325.0000
I need to remove that 4 zeroes.
Suggest me the solution.
10-20-2008 11:51 AM
Hi
Now the decimal problem s solved.But I m not getting the commas
I need commas but no decimal value.
10-20-2008 11:21 AM
10-20-2008 11:23 AM
this fm s 4 the removal of trailing zeroes.
i need to remove the zeroes at the end
10-20-2008 11:25 AM
HI ...
you can use
Conversion_exit_alpha_output to remove the zeros
or you can convert these to char
Regards
Prashant
Edited by: Prashant singh on Oct 20, 2008 12:25 PM
Edited by: Prashant singh on Oct 20, 2008 12:26 PM
10-20-2008 11:25 AM
Hi,
Check below piece of code:
DATA:
v_var1 TYPE bapicurr-bapicurr VALUE '12345',
v_var2(20) TYPE c.
WRITE:
v_var1 TO v_var2 DECIMALS 0.
WRITE:
v_var2.
Thanks & Regards,
Navneeth K.
10-20-2008 11:27 AM
Try this,
data amt(6) type p decimals 3 value '123.450'.
data amt1(6) type p decimals 2.
data amt_c(6) type c.
unpack amt to amt_c.
shift amt_c right deleting trailing '0'.
translate amt_c using ' 0'.
pack amt_c to amt1.
write amt1.
If you want to eliminate the decimals completely, then simply specify decimals 0.
data amt(6) type p decimals 0 value '123.450'.
regards,
Advait
Edited by: Advait Gode on Oct 20, 2008 12:28 PM
10-20-2008 11:28 AM
i am not sure how you are doing.., i just tried this way, it is working fine. check it once.
data: decp type p decimals 0.
data: number(10).
number = 1234325.
decp = number.
write decp.
10-20-2008 11:29 AM
Hi
Try this
DATA : VAL1 TYPE BAPICURR_D VALUE '12345.0000',
VAL2 TYPE p DECIMALS 0.
VAL2 = VAL1.
WRITE : VAL1,
VAL2.
Regards
10-20-2008 11:29 AM
10-20-2008 11:51 AM
Hi
Now the decimal problem s solved.But I m not getting the commas
I need commas but no decimal value.
10-20-2008 11:52 AM
My above piece of code, does display commas, it removes decimals.
10-20-2008 12:00 PM
10-20-2008 12:07 PM
Hi,
You can do a simple thing.
While declaring your variable use the following thing.
DATA: VAR TYPE p DECIMALS 0.
It should help you.
Thanks
Edited by: Nitesh Kumar on Oct 20, 2008 1:08 PM