admin 管理员组

文章数量: 887021


2024年2月18日发(作者:do while循环的语句格式)

SAP批量修改销售订单FirstDate*&---------------------------------------------------------------------**& Report ZSD200*&---------------------------------------------------------------------**&PROGRAM NAME : *---------------------------------------------------------------------** VERSION: V1.0* DATE CREATED : 2018/09/17* CREATED BY : XXXXX* TRANSPORT REQUEST: XXXXXXXXXX* DESCRIPTION : Update Requested Delivery Date.* request raised by: XXXXXREPORT zsd200.********************************* INNITIALIZATION********************************TYPES: BEGIN OF lty_infor, vbeln TYPE vbak-vbeln,* vdatu TYPE vbak-vdatu, edatu TYPE vbep-edatu, fldname TYPE fnam_____4, message_text TYPE char300, END OF lty_ : BEGIN OF ltype_vbuk, vbeln TYPE vbuk-vbeln, gbstk TYPE vbuk-gbstk, END OF ltype_ : BEGIN OF ltype_vbup, vbeln TYPE vbup-vbeln, posnr TYPE vbup-posnr, lfgsa TYPE vbup-lfgsa, END OF ltype_: lt_infor TYPE TABLE OF lty_infor, ls_infor LIKE LINE OF lt_: lt_upload LIKE TABLE OF alsmex_tabline, ls_upload LIKE LINE OF lt_: g_update_flag TYPE char1 VALUE 'X'. "//should be updatedDATA : lt_vbuk TYPE TABLE OF ltype_vbuk, ls_vbuk LIKE LINE OF lt_ : lt_vbup TYPE TABLE OF ltype_vbup, ls_vbup LIKE LINE OF lt_ :msg1(50) TYPE c,msg2(50) TYPE c.********************************* SELECTION-SCREEN********************************SELECTION-SCREEN BEGIN OF BLOCK blk01 WITH TERS: p_path LIKE ibipparms-path ION-SCREEN END OF BLOCK blk01.

SELECTION-SCREEN END OF BLOCK blk01.********************************* AT SELECTION-SCREEN ON VALUE-REQUEST FOR xxxxx.********************************AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_path. PERFORM frm_get_filepath USING p_path.********************************* START OF SELECTION********************************START-OF-SELECTION. PERFORM frm_upload_data. IF lt_infor IS NOT INITIAL AND g_update_flag = 'X'. PERFORM frm_update_data. PERFORM frm_alv_diplay. ELSE. PERFORM frm_alv_diplay. ENDIF.*&---------------------------------------------------------------------**& Form FRM_GET_FILEPATH*&---------------------------------------------------------------------** text*----------------------------------------------------------------------** -->P_P_PATH text*----------------------------------------------------------------------*FORM frm_get_filepath USING p_p_path. CALL FUNCTION 'F4_FILENAME' IMPORTING file_name = p_M. " FRM_GET_FILEPATH*&---------------------------------------------------------------------**& Form FRM_UPLOAD_DATA*&---------------------------------------------------------------------** text*----------------------------------------------------------------------** --> p1 text* <-- p2 text*----------------------------------------------------------------------*FORM frm_upload_data . DATA: lc_fname TYPE rlgrap-filename. DATA: iv_line TYPE sy-tabix, l_previous_line TYPE sy-tabix, l_sytabix TYPE sy-tabix, l_next_line TYPE sy-tabix, l_mod TYPE i. DATA: ls_upload_next LIKE LINE OF lt_upload. DATA: lwa_upload LIKE LINE OF lt_upload. lc_fname = p_path. CLEAR lt_upload[]. CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE' EXPORTING filename = lc_fname i_begin_col = 1 i_begin_row = 2 i_end_col = 3 i_end_row = 65536

i_end_row = 65536 TABLES intern = lt_upload EXCEPTIONS inconsistent_parameters = 1 upload_ole = 2 OTHERS = 3. IF sy-subrc <> 0. MESSAGE ID sy-msgid TYPE 'S' NUMBER sy-msgno WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. ENDIF. IF lt_upload IS NOT INITIAL. SORT lt_upload BY row col. CLEAR lt_infor[]. CLEAR ls_upload. LOOP AT lt_upload INTO ls_upload. CLEAR l_next_line. l_next_line = sy-tabix + 1. CASE ls_upload-col. WHEN 1. "// sales order CONDENSE ls_upload-value. ls_infor-vbeln = ls_upload-value.* WHEN 2. "// requested delivery data* CONDENSE ls_upload-value.* ls_infor-vdatu = ls_upload-value. WHEN 2. "// CONDENSE ls_upload-value. ls_infor-edatu = ls_upload-value. ENDCASE. CLEAR ls_upload_next. READ TABLE lt_upload INTO ls_upload_next INDEX l_next_line. IF ls_upload_next-row NE ls_upload-row. APPEND ls_infor TO lt_infor. CLEAR ls_infor. ENDIF. CLEAR ls_upload. ENDLOOP. M. " FRM_UPLOAD_DATA*&---------------------------------------------------------------------**& Form FRM_UPDATE_DATA*&---------------------------------------------------------------------** text*----------------------------------------------------------------------** --> p1 text* <-- p2 text*----------------------------------------------------------------------*FORM frm_update_data . CLEAR ls_infor. LOOP AT lt_infor INTO ls_infor. PERFORM frm_delinfo_update. MODIFY lt_infor FROM ls_infor.

