ABAP 供应商、工厂对应公里数维护
*&---------------------------------------------------------------------*
*& Report ZMMR011
*&
*&---------------------------------------------------------------------*
*&程序名称:供应商、工厂对应公里数维护
*&事物代码:ZMM031
*&导入模板:无
*&作者:
*&时间:2016/3/2
*&更新时间:2016/3/3
*&---------------------------------------------------------------------*
REPORT zmmr011.
TABLES: tvbvk ,cskt ,ztmm002,sscrfields.
TYPES:ty_xs LIKE v_tvbur.
DATA:gt_xs LIKE TABLE OF v_tvbur.
DATA:wa_xs TYPE v_tvbur.
DATA:edit(1) VALUE ''."ALV是否处于可编辑状态
DATA: excel TYPE ole2_object,
workbook TYPE ole2_object,
sheet TYPE ole2_object,
cell TYPE ole2_object,
row TYPE ole2_object.
DATA:lt_lfa1 TYPE lfa1 OCCURS 0 WITH HEADER LINE. "供应商内表
DATA:lt_t001w TYPE t001w OCCURS 0 WITH HEADER LINE."工厂内表
FIELD-SYMBOLS: <f1>, <f2>, <f3>.
TYPES:BEGIN OF ty_tab.
INCLUDE TYPE ztmm002.
TYPES: lifnr_name LIKE lfa1-name1,
werks_name LIKE t001w-name1.
TYPES:END OF ty_tab.
DATA :gt_zz TYPE STANDARD TABLE OF ty_tab .
DATA:wa_zz TYPE ty_tab.
FORM get_data.
* CALL FUNCTION 'VIEW_GET_DATA'
* EXPORTING
* view_name = 'V_TVBUR'
* TABLES
* data = gt_xs.
SELECT *
FROM lfa1
INTO CORRESPONDING FIELDS OF TABLE lt_lfa1.
SELECT *
FROM t001w
INTO CORRESPONDING FIELDS OF TABLE lt_t001w.
SELECT *
FROM ztmm002
INTO CORRESPONDING FIELDS OF TABLE gt_zz.
LOOP AT gt_zz INTO wa_zz.
READ TABLE lt_lfa1 WITH KEY lifnr = wa_zz-lifnr.
wa_zz-lifnr_name = lt_lfa1-name1.
READ TABLE lt_t001w WITH KEY werks = wa_zz-werks.
wa_zz-werks_name = lt_t001w-name1.
MODIFY gt_zz FROM wa_zz.
ENDLOOP.
ENDFORM.
DATA: gs_fcat TYPE lvc_s_fcat,
gt_fcat TYPE lvc_t_fcat,
gs_layo TYPE lvc_s_layo,
gs_grid TYPE lvc_s_glay.
DATA: gt_event TYPE slis_t_event WITH HEADER LINE,
gt_event_exit TYPE slis_t_event_exit WITH HEADER LINE.
DATA: ref_grid TYPE REF TO cl_gui_alv_grid .
"parameters: p_ds type c as checkbox.
SELECTION-SCREEN BEGIN OF BLOCK blk2 WITH FRAME TITLE text-002.
PARAMETERS: r1 RADIOBUTTON GROUP gr1 DEFAULT 'X' USER-COMMAND radio.
PARAMETERS: r2 RADIOBUTTON GROUP gr1.
SELECTION-SCREEN END OF BLOCK blk2.
DATA: filepath LIKE rlgrap-filename .
DATA: file LIKE rlgrap-filename.
START-OF-SELECTION.
IF r1 EQ 'X'.
PERFORM get_data.
PERFORM show_data_to_alv.
ELSEIF r2 EQ 'X'.
PERFORM frm_path_selected CHANGING filepath.
CONCATENATE filepath '\供应商工厂对应公里数模板.XLS' INTO file.
PERFORM frm_download_template USING file.
ENDIF.
CLASS lcl_event_receiver DEFINITION.
PUBLIC SECTION.
METHODS handle_modify
FOR EVENT data_changed_finished OF cl_gui_alv_grid
IMPORTING e_modified et_good_cells.
METHODS data_changed
FOR EVENT data_changed OF cl_gui_alv_grid
IMPORTING er_data_changed.
ENDCLASS.
CLASS lcl_event_receiver IMPLEMENTATION.
METHOD handle_modify.
* PERFORM refresh.
DATA stbl TYPE lvc_s_stbl.
stbl-row = 'X'." 基于行的稳定刷新
stbl-col = 'X'." 基于列稳定刷新
CALL METHOD ref_grid->refresh_table_display
EXPORTING
is_stable = stbl.
ENDMETHOD.
METHOD data_changed.
DATA: ls_mod_cells TYPE lvc_s_modi,
tvalue TYPE string.
DATA: ls_stable TYPE lvc_s_stbl.
DATA: l_message TYPE string.
*
DATA:wa_lfa1 TYPE lfa1.
DATA:wa_t001w TYPE t001w.
DATA:row_no TYPE i.
CHECK er_data_changed->mt_inserted_rows[] IS INITIAL.
LOOP AT er_data_changed->mt_good_cells INTO ls_mod_cells.
CLEAR tvalue.
CALL METHOD er_data_changed->get_cell_value
EXPORTING
i_row_id = ls_mod_cells-row_id
i_fieldname = ls_mod_cells-fieldname
IMPORTING
e_value = tvalue.
IF ls_mod_cells-fieldname EQ 'LIFNR'.
LOOP AT lt_lfa1 INTO wa_lfa1 .
IF wa_lfa1-lifnr EQ tvalue.
CALL METHOD er_data_changed->modify_cell
EXPORTING
i_row_id = ls_mod_cells-row_id
i_fieldname = 'LIFNR_NAME'
i_value = wa_lfa1-name1.
EXIT.
ENDIF.
CLEAR lt_lfa1.
ENDLOOP.
ENDIF.
IF ls_mod_cells-fieldname EQ 'WERKS'.
LOOP AT lt_t001w INTO wa_t001w.
IF wa_t001w-werks EQ tvalue.
CALL METHOD er_data_changed->modify_cell
EXPORTING
i_row_id = ls_mod_cells-row_id
i_fieldname = 'WERKS_NAME'
i_value = wa_t001w-name1.
EXIT.
ENDIF.
CLEAR wa_t001w.
ENDLOOP.
ENDIF.
* DATA:blank_zz TYPE ztmm002.
*
*
*
* LOOP AT tab_tvgrt INTO wa_tvgrt .
* IF wa_tvgrt-vkgrp EQ tvalue.
* CLEAR wa_zz.
* LOOP AT gt_zz INTO wa_zz.
* IF wa_zz-vkgrp EQ tvalue AND tvalue NE ''.
* MESSAGE i001(00) WITH '已有相同的销售组!'.
*
* "MODIFY gt_zz INDEX ls_mod_cells-row_id FROM blank_zz .
* CLEAR wa_tvgrt.
* "如果有重复的销售组,那么将输入的销售组清空
* CALL METHOD er_data_changed->modify_cell
* EXPORTING
* i_row_id = ls_mod_cells-row_id
* i_fieldname = 'VKGRP'
* i_value = ''.
* ENDIF.
*
* CONTINUE.
* ENDLOOP.
*
* CALL METHOD er_data_changed->modify_cell
* EXPORTING
* i_row_id = ls_mod_cells-row_id
* i_fieldname = 'VKGRPTEXT'
* i_value = wa_tvgrt-bezei.
* ENDIF.
* CLEAR wa_tvgrt.
* ENDLOOP.
*
* IF strlen( tvalue ) GT 4.
*
*
* LOOP AT tab_cskt INTO wa_cskt .
* IF wa_cskt-kostl EQ tvalue.
* CALL METHOD er_data_changed->modify_cell
* EXPORTING
* i_row_id = ls_mod_cells-row_id
* i_fieldname = 'LTEXT'
* i_value = wa_cskt-ltext.
* EXIT.
* ENDIF.
* CLEAR wa_cskt.
* ENDLOOP.
* ENDIF.
ENDLOOP.
ENDMETHOD. "HANDLE_MODIFY
ENDCLASS. "LCL_EVENT_RECEIVER IMPLEMENTATION
DATA gt_event_receiver TYPE REF TO lcl_event_receiver .
FORM show_data_to_alv.
CLEAR gt_fcat[].
PERFORM set_fcat USING edit.
PERFORM set_layout.
PERFORM show_alv TABLES gt_fcat gt_zz[]
USING gs_layo.
ENDFORM.
FORM frm_edit_alv." TABLES GT.
*DATA: ls_row TYPE lvc_s_cell,
* lt_rows TYPE lvc_t_cell.
* "CLEAR GT_HEADER.
* "CLEAR GT_ITEMS.
* CALL METHOD ref_grid->GET_SELECTED_CELLS
* IMPORTING
* et_index_cells = lt_rows
ENDFORM.
FORM show_changed_alv.
CLEAR gt_fcat[].
* IF edit EQ '' .
* edit = 'X'.
* ELSE.
* edit = ''.
* ENDIF.
PERFORM set_fcat USING edit.
PERFORM set_layout.
PERFORM show_alv TABLES gt_fcat gt_zz[]
USING gs_layo.
PERFORM frm_edit_alv.
ENDFORM.
FORM set_fcat USING edit.
PERFORM csalv_set_fcat USING :
" 'Field' 'Text' 'Edit' 'Zero' 'Type' 'Qfieldname' 'Key' 'Hostspot' 'Emphasize' 'Checkbox'
'LIFNR' '供应商或债权人账号' edit '' '' '' '' '' '' '' '' '' '' 'X' 'ZTMM002' 'LIFNR' 'LIFNR' 'C',
'LIFNR_NAME' '供应商名称' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '',
'WERKS' '工厂' edit '' '' '' '' '' '' '' '' '' '' 'X' 'ZTMM002' 'WERKS' '' '',
'WERKS_NAME' '工厂名称' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '',
'MENGE' '数量' edit '' '' '' '' '' '' '' '' '' '' '' '' '' 'C' 'QUAN',
'MEINS' '单位' edit '' '' '' '' '' '' '' '' '' '' '' '' '' '' ''.
ENDFORM. " SET_FCAT
FORM set_layout .
gs_layo
-zebra = 'X'.
* gs_layout-stylefname = 'FIELD_STYLE'.
gs_layo
-cwidth_opt = 'X'.
ENDFORM. " SET_LAYOUT
*&---------------------------------------------------------------------*
FORM csalv_set_fcat USING
p_name
p_text
p_edit
p_zero
p_type
p_qfieldname
p_key
p_hotspot
p_emphasize
p_checkbox
p_do_sum
p_decimals_out
p_no_out
p_f4availabl
p_ref_table
p_ref_field
p_inttype
p_datatype
.
gs_fcat
-fieldname = p_name.
* gs_fcat-reptext_l =
* gs_fcat-selddictxt =
gs_fcat
-reptext = p_text.
gs_fcat
-edit = p_edit.
gs_fcat
-no_zero = p_zero.
gs_fcat
-datatype = p_type.
gs_fcat
-qfieldname = p_qfieldname.
gs_fcat
-key = p_key.
gs_fcat
-hotspot = p_hotspot.
gs_fcat
-emphasize = p_emphasize.
gs_fcat
-checkbox = p_checkbox.
gs_fcat
-do_sum = p_do_sum.
gs_fcat
-decimals_o = p_decimals_out.
gs_fcat
-no_out = p_no_out.
gs_fcat
-f4availabl = p_f4availabl.
gs_fcat
-ref_table = p_ref_table.
gs_fcat
-ref_field = p_ref_field.
gs_fcat
-inttype = p_inttype.
gs_fcat
-datatype = p_datatype.
APPEND gs_fcat TO gt_fcat.
ENDFORM. "csalv_set_fcat
FORM show_alv TABLES pt_fcat
pt_tab
USING ps_layout.
gs_grid
-edt_cll_cb = 'X'."当屏幕失去焦点时,自动刷新
gt_event
-name = 'CALLER_EXIT'. "slis_ev_caller_exit_at_start事件
gt_event
-form = 'FM_BUTTON'.
APPEND gt_event .
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC'
EXPORTING
i_callback_program
= sy-repid
i_callback_user_command
= 'USER_COMMAND'
i_grid_settings
= gs_grid
i_callback_pf_status_set
= 'SET_PF_STATUS'
is_layout_lvc
= ps_layout
it_fieldcat_lvc
= pt_fcat[]
it_events
= gt_event[]
* it_event_exit = gt_event_exit[]
TABLES
t_outtab
= pt_tab
EXCEPTIONS
program_error
= 1
OTHERS = 2.
ENDFORM. "csalv_set_fcat
FORM user_command USING r_ucomm LIKE sy-ucomm
rs_selfield
TYPE slis_selfield.
CASE r_ucomm.
WHEN '&CHANGE'.
IF edit EQ '' .
edit = 'X'.
ELSE.
edit = ''.
ENDIF.
PERFORM show_changed_alv.
WHEN '&BACK'.
LEAVE PROGRAM.
WHEN '&ADD_ROW'.
* CLEAR wa_zz.
* DATA:end TYPE i.
* DESCRIBE TABLE gt_zz LINES end.
*
* READ TABLE gt_zz INDEX end INTO wa_zz.
* IF wa_zz-vkbur IS INITIAL AND gt_zz is NOT INITIAL .
* MESSAGE i001(00) WITH '不能继续添加行!'.
* exit.
* ENDIF.
"edit = ''.
CLEAR wa_zz.
IF edit EQ 'X'.
wa_zz
-meins = 'KM'.
APPEND wa_zz TO gt_zz.
"PERFORM show_changed_alv.
PERFORM show_data_to_alv.
ENDIF.
WHEN '&SAVE_DATA'.
DATA:lt_ztmm002 TYPE TABLE OF ztmm002.
DATA:wa_ztmm002 TYPE ztmm002.
CLEAR wa_ztmm002.
DELETE FROM ztmm002 .
MOVE-CORRESPONDING gt_zz TO lt_ztmm002.
IF lt_ztmm002 IS NOT INITIAL.
LOOP AT lt_ztmm002 INTO wa_ztmm002 .
IF wa_ztmm002-lifnr IS NOT INITIAL AND wa_ztmm002-werks IS NOT INITIAL.
INSERT INTO ztmm002 VALUES wa_ztmm002 .
ENDIF.
ENDLOOP.
"MODIFY ztmm002 FROM TABLE lt_ztmm002.
ENDIF.
IF sy-subrc EQ 0.
MESSAGE i001(00) WITH '保存成功!'.
ELSE.
MESSAGE i001(00) WITH '保存失败!'.
ENDIF.
WHEN '&DELE_ROW'.
DATA:ls_row TYPE lvc_s_row,
lt_rows
TYPE lvc_t_row.
DATA:del_rows TYPE STANDARD TABLE OF ty_tab.
CALL METHOD ref_grid->get_selected_rows
IMPORTING
et_index_rows
= lt_rows
* et_row_no =
.
CLEAR wa_zz.
LOOP AT lt_rows INTO ls_row.
READ TABLE gt_zz INTO wa_zz INDEX ls_row-index.
"delete gt_zz INDEX ls_row-index.
"DELETE ztmm002 FROM wa_zz.
APPEND wa_zz TO del_rows.
ENDLOOP.
LOOP AT del_rows INTO wa_zz.
DELETE TABLE gt_zz FROM wa_zz.
ENDLOOP.
CLEAR del_rows.
CLEAR ls_row.
CLEAR lt_rows.
PERFORM show_changed_alv.
WHEN '&IN'.
DATA: filepath LIKE rlgrap-filename.
PERFORM set_file_path CHANGING filepath.
PERFORM frm_upload_from_excel USING filepath.
PERFORM show_changed_alv.
ENDCASE.
ENDFORM.
FORM set_pf_status USING rt_extab TYPE slis_t_extab..
SET PF-STATUS 'STANDARD'.
ENDFORM. "SET_PF_STATUS
FORM fm_button USING e_grid TYPE slis_data_caller_exit.
DATA: lt_f4 TYPE lvc_t_f4,
ls_f4
TYPE lvc_s_f4.
CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
* EXPORTING
* IR_SALV_FULLSCREEN_ADAPTER =
IMPORTING
* ET_EXCLUDING =
* E_REPID =
* E_CALLBACK_PROGRAM =
* E_CALLBACK_ROUTINE =
e_grid
= ref_grid
* ET_FIELDCAT_LVC =
* ER_TRACE =
* E_FLG_NO_HTML =
* ES_LAYOUT_KKBLO =
* ES_SEL_HIDE =
* ET_EVENT_EXIT =
* ER_FORM_TOL =
* ER_FORM_EOL =
.
* CALL METHOD ref_grid->check_changed_data.
* 设置enter事件
CALL METHOD ref_grid->register_edit_event
EXPORTING
i_event_id
= cl_gui_alv_grid=>mc_evt_enter
EXCEPTIONS
error
= 1
OTHERS = 2.
CREATE OBJECT gt_event_receiver.
SET HANDLER gt_event_receiver->handle_modify FOR ref_grid.
SET HANDLER gt_event_receiver->data_changed FOR ref_grid.
ENDFORM.
FORM frm_upload_from_excel USING p_pa_fname LIKE rlgrap-filename.
TYPES: BEGIN OF ty_tmp,
lifnr
LIKE ztmm002-lifnr,
lifnr_name
LIKE lfa1-name1,
werks
LIKE ztmm002-werks,
werks_name
LIKE t001w-name1,
menge
LIKE ztmm002-menge,
meins
LIKE ztmm002-meins,
END OF ty_tmp.
DATA: git_xls TYPE TABLE OF ty_tmp WITH HEADER LINE,
gwa_xls
TYPE ty_tmp.
**数据从EXCEL导入程序
DATA: l_exception TYPE REF TO cx_root.
DATA: lit_intern TYPE alsmex_tabline OCCURS 0 WITH HEADER LINE,
l_index
TYPE i,
l_no
TYPE i.
DATA: ls_style TYPE lvc_s_styl.
FIELD-SYMBOLS: <f>.
CHECK p_pa_fname IS NOT INITIAL.
REFRESH: git_xls.
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
filename
= p_pa_fname
i_begin_col
= 1
i_begin_row
= 2
i_end_col
= 6
i_end_row
= 30000
TABLES
intern
= lit_intern
EXCEPTIONS
inconsistent_parameters
= 1
upload_ole
= 2
OTHERS = 3.
IF sy-subrc = 0.
l_no
= 0.
LOOP AT lit_intern.
MOVE lit_intern-col TO l_index.
ASSIGN COMPONENT l_index OF STRUCTURE gwa_xls TO <f>.
TRY.
MOVE lit_intern-value TO <f>.
CATCH cx_root INTO l_exception.
* gwa_xls-err_info = l_exception->get_text( ).
* gwa_xls-status = icon_led_red.
ENDTRY.
AT END OF row.
ADD 1 TO l_no.
"gwa_xls-no = l_no.
APPEND gwa_xls TO git_xls.
CLEAR gwa_xls.
ENDAT.
ENDLOOP.
ENDIF.
LOOP AT git_xls INTO gwa_xls.
MOVE-CORRESPONDING gwa_xls TO wa_zz.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = wa_zz-lifnr
IMPORTING
output = wa_zz-lifnr.
SELECT SINGLE name1 INTO wa_zz-lifnr_name
FROM lfa1 WHERE lifnr EQ wa_zz-lifnr.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = wa_zz-werks
IMPORTING
output = wa_zz-werks.
SELECT SINGLE name1 INTO wa_zz-werks_name
FROM t001w WHERE werks EQ wa_zz-werks.
APPEND wa_zz TO gt_zz.
CLEAR wa_zz.
ENDLOOP.
ENDFORM.
FORM set_file_path CHANGING filepath LIKE rlgrap-filename.
FIELD-SYMBOLS: <f> TYPE file_table .
DATA: gd_path TYPE string.
DATA: it_tab TYPE filetable,
gd_subrc
TYPE i.
DATA: ld_filename TYPE string,
ld_path
TYPE string,
ld_fullpath
TYPE string,
ld_result
TYPE i,
gd_file
TYPE c.
DATA:"filepath LIKE rlgrap-filename,
openfile
LIKE rlgrap-filename.
* CALL METHOD cl_gui_frontend_services=>directory_browse
* EXPORTING
* window_title = '文件路径选择'
* initial_folder = 'C:'
* CHANGING
* selected_folder = gd_path.
* CALL METHOD cl_gui_cfw=>flush.
* CONCATENATE gd_path '' INTO filepath.
CALL METHOD cl_gui_frontend_services=>file_open_dialog
EXPORTING
window_title
= 'Select File'
default_filename
= '供应商工厂对应公里数模板.XLS'
multiselection
= 'X'
CHANGING
file_table
= it_tab
rc
= gd_subrc.
* LOOP AT it_tab INTO openfile-low.
* openfile-sign = 'I'.
* openfile-option = 'EQ'.
* APPEND openfile.
* ENDLOOP.
CALL METHOD cl_gui_cfw=>flush.
READ TABLE it_tab ASSIGNING <f> INDEX 1.
IF sy-subrc EQ 0.
filepath
= <f>-filename.
ENDIF.
*CALL METHOD cl_gui_frontend_services=>file_save_dialog
* EXPORTING
* default_extension = 'XLS'
* default_file_name = '产品出库单'
* initial_directory = 'c:/temp/'
* CHANGING
* filename = ld_filename
* path = filepath
* fullpath = ld_fullpath
* user_action = ld_result.
ENDFORM.
FORM frm_path_selected CHANGING filepath LIKE rlgrap-filename.
DATA: gd_path TYPE string.
DATA: it_tab TYPE filetable,
gd_subrc
TYPE i.
DATA: ld_filename TYPE string,
ld_path
TYPE string,
ld_fullpath
TYPE string,
ld_result
TYPE i,
gd_file
TYPE c.
DATA:"filepath LIKE rlgrap-filename,
openfile
LIKE rlgrap-filename.
CALL METHOD cl_gui_frontend_services=>directory_browse
EXPORTING
window_title
= '文件路径选择'
initial_folder
= 'C:'
CHANGING
selected_folder
= gd_path.
CALL METHOD cl_gui_cfw=>flush.
CONCATENATE gd_path '' INTO filepath.
ENDFORM.
FORM frm_download_template USING c_path .
DATA: lv_objdata LIKE wwwdatatab,
lv_obj_name
LIKE wwwdatatab-objid,
lv_destination
LIKE rlgrap-filename,
lv_objid
LIKE sy-repid,
lv_subrc
LIKE sy-subrc.
DATA:l_ret TYPE abap_bool, lv_answer
.
DATA:lv_file TYPE string.
MOVE c_path TO lv_file.
CALL METHOD cl_gui_frontend_services=>file_exist
EXPORTING
file
= lv_file
RECEIVING
result
= l_ret
EXCEPTIONS
cntl_error
= 1
error_no_gui
= 2
wrong_parameter
= 3
not_supported_by_gui
= 4
OTHERS = 5.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
EXIT.
ENDIF.
IF l_ret EQ 'X'.
* 模版已存在,是否覆盖
CALL FUNCTION 'POPUP_TO_CONFIRM'
EXPORTING
text_question
= '模版已存在,是否覆盖?'
text_button_1
= '是'(001)
text_button_2
= '否'(002)
IMPORTING
answer
= lv_answer
EXCEPTIONS
text_not_found
= 1
OTHERS = 2.
IF sy-subrc <> 0.
ENDIF.
IF lv_answer EQ 'A'. "取消
EXIT.
ELSEIF lv_answer NE '1'. "否
"p_filepath = c_path.
ENDIF.
ELSE.
lv_answer
= '1'.
ENDIF.
CREATE OBJECT excel 'EXCEL.APPLICATION'.
GET PROPERTY OF excel 'Workbooks' = workbook .
CALL METHOD OF workbook
'Close'.
IF lv_answer EQ '1'.
MOVE 'ZMM_XLS_002' TO lv_obj_name."引用传入到服务器中xls模板
SELECT relid objid
FROM wwwdata
INTO CORRESPONDING FIELDS OF lv_objdata
UP TO 1 ROWS
WHERE srtf2 = 0 AND relid = 'MI'
AND objid = lv_obj_name.
ENDSELECT.
CALL FUNCTION 'DOWNLOAD_WEB_OBJECT'
EXPORTING
key = lv_objdata
destination
= c_path
IMPORTING
rc
= lv_subrc.
* IF lv_subrc = 0.
* p_filepath = c_path.
* ENDIF.
ENDIF.
* CALL METHOD OF
* g_workbook
* 'open'
*
* EXPORTING
* #1 = c_path.
*
* CALL METHOD OF
* g_excel
* 'worksheets' = g_sheet
* EXPORTING
* #1 = 1.
* CALL METHOD OF
* g_sheet
* 'activate'.
"SET PROPERTY OF g_excel 'visible' = 0.
FREE OBJECT sheet.
"FREE OBJECT g_applica.
FREE OBJECT workbook.
FREE OBJECT excel.
ENDFORM. "frm_download_template
ABAP 供应商、工厂对应公里数维护的更多相关文章
- ABAP 自建透明表维护
*&---------------------------------------------------------------------* *& Report ZMMR011 ...
- abap 开发之创建表维护生成器
在sap开发中有时需要对一些自建表维护数据,但又不想写程序,怎么办呢??这个时候我们可以直接生成个表维护生成器,为其定义一个事物码就ok了.以下是表格维护生成器的生成步骤. 首先我们需要先定义表.输入 ...
- [SAP ABAP开发技术总结]ABAP常用事务码
声明:原创作品,转载时请注明文章来自SAP师太技术博客( 博/客/园www.cnblogs.com):www.cnblogs.com/jiangzhengjun,并以超链接形式标明文章原始出处,否则将 ...
- 依赖注入及AOP简述(二)——工厂和ServiceLocator .
2.2. 工厂模式 基于手工构建组件的诸多弱点,1995年“大师4人组”(GoF)在其经典著作<DesignPatterns>一书中提出了“工厂模式”,这种模式在一定程度上有效的解决 ...
- SAP MM 明明已经扩展供应商到采购组织下,采购订单里还是报错?
SAP MM 明明已经扩展供应商到采购组织下,采购订单里还是报错? 如下的PO 4400000069,处于HELD状态.ME22N试图保存它为一个正式的采购订单,报错说供应商没有在采购组织下维护, 使 ...
- python风格的抽象工厂模式
抽象工厂模式: 提供一个接口,用户创建多个相关或依赖对象,而不需要指定具体类. 原则: 依赖抽象,不依赖具体类. 实例: 用不同原材料制作不同口味的披萨,创建不同原材料的工厂,不同实体店做出口味不同的 ...
- 浅谈cocos2dx(18) 中工厂模式
----我的生活.我的点点滴滴! ! cocos2d-x中也有工厂模式.何为工厂模式,顾名思义就是用来产生产品的,工厂就是用来创建其它类对象的类,我们把这个创建其它类对象的类叫做工厂类.而这些被创建的 ...
- 使用ABAP绘制可伸缩矢量图
Jerry去年的文章 动手使用ABAP Channel开发一些小工具,提升日常工作效率 里曾经介绍过一些用ABAP实现的可供娱乐的小程序,比如用古老的HPGL接口在SAPGUI里绘图: 关于如何用SA ...
- SAP 跨公司销售业务
SAP 跨公司销售业务 http://blog.sina.com.cn/s/blog_95ac31e30102x5wh.html 分类: SAP_SD SAP 跨公司销售业务 一.业务简介 在由 ...
随机推荐
- XDU 1161 - 科协的数字游戏II
Problem 1161 - 科协的数字游戏II Time Limit: 1000MS Memory Limit: 65536KB Difficulty: Total Submit: 112 ...
- 机器学习之Hash集合问题
问题来源与七月学习之 (3.x线性代数与矩阵运算基础)
- 【C语言入门教程】7.4 共用体
7.4 共用体 共用体又称为联合体,是由不同的数据类型组成的一个整体.与结构体不同的是,共用体每次只能使用其中一个成员.结构体的总长度是结构体所有成员长度之和,共用体的总长度是其中最长一个数据类型的长 ...
- CentOS 6.5 zabbix 3.0.4 乱码问题
中文支持 修改web端源文件来开启语言 [root@localhost /]# vim /var/www/html/zabbix/include/locales.inc.php 'zh_CN' =&g ...
- 第五章第二例题关于Vector(LRJ)
vector(动态数组)(粘) 一.概述 vector是C++标准模板库中的部分内容,它是一个多功能的,能够操作多种数据结构和算法的模板类和函数库.vector是一个容器,它能够存放各种类型的对象,简 ...
- BZOJ3172——[Tjoi2013]单词
1. 题目大意:一篇论文是由许多单词组成,现在想知道每个单词分别在论文中出现多少次. 2.分析:对着 广义后缀自动机的图看,我们就会发现玄机,答案不就是这个单词下的后缀个数吗? 于是建立自动机,然后求 ...
- .net 默认时间格式不正确
经测试发现,有时通过在“日期.时间.语言和区域设置”里面设置是无效的. 对应键值为HKEY_LOCAL_MACHINE"SOFTWARE"Microsoft"OLEAUT ...
- sql执行顺序
SQL 不同于与其他编程语言的最明显特征是处理代码的顺序.在大数编程语言中,代码按编码顺序被处理,但是在SQL语言中,第一个被处理的子句是FROM子句,尽管SELECT语句第一个出现,但是几乎总是最后 ...
- 跟着百度学PHP[4]-OOP面对对象编程-2-属性和方法
简单的说 变量就是成员属性函数就是成员方法(方法有三:构造方法[即为__construct].成员方法.析构方法[__destruct]) 成员方法和成员属性都是可以加修饰词.比如封装性的方法或者属性 ...
- 数据结构大二课程设计:QT实现线段树
源码以及编译文件下载地址:http://download.csdn.net/detail/zhiyanpianyu1234/9445909#comment 加入了一些小东西,一直觉得课设是做给自己看的 ...