on 01-21-2009 11:04 AM
Hi,
In the sapscript for printing production order, we are printing the order quantity field MGVRG
present in the structure AFVGD. &AFVGD-MGVRG&
But we dont want the decimal places to be printed.
Suppose if the quantity is 10,000 it should be printed as 10.
I tried using &AFVGD-MGVRG(.0)& , but no result.
Please let me know how we can achieve this.
Thanks in advance,
Poornima
DATA: val TYPE P DECIMALS 2 VALUE 1000.00 ,
Amt type i.
Amt = TRUNC( val ).
WRITE: / Amt.
Regards,
Joan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi poornima,
Do one thing.
Declare one field as
Data z_mgvrg TYPE i. in your driver program.
Now z_mgvrg = AFVGD-MGVRG.
No print &z_mgvrg& in your script.
hope it will help you.
regrds,
Lokesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
Suppose if the quantity is 10,000 it should be printed as 10.
I tried using &AFVGD-MGVRG(.0)& , but no result.
I see that the decimal separator is comma(,).
Plz change &AFVGD-MGVRG(.0)& to
&AFVGD-MGVRG(,0)&
BR,
Suhas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Poornima,
Get the value of your field i.e AFVGD-MGVRG into a variable of type p deciamal 2 as shown in the code below.
DATA a TYPE I.
DATA b TYPE P DECIMALS 2 VALUE '10.15'.
a = TRUNC( b ).
WRITE: / 'TRUNC:', a.
Let me know if this is useful
Nayan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
data lv_qty type vbap-zmeng.
data char_qty(10).
lv_qty = '10.000'.
Move lv_qty TO char_qty.
Replace '.000' IN char_qty WITH ''.
CONDENSE char_qty.
write / char_qty. " output 10
lv_qty = '10.100'.
Move lv_qty TO char_qty.
Replace '.000' IN char_qty WITH ''.
CONDENSE char_qty.
write / char_qty. " output 10.100
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.