ABAP从数据库中删除行

         删除单行:

         DELETE [CLIENT SPECIFIED] FROM ."从数据表中删除与中主键相同的行。

         DELETE [CLIENT SPECIFIED]."从数据库删除主键与表工作区中指定主键相同的行。

        例:

         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 [CLIENT SPECIFIED] WHERE .

         

        使用内表删除多行

        语法:

          DELETE [CLIENT SPECIFIED] FROM TABLE ."如果已处理了内表中所有行,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.

你可能感兴趣的:(程序人生,ABAPer)