Application Development 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: 

losing decimal pt in sapscript

Former Member
0 Kudos

I am using a field KAWRT data type CURR length 15 decimal 2 to be displayed in Sapscript

If I pass 100.00, the value is displayed as 10.00. Does anyone know the reason for the loss of one decimal pt? How can this be fixed. Currently I am multiplying the actual value by 10 prior to passing it through write_form

17 REPLIES 17

Former Member
0 Kudos

Hi Megan,

Just debug the form and check what value are you getting where this field is getting priinted.

Regards,

Nitin.

Former Member
0 Kudos

check the value in itab that u passing(that is value is 10 are it is 100).....

Former Member
0 Kudos

I have debuged this. The value right before the WRITE_FORM for the element is 100.00 But it gets displayed 10.00 in the document

If I were to pass it 1000.00, it would be displayed as 100.00

0 Kudos

Check weather the windows are overlapping...some times a silly overlap of one window over the other..which inturn overlaps the last decimal or alfabet or value etc. this might sound as a very silly reply but it happend to me so i am telling u . cause value comming perfectly till u call the write_window and there wont be any scope that it goes wrong in the call function.

Former Member
0 Kudos

Now check with the driver program.

What is the value of that field there?

Former Member
0 Kudos

The value in the driver program is 100.00

The value thats displayed on document is 10.00

0 Kudos

Hi,

I have confronted with such a problem just yesterday.

do you use something like :

&price(10.2)&

Something like that?

Try to increase the lenght of the 10 as 11 or 12 etc.

Hope helps.

deniz.

0 Kudos

Deniz

Yes the KAWRT variable in the driver program is a CURR length 15 and dec 2

and in the sapscript I am using it as &KOMVD-KAWRT&(I12.1)&

Do you think this is whats causing the problem. What can be done to resolve it? Also its important that the value be displayed in the document with one decimal place and not more.

Edited by: Megan Flores on Nov 12, 2008 2:04 PM

Edited by: Megan Flores on Nov 12, 2008 2:05 PM

Former Member
0 Kudos

hi friend,

try this 2 function modules for ur solution.

1.CALL FUNCTION 'HR_IN_ROUND_AMT'

2.CALL FUNCTION 'ZSPELL_AMOUNT'

I hope this help for u.

Regards,

K.S.Kannan

Former Member
0 Kudos

Hi,

Display the field as &KOMVD-KAWRT&(15.1)&

I hope it works

Regards

Manasa

0 Kudos

I am now displaying the field as &KOMVD-KAWRT(15.1)& and it does not fix it.

I am passing KOMVD-KAWRT as 100.00 and debugging the sapscript and the moment its gets into the sapscript, it becomes 10.00

This is so bizarre!!!

0 Kudos

I am passing value 100.00 in driver program

DATA : KOMVD-KAWRT LIKE KOMVD-KAWRT.

KOMVD-KAWRT = '100.00'.

and displaying in form as &KOMVD-KAWRT(I15.1)&

I am getting the value displayed as 100.0

0 Kudos

What about &KOMVD-KAWRT(I12.1)& Do you get 100.00 then too?

I have tried I12.1 & I15.1 and so on and I always get 10.0

Former Member
0 Kudos

It might be the currency fields acting up. I suggest you use your abap control program to WRITE your variable TO a plain text one, check that it was passed correctly (with the debugger) and print that text in the sapscript.

0 Kudos

I cant for legacy reasons. I need to continue using the CURR field. The total output length given is 21

I even tried (I21.1) but even that doesnt work.

0 Kudos

WERTV8 is the domain name

0 Kudos

Hi,

Try give it &KOMVD-KAWRT&(.2)& in FORM

Regards

Bala Krishna