abap基础语法练习
更新时间:2024-07-06 23:17:01 阅读量: 综合文库 文档下载
- abap新语法推荐度:
- 相关推荐
REPORT ztest_lianxi.
**data类型的定义与statics类型的定义区别。
*PERFORM datatest1. *PERFORM datatest1. *PERFORM datatest2. *PERFORM datatest2. *
**&--------------------------------------------------------------------- *
**& Form DATATEST1
**&--------------------------------------------------------------------- *
** text
**---------------------------------------------------------------------- *
*FORM datatest1.
* TYPES f_word(5) TYPE c.
* DATA f_text TYPE f_word VALUE 'INIT'. * WRITE f_text.
* f_text = '12345'. * WRITE f_text.
*ENDFORM. \ *
**&--------------------------------------------------------------------- *
**& Form DATATEST2
**&--------------------------------------------------------------------- *
** text
**---------------------------------------------------------------------- *
*FORM datatest2.
* TYPES f_word(5) TYPE c.
* STATICS f_text TYPE f_word VALUE 'INIT'. * WRITE f_text.
* f_text = 'ABCDE'. * WRITE f_text.
*ENDFORM. \
*----------------------------------------------------------------------*
*i类型的变量,为什么是从后往前截取。
*DATA: NUMBER TYPE I VALUE '1234556', * TEXT(15) VALUE 'ABSCCCSDFGD'. *WRITE:(5) NUMBER, /(6) TEXT.
*----------------------------------------------------------------------*
*显示图标,需要引用系统的图标群组
*INCLUDE
*WRITE: 'PHONE SYMBOL:',SYM_PHONE AS SYMBOL. *WRITE:/ 'ALARM ICON:',ICON_ALARM AS ICON. *
*----------------------------------------------------------------------*
*SKIP TO LINE 5. *WRITE 'PASS'.
*----------------------------------------------------------------------*
*CHECKBOX的应用
*PARAMETERS:CHECK1 AS CHECKBOX DEFAULT 'X', *CHECK2 AS CHECKBOX.
*----------------------------------------------------------------------*
*复制功能
*DATA: BEGIN OF ADDRESS,
* FIRSTNAME(10) TYPE C VALUE 'LULU', * LASTNAME(10) TYPE C VALUE 'CHOU', * TEL(12) TYPE C VALUE '4660570', * END OF ADDRESS. *DATA: BEGIN OF NAME,
* FIRSTNAME(10) TYPE C, * LASTNAME(10) TYPE C, * E_MAIL(30) TYPE C, * END OF NAME.
*MOVE-CORRESPONDING ADDRESS TO NAME. *
*WRITE :NAME-FIRSTNAME.
*----------------------------------------------------------------------*
*赋值语句的练习
*DATA:NAME(20) TYPE C VALUE 'SOCRCE', * SOURCE(10) TYPE C VALUE 'LILY', * TARGET(10) TYPE C. *WRITE NAME TO TARGET. *WRITE / TARGET.
*----------------------------------------------------------------------*
*shift的练习
*DATA:STRING(10) TYPE C VALUE 'ABCDEFJ'. * WRITE: STRING. * SHIFT STRING.
* WRITE :/ STRING. * SHIFT STRING LEFT. * WRITE:/ STRING.
* SHIFT STRING RIGHT. * WRITE:/ STRING.
* SHIFT: STRING RIGHT. * WRITE:/ STRING.
*----------------------------------------------------------------------*
*REPLACE的练习
*DATA: STRING(10) TYPE C VALUE 'ABCDEFGHT', * STR1(3) TYPE C VALUE 'DEF', * STR2(3) TYPE C VALUE '123'. *REPLACE STR1 WITH STR2 INTO STRING. *WRITE: STRING.
*----------------------------------------------------------------------*
*SEARCH的使用方法
*DATA: STRING(10) TYPE C VALUE 'ABCDEFJ'. *SEARCH STRING FOR 'C'. *WRITE: STRING.
*IF SY-SUBRC <> 0. * WRITE: SY-SUBRC. *ELSE.
* WRITE: SY-SUBRC. *ENDIF.
*----------------------------------------------------------------------*
*SPLIT的使用
*DATA: STRING(60),
* P1(20) VALUE '++++++++', * P2(20) VALUE '++++++++', * P3(20) VALUE '++++++++', * P4(20) VALUE '++++++++', * DEL(3) VALUE '***'.
*STRING = 'PART1***PART2***PART3***PART4***PART5'. *WRITE STRING.
*SPLIT STRING AT DEL INTO P1 P2 P3 P4. *WRITE:/ P1,/ P2,/ P3,/ P4.
*----------------------------------------------------------------------*
*日期的使用
*DATA: MDATA TYPE D. *MDATA = SY-DATUM. *WRITE MDATA.
*MDATA+6(2) = '01'. *WRITE / MDATA.
*MDATA = MDATA - 1. *WRITE / MDATA.
*----------------------------------------------------------------------*
*时间的使用
*DATA: HOURS TYPE I, * MINUTES TYPE I,
* T2 TYPE T VALUE '200000', * T1 TYPE T VALUE '183000'. *HOURS = ( T2 - T1 ) / 3600. *MINUTES = ( T2 - T1 ) / 60. *
*WRITE: HOURS,/ MINUTES.
*DATA: BEGIN OF ITAB OCCURS 3, * COL1(3) TYPE C, * COL2 TYPE I, * END OF ITAB. *ITAB-COL1 = 'ABC'. *ITAB-COL2 = 10. *COLLECT ITAB.
*ITAB-COL1 = 'XYZ'. *ITAB-COL2 = 20. *COLLECT ITAB.
*ITAB-COL1 = 'ABC'. *ITAB-COL2 = 30. *COLLECT ITAB. *LOOP AT ITAB.
* WRITE:/ ITAB-COL1,/ ITAB-COL2. *ENDLOOP.
*----------------------------------------------------------------------*
**NEW PAGE的应用
*DATA: IT_SPFLI TYPE TABLE OF SPFLI WITH HEADER LINE. *NEW-PAGE LINE-COUNT 11. *
*SELECT * FROM SPFLI INTO TABLE IT_SPFLI. *
* LOOP AT IT_SPFLI.
*WRITE: / SY-VLINE,(15) IT_SPFLI-CARRID,SY-VLINE,(15) *IT_SPFLI-CONNID,SY-VLINE,
*(15) IT_SPFLI-COUNTRYTO,SY-VLINE,(15) IT_SPFLI-CITYFROM,SY-VLINE,
*(15) IT_SPFLI-AIRPFROM,SY-VLINE. *ULINE AT /(91). * ENDLOOP. *
* TOP-OF-PAGE.
* FORMAT COLOR COL_HEADING. * ULINE AT /(91).
*WRITE: / SY-VLINE,(15) '航线承运人',SY-VLINE,(15) '航班连接',SY-VLINE,
*(15) '国家代码',SY-VLINE,(15) '起飞城市',SY-VLINE, *(15) '起飞机场',SY-VLINE. *ULINE AT /(91). *FORMAT COLOR OFF.
*----------------------------------------------------------------------*
*热点的设定
START-OF-SELECTION.
WRITE '请按'.
FORMAT HOTSPOT ON COLOR 6 INVERSE ON. WRITE '热点'.
FORMAT HOTSPOT OFF COLOR OFF. AT LINE-SELECTION. WRITE 'WELCOME!'.
*SELECT * FROM SPFLI INTO TABLE IT_SPFLI. *
* LOOP AT IT_SPFLI.
*WRITE: / SY-VLINE,(15) IT_SPFLI-CARRID,SY-VLINE,(15) *IT_SPFLI-CONNID,SY-VLINE,
*(15) IT_SPFLI-COUNTRYTO,SY-VLINE,(15) IT_SPFLI-CITYFROM,SY-VLINE,
*(15) IT_SPFLI-AIRPFROM,SY-VLINE. *ULINE AT /(91). * ENDLOOP. *
* TOP-OF-PAGE.
* FORMAT COLOR COL_HEADING. * ULINE AT /(91).
*WRITE: / SY-VLINE,(15) '航线承运人',SY-VLINE,(15) '航班连接',SY-VLINE,
*(15) '国家代码',SY-VLINE,(15) '起飞城市',SY-VLINE, *(15) '起飞机场',SY-VLINE. *ULINE AT /(91). *FORMAT COLOR OFF.
*----------------------------------------------------------------------*
*热点的设定
START-OF-SELECTION.
WRITE '请按'.
FORMAT HOTSPOT ON COLOR 6 INVERSE ON. WRITE '热点'.
FORMAT HOTSPOT OFF COLOR OFF. AT LINE-SELECTION. WRITE 'WELCOME!'.
正在阅读:
abap基础语法练习07-06
“梦巴黎”大型主题游乐园工程投资新建项目可行性研究报告06-27
五年级下册语文教学计划优秀8篇04-03
《 浮士德》中人性欲望的启示11-07
初支净空检验批区间3左线西06-04
传动器主要部件的加工毕业设计09-02
苏教版五年级上册语文课课通电子稿04-18
通信中级练习综合能力题目及答案305-17
PY-PQ电能质量在线监测装置说明书07-26
- 多层物业服务方案
- (审判实务)习惯法与少数民族地区民间纠纷解决问题(孙 潋)
- 人教版新课标六年级下册语文全册教案
- 词语打卡
- photoshop实习报告
- 钢结构设计原理综合测试2
- 2014年期末练习题
- 高中数学中的逆向思维解题方法探讨
- 名师原创 全国通用2014-2015学年高二寒假作业 政治(一)Word版
- 北航《建筑结构检测鉴定与加固》在线作业三
- XX县卫生监督所工程建设项目可行性研究报告
- 小学四年级观察作文经典评语
- 浅谈110KV变电站电气一次设计-程泉焱(1)
- 安全员考试题库
- 国家电网公司变电运维管理规定(试行)
- 义务教育课程标准稿征求意见提纲
- 教学秘书面试技巧
- 钢结构工程施工组织设计
- 水利工程概论论文
- 09届九年级数学第四次模拟试卷
- 语法
- 练习
- 基础
- abap
- 中财习题集
- 布袋除尘操作规程
- 采用拱弦钢管搭设拱桥拱架 - 图文
- 说课稿
- 饮料自动售货机课程设计
- ipad 3 拆机 - 图文
- 江苏省省级现代服务业(软件产业)发展专项引导资金项目申报书
- 七年级英语第六单元 第五课时Section B
- 儿童文学考试重点
- 流动资金贷款管理实施细则新
- 平行四边形的认识说课教案
- 阮永兴在中共合肥市蜀山区委二届十一次全会上的讲话
- 《区域工业化与城市化》教学反思
- T3全套(主财务业务一体化)习题
- 2018最新版苏教版三年级下学期语文教案与教学设计(全)
- 格雷码crosoft Word 文档
- 奥迪A4电子燃油喷射系统故障诊断与排除(1)
- 物流管理专业概论的论文
- 监理实施细则 doc(1)
- 五年级下册语文预习单