單位轉換函式: MATERIAL_UNIT_CONVERSION

kevinhaerbin發表於2009-02-20

DATA: BEGIN OF gt_billing OCCURS 0,

fkdat TYPE fkdat, " vbrk
kunag TYPE kunag, " vbrk / kna1
land1 TYPE land1, " kna1
kurrf TYPE kurrf, " vbrk

werks TYPE werks_d, " vbrp
fklmg TYPE fklmg, " vbrp
meins TYPE meins, " vbrp
netwr TYPE netwr_fp, " vbrp
waerk TYPE waerk, " vbrp
vkorg_auft TYPE vkorg_auft, " vbrp / mvke
vtweg_auft TYPE vtweg_auft, " vbrp / mvke
mvgr1 TYPE mvgr1, " mvke

matnr TYPE matnr, " marc / vbrp
gpnum TYPE gpnum, " marc
prodmeins TYPE meins, " zprodcom

menge TYPE menge_d, " mseg
meins_totprod TYPE meins, " mseg

mtart TYPE mtart, " mara gsu-150
sale_netwr TYPE vbap-netwr, " vbap gsu-150
sale_netwr_be TYPE vbap-netwr, " vbap gsu-150
END OF gt_billing.

* --- compare the unit with base unit , if not equal change the corresponding value and amount
CALL FUNCTION 'MATERIAL_UNIT_CONVERSION'
EXPORTING
input = gt_billing-fklmg
* KZMEINH = ' '
matnr = gt_billing-matnr
meinh = gt_billing-prodmeins
meins = gt_billing-meins
* EXTENDED_CONV = ' '
* TYPE_UMR = ' '
* NO_OUTPUT = ' '
* CHARGE =
* CHARG_CUOBJ =
* WERKS =
IMPORTING
* ADDKO =
* MEINS =
output = gt_billing-fklmg
* UMREN =
* UMREZ =
* BATCH_CONVERSION_ERROR =
* KZWSO =
EXCEPTIONS
conversion_not_found = 1
input_invalid = 2
material_not_found = 3
meinh_not_found = 4
meins_missing = 5
no_meinh = 6
output_invalid = 7
overflow = 8
OTHERS = 9.

注:

MD_CONVERT_MATERIAL_UNIT
EHSWA_490_UNIT_CONVERSION

[@more@]

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/11011430/viewspace-1017633/,如需轉載,請註明出處,否則將追究法律責任。

相關文章