显示标签为“ABAP,SAP”的博文。显示所有博文
显示标签为“ABAP,SAP”的博文。显示所有博文

2009年2月20日星期五

ABAP第十三步:ABAP字典回顾

2009年2月19日星期四

ABAP第十二步:类型组

ABAP第十一步:在线帮助 & 文档

2009年2月18日星期三

ABAP第十步:搜索帮助概览

2009年2月17日星期二

ABAP第九步:ABAP字典对象——View

ABAP第八步:更改ABAP字典

2009年2月15日星期日

ABAP第六步:添加结构

2009年2月12日星期四

ABAP第五步:关系数据库中ABAP字典表

ABAP第四步:数据库外键

2009年2月9日星期一

ABAP第三步:建立域、数据元素和搜索帮助

ABAP第三步:建立域、数据元素和搜索帮助






top-down: proceeding by breaking large general aspects (as of a problem) into smaller more detailed constituents : working from the general to the specific
bottom-up: progressing upward from the lowest levels (as of a stratified organization or system)

A Data Model have three basic components: Entities, Attributes, Entity Types.

Entity: An entity is a uniquely identifiable object for which information is to be collected.

Attribute: An attribute is a characteristic of an entity.
Entity Type: An entity type is a set of entities with common attributes.

Primary Key: A primary key is that attribute or combination of attributes that uniquely identifies an entity of a particular type. A customer ID number might serve as the primary key of the customers entity type.

Relationships between entities can be classified in several ways:
Cardinality: the cardinality of a relationship describes the number of entities of one type that relate to entities of other types.

Optionality: The optionality of a relationship describes whether or not entities of one type must refer to entities of another type.

Category: A relationship’s category provides information about whether one entity is identified by its relationship to another entity



重要的编辑键

  key        Function

F8        执行程序

F5        复制游标所在列的内容

F11        储存档案

CTRL+F11     删除游标所在列

域(Domain):描述一个字段类型和长度等信息;
数据元素(
Data Element):描述一个字段的用途。
使用时,先定义域,再定义数据元素使用哪个域,最后定义一个表字段使用哪些数据元素。

表类型:透明表(Transparent Table):在数据库中有对应的物理表、结构(Structure):为若干个字段的组合,在数据库中不存在数据记录、附加结构(Append Structure)、存储表(Pooled Table)、簇表(Cluster Table)、视图(Generated View Structure)。


Create new Domain: SE11


Input the Data Type, No.Characters, Output Length. Saved and active.


Create new Data Element: SE11


Input the Domain “YD_CITYID” which created above. Then Choose the “Field Lable”.

Save and active data elements.


Maintain Data Element in Table: SE11


Input the appropriate Data Element



Create the Search Help: SE11


Double click the YSCRH_TEST


Input the Short Description, Parameters


Double click “YCT_NAME” to establish Data Element



Input Parameters “YCT_ID”, save and active


SE16 open Data Browser, we can see YCT_ID have “Search Help”

2009年2月8日星期日

ABAP第二步:建立、维护数据表



top-down: proceeding by breaking large general aspects (as of a problem) into smaller more detailed constituents : working from the general to the specific
bottom-up: progressing upward from the lowest levels (as of a stratified organization or system)

A Data Model have three basic components: Entities, Attributes, Entity Types.

Entity: An entity is a uniquely identifiable object for which information is to be collected.

Attribute: An attribute is a characteristic of an entity.
Entity Type: An entity type is a set of entities with common attributes.

Primary Key: A primary key is that attribute or combination of attributes that uniquely identifies an entity of a particular type. A customer ID number might serve as the primary key of the customers entity type.

Relationships between entities can be classified in several ways:
Cardinality: the cardinality of a relationship describes the number of entities of one type that relate to entities of other types.

Optionality: The optionality of a relationship describes whether or not entities of one type must refer to entities of another type.

Category: A relationship’s category provides information about whether one entity is identified by its relationship to another entity


ABAP第二步:建立、维护数据表

主要ABAP相关技术

简称        描述             备注
Internal Table   内表处理
CATT       计算机辅助测试工具      SCAT
BDC        批量数据处理程序       SHDB等
List        数据列表,报表输出使用
Selection     数据选择
Screen       屏幕设计           SE51
Menu       菜单绘制器          SE41
Form       单据打印           SE71
SmartForms   单据打印           SmartForms
Query       简单查询           SQ01
BAPI       API接口           BAPI
ALV        SAP List Viewer
ALV Tree     ALV分类汇总
Table Control   Screen相关
Excel处理     读入和存出
UserExit      用户出口          CMOD,SMOD
Tree Control    Tree 控件  
数据字典     数据字典           SE11
逻辑库       逻辑库           SE36
权限        用户权限管理(BASIS)   PFCG
测试跟踪      SQL跟踪          ST05
授权        授权及权限检测       SU21、SU20
LSMW       数据导入工具       LSMW


