admin 管理员组文章数量: 887021
2023年12月24日发(作者:输送泵)
* APPEND lt_so_conditions.* CLEAR lt_so_conditions.* break hp_abap3. CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2' EXPORTING salesdocumentin = l_sono order_header_in = lt_so_head IMPORTING salesdocument = doc_no TABLES return = lt_return order_items_in = lt_so_item order_partners = lt_so_partners order_schedules_in = lt_so_sch order_conditions_in = lt_so_conditions order_text = lt_so_text. IF doc_no IS INITIAL. l_error = 'X'. ENDIF. IF l_error = 'X'. CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'. LOOP AT lt_return WHERE type = 'E' OR type = 'A'. CLEAR lv_msg. MESSAGE ID lt_return-id TYPE lt_return-type NUMBER lt_return-number WITH lt_return-message_v1 lt_return-message_v2 lt_return-message_v3 lt_return-message_v4 INTO lv_msg. CONCATENATE wa_sales-zzmsg lv_msg INTO wa_sales-zzmsg. ENDLOOP. ELSE. lt_vbap-vbeln = doc_no. MODIFY lt_vbap TRANSPORTING vbeln WHERE vbeln IS INITIAL. CALL FUNCTION 'SERIAL_INTTAB_REFRESH' EXPORTING objects_status_refresh = 'E'. PERFORM frm_set_serial. CALL FUNCTION 'BAPI_TRANSACTION_COMMIT' EXPORTING wait = 'X'. wa_sales-zzso = doc_no. M. "FRM_CREATE_SALESORDER*&---------------------------------------------------------------------**& Form FRM_CREATE_DELIVERY*&---------------------------------------------------------------------** text*----------------------------------------------------------------------*FORM frm_create_delivery. REFRESH:lt_dn_item , lt_return. CLEAR :lt_dn_item , lt_return , l_dn_no. LOOP AT lt_so_item. lt_dn_item-ref_doc = wa_sales-zzso. lt_dn_item-ref_item = lt_so_item-itm_number. lt_dn_item-dlv_qty = lt_so_item-target_qty. lt_dn_item-sales_unit = 'EA'. APPEND lt_dn_item. LOOP AT lt_vbap WHERE vbeln = wa_sales-zzso AND posnr = lt_so_item-itm_number. lt_sernr-ref_doc = wa_sales-zzso. lt_sernr-ref_item = lt_so_item-itm_number.
ENDLOOP. CALL FUNCTION 'WS_DELIVERY_UPDATE' EXPORTING vbkok_wa = wa_mvt synchron = 'X'* commit = 'X' delivery = wa_sales-zzdn if_error_messages_send_0 = '' it_sernr_update = lt_dn_sernr* IMPORTING* ef_error_any_0 = l_err01* ef_error_in_item_deletion_0 = l_err02* ef_error_in_pod_update_0 = l_err03* ef_error_in_interface_0 = l_err04* ef_error_in_goods_issue_0 = l_err05* ef_error_in_final_check_0 = l_err06* ef_error_partner_update = l_err07* ef_error_sernr_update = l_err08 TABLES vbpok_tab = lt_vbpok prot = lt_prot.* IF l_err01 = 'X' OR l_err02 = 'X' OR l_err03 = 'X' OR l_err04 = 'X' OR* l_err05 = 'X' OR l_err06 = 'X' OR l_err07 = 'X' OR l_err08 = 'X'.* l_error = 'X'.* wa_sales-zzmsg = 'DN PGI error'.* ENDIF. LOOP AT lt_prot WHERE msgty = 'A' OR msgty = 'E'. MESSAGE ID lt_prot-msgid TYPE lt_prot-msgty NUMBER lt_prot-msgno WITH lt_prot-msgv1 lt_prot-msgv2 lt_prot-msgv3 lt_prot-msgv4 INTO lv_msg. CONCATENATE wa_sales-zzmsg lv_msg INTO wa_sales-zzmsg. l_error = 'X'. ENDLOOP. IF l_error = 'X'. CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'. ELSE. CALL FUNCTION 'BAPI_TRANSACTION_COMMIT' EXPORTING wait = 'X'. SELECT SINGLE vbeln INTO wa_sales-zzpgi FROM vbfa WHERE vbelv = wa_sales-zzdn AND vbtyp_n = 'R' AND vbtyp_v = 'J'. M. "FRM_DELIVERY_PGI*&---------------------------------------------------------------------**& Form FRM_SET_SERIAL*&---------------------------------------------------------------------** text*----------------------------------------------------------------------** -->LS_VBAP text*----------------------------------------------------------------------*FORM frm_set_serial. DATA ls_vbap TYPE ty_vbap. LOOP AT lt_vbap INTO ls_vbap. CALL FUNCTION 'SERNR_ADD_TO_AU' EXPORTING sernr = ls_vbap-sernr "'LVTDH12A3EB040976'
profile = ls_vbap-serail material = ls_vbap-matnr quantity = ls_vbap-anzsn cuobj = ls_vbap-cuobj document = ls_vbap-vbeln item = ls_vbap-posnr debitor = ls_vbap-kunnr vbtyp = ls_vbap-vbtyp sd_auart = ls_vbap-auart sd_postyp = ls_vbap-pstyv i_bapi = 'X'* IMPORTING* anzsn = ls_vbap-anzsn* serial_commit = lv_dataloss EXCEPTIONS konfigurations_error = 1 serialnumber_errors = 2 serialnumber_warnings = 3 OTHERS = 4. ENDLOOP. CALL FUNCTION 'SERIAL_LISTE_POST_AU'.* TABLES* tab_cuobj = lt_M. "FRM_SET_SERIAL*&---------------------------------------------------------------------**& Form FRM_DISPLAY*&---------------------------------------------------------------------** text*----------------------------------------------------------------------*FORM frm_display. de_alvflds :'BSTKD' '订单序号', 'AUART' '订单类型', 'KUNNR' '客户编号', 'ZZSO' '销售订单号', 'ZZDN' '交货单号', 'ZZPGI' '交货物料凭证', 'ZZMSG' '消息'. wa_layout-zebra = 'X'. wa_layout-colwidth_optimize = 'X'. "优化列宽选项是否设置 CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY' EXPORTING i_callback_program = sy-cprog* i_callback_user_command = 'SUB_USER_COMMAND' i_default = 'X' i_save = 'X' is_layout = wa_layout it_fieldcat = it_fieldcat[] TABLES t_outtab = lt_sales[] EXCEPTIONS program_error = 1 OTHERS = M. "FRM_DISPLAY*&---------------------------------------------------------------------**& Form FRM_UPLOAD*&---------------------------------------------------------------------** text*----------------------------------------------------------------------** --> p1 text* <-- p2 text
* <-- p2 text*----------------------------------------------------------------------*FORM frm_upload . IF p_sales IS NOT INITIAL. CALL FUNCTION 'WS_UPLOAD' EXPORTING filename = p_sales filetype = 'DAT' TABLES data_tab = lt_xls1 EXCEPTIONS conversion_error = 1 file_open_error = 2 file_read_error = 3 invalid_type = 4 no_batch = 5 unknown_error = 6 invalid_table_width = 7 gui_refuse_filetransfer = 8 customer_error = 9 no_authority = 10 OTHERS = 11. ENDIF. IF p_serial IS NOT INITIAL. CALL FUNCTION 'WS_UPLOAD' EXPORTING filename = p_serial filetype = 'DAT' TABLES data_tab = lt_xls2 EXCEPTIONS conversion_error = 1 file_open_error = 2 file_read_error = 3 invalid_type = 4 no_batch = 5 unknown_error = 6 invalid_table_width = 7 gui_refuse_filetransfer = 8 customer_error = 9 no_authority = 10 OTHERS = 11. M. " FRM_UPLOAD*&---------------------------------------------------------------------**& Form FRM_PROCESS*&---------------------------------------------------------------------** text*----------------------------------------------------------------------** --> p1 text* <-- p2 text*----------------------------------------------------------------------*FORM frm_process . DATA : lt_vin TYPE zsdvin OCCURS 0 WITH HEADER LINE. DATA : lv_anzsn TYPE anzsn, lv_qty TYPE kwmeng. SORT lt_xls1 BY bstkd posnr. SORT lt_xls2 BY bstkd posnr. LOOP AT lt_xls1. wa_xls1 = lt_xls1. CLEAR : lv_qty , lv_anzsn.
版权声明:本文标题:销售订单导入+序列号VA01 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.freenas.com.cn/free/1703399322h449565.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论