Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

how to convert quantity

Former Member
0 Likes
833

Hi ,

i develop purchase register when i run this by giving only miro date then it will give me wrong o/p with message

EA could not be converted to TO but when i run this with miro date and perticular tax code the it will give me correct output.

in this report i use the function CALCULATE_TAX_ITEM.

Thanks

Dinesh

3 REPLIES 3
Read only

Former Member
0 Likes
620

Use the function module -> MD_CONVERT_MATERIAL_UNIT.

This will convert the unit if the conversion factor is maintained in material master

Read only

0 Likes
620

hi Jeniphin

can u please explain how to use this function module in

a program with example.

Thanks

Dinesh

Read only

Former Member
0 Likes
620

Suppose if i want to find the UoM for a material

Use the below Fn. module.

DATA: i_matnr TYPE mara-matnr,

i_in_me TYPE mara-meins,

i_out_me TYPE mara-meins,

i_menge TYPE ekpo-menge, "Input value

e_menge TYPE ekpo-menge. " Your output value

i_matnr = ->material numer.

i_in_me = -> Input unit.

i_out_me = ->to which unit it has to convert.

i_menge = -> Input value.

CALL FUNCTION 'MD_CONVERT_MATERIAL_UNIT'

EXPORTING

i_matnr = i_matnr "Material number

i_in_me = i_in_me "Input unit

i_out_me = i_out_me "Output unit i_menge = i_menge "i/p value

IMPORTING

E_MENGE = e_menge " o/p value

EXCEPTIONS

ERROR_IN_APPLICATION = 1

ERROR = 2

OTHERS = 3

.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ELSE.

ENDIF.