`
loky
  • 浏览: 181023 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

Basic

    博客分类:
  • ABAP
阅读更多
Declare data objects:
  predefined ABAP types
Predefined data types are provided by the ABAP runtime environment.We differentiate between incomplete types(c,n,p,and

x) and complete types (i,f,d,t,string,and xstring),depending on whether an additional length specification is required when the

corresponding data objects are declared.
  Global data types
Global data types are defined in the Dictionary.They refer to predefined Dictionary types,which largely correspond to

the predefined ABAP types.
  Local data types
Local data types are defined using the TYPES statement within the ABAP porgram.They can refer to predefined ABAP types

or global data types from the Dictionary.


Caution: Data objects in modules and event blocks are always global.
  If the DATA statement appears between MODULE and ENDMODULE,the defined object is still a global data object that is visible

in the entire program.Likewise,data objects that you declare in an ABAP event block are visible globally.
  To avoid misunderstandings,we recommend declaring such data at the start of the program and avoiding DATA statements

completely in modules and event blocks.
  
  The TABLES statement always creates data objects that are visible porgram-wide.
   Data objects that are created with the TABLES statement are always visible in the entire program,even if the statement

appears within a subroutine or a function module.(The objects can even be visible in other programs,for example when calling an

external subroutine.)

Hint: If you use the STATICS statement instead of DATA when you declare local data objects,their lifetime is extended to the

overall program lifetime.Therefore,such data objects have the same lifetime as global data objects,but their visibility is

still limited to the respective modularization unit.
  You can use the STATICS statement in function mudules,subroutines,and static methods.


Each data object is filled with either a start value or the initial value at the start of its lifetime.Specifically,this is the

case when the program is loaded in memory for global data objects,and when the object is instantiated for object attributes.

Local data objects are overwritten with their start value or initial value each time they are called by the surrounding

modulariztion unit(unless they were declared with the STATICS statement).

You can define a start value with the optional VALUE addition for the DATA statement.If you do not use this addition,the

initial value for the respective data type is used.


USING NUMERIC DATA OBJECTS
  There are three numeric data types in ABAP,which differ in their inner representation of values and their maximum value

range.Therefore,which data type you choose for a data object depends on its required value range.In additioon,ench of the three

data types is linked with its own arithmetic,which is used for calculations involving data objects of the respective type.We

differentiate between the following:
    Type i - integer arithmetic
    Type p - fixed point arithmetic
    Type f - floating point arithmetic
We will examine the three numeric data types and their corresponding arithmetic methods in more detail below.We initially

assume that "pure" arithmetic expressions are involved - that is,expressions in which all the involved data objects have the

same type.We will then examine mixed arithmetic expressions and learn how the runtime environment determines which arithmetic

to use.


Types:
    name_type(25) type c,
    title_type(5) type c,
    email_type(35) type c.
data:
    begin of s_name,
    prename type name_type,
    surname type name_type,
    title   type title_type,
    end of s_name.
data:
    begin of s_address,
     prename type name_type,
     surname type name_type,
     title   type title_type,
     email   type email_type,
    end of s_address.
...

move-corresponding
   s_name to s_address.

You can use the Move-corresponding statement to copy the contents of a source structure to the targety structure by

component.The system then copies each source field to the target field with the same name.The conversion rules for elementary

data objects then apply.

Hint: Note that the system only searches for identically-named components,but does not check whether these identically-named

components are also compatibly typed.This can be useful,but there are dangers involed.



The ABAP Dictionary manages global information that can be used throughout the system in all Repository objects.These objects

include:
  Global types
     You can define simple and complex structured data types globally in the ABAP Dictionary.These global data types contain

both semantic and technical information.
  Search help
     Search helps control dialogs for possible entries help.Among other things,they specify which database tables and which

criteria the system should use when searching for possible entries help.

Database tables
    All information about database tables,which are addressed from the SAP system,are managed in the ABAP Dictionary.Database

tables are changed in the ABAP Dictionary first and then copied to the database using the appropriate tool after they have been

activated.This procedure ensures that the information is always up-to-data.Moreover,it allows users to maintain tables in a

non-platform-specific way in the SAP system.

Development objects connected with database access
  From the ABAP program,you can very easily access data from several database tables with the help of Views;Lock entries can be

created and deleted from the ABAP program using lock objects.This forms the basis of the SAP lock concept.


分享到:
评论

相关推荐

    老版BASIC软件:F-BASIC

    **F-BASIC编程语言概述** F-BASIC是早期个人计算机时代流行的一种BASIC(Beginner's All-purpose Symbolic Instruction Code)编程语言的版本。BASIC起源于1964年,由美国达特茅斯学院的约翰·科克和汤姆·范·瓦伦...

    CC2530 BasicRF_cc2530basicrf_zigbeecc2530_basicrf_

    《CC2530 BasicRF:开启Zigbee无线控制的新篇章》 CC2530是一款由Texas Instruments(TI)公司推出的微控制器,专为2.4GHz无线应用设计,尤其是在Zigbee网络中广泛应用。它集成了ARM7TDMI-S CPU与2.4GHz RF收发器,...

    CC2530-BasicRF.rar_BasicRF CC2530_CC2530-BasicRF_SRF05.h_cc2530代

    代码解压完成后,请将附件hal_lcd_srf05.rar解压并将hal_lcd_srf05.c文件替换掉..\CC2530 BasicRF\source\components\targets\common\文件夹下的同名文件,同时将hal_lcd.h文件替换..\CC2530 BasicRF\source\...

    DSlogic-老毛子-Basic-U2Basic-Plus-3个固件.zip

    《DSlogic固件详解:Basic、U2Basic与Plus的区别及应用》 在电子工程和嵌入式系统领域,逻辑分析仪是不可或缺的调试工具,它可以帮助开发者深入了解电路的工作状态。DSlogic系列作为一款高性能、易用且价格亲民的...

    FAMILY BASIC编程全套

    "FAMILY BASIC编程全套"是一份全面的资源,旨在帮助学习者深入理解并实践FAMILY BASIC编程语言。FAMILY BASIC是80年代末90年代初在FC(Family Computer,即任天堂红白机)上流行的一种编程语言,主要用于游戏开发和...

    BasicExcel_src1.5_basicexcel_

    【标题】"BasicExcel_src1.5_basicexcel_" 指的是一款名为 "BasicExcel" 的软件或库的源代码版本1.5。这个版本是在先前的1.4版本基础上进行了升级,目的是确保其能够在Visual Studio 2019开发环境中顺利编译,并能...

    G-BASIC语言手册

    G-BASIC 语言手册 G-BASIC 语言手册是小霸王学习机上的游戏开发指南,基于 Family Computer(FC)的 F-BASIC 语言。该语言除了具有一般 BASIC 语言的运算和控制功能外,还增加了动画和游戏支持。 基本语法 在 G-...

    BasicRF工程包.rar

    【BasicRF工程】是无线通信领域中的一个基础概念,它通常指的是使用基本射频技术的无线通信系统。在本资源包中,"BasicRF工程包.rar"包含了完整的BasicRF工程模板及相关资料,这对于理解、学习和开发无线通信系统...

    webService添加basic验证

    ### WebService添加Basic验证详解 在现代Web应用中,安全性和数据保护至关重要。为了确保对外提供的WebService接口不被未授权的第三方访问,一种常见的做法就是在这些接口上实施身份验证机制。其中,Basic验证是一...

    Visual Basic 6.0 完全自学手册(光盘).rar

    Visual Basic 6.0 完全自学手册(光盘).rarVisual Basic 6.0 完全自学手册(光盘).rarVisual Basic 6.0 完全自学手册(光盘).rarVisual Basic 6.0 完全自学手册(光盘).rarVisual Basic 6.0 完全自学手册(光盘...

    Small basic试题及参考答案

    Small Basic 是一种简易版的编程语言,旨在帮助初学者,特别是青少年,轻松入门计算机编程。它基于Microsoft .NET Framework,并提供了简洁、易于理解的语法,让编程变得更加直观。本资源包含的是Small Basic的学习...

    Visual Basic学习视频教程/Visual Basic 6.0教程【Visual Basic从入门到实践】

    Visual Basic学习视频教程/Visual Basic 6.0教程/Visual Basic从入门到实践 李天生VB从入门到精通 第一章 VisualBasic6基本介绍 第二章 VisualBasic6的数据类型与运算符表达式 第三章 VisualBasic6的内部函数 第四章...

    Visual Basic精彩编程200例

    根据提供的标题“Visual Basic精彩编程200例”,我们可以推断出这是一本关于Visual Basic编程的书籍,其中包含了200个实用且精彩的编程示例。虽然在描述及部分内容中并未提供具体的知识点,但从书名出发,我们可以对...

    Visual Basic.NET项目开发宝典.pdf

    《Visual Basic.NET项目开发宝典》主要介绍Visual Basic的数据库项目开发过程。《Visual Basic.NET项目开发宝典》从实用的角度,对如何使用VB开发应用程序做了系统、全面的介绍。《Visual Basic.NET项目开发宝典》...

    Visual Basic.NET程序员查询辞典

    本书面向的对象 Visual Basic.Net展现了一个全新的世界,我希望,本书能够帮助读者逐渐开始使用新的Visual Basic.Net系统。我还编写了一部姐妹卷,.NET Programmer\'s Reference(ISBN 0-07-219466-9),介绍了...

    OpenOffice Basic编程指南

    ### OpenOffice Basic编程指南 #### 一、OpenOffice Basic编程简介 **OpenOffice Basic**是一种专为**OpenOffice.org**开发的编程语言,它与**Basic**家族中的其他语言(如Visual Basic或VBA)有着密切的关系。...

    CC2530 BasicRF(TI源文件)

    BasicRF是TI提供的一套软件开发工具,它包含了实现无线通信的基础功能,简化了开发过程,使得开发者能够快速构建无线应用。 **CC2530的特点:** 1. **集成的射频收发器:** CC2530集成了2.4GHz RF收发器,具有高...

    vb6.0安装包/visual basic6.0下载中文/vb6.0软件安装包/visual basic6.0企业版下载

    【企业版】vb6.0安装包/visual basic6.0下载中文/vb6.0软件安装包/visual basic6.0企业版下载 VB6.0,全称为Visual Basic6.0,是微软公司开发的一款经典编程环境 主要用于编写基于Windows操作系统的应用程序。 vb6.0...

    使用BasicExcel来操作excel的读写例子

    在IT行业中,处理Excel数据是一项常见的任务,而BasicExcel是一个专为简化此类任务设计的库。这个库提供了方便的方式来读取和写入Excel文件,尤其适用于那些需要进行基础操作但不希望依赖大型库如Apache POI或...

Global site tag (gtag.js) - Google Analytics