REPORT Y_TEST1 .
- Title : ZPPR101 *
- Application : PP *
- Subject : 批量更改BOM组件 *
- Requested by : PP *
- Execution : any time *
- Ref no: : B221 *
- Author : rainy *
- Req Date : 20150701 *
- Production Order Variance Report *
*1.取数: Excel 上传数据并对数据bom 批量更改BOM组件
*2.输出: *
- MODIFICATIONS (latest entry at the top) *
- ------------------------------------------------------------------- *
- REL DATE NAME (COMPANY) DESCRIPTION TASK-NO *
- — ---- ---- --------- ----------- ------- *
-
*report zppr017b.
data csap_mbom type csap_mbom.
data t_stpo type standard table of stpo_api02 with header line.
data: begin of g_matnr occurs 0,
matnr like mara-matnr,
end of g_matnr.
data: filename type string.
- 对应Excel导入文件的结构
data: begin of gt_data occurs 0,
matnr like mara-matnr,
qty like stpo-menge,
unit like stpo-meins,
comp like mara-matnr,
comp_scrap like stpo-ausch,
item_no like stpo-posnr,
end of gt_data.
data it_comp_data like standard table of gt_data with header line.
data wa_gt_data like gt_data.
&---------------------------------------------------------------------
*& 选择屏幕
&---------------------------------------------------------------------
selection-screen begin of block block1 with frame title text-001 . "‘请指定选择条件’.
"BOM 选择条件
parameters p_plant like csap_mbom-werks.
parameters p_usage like csap_mbom-stlan.
parameters p_alt like csap_mbom-stlal.
parameters p_datuv like csap_mbom-datuv .
selection-screen end of block block1.
selection-screen skip.
selection-screen begin of block block2 with frame title text-002. " ‘请指定本地EXCEL文件’
parameters: p_name like rlgrap-filename obligatory.
selection-screen end of block block2.
selection-screen skip.
selection-screen begin of block block3 with frame title text-003 . " ‘说明’.
selection-screen comment /2(79) text-004.
selection-screen comment /2(79) text-005.
selection-screen end of block block3.
initialization. " 初始化选择屏上的变量
- 读取文件
at selection-screen on value-request for p_name.
call function ‘WS_FILENAME_GET’
exporting
def_path = ‘C:’
mask = ‘,DAT(.DATA),.DAT.’
"MASK = ‘,Excel文件