YTST_CX_0001(ALV栏位汇总)
***********************************************************************
* Title : X *
* Application : X *
* Subject : X *
* Requested by : X *
* Execution : X *
* Ref no: : X *
* Author : X *
* Req Date : X *
***********************************************************************
* 设计主要逻辑与原理说明 *
***********************************************************************
* 1.XXX *
* XXX *
* XXX *
* *
***********************************************************************
* MODIFICATIONS (latest entry at the top) *
* ------------------------------------------------------------------- *
* REL DATE NAME (COMPANY) DESCRIPTION TASK-NO *
* --- ---- ---- --------- ----------- ------- *
* *
***********************************************************************
REPORT YTST_CX_0001 NO STANDARD PAGE HEADING
LINE-COUNT 65
LINE-SIZE 135
MESSAGE-ID YTCX_01.
*----------------------------------------------------------------------
* TYPE-POOLS
*----------------------------------------------------------------------
TYPE-POOLS: SLIS. "ALV
*----------------------------------------------------------------------
* TABLES/Structure
*----------------------------------------------------------------------
TABLES: MARA,
MBEW.
*----------------------------------------------------------------------
* TYPES
*----------------------------------------------------------------------
TYPES:BEGIN OF T_ITAB,
MATNR LIKE MARA-MATNR,
ERSDA LIKE MARA-ERSDA,
MATKL LIKE MARA-MATKL,
LBKUM LIKE MBEW-LBKUM,
SALK3 LIKE MBEW-SALK3,
END OF T_ITAB.
*----------------------------------------------------------------------
* Internal table
*----------------------------------------------------------------------
DATA:ITAB TYPE TABLE OF T_ITAB WITH HEADER LINE.
DATA:G_LEN TYPE I.
*======================================================================
* SELECTION-SCREEN
*======================================================================
SELECTION-SCREEN BEGIN OF BLOCK BLOK WITH FRAME TITLE TXT1.
SELECT-OPTIONS: MATNR FOR MARA-MATNR.
SELECTION-SCREEN END OF BLOCK BLOK.
*----------------------------------------------------------------------
* INITIALIZATION
*----------------------------------------------------------------------
INITIALIZATION.
TXT1 = '请输入选择条件'.
*&G1 初始化数据
PERFORM FRM_INITIAL.
*----------------------------------------------------------------------
* AT SELECTION-SCREEN
*----------------------------------------------------------------------
AT SELECTION-SCREEN.
*G2 权限检查部分
PERFORM FRM_CHECK_AUTHOR.
*======================================================================
* MAIN PROGRAM
*======================================================================
* START-OF-SELECTION
*----------------------------------------------------------------------
START-OF-SELECTION.
*&G3 获取数据
PERFORM FRM_GET_DATA.
*&G4 ALV展示输出
PERFORM FRM_ALV_OUTPUT.
*======================================================================
* END-OF-SELECTION
*----------------------------------------------------------------------
END-OF-SELECTION.
**&G3 获取数据
* PERFORM FRM_GET_DATA.
**&G4 ALV展示输出
* PERFORM FRM_ALV_OUTPUT.
TOP-OF-PAGE.
END-OF-PAGE.
*&---------------------------------------------------------------------*
*& Form FRM_INITIAL
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM FRM_INITIAL .
ENDFORM. " FRM_INITIAL
*&---------------------------------------------------------------------*
*& Form FRM_CHECK_AUTHOR
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM FRM_CHECK_AUTHOR .
ENDFORM. " FRM_CHECK_AUTHOR
*&---------------------------------------------------------------------*
*& Form FRM_GET_DATA
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM FRM_GET_DATA .
SELECT MARA~MATNR
MARA~ERSDA
MARA~MATKL
MBEW~LBKUM
MBEW~SALK3
INTO TABLE ITAB
FROM MARA
JOIN MBEW ON ( MARA~MATNR = MBEW~MATNR AND MBEW~BWKEY = '1000' )
WHERE MARA~MATNR IN MATNR
ORDER BY MARA~MATNR.
DESCRIBE TABLE ITAB LINES G_LEN.
IF G_LEN EQ 0.
MESSAGE E000 WITH '没有找到符合条件的数据!'.
ELSE.
MESSAGE S002 WITH '找到符合条件数据' G_LEN '条!'.
ENDIF.
ENDFORM. " FRM_GET_DATA
*&---------------------------------------------------------------------*
*& Form FRM_ALV_OUTPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM FRM_ALV_OUTPUT .
DATA:IT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
IS_VARIANT LIKE DISVARIANT,
IT_EVENTS TYPE SLIS_T_EVENT,
IS_LAYOUT TYPE SLIS_LAYOUT_ALV,"ALV的格式
I_LIST_COMMENTS TYPE SLIS_T_LISTHEADER,
I_CALLBACK_PROGRAM TYPE SY-REPID,
TITLE TYPE LVC_TITLE,
IT_SORT TYPE SLIS_T_SORTINFO_ALV.
PERFORM FIELDCAT_INIT USING IT_FIELDCAT."输出列表控件表头
* PERFORM layout_init USING is_layout.
* PERFORM eventtab_build USING it_events.
PERFORM E02_LAYOUT_SORT_BUILD CHANGING IT_SORT.
I_CALLBACK_PROGRAM = SY-REPID.
TITLE = '测试'.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = I_CALLBACK_PROGRAM
I_GRID_TITLE = TITLE
IS_LAYOUT = IS_LAYOUT
IT_FIELDCAT = IT_FIELDCAT
IT_EVENTS = IT_EVENTS
IT_SORT = IT_SORT[]
TABLES
T_OUTTAB = ITAB
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2.
IF SY-SUBRC <> 0.
ENDIF.
ENDFORM. " FRM_ALV_OUTPUT
*&---------------------------------------------------------------------*
*& Form FIELDCAT_INIT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->P_IT_FIELDCAT text
*----------------------------------------------------------------------*
FORM FIELDCAT_INIT USING IT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV.
DATA: LS_FIELDCAT TYPE SLIS_FIELDCAT_ALV.
LS_FIELDCAT-FIELDNAME = 'MATNR'.
LS_FIELDCAT-REPTEXT_DDIC = '物料号'.
LS_FIELDCAT-NO_ZERO = 'X'.
APPEND LS_FIELDCAT TO IT_FIELDCAT.
CLEAR LS_FIELDCAT.
LS_FIELDCAT-FIELDNAME = 'ERSDA'.
LS_FIELDCAT-REPTEXT_DDIC = '创建日期'.
APPEND LS_FIELDCAT TO IT_FIELDCAT.
CLEAR LS_FIELDCAT.
LS_FIELDCAT-FIELDNAME = 'MATKL'.
LS_FIELDCAT-REPTEXT_DDIC = '物料组'.
APPEND LS_FIELDCAT TO IT_FIELDCAT.
CLEAR LS_FIELDCAT.
LS_FIELDCAT-FIELDNAME = 'LBKUM'.
LS_FIELDCAT-REPTEXT_DDIC = '总评估的库存'.
LS_FIELDCAT-DO_SUM = 'X'.
APPEND LS_FIELDCAT TO IT_FIELDCAT.
CLEAR LS_FIELDCAT.
LS_FIELDCAT-FIELDNAME = 'SALK3'.
LS_FIELDCAT-REPTEXT_DDIC = '估价的总库存价值'.
LS_FIELDCAT-DO_SUM = 'X'.
APPEND LS_FIELDCAT TO IT_FIELDCAT.
CLEAR LS_FIELDCAT.
ENDFORM. " fieldcat_init
*&---------------------------------------------------------------------*
*& Form E02_LAYOUT_SORT_BUILD
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* <--P_IT_SORT text
*----------------------------------------------------------------------*
FORM E02_LAYOUT_SORT_BUILD CHANGING LT_SORT TYPE SLIS_T_SORTINFO_ALV.
DATA LS_SORT TYPE SLIS_SORTINFO_ALV.
CLEAR LS_SORT.
LS_SORT-FIELDNAME = 'ERSDA'. "#EC *
LS_SORT-SPOS = 1.
LS_SORT-UP = 'X'.
LS_SORT-SUBTOT = 'X'.
APPEND LS_SORT TO LT_SORT.
CLEAR LS_SORT.
LS_SORT-FIELDNAME = 'MATKL'. "#EC *
LS_SORT-SPOS = 1.
LS_SORT-UP = 'X'.
LS_SORT-SUBTOT = 'X'.
APPEND LS_SORT TO LT_SORT.
ENDFORM. " e02_layout_sort_build
YTST_CX_0001(ALV栏位汇总)的更多相关文章
- input 栏位光标末尾闪烁
var input1 =window.document.getElementById("input1").createTextRange(); input1.collapse(fa ...
- 6 关于 Oracle NULL栏位和PL./SQL执行实验
今日有针对NULL值有了相关实验. 对NULL 值插入的讨论. 1, PL/SQL 中可以执行插入''或者NULL 的操作, 前提是栏位允许为空. 2, 可以对NULL进行一系列数据库运算. 如: ...
- ZZ_INEERNAL每个栏位的含义
ZZ_INEERNAL包含10列,每列之间用,隔开 第一列:exception class,有KE/NE/JE/EE等 第二列:pid 第三列:tid 第四列:固定是99 第五列:固定是/data/c ...
- Linux显示各栏位的标题信息列
Linux显示各栏位的标题信息列 youhaidong@youhaidong-ThinkPad-Edge-E545:~$ who -H 名称 线路 时间 备注 youhaidong :0 2015-0 ...
- Rails Migration Data Model栏位修改及数据类型介绍
测试版本Ruby:2.3.1 Rails:5.0.1 一.增加栏位 给devise默认的用户新增增加username字段 $ rails generate migration add_ ...
- SAP 销售条件表增强栏位
有时遇到一个比较特殊的业务,比如公司间免费订单,既要让价格为0,不读取VK11里创建的价格, 又要让公司间的价格读取VK11,这实际上是有矛盾的,也就是说一个订单里面的两行,物料一样,客户一样,就会出 ...
- org.postgresql.util.PSQLException: 栏位索引超过许可范围:3,栏位数:2。
org.postgresql.util.PSQLException: 栏位索引超过许可范围:3,栏位数:2. 今天在写完SQL进行查询的时候,后台一直报错显示上面的信息.看错误完全不知道原因,就重新检 ...
- pymysql 单独获取表的栏位名称
有时需要获取表的栏位+数值,请参考 https://www.cnblogs.com/xibuhaohao/p/9996571.html 有时只需要栏位名称,那么可以使用 col=self.cursor ...
- OFBiz:添加实体栏位
如何添加实体栏位?这里演示为PostalAddress添加planet栏位.打开applications/party/entitydef/entitymodel.xml,找到PostalAddress ...
随机推荐
- Mark S. Rasmussen improve.dk-----knife-for-mdf-files
http://improve.dk/orcamdf-rawdatabase-a-swiss-army-knife-for-mdf-files/ http://www.cnblogs.com/lyhab ...
- Taskaffinity属性使用小结
TaskAffinity属性小结 最近在项目中用到了TaskAffinity属性,发现这个还是挺有意思,可以用来控制activity所属的任务栈.但同时只设置这一个属性又是不能完成功能的,需要与其它属 ...
- 在Android中实现阴影效果
在Android L推出后,Google提出了全新的设计语言:材质设计.其中很重要的一点就是阴影效果的使用,你可以为每一个View设置一个elevation值,相当于除了x.y之外的z值,z值决定了阴 ...
- 用户空间和内核空间通讯之【Netlink 上】
原文地址:用户空间和内核空间通讯之[Netlink 上] 作者:wjlkoorey258 引言 Alan Cox在内核1.3版本的开发阶段最先引入了Netlink,刚开始时Netlink是以字符驱动接 ...
- ElasticSearch命令增加字段总结
1.建立一个String类型的字段 curl -XPUT http://192.168.46.163:9200/t_risk_case/_mapping/t_risk_case?pretty -d ' ...
- spring Multiple MongoTemplate
<!-- 数据环境配置 --> <mongo:repositories base-package="com.my9yu.manager.module.server.repo ...
- 【温故知新】——HTML5重要知识点复习
前言:本文是自己在学习课程中的课程笔记,这里用来温故知新的,并非本人原创. 一.HTML5新特性 —— 十个新特性:凌乱 (1)新的语义标签 (2)增强型表单(表单2.0) (3)音频和视频 (4)C ...
- 转:office 2016最新安装及激活教程(KMS)
office 2016最新安装及激活教程(KMS)[亲测有效]!! win7激活教程 博主的一个朋友,咳咳……你们懂得,想装office,于是我就上网找了一下激活的方法,亲测有效,而且也没有什么广 ...
- mybatis数据查询返回值
查询: 返回值是整数. 小于0是查询的数据不存在,大于0是查询的数据已经存在. 修改: 返回值是整数. 大于0是修改的数据成功,否则就是失败. 添加: 和修改同理.
- ExtJs4学习(二):Dom操作
如今主流的JS框架要数ExtJs和JQuery应用的比較广泛.JQuery属于轻量级的,一般做站点应用比較常见.可见块头小的优势. ExtJs比較庞大,它除了对主要的JS语法和HTML DOM操作方式 ...