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

Problem with FM - MD_CONVERT_MATERIAL_UNIT (calling from program)

former_member203070
Participant
0 Likes
2,555

Hi experts:

I have a problem using the FM - MD_CONVERT_MATERIAL_UNIT.

When I use the FM in dry run (from SE37) its giving me the correct result.

But whenever I'm calling the same FM from my code, its returning SY-SUBRC = 1 .

Please reply.

------------------------------------------------------

data:fp_menge type menge_d.

  CALL FUNCTION 'MD_CONVERT_MATERIAL_UNIT'

  EXPORTING

  i_matnr = '000000000000005382'

  i_in_me = 'E21'

  i_out_me = 'E24'

  i_menge = 4

  IMPORTING

  e_menge = fp_menge

  EXCEPTIONS

  error_in_application = 1

  error = 2

  OTHERS = 3.

  write:/ sy-subrc, fp_menge.

3 REPLIES 3
Read only

former_member187748
Active Contributor
0 Likes
1,040

Hi Partha,

clearly its an application error, please show the declaration of fp_menge in your program. Please write it as shown below and see is it working or not

DATA : fp_menge TYPE ekpo-menge.

Read only

RaymondGiuseppi
Active Contributor
0 Likes
1,040

Did you check for internal/external format of fields and/or conversion-exit, as on units of measure fields (*)

Regards,

Raymond

(*) conversion CUNI based on table T006A language dependant.

Read only

Former Member
0 Likes
1,040

Please pass correct 'Base Unit of Measure'(MARA-MEINS)

Both 4 parameters are pass by value

MARA-MATNR

MARA-MEINS

MARA-MEINS

EKPO-MENGE

All the values should be the above type.

Regards,

Vadamalai.