AS01_BAPI:BAPI_FIXEDASSET_OVRTAKE_CREATE_创建资产主数据

AS01_创建资产主数据
一、功能介绍
  1. 使用事务码AS01创建资产主数据

    在这里插入图片描述

二、程序代码
  1. 程序代码:

    REPORT zfir002.TYPE-POOLS: slis, icon.
    TYPES: BEGIN OF ty_file,zanln    TYPE anla-anln1,  "资产编号anln2    TYPE anla-anln2,  "资产次级编号bukrs    TYPE anla-bukrs,  "公司代码anlkl    TYPE anla-anlkl,  "资产分类txt50    TYPE anla-txt50,  "资产描述txa50    TYPE anla-txa50,  "附加资产描述sernr    TYPE anla-sernr,  "序列号invnr    TYPE anla-invnr,  "存货号 旧资产编号quantity TYPE bapi1022_feglg001-quantity,     "数量base_uom TYPE bapi1022_feglg001-base_uom,     "单位invzu    TYPE anla-invzu,  "库存备注aktiv    TYPE anla-aktiv,  "资产资本化日期kostl    TYPE anlz-kostl,  "成本中心kostlv   TYPE anlz-kostlv, "责任成本中心caufn    TYPE anlz-caufn,  "内部订单ord41    TYPE anla-ord41,  "变动方式ord42    TYPE anla-ord42,  "使用状态ord43    TYPE anla-ord43,  "经济用途lifnr    TYPE lifnr,       "供应商liefe    TYPE anla-liefe,  "供应商描述herst    TYPE herst ,      "制造商afasl    TYPE anlb-afasl,  "折旧码ndjar    TYPE anlb-ndjar,  "计划年限ndper    TYPE anlb-ndper,  "计划月safbg    TYPE anlb-safbg,  "折旧开始日期kansw    TYPE anlc-kansw,   "购置价值knafa    TYPE anlc-knafa,   "以前年度折旧nafag    TYPE anlc-nafag,   "当期年度折旧schrw    TYPE anlb-schrw, " 残值END OF ty_file,BEGIN OF ty_result.INCLUDE TYPE ty_file.
    TYPES: icon    TYPE icon-id, "图标message TYPE string,      "消息内容anln1   TYPE anla-anln1,  "主资产号
    *       anln2   type anla-anln2,  "资产次级编号mark    TYPE as4flag,     "选中行return  TYPE bapiret2_t,  "处理结果消息表END OF ty_result.
    DATA :ls_return TYPE bapiret2."处理结果消息工作区*----------------------------------------------------------------------*
    * 工作区定义
    *----------------------------------------------------------------------*
    TABLES: sscrfields.
    DATA: wa_result TYPE ty_result,wa_fcat   TYPE slis_fieldcat_alv,wa_layo   TYPE slis_layout_alv.
    *----------------------------------------------------------------------*
    * 内表定义
    *----------------------------------------------------------------------*
    DATA: it_result TYPE STANDARD TABLE OF ty_result,it_fcat   TYPE slis_t_fieldcat_alv.*----------------------------------------------------------------------*
    * 变量定义
    *----------------------------------------------------------------------*
    DATA: g_save_path TYPE string VALUE 'C:\'.
    *----------------------------------------------------------------------*
    * 宏定义
    *----------------------------------------------------------------------*
    DEFINE macro_add_fieldcat.CLEAR: wa_fcat.wa_fcat-fieldname     = &1.wa_fcat-reptext_ddic  = &2.wa_fcat-seltext_l     = &2.wa_fcat-seltext_m     = &2.wa_fcat-seltext_s     = &2.wa_fcat-ref_tabname   = &3.wa_fcat-ref_fieldname = &4.APPEND wa_fcat TO it_fcat.
    END-OF-DEFINITION.
    *----------------------------------------------------------------------*
    * 选择屏幕
    *----------------------------------------------------------------------*
    SELECTION-SCREEN: BEGIN OF BLOCK b0 WITH FRAME TITLE tit.
    SELECTION-SCREEN: FUNCTION KEY 1.
    PARAMETERS: p_file TYPE rlgrap-filename MEMORY ID fi02.
    *selection-screen skip.
    *parameters: p_skip type as4flag as checkbox default abap_true.
    SELECTION-SCREEN: END OF BLOCK b0.
    *----------------------------------------------------------------------*
    * INITIALIZATION
    *----------------------------------------------------------------------*
    INITIALIZATION.tit = '选择条件'.sscrfields-functxt_01 = '下载模板'.*----------------------------------------------------------------------*
    * AT SELECTION-SCREEN
    *----------------------------------------------------------------------*
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.PERFORM frm_f4_filename CHANGING p_file.
    *----------------------------------------------------------------------*
    * AT SELECTION-SCREEN
    *----------------------------------------------------------------------*
    AT SELECTION-SCREEN.CASE sscrfields-ucomm.WHEN 'FC01'.  "下载模板PERFORM frm_download_template.WHEN 'ONLI'.  "执行ENDCASE.
    *----------------------------------------------------------------------*
    * START-OF-SELECTION
    *----------------------------------------------------------------------*
    START-OF-SELECTION.
    *&---检查文件格式PERFORM frm_check_filename.PERFORM frm_upload_file USING p_file. "上传文件*----------------------------------------------------------------------*
    * end-of-selection
    *----------------------------------------------------------------------*
    END-OF-SELECTION.PERFORM frm_display_result.  "显示文件内容
    *&---------------------------------------------------------------------*
    *&      form  frm_download_template
    *&---------------------------------------------------------------------*
    *       模板下载
    *----------------------------------------------------------------------*
    FORM frm_download_template.DATA: lw_key   TYPE  wwwdatatab,l_down   TYPE rlgrap-filename,l_name   TYPE rlgrap-filename,l_path   TYPE rlgrap-filename,l_path_s TYPE string,l_name_s TYPE string,l_path_f TYPE string,l_action TYPE i.CLEAR: lw_key.lw_key-relid = 'MI'.lw_key-objid = sy-repid.CALL METHOD cl_gui_frontend_services=>file_save_dialogEXPORTINGwindow_title              = '选择位置'default_extension         = 'xlsx'default_file_name         = '固定资产期初导入模板'file_filter               = 'Excel Files(2007/2010/2013)|*.xlsx|Excel Files(2003)|*.xls'initial_directory         = g_save_pathCHANGINGfilename                  = l_name_spath                      = l_path_sfullpath                  = l_path_fuser_action               = l_actionEXCEPTIONScntl_error                = 1error_no_gui              = 2not_supported_by_gui      = 3invalid_default_file_name = 4OTHERS                    = 5.IF sy-subrc <> 0.MESSAGE ID sy-msgidTYPE sy-msgtyNUMBER sy-msgnoWITH sy-msgv1 sy-msgv2sy-msgv3 sy-msgv4.RETURN.ELSE.g_save_path = l_path_s.IF l_action EQ cl_gui_frontend_services=>action_cancel.MESSAGE s398(00) WITH '用户取消操作'.RETURN.ENDIF.ENDIF.l_down = l_path_f.CALL FUNCTION 'DOWNLOAD_WEB_OBJECT'EXPORTINGkey         = lw_keydestination = l_down.CALL FUNCTION 'SO_SPLIT_FILE_AND_PATH'EXPORTINGfull_name     = l_downIMPORTINGstripped_name = l_namefile_path     = l_path.CALL FUNCTION 'GUI_RUN'EXPORTINGcommand   = 'EXCEL'parameter = l_namecd        = l_path.
    ENDFORM. " FRM_DOWNLOAD_TEMPLATE
    *&---------------------------------------------------------------------*
    *&      form  frm_f4_filename
    *&---------------------------------------------------------------------*
    *       文件搜索
    *----------------------------------------------------------------------*
    *    <-- fc_path 文件路径
    *----------------------------------------------------------------------*
    FORM frm_f4_filename CHANGING fc_path.DATA: l_path TYPE rlgrap-filename.CALL FUNCTION 'KD_GET_FILENAME_ON_F4'EXPORTINGstatic    = abap_truemask      = 'Excel Files(2007/2010/2013)|*.xlsx|Excel Files(2003)|*.xls'CHANGINGfile_name = l_path.fc_path = l_path.
    ENDFORM. " FRM_F4_FILENAME
    *&---------------------------------------------------------------------*
    *&      form  frm_upload_file
    *&---------------------------------------------------------------------*
    *       上传文件
    *----------------------------------------------------------------------*
    *      -->fu_file  文件名称
    *----------------------------------------------------------------------*
    FORM frm_upload_file USING fu_file.DATA:
    *    lt_return TYPE bapiret2_t,
    *    ls_return TYPE LINE OF bapiret2_t,l_string TYPE string,ls_path  TYPE rlgrap-filename.FIELD-SYMBOLS: <fs>.DATA:l_filename TYPE rlgrap-filename,l_endrow   TYPE i.DATA:itab TYPE TABLE OF zalsmex_tabline WITH HEADER LINE.CLEAR: it_result.IF p_file IS INITIAL .MESSAGE '文件路径不存在' TYPE 'E'.ENDIF.*  ls_path = p_file.l_filename = fu_file.l_endrow   = 900000.CALL FUNCTION 'ZALSM_EXCEL_TO_INTERNAL_TABLE'EXPORTINGfilename                = l_filenamei_begin_col             = 1i_begin_row             = 2i_end_col               = 29i_end_row               = l_endrowTABLESintern                  = itabEXCEPTIONSinconsistent_parameters = 1upload_ole              = 2OTHERS                  = 3.IF sy-subrc <> 0.ENDIF.IF itab[] IS NOT INITIAL.LOOP AT itab.ON CHANGE OF itab-row.IF sy-tabix NE 1.APPEND wa_result TO it_result.CLEAR  wa_result.ENDIF.ENDON.ASSIGN COMPONENT itab-col OF STRUCTURE wa_result TO <fs>.<fs> = itab-value.ENDLOOP.APPEND wa_result TO it_result.CLEAR  wa_result.ENDIF.*  DATA: lw_file   TYPE ty_file,
    *        lt_file   TYPE STANDARD TABLE OF ty_file,
    *        lt_return TYPE bapiret2_t,
    *        ls_return TYPE LINE OF bapiret2_t.
    *  DATA l_string TYPE string.
    *  CALL FUNCTION 'Z_UPLOAD_FILE'
    *    EXPORTING
    *      i_filename = fu_file
    *      i_skip     = abap_true
    *    TABLES
    *      t_data     = lt_file
    *      t_return   = lt_return.
    *
    *  READ TABLE lt_return WITH KEY type = 'E' TRANSPORTING NO FIELDS.
    *  IF sy-subrc EQ 0.
    *
    *    LOOP AT lt_return INTO ls_return WHERE type = 'E'.
    *
    *      CONCATENATE l_string ls_return-message INTO l_string SEPARATED BY space.
    *
    *    ENDLOOP.
    *
    *    MESSAGE l_string TYPE 'I' .
    *    LEAVE LIST-PROCESSING.
    *
    *  ENDIF.
    *
    *  LOOP AT lt_file INTO lw_file.
    *    MOVE-CORRESPONDING lw_file TO wa_result.
    *    APPEND wa_result TO it_result.
    *  ENDLOOP.ENDFORM. " FRM_UPLOAD_FILE
    *&---------------------------------------------------------------------*
    *&      form  frm_display_result
    *&---------------------------------------------------------------------*
    *       显示结果
    *----------------------------------------------------------------------*
    FORM frm_display_result .PERFORM frm_build_layout.PERFORM frm_build_fieldcat.CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'EXPORTINGi_callback_program       = sy-repidi_callback_pf_status_set = 'FRM_STATUS_SET'i_callback_user_command  = 'FRM_USER_COMMAND'is_layout                = wa_layoit_fieldcat              = it_fcati_save                   = 'A'TABLESt_outtab                 = it_resultEXCEPTIONSprogram_error            = 1.IF sy-subrc NE 0.ENDIF.
    ENDFORM. " FRM_DISPLAY_RESULT
    *&---------------------------------------------------------------------*
    *&      form  frm_build_layout
    *&---------------------------------------------------------------------*
    *       创建显示布局
    *----------------------------------------------------------------------*
    FORM frm_build_layout .wa_layo-box_fieldname     = 'MARK'.wa_layo-zebra             = abap_true.wa_layo-colwidth_optimize = abap_true.
    ENDFORM. " FRM_BUILD_LAYOUT
    *&---------------------------------------------------------------------*
    *&      form  frm_build_fieldcat
    *&---------------------------------------------------------------------*
    *       创建显示字段
    *----------------------------------------------------------------------*
    FORM frm_build_fieldcat .macro_add_fieldcat:'ICON'    '信号灯'          'ICON' 'ID','MESSAGE' '消息内容'      space space,     "消息内容'ANLN1'   '主资产号'      'ANLA' 'ANLN1',  "主资产号'ANLN2'   '资产次级编号'  'ANLA' 'ANLN2',  "资产次级编号'BUKRS'   '公司代码'      'ANLA' 'BUKRS',  "公司代码'ZANLN'   '资产编号'      'ANLA' 'ANLN1',  "资产编号'ANLKL'   '资产分类'      'ANLA' 'ANLKL',  "资产分类'TXT50'   '资产描述'      'ANLA' 'TXT50',  "资产描述'TXA50'   '附加资产描述'  'ANLA' 'TXA50',  "附加资产描述'SERNR'   '序列号'        'ANLA' 'SERNR',  "序列号'INVNR'   '存货号  旧资产编号' 'ANLA' 'INVNR',  "存货号'QUANTITY'   '数量'        '' '',  "数量'BASE_UOM'   '单位'        '' '',  "数量'INVZU'  '库存备注'  'ANLA' 'INVZU', "库存备注'AKTIV'  '资产资本化日期' 'ANLA' 'AKTIV',  "资产资本化日期'KOSTL'  '成本中心'      'ANLZ' 'KOSTL',  "成本中心'KOSTLV' '责任成本中心'      'ANLZ' 'KOSTLV',  "责任成本中心'CAUFN'  '内部订单' 'ANLZ' 'CAUFN', "内部订单'ORD41'  '变动方式' 'ANLA' 'ORD41', "变动方式'ORD42'  '使用状态' 'ANLA' 'ORD42', "使用状态'ORD43'  '经济用途' 'ANLA' 'ORD43', "经济用途'LIFNR'  '供应商' 'ANLA' 'LIFNR',   "供应商'LIEFE'  '供应商描述' 'ANLA' 'LIEFE',"供应商描述'HERST'  '制造商'     'ANLA' 'HERST',    "制造商'AFASL'  '折旧码'     'ANLB' 'AFASL',  "  折旧码'NDJAR'  '计划折旧年' 'ANLC' 'KANSW','NDPER'  '计划折旧'   'ANLC' 'KNAFA','SAFBG'  '折旧开始日期' 'ANLB' 'SAFBG','KANSW'  '购置价值'   'ANLC' 'KANSW',  "购置价值'KNAFA'  '正常折旧'      'ANLC' 'KNAFA',  "以前年度折旧'NAFAG'  '已记正常折旧'  'ANLC' 'NAFAG',  "当期年度折旧'SCHRW'  '残值'         'ANLC' 'NAFAG'.  " 残值ENDFORM. " FRM_BUILD_FIELDCAT
    *&---------------------------------------------------------------------*
    *&      form  frm_status_set
    *&---------------------------------------------------------------------*
    *   gui状态设置
    *----------------------------------------------------------------------*
    *    --> fu_extab  排除的按钮
    *----------------------------------------------------------------------*
    FORM frm_status_set USING fu_extab TYPE slis_t_extab.SET PF-STATUS 'STANDARD' EXCLUDING fu_extab.
    ENDFORM. " FRM_STATUS_SET*&---------------------------------------------------------------------*
    *&      form  frm_user_command
    *&---------------------------------------------------------------------*
    *       用户按键响应
    *----------------------------------------------------------------------*
    *     --> fu_ucomm     用户按键名
    *       --> FU_SELFIELD  选择的字段
    *----------------------------------------------------------------------*
    FORM frm_user_command USING p_ucomm TYPE sy-ucommp_selfield TYPE slis_selfield.DATA: lo_grid TYPE REF TO cl_gui_alv_grid.CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'IMPORTINGe_grid = lo_grid.CALL METHOD lo_grid->check_changed_data.p_selfield-refresh    = abap_true.p_selfield-col_stable = abap_true.p_selfield-row_stable = abap_true.CASE p_ucomm.WHEN '&IC1'.IF p_selfield-fieldname EQ 'MESSAGE'.READ TABLE it_result INTO wa_result INDEX p_selfield-tabindex.IF sy-subrc EQ 0.IF wa_result-return IS NOT INITIAL.ELSE.MESSAGE s001(00) WITH '无可用明细信息'.ENDIF.ENDIF.ENDIF.WHEN 'TESTRUN'.PERFORM frm_create_asset USING abap_true.WHEN '&RUN'.PERFORM frm_create_asset USING abap_false.ENDCASE.
    ENDFORM. " FRM_USER_COMMAND
    *&---------------------------------------------------------------------*
    *&      form  frm_create_asset
    *&---------------------------------------------------------------------*
    *       创建资产
    *----------------------------------------------------------------------*
    *       --> fu_test  测试执行
    *----------------------------------------------------------------------*
    FORM frm_create_asset USING fu_test.DATA: l_asset                TYPE bapi1022_1-assetmaino,l_subnumber            TYPE bapi1022_1-assetsubno,lw_key                 TYPE bapi1022_key,lw_generaldata         TYPE bapi1022_feglg001,lw_generaldatax        TYPE bapi1022_feglg001x,lw_postinginformation  TYPE bapi1022_feglg002,lw_postinginformationx TYPE bapi1022_feglg002x,lw_timedependentdata   TYPE bapi1022_feglg003,lw_timedependentdatax  TYPE bapi1022_feglg003x,lw_origin              TYPE bapi1022_feglg009,lw_originx             TYPE bapi1022_feglg009x,lw_allocations         TYPE bapi1022_feglg004,lw_allocationsx        TYPE bapi1022_feglg004x,lw_inventory           TYPE bapi1022_feglg011,lw_inventoryx          TYPE bapi1022_feglg011x,lw_cumulatedvalue      TYPE bapi1022_cumval,lw_postedvalue         TYPE bapi1022_postval,lw_transaction         TYPE bapi1022_trtype,lw_depreciationareas   TYPE bapi1022_dep_areas, "折旧范围数据lw_depreciationareasx  TYPE bapi1022_dep_areasx,lt_depreciationareas   TYPE STANDARD TABLE OF bapi1022_dep_areas,lt_depreciationareasx  TYPE STANDARD TABLE OF bapi1022_dep_areasx,lt_cumulatedvalues     TYPE STANDARD TABLE OF bapi1022_cumval,lt_postedvalues        TYPE STANDARD TABLE OF bapi1022_postval,lt_transactions        TYPE STANDARD TABLE OF bapi1022_trtype.DATA : l_meins TYPE meins.FIELD-SYMBOLS: <fs_result> TYPE ty_result.LOOP AT it_result ASSIGNING <fs_result> WHERE mark EQ abap_true.CHECK <fs_result>-anln1 IS INITIAL.CLEAR: l_asset,l_subnumber,lw_key,lw_generaldata,lw_generaldatax,lw_postinginformation,lw_postinginformationx,lw_timedependentdata,lw_timedependentdatax,lt_cumulatedvalues,lt_postedvalues,lt_transactions,lt_depreciationareas,lt_depreciationareasx,<fs_result>-return,<fs_result>-anln1.CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'EXPORTINGinput  = <fs_result>-anlklIMPORTINGoutput = <fs_result>-anlkl.CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'EXPORTINGinput  = <fs_result>-sernrIMPORTINGoutput = <fs_result>-sernr.lw_key-companycode = <fs_result>-bukrs.         "公司代码lw_key-asset       = |{ <fs_result>-zanln ALPHA = IN }|. "资产编号lw_key-subnumber   = |{ <fs_result>-anln2 ALPHA = IN }|. "子编号lw_generaldata-assetclass = <fs_result>-anlkl.  "资产分类lw_generaldata-descript   = <fs_result>-txt50.    "资产描述lw_generaldata-descript2  = <fs_result>-txa50.   "附加资产描述lw_generaldata-serial_no  = <fs_result>-sernr.   "序列号lw_generaldata-invent_no  = <fs_result>-invnr.   "存货号lw_generaldata-quantity   = <fs_result>-quantity."数量CALL FUNCTION 'CONVERSION_EXIT_CUNIT_INPUT'EXPORTINGinput          = <fs_result>-base_uomlanguage       = sy-languIMPORTINGoutput         = lw_generaldata-base_uomEXCEPTIONSunit_not_found = 1OTHERS         = 2.IF sy-subrc <> 0.
    * Implement suitable error handling hereENDIF.lw_generaldatax-assetclass    = abap_true.lw_generaldatax-descript      = abap_true.lw_generaldatax-descript2     = abap_true.lw_generaldatax-main_descript = abap_true.lw_generaldatax-serial_no     = abap_true.lw_generaldatax-invent_no     = abap_true.lw_generaldatax-quantity      = abap_true.   "数量lw_generaldatax-base_uom      = abap_true.   "单位lw_postinginformation-cap_date  = <fs_result>-aktiv."资产资本化日期lw_postinginformationx-cap_date = abap_true.lw_inventory-note  = <fs_result>-invzu.  "库存备注lw_inventoryx-note = abap_true.lw_timedependentdata-costcenter  = <fs_result>-kostl. "成本中心lw_timedependentdata-intern_ord  = <fs_result>-caufn. "内部订单lw_timedependentdata-resp_cctr   = <fs_result>-kostlv. "责任成本中心lw_timedependentdatax-costcenter = abap_true. "成本中心lw_timedependentdatax-intern_ord = abap_true. "内部订单lw_timedependentdatax-resp_cctr  = abap_true. "责任成本中心lw_depreciationareas-area            = '01'.lw_depreciationareas-ulife_yrs       = <fs_result>-ndjar ."计划使用年lw_depreciationareas-ulife_prds      = <fs_result>-ndper ."计划使用月lw_depreciationareas-scrapvalue      = <fs_result>-schrw ."残值lw_depreciationareas-dep_key         = <fs_result>-afasl ."折旧码lw_depreciationareas-sdep_start_date = <fs_result>-safbg. "折旧开始日期lw_depreciationareasx-area = '01' .IF <fs_result>-ndjar <> 0 OR <fs_result>-ndper <> 0 .lw_depreciationareasx-ulife_yrs  = abap_true .lw_depreciationareasx-ulife_prds = abap_true .ENDIF.IF <fs_result>-schrw <> 0 .lw_depreciationareasx-scrapvalue = abap_true .ENDIF.lw_depreciationareasx-dep_key = abap_true.APPEND  lw_depreciationareas TO  lt_depreciationareas.APPEND  lw_depreciationareasx TO  lt_depreciationareasx.IF <fs_result>-aktiv(4) LT sy-datum(4).  "以住年份的数据CLEAR: lw_cumulatedvalue.lw_cumulatedvalue-fisc_year = '2019'.  "年份lw_cumulatedvalue-area      = '01'. "折旧范围lw_cumulatedvalue-acq_value = <fs_result>-kansw. "购置价值lw_cumulatedvalue-ord_dep   = <fs_result>-knafa * -1."以前年度折旧lw_cumulatedvalue-currency  = 'CNY'.APPEND lw_cumulatedvalue TO lt_cumulatedvalues.ELSE.  "当年的数据CLEAR: lw_transaction.lw_transaction-fisc_year  = '2019'.  "年份lw_transaction-area       = '01'.lw_transaction-current_no = '1'.lw_transaction-valuedate  = <fs_result>-aktiv.lw_transaction-assettrtyp = '100'.  "资产交易类型lw_transaction-amount     = <fs_result>-kansw.lw_transaction-currency   = 'CNY'.APPEND lw_transaction TO lt_transactions.ENDIF.IF <fs_result>-nafag IS NOT INITIAL.CLEAR: lw_postedvalue.lw_postedvalue-fisc_year = '2019'.  "年份lw_postedvalue-area      = '01'.lw_postedvalue-ord_dep   = <fs_result>-nafag * -1."当期年度折旧lw_postedvalue-currency  = 'CNY'.APPEND lw_postedvalue TO lt_postedvalues.ENDIF.lw_origin-vendor_no     = |{ <fs_result>-lifnr ALPHA = IN }|. " 供应商lw_origin-vendor        = <fs_result>-liefe.lw_origin-manufacturer  = <fs_result>-herst."制造商lw_originx-vendor_no    = abap_true.lw_originx-vendor       = abap_true.lw_originx-manufacturer = abap_true.lw_allocations-evalgroup1  = <fs_result>-ord41." 变动方式lw_allocations-evalgroup2  = <fs_result>-ord42." 使用状态lw_allocations-evalgroup3  = <fs_result>-ord43." 经济用途lw_allocationsx-evalgroup1 = abap_true.lw_allocationsx-evalgroup2 = abap_true.lw_allocationsx-evalgroup3 = abap_true.CALL FUNCTION 'BAPI_FIXEDASSET_OVRTAKE_CREATE'EXPORTINGkey                 = lw_keytestrun             = fu_testgeneraldata         = lw_generaldatageneraldatax        = lw_generaldataxpostinginformation  = lw_postinginformationpostinginformationx = lw_postinginformationxtimedependentdata   = lw_timedependentdatatimedependentdatax  = lw_timedependentdataxorigin              = lw_originoriginx             = lw_originxallocations         = lw_allocationsallocationsx        = lw_allocationsxinventory           = lw_inventoryinventoryx          = lw_inventoryxIMPORTINGasset               = l_assetsubnumber           = l_subnumberTABLESdepreciationareas   = lt_depreciationareasdepreciationareasx  = lt_depreciationareasxcumulatedvalues     = lt_cumulatedvaluespostedvalues        = lt_postedvaluestransactions        = lt_transactionsreturn              = <fs_result>-return.<fs_result>-anln1 = l_asset.<fs_result>-anln2 = l_subnumber.READ TABLE <fs_result>-return WITH KEY type = 'E' TRANSPORTING NO FIELDS.IF sy-subrc NE 0.READ TABLE <fs_result>-return WITH KEY type = 'W' TRANSPORTING NO FIELDS.IF sy-subrc EQ 0.<fs_result>-icon = icon_led_yellow.ELSE.<fs_result>-icon = icon_led_green.ENDIF.<fs_result>-message = '资产创建成功'.IF fu_test IS INITIAL.CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'EXPORTINGwait = abap_true.ENDIF.ELSE.<fs_result>-icon = icon_led_red.
    *       <fs_result>-message = '资产创建失败,双击查看明细'.
    *      <fs_result>-message = '资产创建失败,双击查看明细'.LOOP AT <fs_result>-return INTO ls_return.CONCATENATE <fs_result>-message ls_return-id ls_return-number ls_return-messageINTO <fs_result>-message SEPARATED BY space.ENDLOOP.IF fu_test IS INITIAL.CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.ENDIF.ENDIF.ENDLOOP.IF sy-subrc NE 0.MESSAGE s001(00) WITH '请选择行进行操作'.ENDIF.ENDFORM. " FRM_CREATE_ASSET
    *&---------------------------------------------------------------------*
    *& Form FRM_CHECK_FILENAME
    *&---------------------------------------------------------------------*
    *& text
    *&---------------------------------------------------------------------*
    *& -->  p1        text
    *& <--  p2        text
    *&---------------------------------------------------------------------*
    FORM frm_check_filename .DATA: lv_s1 TYPE string,lv_s2 TYPE string.SPLIT p_file AT '.' INTO lv_s1 lv_s2.TRANSLATE lv_s2 TO UPPER CASE.IF p_file IS INITIAL.MESSAGE '请输入数据路径!' TYPE 'S' DISPLAY LIKE 'W'.LEAVE LIST-PROCESSING.ENDIF.
    ENDFORM.
    

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/834088.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

