Skip to Content
avatar image
Former Member

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.

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

5 Answers

  • Best Answer
    Sep 02, 2008 at 10:36 AM

    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.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 02, 2008 at 09:41 AM

    have you checked the FM seperately.

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

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      IT IS working fine seperatly.

      but progrmatically it is not working properly.

      its not passing back the value to Ld_menge_out.

      Regards,

      Priyanka.

  • Sep 02, 2008 at 09:49 AM

    Priyanka,

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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 02, 2008 at 09:50 AM
    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 02, 2008 at 10:53 AM

    Hi,

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

    Add comment
    10|10000 characters needed characters exceeded