ABAP从数据库中删除行
? ? ? ? ?刪除單行:
?????????DELETE <dbtab> [CLIENT SPECIFIED] FROM <wa>."從數據表中刪除與<wa>中主鍵相同的行。
?????????DELETE <dbtab> [CLIENT SPECIFIED]."從數據庫刪除主鍵與表工作區<dbtab>中指定主鍵相同的行。
????????例:
?????????TABLES SPFLI.
?????????DATA WA LIKE SPFLI.
?????????WA-CARRID = 'AA'.
?????????WA-CONNID = '0064'.
?????????DELETE SPFLI FROM WA.
?
?????????SPFLI-CARRID = 'LH'.
?????????SPFLI-CONNID = '0017'.
?????????DELETE SPFLI.
?????
??????? ?刪除多行
?????????語法:
?????????DELETE FROM <dbtab> [CLIENT SPECIFIED] WHERE <conditions>.
?????????
????????使用內表刪除多行
????????語法:
??????????DELETE <dbtab> [CLIENT SPECIFIED] FROM TABLE <itab>."如果已處理了內表中所有行,SY-SUBRC置為0.否則為4.如內表為空,SY-SUBRC和SY-DBCNT都為0.
????????例:
??????????TABLES SPFLI.
??????????DATA ITAB LIKE SPFLI OCCURS 10 WITH HEADER LINE.
??????????ITAB-CARRID = 'UA'. ITAB-CONNID = '0011'.
??????????APPEND ITAB.
??????????ITAB-CARRID = 'LH'. ITAB-CONNID = '1245'.
??????????APPEND ITAB.
??????????ITAB-CARRID = 'AA'. ITAB-CONNID = '4574'.
??????????APPEND ITAB.
??????????DELETE SPFLI FROM TABLE ITAB.
總結
以上是生活随笔為你收集整理的ABAP从数据库中删除行的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 香港四大天王影帝情况(截止2016)
- 下一篇: SAP新增仓库