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 ...
随机推荐
- PostgreSQL 10.0 preview 功能增强
https://yq.aliyun.com/users/1384833841157402?spm=5176.100239.blogrightarea51131.3.yI7e9d
- ARCGIS 二次开发可以参考的资源(长期更新)
背景: 今天,被领导教导,说是你刚入职,要尽快把项目做起.言语忠恳,而且说不要再在电脑上练习那些小的测试例子了,要直接切入项目,熟悉项目的开发框架,与设计理念.得到,我的负责人(TB)把他做的项目的资 ...
- 一次lenovo a390t刷机体验
今天一朋友说自己的联想a390t手机有时候打着打着电话就没声音了,手机好像死机了一样,以前用着挺好的没什么毛病. 因为以前用刷机精灵刷过几个android手机,感觉挺简单的,只要找好对应的rom点击两 ...
- 单选复选框的js代码取值
单选框 复选框选中后的js代码处理 <script type="text/javascript"> function check(){ document.getElem ...
- kohana nginx的配置
kohana nginx的配置 location / { if (!-e $request_filename) { rewrite ^/(.*)$ /index.php? kohana_uri=/$1 ...
- 登陆界面综合实例+spinner下拉列表框详解
点击确定: 点击修改: 想到Spinner下拉按钮可以通过两种方法生成 方法一: 1.在array数组里面定义数组 代码如下: <resources> <st <? ...
- 《Head First 设计模式》学习笔记——观察者模式 + 装饰者模式
装饰者模式是JDK中还有一个使用较多的设计模式,上一个是观察者模式(在Swing中大量使用),业内好的API设计无一离不开常见的设计模式,通常我们所说要阅读源代码,也是为了学习大牛们的设计思路.--- ...
- linux 安装jdk和tomcat
安装jdk 下载相关jdk .rpm包,如:jdk-8u31-linux-i586.rpm 解压:#rpm -ivh jdk-8u31-linux-i586.rpm 配置环境变量:#vi /etc/ ...
- 浅谈js中的MVC
MVC是什么? MVC是一种架构模式,它将应用抽象为3个部分:模型(数据).视图.控制器(分发器) 本文将用一个经典的例子todoList来展开 一个事件发生的过程(通信单向流动): 1.用户在视图V ...
- js向后台传递对象
js: }; $.ajax({ url: "/.../...", type: "POST", async: false, data: JSON.stringif ...