2011年6月14日 星期二

[Func] Converting Material Quantities To Different Unit Of Measure

單位轉換
Example code:
IF GT_ITAB-VRKME EQ GT_ITAB-KMEIN OR
   GT_ITAB-KMEIN EQ SPACE.
  LV_LFIMG = GT_ITAB-LFIMG.
ELSE.
  CALL FUNCTION 'MATERIAL_UNIT_CONVERSION'
    EXPORTING
      INPUT    = GT_ITAB-LFIMG
      KZMEINH  = 'X'
      MATNR    = GT_ITAB-MATNR
      MEINH    = GT_ITAB-VRKME
      MEINS    = GT_ITAB-KMEIN
      TYPE_UMR = '3'
    IMPORTING
      OUTPUT   = LV_LFIMG.
ENDIF.