‎2006 Feb 15 7:33 AM
Hi, in sales order the quantity is 11.5 but when printed out, it turned out 12. how can I change this?
thanks a lot! kitty
‎2006 Feb 15 7:45 AM
Hi Kitty,
Use a variable of type char. It's length should be equal to output length of the (Quantity + Decimal Places).
Pass the value of quantity in this variable and display this variable on the screen.
Regards,
Neeraj Gupta
‎2006 Feb 15 8:00 AM
Hi thanks for u quickly reply, could you pls explain more clear?
b.r susan
‎2006 Feb 15 8:07 AM
hi kitty,
1. write the number field INTO the charcter field,
and display this character field (instead of number field) in the smartform.
2. For Eg :
REPORT abc.
data : num type p decimals 2.
data : s(10) type c.
num = '25.15'.
write num to s.
write 😕 s.
regards,
amit m.
‎2006 Feb 15 8:10 AM
Hi Kitty,
Move the value in quantity to a char field of same size.
and use this variable for printing.
eg:
declare hte variable in global.
data v_menge(13).
v_menge = 'ur_quantity_field'.
while printing in smarform use this variable as &v_menge'.
Please let us know if its working for you/
Best Regards,
Anjali
‎2006 Feb 16 3:44 AM
I think there is a conversation in the data type.
kwmeng is p, decimal 3, and the vairable is p, with demcimal o. after the step variable = kwmeng, the figure is rounded. so where can I change in this case?
thanks for all help. b.r kitty
‎2006 Feb 16 3:48 AM
Since you are using data type p with decimals 0 it is rounded off.
Instead try using a variable with decimals 3 or a character data type.
Ps: Reward points if helpful.
‎2006 Feb 15 8:10 AM
Hi,
Is there something after the name of your data ? like &data(.0)& ?
if yes just remove the (.0)
Rgd
Frédéric
‎2006 Feb 15 8:13 AM
Hi,
In Global Definition->Global Data,declare the character variable whose output lenght is equal to that of that field.
In Program logic,use the field as input parameter and the variable you declared as output parameter.
In the coding,assign the value to the variable.
Then instead of printing the field,print the variable.
Kindly reward points by clicking the star on the left of reply,if it helps.
‎2006 Feb 15 8:15 AM
Hi,
Why dont u try
&field(.<n>)&
syntax which limits output of decimal places to <n>
regards
austin
‎2006 Feb 15 8:21 AM
Hi kitty,
Here is the sample code:
Suppose KWMENG is your quantity field. Declare variable quan as follows.
Data: quan(19) type c.
kwmeng = '11.5'.
quan = kwmeng.
Now, display quan instead of KWMENG.
Regards,
Neeraj Gupta
‎2006 Feb 15 9:02 AM
Hi Kitty,
May be u use integer type for that field. So, u get round up value. U can take the variable type p with decimals 2.
eg. menge type p decimals 2
Regards,
Digesh Panchal
‎2006 Feb 15 10:17 AM
‎2006 Feb 16 4:42 AM
Use &QUANTITY(C.2)&
and declare quantity like any database quantity field.
if helpful, reward the points and close the question.