互动报表 SAP ABAP

简介: 下午花了一个小时复习了一下以前培训的things,以前学的现在也用不到多少,为了不忘记,现在开始又要复习一下,都是写些简单地的程序。我的学习都是这样,从简单的东西然后慢慢的融汇到复杂的事情。

下午花了一个小时复习了一下以前培训的things,以前学的现在也用不到多少,为了不忘记,现在开始又要复习一下,都是写些简单地的程序。我的学习都是这样,从简单的东西然后慢慢的融汇到复杂的事情。嘿嘿,这个星期六和星期天实在不想做什么事情,就看了下以前下的一个关于测字的书,看上去好难。说不定哪天abap不会了,就出去给人家算命,给自己留条后路阿!哈哈!~


*&---------------------------------------------------------------------*
*& Report ZTESTWS3 *
*& *
*&---------------------------------------------------------------------*

REPORT ZTESTWS3.

**define data
TABLES: EKKO,
EKPO.
DATA MARK.
*DATA OK_CODE LIKE SY-UCOMM.
**define internal table it_ekko.
DATA: WA_EKKO TYPE EKKO,
IT_EKKO TYPE TABLE OF EKKO.

**DEFINE INTERNAL TABLE IT_EKPO
DATA: WA_EKPO TYPE EKPO,
IT_EKPO_READ TYPE TABLE OF EKPO,
IT_EKPO TYPE TABLE OF EKPO.
**selection-screen
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
SELECT-OPTIONS S_EBELN FOR EKKO-EBELN.
SELECTION-SCREEN END OF BLOCK B1.

**start-of-selection
START-OF-SELECTION.
PERFORM GET_DATA_EKKO.

**end-of-selection
END-OF-SELECTION.
PERFORM DISPLAY_DATA_EKKO.
SET PF-STATUS 'STATUS_TBASE'.
SET TITLEBAR 'TITLE_TBASE'.

**at user-command
AT USER-COMMAND.
CASE SY-UCOMM.
WHEN 'BOOK'.
REFRESH IT_EKKO.
DO.
READ LINE SY-INDEX FIELD VALUE MARK.
IF SY-SUBRC 0.
EXIT.
ENDIF.
CHECK NOT MARK IS INITIAL.
PERFORM GET_DATA_EKPO
USING WA_EKKO-EBELN
CHANGING IT_EKPO_READ.
APPEND LINES OF IT_EKPO_READ TO IT_EKPO.
ENDDO.
SORT IT_EKPO BY EBELN.
PERFORM DISPLAY_DATA_EKPO.
SET TITLEBAR 'TITLE_SBASE'.
SET PF-STATUS 'STATUS_SBASE'.

**SELECT ALL
WHEN 'SELECT'.
DO.
READ LINE SY-INDEX.
IF SY-SUBRC NE 0. EXIT. ENDIF.
MODIFY CURRENT LINE FIELD VALUE MARK FROM 'X'.
ENDDO.

**DESELECT ALL
WHEN 'DESELECT'.
DO.
READ LINE SY-INDEX.
IF SY-SUBRC NE 0. EXIT. ENDIF.
MODIFY CURRENT LINE FIELD VALUE MARK FROM SPACE.
ENDDO.
ENDCASE.
**TOP-OF-PAGE DURING LINE-SELECTION
TOP-OF-PAGE DURING LINE-SELECTION.
CASE SY-UCOMM.
WHEN 'BOOK'.
FORMAT COLOR COL_HEADING.
ULINE.

ENDCASE.
*&---------------------------------------------------------------------*
*& Form get_data_ekko
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
FORM GET_DATA_EKKO .
SELECT *
INTO CORRESPONDING FIELDS OF TABLE IT_EKKO
FROM EKKO
WHERE EBELN IN S_EBELN.
ENDFORM. " get_data_ekko
*&---------------------------------------------------------------------*
*& Form display_data_ekko
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*

FORM DISPLAY_DATA_EKKO .
LOOP AT IT_EKKO INTO WA_EKKO.
WRITE: / MARK AS CHECKBOX,
WA_EKKO-EBELN,
WA_EKKO-BUKRS,
WA_EKKO-LIFNR,
WA_EKKO-AEDAT.

HIDE: WA_EKKO-EBELN.
ENDLOOP.
ENDFORM. " display_data_ekko
*&---------------------------------------------------------------------*
*& Form GET_DATA_EKPO
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->P_WA_EKKO_EBELN text
* *----------------------------------------------------------------------*
FORM GET_DATA_EKPO USING P_EBELN TYPE EKPO-EBELN
CHANGING P_EKPO LIKE IT_EKPO.
SELECT *
INTO CORRESPONDING FIELDS OF TABLE P_EKPO
FROM EKPO
WHERE EBELN = P_EBELN.
ENDFORM. " GET_DATA_EKPO
*&---------------------------------------------------------------------*
*& Form DISPLAY_DATA_EKPO
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* *----------------------------------------------------------------------*
FORM DISPLAY_DATA_EKPO .
LOOP AT IT_EKPO INTO WA_EKPO.
WRITE: / WA_EKPO-EBELN,
WA_EKPO-EBELP,
WA_EKPO-AEDAT.

ENDLOOP.
ENDFORM. " DISPLAY_DATA_EKPO

目录
相关文章
SAP ABAP 程序调用设置成后台作业模式
ABAP 程序调用设置成后台作业模式
520 0
SAP ABAP 内表排序 动态字段排序
对于动态内表排序引用ABAP_SORTORDER_TAB
296 0
|
SQL 设计模式 前端开发
【置顶】SAP ABAP开发实战——从入门到精通系列目录
本文章为SAP ABAP开发实战——从入门到精通系列的目录以及关于该教程的后续写作计划表
1587 0
【置顶】SAP ABAP开发实战——从入门到精通系列目录
|
SQL
SAP ABAP-OPENSQL-数值函数简介
S4中针对OPENSQL新提供一些函数
139 0
|
SQL
SAP ABAP-OPENSQL-字符串函数介绍
S4中SQL新语法字符串函数
209 0
|
SQL
SAP ABAP-OPENSQL-日期/时间戳函数
S4提供针对OPENSQL一些新的SQL函数调用,本文展示相关函数的使用
654 0
|
BI
SAP ALV报表选择屏幕筛选字段动态文本
SAP ALV报表选择屏幕筛选字段动态文本
240 0
SAP ABAP-删除工序示例代码
ABAP-删除工序示例代码
171 0
SAP ABAP 检查事务码权限
检查用户是否有自开发事务码的权限
158 0
|
BI
SAP ABAP在线预览文档对象的开发实现
应用场景:有些定制化开发(报表/功能增强等)完成之后,客户需要将其操作手册或者相关文档放在某个报表的初始画面,供实际操作者在线查阅,当然这个功能也同样类似于模板的下载,这里就以在线预览(直接打开)为例进行说明。
225 0