Application Development and Automation 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: 
Read only

Issue with Decimal notation output

former_member202077
Participant
0 Likes
1,347

Hi Experts,

I am pulling the KBETR (amount/value field) from KONV into my report, am getting as 10.37 and its currency is USD6 (6 decimals) and there transferring it to OS/Unix

Now my interface notepad in OS/Unix should show 10.370000, pls. let me know do we have any FM or any standard routine?

Thank you

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,279

Check logic behind this function FILL_LPAD_ZEROES. It adds leading zeros.

I am sure u'll fig out how to add zero after decimal.

Thanks,

Arpit

9 REPLIES 9
Read only

Former Member
0 Likes
1,280

Check logic behind this function FILL_LPAD_ZEROES. It adds leading zeros.

I am sure u'll fig out how to add zero after decimal.

Thanks,

Arpit

Read only

0 Likes
1,279

ThanQ.

But, am asking zeros after decimals, according to currency (TCURRX) table

Read only

0 Likes
1,279

Actually, I treid with F4 in SE37 with key word of DECIAMLS, but not find any!!

Thank you

Read only

0 Likes
1,279

But a stored value of '10.37' with a 6 decimal definition is actually a value of '0.001037'. You can see this by using WRITE with the CURRENCY addition. If you want '10.370000' then you can just use WRITE with 'DECIMALS TCURX-CURRDEC', assuming you have read the definition into that work area. Is that what you need?

Read only

0 Likes
1,279

you should check code behind this fm. I am not sure if there is any standard function module to full fill ur requirement.

My logic says that

1. transfer amount into text field

2. Split when period start

3. Concatenate zeros in second field

4 Again concatenate with decimal sign

5 transfer text field into amt having 6 decimal.

KBETR is having only 2 decimal place so u can't move back into this field type.

THnaks,

Arpit

Read only

0 Likes
1,279

Yes, i want to get it as 10.370000.

So i tried ur suggestion that adding DECIMALS addition to WRITE statemetn, but, its not working!! pls. give me a example.

ThanQ

Read only

0 Likes
1,279

Any suggestion?

THank you

Read only

0 Likes
1,279

Without the (obvious) table selection - a simple example:


TABLES: tcurx.
DATA: lv_val TYPE char10.
PARAMETERS: p_kbetr TYPE kbetr DEFAULT '10.37'.

tcurx-currdec = 6.

WRITE p_kbetr TO lv_val DECIMALS tcurx-currdec LEFT-JUSTIFIED.
WRITE lv_val.

Don't use the CURRENCY option in addition to the DECIMALS option, or the value will be converted first. Keep in mind that a 6 DEC definition on the currency for '10.37' is not the same thing as '10.370000'.

Edited by: Brad Bohn on Nov 12, 2010 2:47 PM

Read only

0 Likes
1,279

Please be patient. This is not a support site. And even if it were, ten minutes is not long to wait.

Rob