FastAPI vs Flask: 选择最适合您的 Python Web 框架

文章目录 1. 简介2. 安装和设置3. 路由和视图4. 自动文档生成5. 数据验证和序列化6. 性能和异步支持结论 在 Python Web 开发领域&#xff0c;FastAPI 和 Flask 是两个备受欢迎的选择。它们都提供了强大的工具和功能&#xff0c;但是在某些方面有所不同。本文将比较 FastAPI 和…

Ubuntu 下串口工具:Minicom、CuteCom 和 Screen

在 Ubuntu 中&#xff0c;对于串口通信工具的选择&#xff0c;虽然没有一个绝对的 “最好用” 的排名&#xff0c;但根据用户反馈和工具的流行程度&#xff0c;Minicom、CuteCom 和 Screen 这三个工具通常被认为是较为受欢迎和实用的。 一、简介&#xff1a; Minicom&#xff…

【论文笔记】KAN: Kolmogorov-Arnold Networks 全新神经网络架构KAN,MLP的潜在替代者

KAN: Kolmogorov-Arnold Networks code&#xff1a;https://github.com/KindXiaoming/pykan Background ​ 多层感知机&#xff08;MLP&#xff09;是机器学习中拟合非线性函数的默认模型&#xff0c;在众多深度学习模型中被广泛的应用。但MLP存在很多明显的缺点&#xff1a;…

