on 01-05-2007 6:59 AM
Hi all,
we have the qunatity field in script,the requirement is after comma they want
only 2 decimals how we can pass two decimals only
the field is &ITEM_QUANTITY&
Please help me.
regards
sriman
sorry...
&ITEM_QUANTITY(.2)&
..
create a varialble with 2 delcimals...
example avialable data element
then pass it to the ITEM_QUANTITY to that varialble..
print that varilble
Message was edited by:
Naresh Reddy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
i encountered the same problem and
wrote a code like that in smart form before quan program field and problem was solved.
in code window general properties tab write input parameters "it_gen" which is structure name you will use wite yours. and in output parameters write "ztoplamgr" this is my field name, use yourself. Before all you sould add "ztoplamgr" what is your filed name to main input field parameters of form. then, use "ztoplamgr" instead of "GS_IT_GEN-GROSS_WT".that is my example. use yours field names in your code.
the code is :
clear ztoplamgr.
WRITE GS_IT_GEN-GROSS_WT DECIMALS 2 to ztoplamgr.
i hope this is answer for your problem.
Message was edited by:
ERHAN YAZICI
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi sri,
&ITEM_QUANTITY(.2)&
YOU WILL GET 2 DECIMAL PLACES.
check this
<b> Number of Decimal Places </b>
A program symbol of one of the data types DEC, QUAN, and FLTP can contain decimal place data. Use the option below to override the Dictionary definition for the number of decimal places for the formatting of this symbol value.
Syntax
&symbol(.N)&
Example
The EKPO-MENGE field contains the value 1234.56. The Dictionary definition specifies 3 decimal places and an output length of 17.
&EKPO-MENGE& -> 1,234.560
&EKPO-MENGE(.1) -> 1,234.6
&EKPO-MENGE&(.4) -> 1,234.5600
&EKPO-MENGE&(.0) -> 1,235
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I am not sure whether the below will work.But this is my idea.
Use search to find out the position of comma.Store the sy-fdpos in a variable called v1.
v2 = &item_quantity&.
SEARCH v2 FOR ','.
if sy-subrc eq 0.
v1 = sy-fdpos.
endif.
v1 = v1+2.
&item_quantity+0(v1)&
Check this link
http://www.sts.tu-harburg.de/teaching/sap_r3/ABAP4/search.htm
Message was edited by:
Jayanthi Jayaraman
As suggested, the way to print 2 decimal places is to do this:
&item_quantity(.2)&
Are you sure that you activated the form after making the above change?
You can also declare a variable of Type P Decimals 2 in the Global Definitions of your form and then move the quantity to this variable and print it.
<b>&ITEM_QUANTITY(.2)&</b>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Try this:
&ITEM_QUANTITY(.2)&
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
&item_quantity(.2)&
Message was edited by:
Durgaprasad Kare
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.