2010年8月3日

Classification 特性值讀取及新增(修改)

DATA: objectkey LIKE bapi1003_key-object,
status
LIKE bapi1003_key-status,
classnum
LIKE bapi1003_key-classnum,
standardclass
LIKE bapi1003_key-stdclass,
allocvaluesnum
LIKE bapi1003_alloc_values_num OCCURS 0 WITH HEADER LINE,
allocvalueschar
LIKE bapi1003_alloc_values_char OCCURS 0 WITH HEADER LINE,
allocvaluescurr
LIKE bapi1003_alloc_values_curr OCCURS 0 WITH HEADER LINE,
return LIKE bapiret2 OCCURS 0 WITH HEADER LINE.

DATA: lv_char(5).

objectkey = p_matnr. “object table MARA時放物料號碼

CALL FUNCTION ‘BAPI_OBJCL_GETDETAIL’
EXPORTING
objectkey = objectkey
objecttable =
‘MARA’
classnum = classnum
classtype =
‘001′
language = ‘M’
IMPORTING
status = status
standardclass = standardclass
TABLES
allocvaluesnum = allocvaluesnum
allocvalueschar = allocvalueschar
allocvaluescurr = allocvaluescurr
return = return.

特性值新增(修改),特性值已存在時是修改,不存在是新增

CALL FUNCTION ‘BAPI_OBJCL_CHANGE’
EXPORTING
objectkey = ls_bapi1003_key-object
objecttable = ls_bapi1003_key-objecttable
classnum = ls_bapi1003_key-classnum
classtype = ls_bapi1003_key-classtype

TABLES
allocvaluesnumnew = allocvaluesnumnew
allocvaluescharnew = allocvalueschar
allocvaluescurrnew = allocvaluescurrnew
return = it_return

沒有留言:

張貼留言