11.ABAP数据结构.ppt
《11.ABAP数据结构.ppt》由会员分享,可在线阅读,更多相关《11.ABAP数据结构.ppt(33页珍藏版)》请在优知文库上搜索。
1、Address ListAddress ListAddress ListAddress List 1REPORT YN1C0008. 2 3TABLES: TABNA. 4DATA:BEGIN OF ADDRESS, 5FLAGTYPE C, 6IDLIKE TABNA-ID, 7NAME1LIKE TABNA-NAME1, 8CITYLIKE TABNA-CITY, 9END OF ADDRESS.10MOVEXTO ADDRESS-FLAG.11MOVE0001TO ADDRESS-ID.12MOVESmithTO ADDRESS-NAME1.13MOVEPhiladelphia TO A
2、DDRESS-CITY.1415WRITE ADDRESS.1617181920212223基本语法基本语法:DATA: BEGIN OF DATA: BEGIN OF . . . 1 . . . . . . 2 . . . . . . . . . END OF END OF . . FlagFlagID ID Name1 Name1 City CityAddress Address 结构结构REPORT Yxxxxxxx.TYPES: BEGIN OF ADDR,FLAG,IDLIKE EMPLOYEE-ID,NAME1LIKE EMPLOYEE-NAME1,CITYLIKE EMPLOYE
3、E-CITY, END OF ADDR.DATA: ADDRESS TYPE ADDR.MOVE: X TO ADDRESS-FLAG,00001 TO ADDRESS-ID,Smith TO ADDRESS-NAME1,Philadelphia TO ADDRESS-CITY.WRITE ADDRESS.基本语法基本语法:TYPES: BEGIN OF TYPES: BEGIN OF ,1, . . . ,1 . . . , . . . ,2 . . . , . . . , . . . , END OF END OF .1.DATA: DATA: TYPE 2 TYPE .1. FlagID
4、 Name1 CityAddress 结构结构REPORT Y170DM37.TABLES: EMPLOYEE.DATA: BEGIN OF ADDRESS,FLAG,IDLIKE EMPLOYEE-ID,NAMELIKE EMPLOYEE-NAME1,CITYLIKE EMPLOYEE-CITY, END OF ADDRESS.SELECT * FROM EMPLOYEE. MOVE-CORRESPONDING EMPLOYEE TO ADDRESS. WRITE: / ADDRESS-FLAG, ADDRESS-ID, ADDRESS-NAME, ADDRESS-CITY. CLEAR A
5、DDRESS.ENDSELECT.EMPLOYEEEMPLOYEEAddressAddressID ID Name1 Name1 City City000000001 Electronics Inc. Waldorf 000000001 Electronics Inc. Waldorf MOVE-CORRESPONDING EMPLOYEE MOVE-CORRESPONDING EMPLOYEE TO ADDRESS. TO ADDRESS.FlagFlag ID ID Name Name City City000000001000000001 Waldorf WaldorfClear .Cl
6、ear . 标准内表标准内表 排序内表排序内表 HashedHashed内表内表REPORT Y170DM38.TABLES: EMPLOYEE.TYPES: BEGIN OF EMP,IDLIKE EMPLOYEE-ID,NAME1LIKE EMPLOYEE-NAME1,COUNTRY LIKE EMPLOYEE-COUNTRY, END OF EMP.DATA: EMPTAB TYPE STANDARD TABLE OF EMP INITIAL SIZE 10 WITH HEADER LINE.SELECT * FROM EMPLOYEE. MOVE-CORRESPONDING EMPLO
7、YEE TO EMPTAB. APPEND EMPTAB.ENDSELECT.TYPES TYPES 语句定义内表的结构和数语句定义内表的结构和数据类型据类型INITIAL SIZE INITIAL SIZE 语句指定了内表的存语句指定了内表的存储数量储数量, HEADER LINE , HEADER LINE 语句指定内语句指定内表带有一个标题行表带有一个标题行标题行标题行 ID NAME1 COUNTRYID NAME1 COUNTRY 默认关键字默认关键字所有的字符类型所有的字符类型 指定关键字指定关键字用户指定用户指定例如例如. . WITH UNIQUE/NON-UNIQUE KEY
8、 WITH UNIQUE/NON-UNIQUE KEY 字段字段1 1 字段字段2 .2 .APPEND APPEND SORTED BY SORTED BY . .APPEND APPEND . .DepartmentDepartment Salary Salary1 12 23 34 45 56 6DepartmentDepartment Salary Salary标题行标题行R&D 400,000R&D 400,000PROD PROD 7,800,0007,800,000MKTG MKTG 1,000,0001,000,000SALES SALES 500,000500,000HR H
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 11. ABAP 数据结构