FM MATERIAL_UNIT_CONVERSION
Hello experts,
I want to use the FM FM MATERIAL_UNIT_CONVERSION.
but SAP SCM Release 4.0 gives me message : Function Module MATERIAL_UNIT_CONVERSION does not exist.
I am getting the same message for FM MD_CONVERT_MATERIAL_UNIT also.
I would like to know why.?
Are there any APO specific FMs.?
Which other FM (APO specific) can I use to convert the base UOM ..?
Thank you
Hi,
Use the function module : /SAPAPO/DM_MAT_UNIT_CONV for proudct(material) unit conversion in SAP.
Regards.
Similar Messages
-
How to use MATERIAL_UNIT_CONVERSION?
Hi experts,
Is there anyone share me how to use FM MATERIAL_UNIT_CONVERSION?
Can I use this to convert Volume to KG and vise versa?
eg. 20M3 to 20000KG; 10L to 12000KG
ThanksThis function module converts a quantity from one unit of measurement to another. A requirement for this is that the units of measurement relate to a material. One of them must be the base unit of measure of the material, while the other must be defined as an alternative unit of measure for the material or be capable of being converted to an
alternative unit of measure as per table T006.
You are recommended declaring the transfer parameters for the quantities and the conversion factors as type F fields since the runtime required for conversion is substantially less than with type P or type I fields and also because the exception OVERFLOW cannot then occur.
If the transfer parameters for the conversion factors are of type P (packed number), the system assumes that you require conversion with 5-digit accuracy. If they are of type I (integer), the system assumes that you require conversion with 10-digit accuracy. (See also the documentation on transfer parameter TYPE_UMR.)
Example
DATA: MATNR LIKE MARA-MATNR,
MEINS LIKE MARA-MEINS,
MEINH LIKE MARM-MEINH,
INPUT TYPE F,
OUTPUT TYPE F,
UMREN TYPE F,
UMREZ TYPE F,
KZMEINH TYPE C.
CALL FUNCTION 'MATERIAL_UNIT_CONVERSION'
EXPORTING
INPUT = INPUT
KZMEINH = KZMEINH
MATNR = MATNR
MEINH = MEINH
MEINS = MEINS
IMPORTING
OUTPUT = OUTPUT
UMREN = UMREN
UMREZ = UMREZ
EXCEPTIONS
CONVERSION_NOT_FOUND = 01
INPUT_INVALID = 02
MATERIAL_NOT_FOUND = 03
MEINH_NOT_FOUND = 04
MEINS_MISSING = 05
OUTPUT_INVALID = 06
OVERFLOW = 07.
Hope this Helps.
Regards
Vinayak -
About FM 'MATERIAL_UNIT_CONVERSION'
Hi all,
I have a problem about the function module 'MATERIAL_UNIT_CONVERSION'.
it looks like this below.
When the parameter Display unit of measure is entered, we need to convert the quantities/units from the database to the desired unit by using function module MATERIAL_UNIT_CONVERSION.
In case its not possible to convert fields to the specified unit of measurement, convert it to the base unit of measurement (can be found in the MARA table or MM03).
So I want to know how to use FM 'MATERIAL_UNIT_CONVERSION'
Thanks in advance .
Best Regard.
Nickhttp://www.erpgenie.com/abap/functions.htm
http://www.sapdevelopment.co.uk/fmodules/fmssap.htm
http://www.erpgenie.com/abap/index.htm
http://www.geocities.com/victorav15/sapr3/abapfun.html
Rewards if useful........
Minal -
MATERIAL_UNIT_CONVERSION round down
The qty on delivery is 31 EA and 1CS =12 EA for this item, so the qty. conversion would be 2.58 CS and because of the rounding down to the closest integer it should be 2 and not 3.
Is it possible to round down the qty with FM MATERIAL_UNIT_CONVERSION?Use the command floor to round down.No need to use Func Module.
d = 2.62
x = floor(d) = 2 . -
Need help in Conversion of Distance using the FM 'UNIT_CONVERSION_SIMPLE'
Hi Group,
I have a requirement to convert a value of type (NUMC - length 4) which has the value for Distance.
Now I am using the FM 'UNIT_CONVERSION_SIMPLE' to convert the value of the above from 'Meter' to 'KM' as under:
CALL FUNCTION 'UNIT_CONVERSION_SIMPLE'
EXPORTING
input = value_in(value of the above mentioned field)
unit_in = 'M'
unit_out = 'KM'
IMPORTING
output = value_out(this value should have the calculated value of the Distance in KM).
and now, I will pass this(value_out) to the field of (NUMC - lenght 4).
I was facing issues while executing the Function Module as :
'Please use a number field for the input value'.
please let me know how to overcome this error or else let me know any other alternative solution is available to overcome this.
thanks for your help in advance.
Regards
Vishnu.Hello
Try to use FM 'MATERIAL_UNIT_CONVERSION'
And read this: UNIT_CONVERSION_SIMPLE -
Function modules for unit conversion
hai gurus.
what is the function module to make one qty to the same unit as other qty.
if one is in kg and other in pounds
i want to make both in pounds.
pls help me with thisHi
chk UNIT_CONVERSION_SAMPLE
also chk this
CF_UT_UNIT_CONVERSION
Some Insights-
Unit conversions
with NW2004s the HOW-TO GUIDE for qty conversion is obsolete.
http://help.sap.com/saphelp_nw2004s/helpdata/en/27/b65c42b4e05542e10000000a1550b0/content.htm
As of SAP NetWeaver 2004s you can create quantity conversion types using transaction RSUOM.
The business transaction rules of the conversion are established in the quantity conversion type. The conversion type is a combination of different parameters (conversion factors, source and target units of measure) that determine how the
conversion is performed.
In terms of functionality, quantity conversion is structured similarly to currency translation.
Quantity conversion allows you to convert key figures with units that have different units of measure in the source system into a uniform unit of measure in the BI system when you update them into InfoCubes
http://help.sap.com/saphelp_nw04s/helpdata/en/27/b38c4284a8c353e10000000a1550b0/content.htm
It is entered in ODS table linked to info object (0material)
What you need to do basically is-
1 ) Goto your infoobject for eg- 0material
2 ) In Info object Maintenance- Tab page- Bex Explorer
3 ) Enter 0BASE_UOM in Base unit of measure
4 ) Generate UOM ODS (System generates it with prefix UOM)
It is made of 4 fields (1 more in case of compounding) with SID for them. This is the place where you enter numerator and
denominator to calculate conversion factor
5 ) Load the UOM ODS with conversion from 0MAT_UNIT_ATTR or flat file
6 ) Define conversion type
7 ) In the conversion type, then you can select 0Material in the dynamic determination of conversion factor
8 ) Select source unit and target unit
For more help refer SAP help file on NW2004s. It is comprehensive and even explain - How to do unit conversion in
transformation rule?
http://help.sap.com/saphelp_nw04s/helpdata/en/4f/707242df019c60e10000000a1550b0/content.htm
Check this sample code,
CALL FUNCTION 'CONVERT_TO_LOCAL_CURRENCY'
EXPORTING
* CLIENT = SY-MANDT
DATE = pdate
FOREIGN_AMOUNT = p_amt1
FOREIGN_CURRENCY = p_curr1
LOCAL_CURRENCY = p_curr2
* RATE = 0
* TYPE_OF_RATE = 'M'
* READ_TCURR = 'X'
IMPORTING
EXCHANGE_RATE = w_rate
FOREIGN_FACTOR = w_fact1
LOCAL_AMOUNT = w_amt
LOCAL_FACTOR = w_fact2
* EXCHANGE_RATEX =
* FIXED_RATE =
* DERIVED_RATE_TYPE =
EXCEPTIONS
NO_RATE_FOUND = 1
OVERFLOW = 2
NO_FACTORS_FOUND = 3
NO_SPREAD_FOUND = 4
DERIVED_2_TIMES = 5
OTHERS = 6.
IF SY-SUBRC <> 0.
write: / 'Conversion to loc.curr. failed:',
p_curr1, '->', p_curr2, 'err.code=', sy-subrc.
ELSE.
write: / 'to Loc.curr:', p_amt1 currency p_curr1, p_curr1, '->',
w_amt currency p_curr2, p_curr2,
'(', w_rate, ')', w_fact1, w_fact2.
ENDIF.
http://www.geocities.com/victorav15/sapr3/examples/currconv.txt
Check this
CONVERSION_FACTOR_GET
Measurement unit conversion: Get measurement unit conversion factor Not for Dimensionless Units of Measure
UNIT_CONVERSION_SIMPLE Measurement unit conversion by table T006, with rounding
UNIT_OF_MEASURE_SAP_TO_ISO
UNIT_OF_MEASURE_ISO_TO_SAP
MATERIAL_UNIT_CONVERSION Material quantity conversion from Base Unit of Measure to Alternative Unit of Measure and vice versa. For Dimensionless Units of Measure (Each, Piece, Box etc.) conversion depends on the given Material (see table MARM). For other Units of Measure (Length, Weigth etc.) conversion can be calculated from the T006 table or via CONVERSION_FACTOR_GET.
CONVERSION_EXIT_CUNIT_INPUT Conversion exit for commercial (3-char) measurement unit INPUT
CONVERSION_EXIT_CUNIT_OUTPUT Conversion exit for commercial (3-char) measurement unit OUTPUT
CONVERSION_EXIT_LUNIT_INPUT Conversion exit for technical (6-char) measurement unit INPUT
CONVERSION_EXIT_LUNIT_OUTPUT Conversion exit for technical (6-char) measurement unit OUTPUT
UNIT_OF_MEASUREMENT_HELP Input help for measurement units of a predefined dimension
http://www.geocities.com/victorav15/sapr3/abapfun.html
Reward all helpfull answers
Regards
Pavan -
hi,
what are the function modules do we use for the conversion of currency and units.
1) i want to convert currency(US$) to INR.
2) and to convert from one unit to another unit.
before using these function modules what we have to do in bdcs.
regards
vivekHi,
Check this sample code,
CALL FUNCTION 'CONVERT_TO_LOCAL_CURRENCY'
EXPORTING
* CLIENT = SY-MANDT
DATE = pdate
FOREIGN_AMOUNT = p_amt1
FOREIGN_CURRENCY = p_curr1
LOCAL_CURRENCY = p_curr2
* RATE = 0
* TYPE_OF_RATE = 'M'
* READ_TCURR = 'X'
IMPORTING
EXCHANGE_RATE = w_rate
FOREIGN_FACTOR = w_fact1
LOCAL_AMOUNT = w_amt
LOCAL_FACTOR = w_fact2
* EXCHANGE_RATEX =
* FIXED_RATE =
* DERIVED_RATE_TYPE =
EXCEPTIONS
NO_RATE_FOUND = 1
OVERFLOW = 2
NO_FACTORS_FOUND = 3
NO_SPREAD_FOUND = 4
DERIVED_2_TIMES = 5
OTHERS = 6.
IF SY-SUBRC <> 0.
write: / 'Conversion to loc.curr. failed:',
p_curr1, '->', p_curr2, 'err.code=', sy-subrc.
ELSE.
write: / 'to Loc.curr:', p_amt1 currency p_curr1, p_curr1, '->',
w_amt currency p_curr2, p_curr2,
'(', w_rate, ')', w_fact1, w_fact2.
ENDIF.
http://www.geocities.com/victorav15/sapr3/examples/currconv.txt
Check this
CONVERSION_FACTOR_GET
<b>Measurement unit conversion:</b> Get measurement unit conversion factor Not for Dimensionless Units of Measure
UNIT_CONVERSION_SIMPLE Measurement unit conversion by table T006, with rounding
UNIT_OF_MEASURE_SAP_TO_ISO
UNIT_OF_MEASURE_ISO_TO_SAP
MATERIAL_UNIT_CONVERSION Material quantity conversion from Base Unit of Measure to Alternative Unit of Measure and vice versa. For Dimensionless Units of Measure (Each, Piece, Box etc.) conversion depends on the given Material (see table MARM). For other Units of Measure (Length, Weigth etc.) conversion can be calculated from the T006 table or via CONVERSION_FACTOR_GET.
CONVERSION_EXIT_CUNIT_INPUT Conversion exit for commercial (3-char) measurement unit INPUT
CONVERSION_EXIT_CUNIT_OUTPUT Conversion exit for commercial (3-char) measurement unit OUTPUT
CONVERSION_EXIT_LUNIT_INPUT Conversion exit for technical (6-char) measurement unit INPUT
CONVERSION_EXIT_LUNIT_OUTPUT Conversion exit for technical (6-char) measurement unit OUTPUT
UNIT_OF_MEASUREMENT_HELP Input help for measurement units of a predefined dimension
http://www.geocities.com/victorav15/sapr3/abapfun.html -
Hi,
In my Itab... I have ekpo data as
menge meins(Unit of measure)
2.000 TO
1.00 BAG
3.00 TO
I want to display in my internal table in MT (Metric ton) only...
How can I do this?
How can I convert Unit of measures from TO to MT and
BAG to MT?Hi
Use FM MATERIAL_UNIT_CONVERSION
Also see
MC_UNIT_CONVERSION
UNIT_CONVERSION_SIMPLE
try using the function module MD_CONVERT_MATERIAL_UNIT
See Sample code below...
FORM f2121_convert_price USING p_lv_meins
p_lv_kbetr
p_lv_kmein
p_lv_matnr
p_lv_kschl.
DATA: lv_imenge LIKE ekpo-menge,
lv_emenge LIKE ekpo-menge.
lv_imenge = p_lv_kbetr.
CALL FUNCTION 'MD_CONVERT_MATERIAL_UNIT'
EXPORTING
i_matnr = p_lv_matnr
i_in_me = p_lv_kmein
i_out_me = p_lv_meins
i_menge = lv_imenge
IMPORTING
e_menge = lv_emenge
EXCEPTIONS
error_in_application = 1
error = 2
OTHERS = 3.
IF sy-subrc = 0.
p_lv_kbetr = lv_emenge.
ELSE.
CONCATENATE text-009 p_lv_kschl INTO v_err_msg.
ENDIF.
ENDFORM.
Hope it will solve your problem..
Thanks & Regards
ilesh 24x7 -
BCD_FIELD_OVERFLOW in passing to a FM
Hi!
How to solve a BCD_FIELD_OVERFLOW dump that is caused by passing a variable that has quan(15) length to a FM exporting parameter having quan(9) length.
In my case kwmeng, brgew, and ntgew(quan15) needs to be passed to value_old_imp(quan9):
Code: Select all
CALL FUNCTION 'CF_UT_UNIT_CONVERSION'
EXPORTING
matnr_imp = var1
unit_new_imp = var2
unit_old_imp = var3
value_old_imp = kwmeng/brgew/ntgew (<= dump)
IMPORTING
value_new_exp = var_new
EXCEPTIONS
overflow = 1
OTHERS = 2.
Thanks.You can check inside the source code of CF_UT_UNIT_CONVERSION.
There MATERIAL_UNIT_CONVERSION is only called with what you give to the above FM and result is what you get from MATERIAL_UNIT_CONVERSION.
Check it, if iam not wrong.
Regards
Karthik D -
Continue background job processing.
Hi All,
How to handle the system error
MESSAGE E328 WITH MATNR RAISING CONVERSION_NOT_FOUND thrown by FM MATERIAL_UNIT_CONVERSION so that the background job continue processing.
Thanks and Regards,
Ashik K.Hi,
I just now checked with this FM and worked with these two options:
1. Runtime error type 'E' will stop the program if we COMMENT the EXCEPTIONS while calling FM
* EXCEPTIONS
* CONVERSION_NOT_FOUND = 1
* INPUT_INVALID = 2
* MATERIAL_NOT_FOUND = 3
* MEINH_NOT_FOUND = 4
* MEINS_MISSING = 5
* NO_MEINH = 6
* OUTPUT_INVALID = 7
* OVERFLOW = 8
* OTHERS = 9
2. Runtime error type 'E' (which stops the program) will not come in this case
EXCEPTIONS
CONVERSION_NOT_FOUND = 1
INPUT_INVALID = 2
MATERIAL_NOT_FOUND = 3
MEINH_NOT_FOUND = 4
MEINS_MISSING = 5
NO_MEINH = 6
OUTPUT_INVALID = 7
OVERFLOW = 8
OTHERS = 9
Hope this helps.
Regards,
Amit Mittal. -
Enhancement spot not visible in debug mode
Hello experts,
I made changes in standard implicit enhancement. save and activate changes with req number. But still in Red color. While debugging I cant see the enhancement point.
in function module MATERIAL_UNIT_CONVERSION,
ENHANCEMENT-POINT BATCH_CONVERSION_FACTOR_01 SPOTS ES_SAPLMAME STATIC.
ENHANCEMENT 15 /SAPMP/PIECEBATCH_SAPLMAME. bold is in R*d color
data: lf_xsingle_unit_batch type xfeld.
........ here I declare data and code.......
ENDENHANCEMENT.
can anybody pls help on this.
Thanks in advance.
Zak.I faced the same problem.
i tried putting break point just before enhancement and the hit F5 while debugging but no help.
Then i re-transported the enhancement implementation and bingo...it showed me the code on setting BP before enhancment and then hitting F5. -
Material unit conversion - rounding up with EA
I need to always round up when doing a conversion to EA. Is this possible in a FM? I currently use FM 'MATERIAL_UNIT_CONVERSION' but it will round up, or down, when converting to EA; I need it to ALWAYS round up.
Regards,
AaronAaron.
As you want always ROUND UP, build your logic for that. FM will not serve your requirement.
Regards,
Kiran -
Converting one base unit of measure to another
Hi Experts,
i want to know the function module name , which should convert the one base unit of mesure to another base unit of measure.
like EA TO PAL , or PAL TO sqft.
i have found one function module ( MATERIAL_UNIT_CONVERSION) ,which is not giving proper output(giving only zero's)
could u please help me out from this problem.
Thanks in Advance,Hello,
Try this.
data:c_kg LIKE lips-gewei VALUE 'KG', "Weight unit in kg
c_lb LIKE lips-gewei VALUE 'LB', "Weight unit in lb(pound).
CALL FUNCTION 'UNIT_CONVERSION_SIMPLE'
EXPORTING
input = i_ln_items-brgew
unit_in = c_kg
unit_out = c_lb
IMPORTING
output = i_ln_items-brgew_lb.
If useful reward.
Vasanth -
Hi Experts,
I have one query. Can anybody will suggest me the FM which will convert the quantity into desired unit of measure?
For example I have material X having qunatity 10 CV & I would like to convert it in PAL.
Regards,
Nehayou can use either of the following
CALL FUNCTION 'UNIT_CONVERSION_SIMPLE'
EXPORTING
INPUT = VALUE_OLD_IMP
ROUND_SIGN = 'X'
UNIT_IN = UNIT_OLD_IMP
UNIT_OUT = UNIT_NEW_IMP
IMPORTING
OUTPUT = VALUE_NEW_EXP
EXCEPTIONS
CONVERSION_NOT_FOUND = 01
DIVISION_BY_ZERO = 02
INPUT_INVALID = 03
OUTPUT_INVALID = 04
OVERFLOW = 05
TYPE_INVALID = 06
UNITS_MISSING = 07
UNIT_IN_NOT_FOUND = 08
UNIT_OUT_NOT_FOUND = 09.
CALL FUNCTION 'MATERIAL_UNIT_CONVERSION'
EXPORTING
MATNR = MATNR_IMP
INPUT = VALUE_OLD_IMP
MEINH = UNIT_OLD_IMP
KZMEINH = 'X'
MEINS = MEINS_IMP
IMPORTING
OUTPUT = VALUE_MEINS_TMP
EXCEPTIONS
CONVERSION_NOT_FOUND = 01
INPUT_INVALID = 02
MATERIAL_NOT_FOUND = 03
MEINH_NOT_FOUND = 04
MEINS_MISSING = 05
NO_MEINH = 06
OUTPUT_INVALID = 07
OVERFLOW = 08.
CALL FUNCTION 'MATERIAL_UNIT_CONVERSION'
EXPORTING
MATNR = MATNR_IMP
INPUT = VALUE_MEINS_TMP
MEINH = UNIT_NEW_IMP
KZMEINH = SPACE
MEINS = MEINS_IMP
IMPORTING
OUTPUT = VALUE_NEW_EXP
EXCEPTIONS
CONVERSION_NOT_FOUND = 01
INPUT_INVALID = 02
MATERIAL_NOT_FOUND = 03
MEINH_NOT_FOUND = 04
MEINS_MISSING = 05
NO_MEINH = 06
OUTPUT_INVALID = 07
OVERFLOW = 08. -
Hi All,
I am developing a report to display the weight of delivery items in KG.
I have Gross Weight and Net Weight, which may or may not be in KG in the table.
But I need to display the output in terms of KG.
Please help me on how to go with it.
There is a function module MATERIAL_UNIT_CONVERSION but I dont know what exact parameters to pass.
Please help me with an example.
Thanks.Please try this FM.
MD_CONVERT_MATERIAL_UNIT
MATERIAL_UNIT_CONVERSION
MC_UNIT_CONVERSION
UNIT_CONVERSION_SIMPLE
using MATERIAL_UNIT_CONVERSION is as shown
report zrich_0002.
data: input type p decimals 3 value '10.000'.
data: begin of xtmp,
menge type mseg-menge,
meins type mseg-meins,
end of xtmp.
data: imara like mara.
Get base UOM
select single * from mara into imara
where matnr = '000000000040006541'.
The uoms must be of the internal format, check against T006a
do conversion
call function 'MATERIAL_UNIT_CONVERSION'
exporting
input = input
matnr = imara-matnr
meins = 'GLL' " Must be internal
meinh = 'OZA' " Must be internal
importing
meins = xtmp-meins
output = xtmp-menge
exceptions
conversion_not_found = 01
input_invalid = 02
material_not_found = 03
meinh_not_found = 04
meins_missing = 05
no_meinh = 06
output_invalid = 07
overflow = 08.
check sy-subrc = 0.
regards
navjot
Maybe you are looking for
-
Performance problems due to sequential read on tables WBCROSSGT and CROSS
Hello all, got the SAPNW2004s Sneak Preview ABAP installed. Performance is quite ok. But with certain dictionary operations like creating new attributes for a class I experience exceptional long runtimes and timeout dumps. In SM50 I see a sequential
-
I have the new Apple TV. It works great. However, today I noticed something odd. I have TV shows on my computer in iTunes and both devices use Home Sharing. Everything works great and I watch the TVs from the Computer on the Apple TV. However, when a
-
CFLAYOUT tab navigation - client wants it to act differently - please HELP
Hello, everyone. The internal webapp I'm working on has two pages that use the CFLAYOUT tag to supply a tabbed navigation to these pages. Now, you know and I know that when this is used, the tabs don't redirect the browser to a different URL; it just
-
How can I change my profile picture to a photo from iPhoto?
I want to change my profile picture on my Macbook Pro, but the only pictures that are letting me choose from, are the default pictures, I can't even see my photos from iPhoto as an option. Please help!
-
First superclass creation - getting error message
Hey again :) I just read through the Object Oriented programing tutorial. Man was it fun to read. :D Even though, I haven't fully understood the concept of interfaces and packages. But I will. Anyway, I made a superclass: public class Keyboard {