常用T-Code及描述
TCODE    描述             备注
ABAPDOCU  ABAP文档和范例
BAPI     BAPI浏览器
CMOD/SMOD 系统增加
LSMW     数据导入工具          数据导入
PFCG     权限管理
SA38     程序执行
SCAT     计算机辅助测试工具,测试,数据导入等 数据导入
SCC1     集团拷贝
SCC4     显示集团
SE09     运输组织者,查询传输请求
SE11     数据字典
SE16     数据浏览器
SE32     文本元素设定
SE36     逻辑数据器
SE37     函数据模块
SE38     ABAP编辑器
SE41     菜单制作器
SE51     屏幕制作器
SE55     生成表维护程序
SE71     Form设计            单据打印
SE78     Form、SmartForms使用图片上载
SE80     对象浏览器
SE90     对象浏览器
SE91     消息设定
SE93     维护事务代码
SHDB     批输入代码           数据导入
SM04     显示在线用户
SM30     维护表视图
SM35     进程监控
SM50     超时用户
SMARTFORMS  SmartForms设计        单据打印
SNUM     编号对象维护
SO10     标准文本,设定Form使用的TIFF图片等
SPAD     假脱机管理
SQ01     Query查询制作
ST05     SQL跟踪
SU20     授权字段              授权
SU21     授权对象              授权
WE21     IDOC处理中的端口         IDOC


Internal Table:
ABAP/4中的Internal Table是一种Data Structure,类似于其它语言中的STRUTURE,它可以由几个不同类型的字段(field)组成,用来表示具有不同属性的某一事物,单独一笔数据表示某个事物,多笔数据表示具有相同属性的多个事物.例如:
为了存取或记录某班的同学资料,我们创建如下的internal table:

DATA: BEGIN OF STUDENT OCCURS 20,
STD_ID TYPE N,
NAME(10) TYPE C,
AGE TYPE I,
BIRTH TYPE D,
SCORE TYPE P DECIMALS 2,
END OF STUDENT.

此时我们已经创建了名叫STUDENT的internal table,并且为它预先申请了能够存放20笔资料的Buffer(当然,如果存取资料不止20笔,程序执行时,会自动申请系统Buffer)
Internal table 的定义有以下几种格式:

格式一. DATA: BEGIN OF OCCURS ,
TYPE ,
[ TYPE ,
TYPE ,
… ]
END OF .

格式二. TYPES: BEGIN OF ,
TYPE ,
[ TYPE ,
TYPE ,
… ]
END OF .
TYPES TYPE OCCURS .

格式三. DATA: BEGIN OF .
INCLUDE STRUCTURE .
DATA: END OF .
DATA: LIKE OCCURS .

SE11: Create new Table “YTCITY”



“Delivery and Maintenance” Tab:

Delivery Class: we can choose ”A” as Application Table, or we can select other delivery class as well.

Data Browser/ Table View Maint: we choose “Display/Maintenance Allowed”, so we can edit the Database Table later without restrictions.




“Fields” Tab:


Select “Predefined Type” to define Data Type and Length



Input data required


Click the “Technical Settings”, after input the Data Class and Size Category, click the green arrow to return the last page, save and active the database table.



Maintain database dictionary: SE16


Press “Enter”, then the Selection Screen appears.



F8 execute,


Drill down to see the separate record



Batch Maintain datas


Find Screen Number, and let the system Propose Screen Numbers




Click the “Create” button



Choose “Local Object”, then “Request completed without errors” appears at the state bar.



SM30 Maintain the datas


Choose “Maintain” button

2009年2月5日星期四

ABAP第一步:Hello World!

ABAP第一步:Hello World





  1. 创建程序:


SE38进入ABAP编辑器,录入程序名后创建程序。



Title为程序运行后的表头,当编辑程序行标题后替换为相应内容。



选择本地对象


新建程序初始界面



录入“Hello World!”


F8执行,同时可用Ctrl + F2 、Ctrl + F7检查语法;


Ctrl + F3 激活程序,左下角状态栏显示“Object activated”。



  1. 创建事物码


SE93建立事物码,选择“Program and Selection Screen(Report Transaction)”


输入程序名和描述,选择屏幕1000是自动生成的,可以在今后的步骤查看或编辑该屏幕


选择本地对象


输入T-Code:Z_HELLO,执行ZHELLO程序

  1. 新增行标题和列标题


SE38 ABAP Editor:Goto → Text Element → List Headings