MODIFY lt_infor FROM ls_infor. M. " FRM_UPDATE_DATA*&---------------------------------------------------------------------**& Form FRM_DELINFO_UPDATE*&---------------------------------------------------------------------** text*----------------------------------------------------------------------** --> p1 text* <-- p2 text*----------------------------------------------------------------------*FORM frm_delinfo_update .* CLEAR lt_vbuk.* SELECT* vbeln* gbstk* FROM vbuk* INTO CORRESPONDING FIELDS OF TABLE lt_vbuk* WHERE vbeln = ls_infor-vbeln.** CLEAR ls_vbuk.* READ TABLE lt_vbuk INTO ls_vbuk WITH KEY vbeln = ls_infor-vbeln.* IF ls_vbuk-gbstk = 'C'.* msg1 = 'Sales Order Completed.'.* ELSE.* UPDATE vbak SET vdatu = ls_infor-vdatu WHERE vbeln = ls_infor-vbeln.* IF sy-subrc = 0.* msg1 = 'Requested delivery data update was succeed.'.* ENDIF.* ENDIF. CLEAR lt_vbup[]. SELECT vbeln posnr lfgsa FROM vbup INTO CORRESPONDING FIELDS OF TABLE lt_vbup WHERE vbeln = ls_infor-vbeln. CLEAR msg2. LOOP AT lt_vbup INTO ls_vbup WHERE lfgsa ne 'C'. IF sy-subrc ne '0'. msg2 = 'Order Deliveried.'. ELSE. UPDATE vbep SET edatu = ls_infor-edatu WHERE vbeln = ls_vbup-vbeln AND posnr = ls_vbup-posnr AND etenr = '1'. IF sy-subrc = '0'. msg2 = 'First delivery data update was succeed.'. ENDIF. ENDIF. ENDLOOP. CONCATENATE msg1 msg2 INTO ls_infor-message_text. CLEAR msg1. CLEAR M. " FRM_DELINFO_UPDATE*&---------------------------------------------------------------------**& Form FRM_ALV_DIPLAY*&---------------------------------------------------------------------** text*----------------------------------------------------------------------*

* --> p1 text* <-- p2 text*----------------------------------------------------------------------*FORM frm_alv_diplay . DATA: l_repid TYPE sy-repid, ls_layout TYPE slis_layout_alv, lt_event TYPE slis_t_event, lt_fieldcat TYPE slis_t_fieldcat_alv. PERFORM frm_build_layout CHANGING ls_layout. PERFORM frm_build_fieldcat CHANGING lt_fieldcat. MOVE sy-repid TO l_repid. CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY' EXPORTING i_callback_program = l_repid is_layout = ls_layout it_fieldcat = lt_fieldcat it_events = lt_event i_callback_user_command = 'FRM_USER_COMMAND'* i_callback_pf_status_set = 'FRM_PF_STATUS_SET' TABLES t_outtab = lt_M. " FRM_ALV_DIPLAY*&---------------------------------------------------------------------**& Form frm_build_fieldcat*&---------------------------------------------------------------------** text*----------------------------------------------------------------------** -->CT_FIELDCAT text*----------------------------------------------------------------------*FORM frm_build_fieldcat CHANGING ct_fieldcat TYPE slis_t_fieldcat_alv. DATA: ls_fieldcat LIKE LINE OF ct_fieldcat. DATA: l_col_pos TYPE i. REFRESH ct_fieldcat. CLEAR ls_fieldcat. ls_fieldcat-col_pos = l_col_pos. ls_fieldcat-fieldname = 'VBELN'. ls_fieldcat-seltext_l = 'Sales Order'. ls_fieldcat-seltext_m = 'Sales Order'. ls_fieldcat-seltext_s = 'Sales Order'. l_col_pos = l_col_pos + 1. APPEND ls_fieldcat TO ct_fieldcat.* CLEAR ls_fieldcat.* ls_fieldcat-col_pos = l_col_pos.* ls_fieldcat-fieldname = 'VDATU'.* ls_fieldcat-seltext_l = 'Req. '.* ls_fieldcat-seltext_m = 'Req. '.* ls_fieldcat-seltext_s = 'Req. '.* l_col_pos = l_col_pos + 1.* APPEND ls_fieldcat TO ct_fieldcat. CLEAR ls_fieldcat. ls_fieldcat-col_pos = l_col_pos. ls_fieldcat-fieldname = 'EDATU'. ls_fieldcat-seltext_l = 'First Delivery Date'. ls_fieldcat-seltext_m = 'First Delivery Date'. ls_fieldcat-seltext_s = 'First Date'. l_col_pos = l_col_pos + 1. APPEND ls_fieldcat TO ct_fieldcat.


本文标签: 销售 语句 订单