小语法的应用

来源:互联网 发布:java下载压缩文件 编辑:程序博客网 时间:2024/05/16 07:55

MESSAGE :

 

一般用于不符合条件的

message text-001 type 'E' display like 'S'.

 

MOD:

 

10 mod 8 = 2

 

SHIFT:

 

shift '123456' by 2 places left .  "结果 3456

 

CONCATENATE:

 

concatenate '2010' '02' '20' into text separated by '.' .    " 结果 2010.02.20

 

CONDENSE:

 

condense  变量.  

condense  变量 no-gaps.

DATA: BEGIN OF sentence,
          word1 TYPE c LENGTH 30 VALUE 'She',
          word2 TYPE c LENGTH 30 VALUE 'feeds',
          word3 TYPE c LENGTH 30 VALUE 'you',
          word4 TYPE c LENGTH 30 VALUE 'tea',
          word5 TYPE c LENGTH 30 VALUE 'and',
          word6 TYPE c LENGTH 30 VALUE 'oranges',
        END OF sentence,
        text TYPE string.

text = sentence.

condense text. " 结果 she feeds you tea and oranges

condense text no-gaps.  "结果 shefeedsyouteaandoranges.

 

负号位置:

 

data: lword type c length 10.
data: lint type I value -9000.
lword = lint.
write / lword .                             " 结果 9000-


CALL FUNCTION 'CLOI_PUT_SIGN_IN_FRONT'
  changing value = lword.
write / lword.                             " 结果 -9000

 

 DELETE:

 

DELETE ADJACENT DUPLICATES FROM ITAB COMPARING matnr .    " 删除重复数据