SAP ABAP 获取批次特性
DATA:e_objek TYPE cuobn,
e_obtab TYPE tabelle,
e_klart TYPE klassenart,
e_class TYPE klasse_d,
lv_objectkey TYPE bapi3060_allocation-objectkey,
batchcontrolfields TYPE bapibatchctrl,
return TYPE TABLE OF bapiret2,
w_return TYPE bapiret2,
allocvaluesnum TYPE TABLE OF bapi1003_alloc_values_num,
allocvalueschar TYPE TABLE OF bapi1003_alloc_values_char,
allocvaluescurr TYPE TABLE OF bapi1003_alloc_values_curr.
DATA:ls_allocvaluesnum TYPE bapi1003_alloc_values_num,
ls_allocvalueschar TYPE bapi1003_alloc_values_char,
ls_allocvaluescurr TYPE bapi1003_alloc_values_curr.
IF <lfs_data>-charg IS NOT INITIAL.
CALL FUNCTION 'VB_BATCH_2_CLASS_OBJECT' "读取批次属性值
EXPORTING
i_matnr = <lfs_data>-matnr
i_charg = <lfs_data>-charg
i_werks = <lfs_data>-werks
IMPORTING
e_objek = e_objek
e_obtab = e_obtab
e_klart = e_klart
e_class = e_class.
CALL FUNCTION 'BAPI_OBJCL_GETDETAIL' "读取批次中各特征值
EXPORTING
objecttable = e_obtab
classnum = e_class
classtype = e_klart
objectkey_long = e_objek
TABLES
allocvaluesnum = allocvaluesnum
allocvalueschar = allocvalueschar
allocvaluescurr = allocvaluescurr
return = return.
READ TABLE allocvalueschar INTO ls_allocvalueschar
WITH KEY charact = 'ZMIGO_VENDORNAME'.
ENDIF.
ZMIGO_VENDORNAME批次特性的值:ls_allocvalueschar-value_char_long