获取物料特征值
客户业务中,由于对外需要每个物料的产品型号一致,因此,在维护特征值中,没有批次的维护。
因此获取特征值的Function Module 也没有import批次号的属性:
1 FUNCTION zbc_get_product_model. 2 *"---------------------------------------------------------------------- 3 *"*"Local interface: 4 *" IMPORTING 5 *" REFERENCE(IP_OBJECTKEY) TYPE MATNR 6 *" EXPORTING 7 *" REFERENCE(EP_PROMO) TYPE ZPROMO 8 *"---------------------------------------------------------------------- 9 10 11 * 产品型号 12 DATA: 13 lt_num TYPE STANDARD TABLE OF bapi1003_alloc_values_num WITH HEADER LINE, 14 lt_char TYPE STANDARD TABLE OF bapi1003_alloc_values_char WITH HEADER LINE, 15 lt_curr TYPE STANDARD TABLE OF bapi1003_alloc_values_curr WITH HEADER LINE, 16 lt_return TYPE STANDARD TABLE OF bapiret2. 17 18 DATA: 19 lv_objectkey LIKE bapi1003_key-object, 20 lv_objecttable LIKE bapi1003_key-objecttable VALUE 'MARA', 21 lv_classnum LIKE bapi1003_key-classnum VALUE 'Z_MATERIAL_1', 22 lv_classtype LIKE bapi1003_key-classtype VALUE '001', 23 lv_charact LIKE bapi1003_alloc_values_char-charact VALUE 'Z_GGMAT'. 24 25 * 取特性/特征值 26 lv_objectkey = ip_objectkey. "物料 27 CALL FUNCTION 'BAPI_OBJCL_GETDETAIL' 28 EXPORTING 29 objectkey = lv_objectkey "物料 30 objecttable = lv_objecttable "MARA表 31 classnum = lv_classnum "类别 32 classtype = lv_classtype "类别种类 33 TABLES 34 allocvaluesnum = lt_num "数值型特性值 35 allocvalueschar = lt_char "字符型特性值 36 allocvaluescurr = lt_curr "货币型特性值 37 return = lt_return. "返回值 38 39 LOOP AT lt_char. 40 IF lt_char-charact = lv_charact. 41 ep_promo = lt_char-value_char. 42 EXIT. 43 ENDIF. 44 ENDLOOP. 45 46 ENDFUNCTION.