运算符使用,字符串处理

"小写全部转换成大写
REPORT ZABAP1903_11_BASIC05.
*data: var(15) type c .

  •  var = 'abhaFDNJKS23'.
    
  •  TRANSLATE var to upper case.
    

*write:/ var.

*"大写全部转换成大写
*data: var1(15) type c .

  •  var1 = 'abhaFDNJKS23'.
    
  •  TRANSLATE var1 to lower case.
    

*write:/ var1.

*"空格加首位和中间都算字符,末尾不占字符节
*data: len type i.
** len1 type i,
** var2(10) type c.
** var2 = 'dhja23'.

  •  len = strlen('shduia').
    

** len1 = strlen(var2) .

  •  write:/ len.
    

*"合并字符串

  • data: c1(5) value '核对',
  •   c2(5) value '接送',
    
  •   c3(2) value 'o',
    
  •   c4(10),
    
  •   c5(10),
    
  •   sep(1) value '-'.
    
  •  concatenate c1 c2 c3 into c4.
    
  •  concatenate c1 c2 c3 into c5 separated by sep.
    

*write:/ c4 ,c5.

*"分割字符串
*data: str(100) type c,

  •  p1(20) type c,
    
  •  p2(20) type c,
    
  •  p3(20) type c,
    
  •  p4(20) type c,
    
  •  del(2) value '&&'.
    

*str = 'part1 && part2 && part3 && part4 && part5'.
*split str at del into p1 p2 p3 p4.
*write:/ p1,p2,p3,p4.

*登录屏幕
parameters:user(20) type c,
password(20) type c.
data: user1(20) type c,
password1(15) type c,
t(20) type c.
user1 = 'ABAP'.
password1 = '123'.
if user = user1 and password = password1.
t = '登陆成功'.
else.
t = '用户名或密码错误'.

endif.
write:/ t.

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • "use strict";function _classCallCheck(e,t){if(!(e instanc...
    久些阅读 2,048评论 0 2
  • pyspark.sql模块 模块上下文 Spark SQL和DataFrames的重要类: pyspark.sql...
    mpro阅读 9,504评论 0 13
  • mean to add the formatted="false" attribute?.[ 46% 47325/...
    ProZoom阅读 2,723评论 0 3
  • ORACLE自学教程 --create tabletestone ( id number, --序号usernam...
    落叶寂聊阅读 1,121评论 0 0
  • 感恩今天发工资,祝愿他们学以致用,更快成长,拿到很多的工资。我们共同努力为客户提供更专业更贴心的服务。 感恩保险公...
    米朵天天阅读 99评论 0 1