Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

problem regarding the function module MD_CONVERT_MATERIAL_UNIT

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.

Tags:
Former Member
replied

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.

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question