1 DATA:lv_mtart TYPE mara-mtart,
2 lv_matnr TYPE mara-matnr,
3 lv_mbrsh TYPE mara-mbrsh.
4 DATA:lt_number TYPE TABLE OF bapimatinr,
5 lt_return TYPE TABLE OF bapireturn1.
6
7 CALL FUNCTION 'BAPI_MATERIAL_GETINTNUMBER'
8 EXPORTING
9 material_type = lv_mtart "物料类型
10 industry_sector = lv_mbrsh "行业领域(默认值为空)
11 required_numbers = 1 "数量(默认值为1)
12 IMPORTING
13 return = lt_return
14 TABLES
15 material_number = lt_number.
16
17 LOOP AT lt_number ASSIGNING FIELD-SYMBOL(<fs_number>) .
18
19 CALL FUNCTION 'CONVERSION_EXIT_MATN1_INPUT'
20 EXPORTING
21 input = <fs_number>-material
22 IMPORTING
23 output = <fs_number>-material.
24
25 ENDLOOP .