跨协议通讯无缝对接:Modbus-BACnet楼宇智能转换器深度解析

在现代化的建筑群里&#xff0c;智能楼宇管理系统如同神经系统&#xff0c;协调着各设备的运行。某大型商业综合体&#xff0c;集购物中心、办公区、酒店于一体&#xff0c;面对着来自不同供应商的设备&#xff0c;如何实现统一管理和高效通讯成了首要挑战。特别是其内部既有采…

ADC模-数转换原理与实现

1. 今日摸鱼计划 今天来学习一下ADC的原理&#xff0c;然后把ADC给实现 ADC芯片:ADC128S102 视频&#xff1a; 18A_基于SPI接口的ADC芯片功能和接口时序介绍_哔哩哔哩_bilibili 18B_使用线性序列机思路分析SPI接口的ADC芯片接口时序_哔哩哔哩_bilibili 18C_基于线性序列机的S…

neo4j-5.11.0安装APOC插件or配置允许使用过程的权限

在已经安装好neo4j和jdk的情况下安装apoc组件&#xff0c;之前使用neo4j-community-4.4.30&#xff0c;可以找到配置apoc-4.4.0.22-all.jar&#xff0c;但是高版本neo4j对应没有apoc-X.X.X-all.jar。解决如下所示&#xff1a; 1.安装好JDK与neo4j 已经安装对应版本的JDK 17.0…

