博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
互动报表 SAP ABAP
阅读量:6295 次
发布时间:2019-06-22

本文共 3667 字,大约阅读时间需要 12 分钟。

下午花了一个小时复习了一下以前培训的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

转载地址:http://bftta.baihongyu.com/

你可能感兴趣的文章
vmstat详解
查看>>
新年第一镖
查看>>
unbtu使用笔记
查看>>
OEA 中 WPF 树型表格虚拟化设计方案
查看>>
Android程序开发初级教程(一) 开始 Hello Android
查看>>
使用Gradle打RPM包
查看>>
“我意识到”的意义
查看>>
淘宝天猫上新辅助工具-新品填表
查看>>
再学 GDI+[43]: 文本输出 - 获取已安装的字体列表
查看>>
nginx反向代理
查看>>
操作系统真实的虚拟内存是什么样的(一)
查看>>
hadoop、hbase、zookeeper集群搭建
查看>>
python中一切皆对象------类的基础(五)
查看>>
modprobe
查看>>
android中用ExpandableListView实现三级扩展列表
查看>>
%Error opening tftp://255.255.255.255/cisconet.cfg
查看>>
java读取excel、txt 文件内容,传到、显示到另一个页面的文本框里面。
查看>>
《从零开始学Swift》学习笔记(Day 51)——扩展构造函数
查看>>
python多线程队列安全
查看>>
[汇编语言学习笔记][第四章第一个程序的编写]
查看>>