SAP资产变动明细
*&---------------------------------------------------------------------*
*& Report ZFIR027
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
REPORT ZFIR027. type-pools: slis. tables: anla,
bkpf,
anlz. types: begin of ty_output_line,
bukrs type anla-bukrs,
anlkl type anla-anlkl,
lbtxk type ankt-txk50,
anln1 type anla-anln1,
anln2 type anla-anln2,
mctxk type anla-txt50,
aktiv type anla-aktiv,
kostl type anlz-kostl,
ltext type cskt-ltext,
bwasl type anep-bwasl,
bwatxt type tabwt-bwatxt,
belnr type anep-belnr,
budat type bkpf-budat,
anbtr type anep-anbtr,
adatu type anlz-adatu,
fbflg type c,
end of ty_output_line.
data: wa_output_line type ty_output_line,
it_output_itab type table of ty_output_line with header line.
field-symbols: <fs_output_line> type ty_output_line. types: begin of ty_anla_line,
bukrs type anla-bukrs,
anlkl type anla-anlkl,
anln1 type anla-anln1,
anln2 type anla-anln2,
mctxk type anla-txt50,
aktiv type anla-aktiv,
end of ty_anla_line.
data: wa_anla_line type ty_anla_line,
it_anla_itab type table of ty_anla_line with header line. types: begin of ty_ankt_line,
anlkl type ankt-anlkl,
txk50 type ankt-txa50,
end of ty_ankt_line.
data: wa_ankt_line type ty_ankt_line,
it_ankt_itab type table of ty_ankt_line with header line. types: begin of ty_cskt_line,
kostl type cskt-kostl,
ltext type cskt-ltext,
end of ty_cskt_line.
data: wa_cskt_line type ty_cskt_line,
it_cskt_itab type table of ty_cskt_line with header line. types: begin of ty_anlz_line,
bukrs type anlz-bukrs,
anln1 type anlz-anln1,
anln2 type anlz-anln2,
bdatu type anlz-bdatu,
adatu type anlz-adatu,
kostl type anlz-kostl,
end of ty_anlz_line.
data: wa_anlz_line type ty_anlz_line,
it_anlz_itab type table of ty_anlz_line with header line. types: begin of ty_anep_line,
bukrs type anep-bukrs,
anln1 type anep-anln1,
anln2 type anep-anln2,
gjahr type anep-gjahr,
bwasl type anep-bwasl,
belnr type anep-belnr,
anbtr type anep-anbtr,
lnsan type anep-lnsan,
end of ty_anep_line.
data: wa_anep_line type ty_anep_line,
it_anep_itab type table of ty_anep_line with header line. types: begin of ty_tabwt_line,
bwasl type tabwt-bwasl,
bwatxt type tabwt-bwatxt,
end of ty_tabwt_line.
data: wa_tabwt_line type ty_tabwt_line,
it_tabwt_itab type table of ty_tabwt_line with header line. types: begin of ty_bkpf_line,
bukrs type bkpf-bukrs,
belnr type bkpf-belnr,
gjahr type bkpf-gjahr,
awkey type bkpf-awkey,
budat type bkpf-budat,
end of ty_bkpf_line.
data: wa_bkpf_line type ty_bkpf_line,
it_bkpf_itab type table of ty_bkpf_line with header line. ranges: rs_awkey for bkpf-awkey. data: col_pos type i.
data: gt_fieldcat type slis_t_fieldcat_alv.
data: gs_layout type slis_layout_alv.
data: control_title type lvc_title.
data: gt_sort type slis_t_sortinfo_alv. selection-screen begin of block b1 with frame title text-.
select-options: s_bukrs for anla-bukrs.
parameters: p_gjahr type bkpf-gjahr obligatory.
select-options: s_monat for bkpf-monat,
s_anlkl for anla-anlkl,
s_anln1 for anla-anln1,
s_anln2 for anla-anln2,
s_kostl for anlz-kostl.
* s_ord41 for anla-ord41.
selection-screen end of block b1. start-of-selection.
perform frm_get_data. end-of-selection.
perform frm_out_data. *&---------------------------------------------------------------------*
*& Form FRM_GET_DATA
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
form frm_get_data .
data: l_index type sy-tabix,
l_index1 type sy-tabix,
l_begin_datum type sy-datum,
l_end_datum type sy-datum. *按照查询条件读取资产主记录
select bukrs anlkl anln1 anln2 txt50 as mctxk aktiv into table it_anla_itab from anla
where bukrs in s_bukrs
and anln1 in s_anln1
and anln2 in s_anln2
and anlkl in s_anlkl. if not it_anla_itab[] is initial.
*读取资产分类描述
select anlkl txk50 into table it_ankt_itab from ankt for all entries in it_anla_itab
where spras eq sy-langu
and anlkl eq it_anla_itab-anlkl.
*读取资产分配相关信息
select bukrs anln1 anln2 bdatu adatu kostl into table it_anlz_itab from anlz for all entries in it_anla_itab
where bukrs eq it_anla_itab-bukrs
and anln1 eq it_anla_itab-anln1
and anln2 eq it_anla_itab-anln2
* and bdatu >= sy-datum
* and adatu <= sy-datum
and kostl in s_kostl.
sort it_anlz_itab by bukrs anln1 anln2.
*读取资产行项目信息
select bukrs anln1 anln2 gjahr bwasl belnr anbtr lnsan into table it_anep_itab from anep for all entries in it_anla_itab
where bukrs eq it_anla_itab-bukrs
and anln1 eq it_anla_itab-anln1
and anln2 eq it_anla_itab-anln2
and gjahr eq p_gjahr
and afabe eq ''. sort it_anep_itab by bukrs anln1 anln2.
endif. if not it_anlz_itab[] is initial.
*读取成本中心描述
select kostl ltext into table it_cskt_itab from cskt for all entries in it_anlz_itab
where spras eq sy-langu
and kostl eq it_anlz_itab-kostl.
endif. if not it_anep_itab[] is initial.
loop at it_anep_itab.
clear rs_awkey.
rs_awkey-sign = 'I'.
rs_awkey-option = 'CP'.
concatenate it_anep_itab-belnr '*' into rs_awkey-low.
append rs_awkey.
endloop.
*读取资产处理类型文本
select bwasl bwatxt into table it_tabwt_itab from tabwt for all entries in it_anep_itab
where spras eq sy-langu
and bwasl eq it_anep_itab-bwasl.
*读取会计凭证信息
select bukrs belnr gjahr awkey budat into table it_bkpf_itab from bkpf for all entries in it_anep_itab
where bukrs eq it_anep_itab-bukrs
and gjahr eq it_anep_itab-gjahr
and awkey in rs_awkey.
*读取会计凭证信息
select bukrs belnr gjahr awkey budat appending table it_bkpf_itab from bkpf for all entries in it_anep_itab
where bukrs eq it_anep_itab-bukrs
and belnr eq it_anep_itab-belnr
and gjahr eq it_anep_itab-gjahr.
endif.
*将取出的数据组合ALV数据
sort it_ankt_itab by anlkl.
sort it_anlz_itab by bukrs anln1 anln2.
sort it_cskt_itab by kostl.
sort it_tabwt_itab by bwasl.
sort it_bkpf_itab by bukrs gjahr belnr.
loop at it_anla_itab.
clear: wa_anep_line, wa_ankt_line, wa_cskt_line, l_index, wa_anlz_line, wa_tabwt_line, it_output_itab. it_output_itab-bukrs = it_anla_itab-bukrs.
it_output_itab-anlkl = it_anla_itab-anlkl. read table it_ankt_itab into wa_ankt_line with key anlkl = it_anla_itab-anlkl binary search.
it_output_itab-lbtxk = wa_ankt_line-txk50. it_output_itab-anln1 = it_anla_itab-anln1.
it_output_itab-anln2 = it_anla_itab-anln2.
it_output_itab-mctxk = it_anla_itab-mctxk.
it_output_itab-aktiv = it_anla_itab-aktiv. clear l_index1.
read table it_anlz_itab into wa_anlz_line with key bukrs = it_anla_itab-bukrs
anln1 = it_anla_itab-anln1
anln2 = it_anla_itab-anln2 binary search.
if sy-subrc eq .
l_index1 = sy-tabix.
else.
continue.
endif. loop at it_anlz_itab into wa_anlz_line from l_index1.
if wa_anlz_line-bukrs ne it_anla_itab-bukrs or
wa_anlz_line-anln1 ne it_anla_itab-anln1 or
wa_anlz_line-anln2 ne it_anla_itab-anln2.
exit.
endif. clear: it_output_itab-kostl, it_output_itab-adatu, l_index.
it_output_itab-kostl = wa_anlz_line-kostl.
it_output_itab-adatu = wa_anlz_line-adatu. read table it_cskt_itab into wa_cskt_line with key kostl = wa_anlz_line-kostl binary search.
it_output_itab-ltext = wa_cskt_line-ltext. read table it_anep_itab into wa_anep_line with key bukrs = it_anla_itab-bukrs
anln1 = it_anla_itab-anln1
anln2 = it_anla_itab-anln2.
if sy-subrc ne .
continue.
else.
l_index = sy-tabix.
loop at it_anep_itab into wa_anep_line from l_index.
if wa_anep_line-bukrs ne it_anla_itab-bukrs or
wa_anep_line-anln1 ne it_anla_itab-anln1 or
wa_anep_line-anln2 ne it_anla_itab-anln2.
exit.
endif. clear: it_output_itab-bwasl, it_output_itab-bwatxt, it_output_itab-belnr,
it_output_itab-budat, it_output_itab-anbtr, it_output_itab-fbflg. it_output_itab-bwasl = wa_anep_line-bwasl. read table it_tabwt_itab into wa_tabwt_line with key bwasl = wa_anep_line-bwasl binary search.
it_output_itab-bwatxt = wa_tabwt_line-bwatxt. read table it_bkpf_itab into wa_bkpf_line with key bukrs = wa_anep_line-bukrs
gjahr = wa_anep_line-gjahr
awkey() = wa_anep_line-belnr binary search.
if sy-subrc eq .
it_output_itab-belnr = wa_bkpf_line-belnr.
else.
it_output_itab-belnr = wa_anep_line-belnr.
read table it_bkpf_itab into wa_bkpf_line with key bukrs = wa_anep_line-bukrs
gjahr = wa_anep_line-gjahr
belnr = wa_anep_line-belnr binary search.
endif. if not s_monat is initial.
if not wa_bkpf_line-budat+() in s_monat.
continue.
endif.
endif. it_output_itab-budat = wa_bkpf_line-budat.
it_output_itab-anbtr = wa_anep_line-anbtr. if not wa_anep_line-lnsan is initial.
it_output_itab-fbflg = 'X'.
endif. append it_output_itab.
endloop.
endif.
endloop.
endloop.
endform. " FRM_GET_DATA
*&---------------------------------------------------------------------*
*& Form FRM_OUT_DATA
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
form frm_out_data .
*ALV数据输出
gs_layout-colwidth_optimize = 'X'.
gs_layout-zebra = 'X'.
perform frm_e01_fieldcat_init using :
'BUKRS' '公司代码' '' '' 'X' '' '' '' '' '' '' '' '',
'ANLKL' '资产类别' '' '' 'X' '' '' '' '' '' '' '' '',
'LBTXK' '资产类别名称' '' '' 'X' '' '' '' '' '' '' '' '',
'ANLN1' '资产编号' '' '' 'X' '' '' '' '' '' '' '' '',
'ANLN2' '资产次级编号' '' '' 'X' '' '' '' '' '' '' '' '',
'MCTXK' '资产名称' '' '' '' '' '' '' '' '' '' '' '',
'AKTIV' '资本化日期' '' '' '' '' '' '' '' '' '' '' '',
'KOSTL' '成本中心' '' '' '' '' '' '' '' '' '' '' '',
'LTEXT' '成本中心描述' '' '' '' '' '' '' '' '' '' '' '',
'ADATU' '调拨日期' '' '' '' '' '' '' '' '' '' '' '',
'BWASL' '业务类型' '' '' '' '' '' '' '' '' '' '' '',
'BWATXT' '业务类型描述' '' '' '' '' '' '' '' '' '' '' '',
'BELNR' '凭证编号' '' '' '' '' '' '' '' '' '' '' '',
'BUDAT' '过账日期' '' '' '' '' '' '' '' '' '' '' '',
'ANBTR' '记账金额' '' '' '' '' '' '' '' '' '' '' '',
'FBFLG' '冲销' '' '' '' '' '' '' '' '' '' '' ''.
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = sy-cprog
it_fieldcat = gt_fieldcat[]
is_layout = gs_layout
i_save = 'X'
tables
t_outtab = it_output_itab.
endform. " FRM_OUT_DATA *&--------------------------------------------------------------------*
*& Form FRM_E01_FIELDCAT_INIT
*&--------------------------------------------------------------------*
* text
*---------------------------------------------------------------------*
* -->FIELD_NAME text
* -->FIELD_TEXT text
* -->FIELD_LENTHtext
* -->FIELD_EDIT text
* -->FIELD_TYPE text
* -->FIELD_KEY text
* -->FIELD_HOTSPtext
* -->FIELD_CHECKtext
* -->FIELD_NO_ZEtext
* -->FIELD_REF_TtextME
* -->FIELD_EMPHAtext
*---------------------------------------------------------------------*
form frm_e01_fieldcat_init using
field_name type c
field_text type c
field_lenth type i
field_edit type c
field_type type c
field_key type c
field_hotspot type c
field_checkbox type c
field_no_zero type c
field_ref_tabname type c
field_emphasize type c "change cell backgorund color
field_decimals_out type c
field_do_sum type c
field_no_out type c. data: ls_fieldcat type slis_fieldcat_alv.
clear ls_fieldcat.
col_pos = col_pos + .
* LS_FIELDCAT-COL_POS = COL_POS.
ls_fieldcat-fieldname = field_name.
ls_fieldcat-seltext_l = field_text.
ls_fieldcat-seltext_m = field_text.
ls_fieldcat-seltext_s = field_text.
ls_fieldcat-checkbox = field_checkbox.
ls_fieldcat-round = .
ls_fieldcat-edit = field_edit.
if field_type = 'Q'.
ls_fieldcat-just = 'R'.
ls_fieldcat-datatype = 'QUAN'.
else.
ls_fieldcat-just = 'L'.
endif.
ls_fieldcat-key = field_key.
ls_fieldcat-hotspot = field_hotspot .
ls_fieldcat-outputlen = field_lenth.
ls_fieldcat-no_zero = field_no_zero.
ls_fieldcat-emphasize = field_emphasize .
ls_fieldcat-ref_tabname = field_ref_tabname.
ls_fieldcat-decimals_out = field_decimals_out.
ls_fieldcat-do_sum = field_do_sum.
ls_fieldcat-no_out = field_no_out.
append ls_fieldcat to gt_fieldcat.
*COLOR
endform. " frm_e01_fieldcat_init
SAP资产变动明细的更多相关文章
- SAP资产明细报表
前两年别人写的,无自定义表字段...直接使用: *&---------------------------------------------------------------------* ...
- SAP资产折旧,消息编号AA687:在上一年结算之后您只能记帐到新的一年
问题:公司****在2015年底没有固定资产,忽略了月结的必要步骤,在2016年1-5月份一直没有计提折旧,再进行折旧时提示"在上一年结算之后您只能记帐到新的一年" 原因: sap ...
- SAP 资产相关日期
1. Capitalized Date(资本化日期) 可以手工输入资本化日期,或者如果不输入,则通常默认写入First Acquisition Date (资产第一次购置时输入资产价值日). 2.As ...
- 【FICO系列】SAP FICO-模块 关于固定资产年结和折旧的问题
公众号:SAP Technical 本文作者:matinal 原文出处:http://www.cnblogs.com/SAPmatinal/ 原文链接:[FICO系列]SAP FICO-模块 关于固定 ...
- 如何在云端部署SAP HANA实战, Azure 上的 SAP HANA(大型实例)概述和体系结构
什么是 Azure 上的 SAP HANA(大型实例)? Azure 上的 SAP HANA(大型实例)是一种针对 Azure 的独特解决方案. 除了提供 Azure 虚拟机以用于部署和运行 SAP ...
- 火币Huobi API Websocket
本文介绍火币Huobi API Websocket WebSocket API简介 WebSocket协议是基于TCP的一种新的网络协议.它实现了客户端与服务器之间在单个 tcp 连接上的全双工通信, ...
- Oracle财务系统常用标准报表
http://erpoperator.blog.163.com/blog/static/17899637220111181121616/ Oracle财务系统常用标准报表 总账系统 系统报表名 中文译 ...
- 数仓1.4 |业务数仓搭建| 拉链表| Presto
电商业务及数据结构 SKU库存量,剩余多少SPU商品聚集的最小单位,,,这类商品的抽象,提取公共的内容 订单表:周期性状态变化(order_info) id 订单编号 total_amount 订单金 ...
- Echarts中太阳图(Sunburst)的实例
Echarts中太阳图(Sunburst)的实例 目前在项目中要实现一个Echars中的太阳图,但是Echars中的太阳图的数据格式是一个树形结构,如下代码格式如下: var mapData = [ ...
随机推荐
- [HDOJ5877]Weak Pair(DFS,线段树,离散化)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5877 题意:给一棵树和各点的权值a,求点对(u,v)个数,满足:1.u是v的祖先,2.a(u)*a(v ...
- Spring + JDBC 组合开发集成步骤
1:配置数据源,如: <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="h ...
- RARP
ARP的工作原理如下:1. 首先,每台主机都会在自己的ARP缓冲区 (ARP Cache)中建立一个 ARP列表,以表示IP地址和MAC地址的对应关系.2. 当源主机需要将一个数据包要发送到目的主机时 ...
- mypc--------------->lspci,lsusb,meminfo cpuinfo ioports filesystems interrupts mounts net partitions pagetypeinfo slabinfo timer_list uptime version zoneinfo 等配置信息
[user@username home]$ lspci00:00.0 Host bridge: Intel Corporation 4th Gen Core Processor DRAM Contro ...
- 超实用压力测试工具-ab工具
在学习ab工具之前,我们需了解几个关于压力测试的概念 吞吐率(Requests per second)概念:服务器并发处理能力的量化描述,单位是reqs/s,指的是某个并发用户数下单位时间内处理的请求 ...
- [转载] 理解RESTful架构
原文: http://www.ruanyifeng.com/blog/2011/09/restful.html 理解RESTful架构 作者: 阮一峰 日期: 2011年9月12日 越来越多的人开 ...
- ScriptX.cab打印控件的使用,控件文件里有
1.在head里添加 <object id="factory" style="display:none;" viewastext classid=&quo ...
- 9月java货车版速记
运算符的优先级java自带的方法正则表达式数组和二维数组:数组遍历,填充数组,数组排序,复制数组,数组查询数组算法:冒泡,选择,反转,快速类和对象:封装,继承,多态,this关键字,抽象类和接口重写和 ...
- TCP/IP协议学习(一) LWIP实现网络远程IAP下载更新
最近需要实现通过TCP/IP远程IAP在线更新功能,忙了2周终于在原有嵌入式服务器的基础上实现了该功能,这里就记录下实现的过程. IAP又称在应用编程,其实说简单点就是实现不需要jlink,仅通过芯片 ...
- composer 安装yii插件 fontawesome
国外站点 http://fontawesome.io/ 国内站点 http://fontawesome.dashgame.com/ Installation The preferred way to ...