Application Development 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: 

problem regarding the function module MD_CONVERT_MATERIAL_UNIT

Former Member
0 Kudos

Hi freinds iam facing a problem regarding the above function module.

MD_CONVERT_MATERIAL_UNIT

data :

p1_matnr type mara-matnr,

p1_meins type mara-meins,

p1_menge type ekpo-menge,

P2_meins type mara-meins,

Ld_menge_out TYPE ekpo-menge.

P1_matnr = wa_final-matnr.

P1_meins = wa_final-meins.

P2_meins = wa_ekpo-meins.

P1_menge = wa_final-menge.

CALL FUNCTION 'MD_CONVERT_MATERIAL_UNIT'

EXPORTING

I_MATNR = P1_MATNR

I_IN_ME = P1_MEINS

I_OUT_ME = P2_MEINS

I_MENGE = P1_MENGE

IMPORTING

E_MENGE = LD_MENGE_OUT

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.

ENDIF.

it is not copying E_MENGE to LD_MENGE_OUT .

It is showing SY-subrc value = 2 .

Can any one tell me how can i correct it.

Regards,

PRIYANKA.

1 ACCEPTED SOLUTION

praveen_kumar132
Participant
0 Kudos

Hi Priyanka,


data : 
p1_matnr type mara-matnr,
p1_meins type mara-meins,
p1_menge type ekpo-menge,
P2_meins type mara-meins,
Ld_menge_out TYPE ekpo-menge.


P1_matnr = wa_final-matnr.
P1_meins = wa_final-meins.
P2_meins = wa_ekpo-meins.
P1_menge = wa_final-menge.

DATA : lv_lfimg TYPE vbdpl-lfimg  " for menge declare like this

CALL FUNCTION 'MD_CONVERT_MATERIAL_UNIT'
EXPORTING
I_MATNR = P1_MATNR
I_IN_ME = P1_MEINS
I_OUT_ME = P2_MEINS
I_MENGE = P1_MENGE
IMPORTING
E_MENGE =  lv_lfimg                   " give like this
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. 
ENDIF.

6 REPLIES 6

Former Member
0 Kudos

have you checked the FM seperately.

It will work fine. I think there may be mismatch between the values you passed.

0 Kudos

IT IS working fine seperatly.

but progrmatically it is not working properly.

its not passing back the value to Ld_menge_out.

Regards,

Priyanka.

former_member181995
Active Contributor
0 Kudos

Priyanka,

See this include LKAIPFC3 and define your parameter exactly same as in include.

Former Member
0 Kudos

Hello

You answered earlier:

praveen_kumar132
Participant
0 Kudos

Hi Priyanka,


data : 
p1_matnr type mara-matnr,
p1_meins type mara-meins,
p1_menge type ekpo-menge,
P2_meins type mara-meins,
Ld_menge_out TYPE ekpo-menge.


P1_matnr = wa_final-matnr.
P1_meins = wa_final-meins.
P2_meins = wa_ekpo-meins.
P1_menge = wa_final-menge.

DATA : lv_lfimg TYPE vbdpl-lfimg  " for menge declare like this

CALL FUNCTION 'MD_CONVERT_MATERIAL_UNIT'
EXPORTING
I_MATNR = P1_MATNR
I_IN_ME = P1_MEINS
I_OUT_ME = P2_MEINS
I_MENGE = P1_MENGE
IMPORTING
E_MENGE =  lv_lfimg                   " give like this
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. 
ENDIF.

Former Member
0 Kudos

Hi,

This function module should work please chekc in debugging or execute funciton moudle directly in SE37