常用ABAP语句




一些爱忘记的语句



(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 zilscshda  lv_layer.


(11)



data type decimals 1.  定义一位小数


TRUNC( a ) 获取整数位, 括号里面要空格



(12)data ac type i.

select count(*from TVARVC into ac.
  write ac.

 

  • 1
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值