MySQL数据库及数据表的创建

1.创建一个名叫 db_classes 的数据库&#xff1a; 创建一个叫 db_classes 的数据库MySQL命令&#xff1a; create database db_classes; 运行效果&#xff1a; 创建数据库后查看该数据库基本信息MySQL命令&#xff1a; show create database db_classes; 运行效果&#xff…

力扣刷题--数组--第三天

今天再做两道二分查找的题目&#xff0c;关于二分查找的知识可看我前两篇博客。话不多说&#xff0c;直接开干&#xff01; 题目1&#xff1a;69.x 的平方根 题目详情&#xff1a;   给你一个非负整数 x &#xff0c;计算并返回 x 的 算术平方根 。由于返回类型是整数&#…

VScode通过ssh远程连接服务器被拒绝:permission denied, please try again

使用场景&#xff1a; 使用windows系统下的vscode远程连接服务器的linux系统&#xff0c;终端提示permission denied, please try again,但是使用cmd是可以远程登录的。 解决办法&#xff1a; 前提条件windows端的vscode安装了ssh远程连接的相关插件Remote - SSH&#xff0c;…

Django之rest_framework(六)

一、GenericViewSet类的使用 继承自GenericAPIView,作用也与GenericAPIVIew类似,提供了get_object、get_queryset等方法便于视图的开发 1.1、代码 from rest_framework.viewsets import GenericViewSet from rest_framework.response import Response from rest_framework …

Duplicate File Finder Pro for Mac激活版:重复文件清理软件

在繁杂的文件管理中&#xff0c;你是否曾为重复文件而烦恼&#xff1f;Duplicate File Finder Pro for Mac&#xff0c;正是你不可或缺的得力助手。这款专业级工具&#xff0c;能够迅速扫描并定位Mac系统中的重复文件&#xff0c;让你的存储空间恢复清爽。 通过强大的算法支持&…

[C/C++] -- 代理模式

代理模式是一种结构型设计模式&#xff0c;允许一个对象&#xff08;代理&#xff09;控制另一个对象的访问。代理对象通常充当客户端和实际目标对象之间的中间人&#xff0c;从而控制对目标对象的访问&#xff0c;可以在访问前后进行一些额外的处理。 代理模式的优点包括&…

《铁路出行更便捷:火车票预定审批系统的设计与应用》

在现代化的铁路交通管理中&#xff0c;火车票预定审批系统扮演着至关重要的角色。它不仅能够有效管理员工出差、培训等需要乘坐火车的行程&#xff0c;还能够提高审批效率&#xff0c;减少人力成本&#xff0c;确保出行安全。本文将探讨火车票预定审批系统的设计原则和应用场景…

图片压缩和尺寸调节工具@图像压缩@分辨率调节@降低图片文件体积和磁盘占用

文章目录 abstract降低图片文件大小的方式相关原理 跨平台免费的压缩工具离线运行的软件在线工具&#x1f47a;windows 系统上的压缩方法windows 照片程序(photo)powertoys image-resizer(分辨率/尺寸调整) windows mspaint(画图工具调整分辨率) abstract 提到图片压缩时&#…

一款支持几分钟视频生成,免费无限制AI视频生成网站

前言 AI可以生成原创中视频了&#xff01; 不是4秒&#xff0c;而是最长达6分钟&#xff0c;官方名为白日梦&#xff0c;将白日梦变成现实&#xff01; 他不是简单的文生图/图生视频 而是将文生图、图生视频、配音字幕、后期剪辑等&#xff0c;打包封装成一条AI视频生产工作…

Axure PR 10 下拉三级菜单设计图

在线预览地址&#xff1a;Untitled Document 程序员必备资源网站&#xff1a;天梦星服务平台 (tmxkj.top) 需要源码设计图联系我wx:19948765606,3块钱拿走

Maven+Junit5 + Allure +Jenkins 搭建 UI 自动化测试实战

文章目录 效果展示Junit 5Junit 5 介绍Junit 5 与 Junit 4 对比PageFactory 模式编写自动化代码公共方法提取测试用例参数化Jenkins 搭建及配置参数化执行生成 Allure 报告Maven 常用命令介绍POM 文件效果展示 本 chat 介绍 UI 自动化测试框架的搭建: 运用 page factory 模式…

文章解读与仿真程序复现思路——电力自动化设备EI\CSCD\北大核心《基于V2G潜力模糊评估与移动储能协调调度的灾后供电恢复策略》

本专栏栏目提供文章与程序复现思路&#xff0c;具体已有的论文与论文源程序可翻阅本博主免费的专栏栏目《论文与完整程序》 论文与完整源程序_电网论文源程序的博客-CSDN博客https://blog.csdn.net/liang674027206/category_12531414.html 电网论文源程序-CSDN博客电网论文源…

第12章 软件测试基础(第三部分)测试类型、测试工具

七、测试类型&#xff08;按工程阶段划分&#xff09; 单集系确收 &#xff08;一&#xff09;单元测试 1、单元测试/模块测试 单元就是软件中最小单位&#xff08;或模块&#xff09;。可以是一个函数、一个过程、一个类。主要依据是模块的详细设计文档。价值在于尽早发现…

spring模块(六)spring监听器(1)ApplicationListener

一、介绍 1、简介 当某个事件触发的时候&#xff0c;就会执行的方法块。 当然&#xff0c;springboot很贴心地提供了一个 EventListener 注解来实现监听。 2、源码&#xff1a; package org.springframework.context;import java.util.EventListener; import java.util.fu…