2010 Jun 04 12:39 PM
Hi experts,
I want to format a quantity according to a unit.
1,00 Unit ST --> 1.
Can you help me??
Thanks
2010 Jun 04 1:05 PM
Hi,
If you display in output, do like this
write <quantity_field> unit <unit_field>.
It will display acording to the number of decimal places fixed table T006 for <unit_field>..
Regards
Dillip
2010 Jun 04 1:05 PM
Hi,
If you display in output, do like this
write <quantity_field> unit <unit_field>.
It will display acording to the number of decimal places fixed table T006 for <unit_field>..
Regards
Dillip
2010 Jun 05 1:08 AM
Hi,
You can use FM UNIT_CONVERSION_SIMPLE.
This FM is used for conversion of one Unit to another, with rounding.
CALL FUNCTION 'UNIT_CONVERSION_SIMPLE'
EXPORTING
INPUT = VALUE_IN ---->Actual UOM
ROUND_SIGN = 'X' ------->Rounding
UNIT_IN = UNIT_IN ------->UOM you want to convert.
UNIT_OUT = UNIT_OUT
IMPORTING
OUTPUT = VALUE_OUT
EXCEPTIONS
CONVERSION_NOT_FOUND = 01
DIVISION_BY_ZERO = 02
INPUT_INVALID = 03
OVERFLOW = 04
OUTPUT_INVALID = 05
UNITS_MISSING = 06
UNIT_IN_NOT_FOUND = 07
UNIT_OUT_NOT_FOUND = 08.Just check it.
May it helps you.
Regards.
Deepak Sharma.
2010 Jun 07 11:13 AM
Hi Deepak Sharma,
It doesn't work correctly, It always returns the excepction 'conversion_not_found'.
Thanks anyway.
2010 Jun 07 11:33 AM
Hi,
Check the below code
DATA: WA_QTY TYPE KTMNG.
WA_QTY = 100.000.
WRTIE WA_QTY UNIT 'ST'.
" Will display 100
WRTIE WA_QTY UNIT 'KG.
" Will display 100.000
Regards
Dillip
2010 Jun 07 11:50 AM
Hi,
You can try below syntax :
WRITE <f> UNIT <u>.
Where as this statement sets the number of decimal places according to the unit <u>. The contents of <u> must be an entry in database table T006 in column MSEHI. The entry in column DECAN then determines the number of decimal places of the field <f> to be displayed. If the system does not find the entry <u> in table T006, it ignores the option.
Thanks and Regards,
P.Bharadwaj
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |