sap总结

变量

data 名 type 类型

常量

constants 名 type 类型 value '值'
说明:用的时候指定值

结构

types : begin of ty_xx . 
		.. 
		end of ty_xx .
data lt_xx type table of ty_xx . "定义一个内表
data ls_xx type ty_xx .			 "定义一个结构

系统参数

sy-subrc 返回代码值(0代表成功)
sy-uname 当前用户
sy-tcode 当前事务
sy-datum 当前日期
sy-uzeit 当前时间
sy-repid 当前程序名

语句

添加
append ls_xx to lt_xx .	
说明:添加语句

修改
modify lt_xx index 数字 .           		     
modify lt_xx transporting 字段名 .				
说明:1.根据行修改
	2.根据字段名修改,只修改指定字段的
	
读取
read table lt_xx into ls_xx with key 条件 binary search .
if sy-subrc .		
..					
endID.
说明:1.二分法 需要排序(sort 表 by 字段)
	2.判断
	
表操作语句
into corresponding fields of table  "按字段名相同的赋值
into table                          "按顺序依次赋值(效率高,注意顺序)
for all entries in        	 	 	"表不能为空,先对表进行判断

表连接 -- inner join
select
	a~xx
	b~xx
	from table1 as a 
	inner join table2 as b
	on a~xx = b~xx 
	into table ...
说明:将俩个表中数据,根据共有字段进行关联,渠道一个内表中

字符串处理


选择屏幕

单选
parameters : p_xx type mara-matnr . 

单项选择
parameters :p_xx radiobutton group 组的名 .
		   :p_dd radiobutton group 组的名 .
		   
多项选择
parameters p_xx as checkbox .
parameters p_dd as checkbox .
parameters p_cc as checkbox .

复选框
select-options s_xx for mara-matnr .

selection-screen begin of line .
	..
selection-screen end of line .

框架
selection-screen begin of block b1 with frame title text-001 .
	..
selection-screen end of block b1 .

界面跳行
selection-screen skip 数字 .

  • 3
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值