一些爱忘记的语句
(1)
LOOP AT source_package ASSIGNING <source_fields>.
LOOP AT source_package ASSIGNING <source_fields>.
Endloop.
loop at RESULT_PACKAGE assigning <RESULT_FIELDS>.
Endloop.
(2)
loop at temp_table into temp_line.
append temp_line to RESULT_PACKAGE.
loop at result_package assigning <result_fields>.
v_record = v_record + 1.
<result_fields>-record = v_record.
<result_fields>-/bic/zilpest = v_pest.
endloop.
endloop.
(3)delete的用法
CONVERT DATE lv_date TIME lv_time
INTO TIME STAMP lv_timestamp TIME ZONE sy-zonlo.
c_days = lv_timestamp.
delete from /bic/aziljao3400 where /bic/zilrmest le c_days.
commit work and wait.
(4)PACKAGE SIZE的用法
select LOGSYS MATERIAL /BIC/ZILASIZE /BIC/ZILKRCAT INTO CORRESPONDING FIELDS of table
dsot_table from /BIC/AZILMAO4500 PACKAGE SIZE 50000.
(5) read table
read table t_table into l_table
WITH KEY MATNR = dsol_table-MATERIAL
J_3ASIZE = dsol_table-/BIC/ZILASIZE BINARY SEARCH.
if SY-SUBRC <> 0.
(6)update的用法
loop at comt_table into coml_table.
update /BIC/AZILMAO4500 set /BIC/ZILDELFL = 'X' where
MATERIAL = coml_table-MATERIAL and
/BIC/ZILASIZE = coml_table-/BIC/ZILASIZE and
/BIC/ZILKRCAT = coml_table-/BIC/ZILKRCAT and
SALESORG = coml_table-SALESORG and
DISTR_CHAN = coml_table-DISTR_CHAN.
endloop.
commit work.
(7)******内表的动态查询
select MATNR J_3ASIZE J_4KRCAT from (tmp) INTO CORRESPONDING FIELDS OF TABLE t_table order by MATNR J_3ASIZE J_4KRCAT.
endif.
(8)select**like***
select ODSNAME_TECH INTO CORRESPONDING FIELDS OF TABLE T_RSTS from RSTSODS where
USEROBJ like 'Z_ILC_DSATTR033%' and USEROBJ like c.
read table T_RSTS into L_RSTS index 1.
(9)
concatenate '%' c into c.
refresh dsot_table.
clear dsol_table.
(10)组合与拆分
CONCATENATE: material
zilasize
color
INTO <RESULT_FIELDS>-/bic/zilbskuf RESPECTING BLANKS.
split <RESULT_FIELDS>-/BIC/ZILSORDID at '_' into lc_fcst c zilscshda lv_layer.
(11)
data a type p decimals 1. 定义一位小数
TRUNC( a ) 获取整数位, 括号里面要空格
(12)data ac type i.
select count(*) from TVARVC into ac.
write ac.