Skip to Content
0
May 14, 2008 at 09:46 AM

DELETE statement does not work even after so many syntax changes and commit

110 Views

Hello Experts,

I am currently having experience deleting my customized table. I used COMMIT WORK, COMMIT WORK AND WAIT,

lock objects, DELETE with WHERE clause, etc. The funny thing is, my delete statement works in debugging mode but when I run it

in foreground it does not work. I checked its subrc and its giving me '0' so that means the record must be deleted

but when I check it in SE11 it still contains the record.

Below is my code:

CONSTANTS: lc_s TYPE char01 VALUE 'S'.

    FIELD-SYMBOLS: <fs_zsalesorder> LIKE LINE OF gt_zsalesorder.

    SELECT *
      FROM zsalesorder
      INTO TABLE gt_zsalesorder.

    REFRESH gt_status.
    LOOP AT gt_zsalesorder ASSIGNING <fs_zsalesorder>.
      CLEAR wa_status.
      CALL FUNCTION 'ZSD_UPDATE_SO_PRICINGTYPE' DESTINATION gv_destination
        EXPORTING
          im_vbeln   = <fs_zsalesorder>-object_id
        IMPORTING
          ex_icon    = wa_status-icon
          ex_status  = wa_status-status
          ex_message = wa_status-message.

      APPEND wa_status TO gt_status.
      IF wa_status-status = lc_s.
*        <fs_zsalesorder>-flag = 'X'.
      ENDIF.
    ENDLOOP.
    DELETE zsalesorder FROM TABLE gt_zsalesorder.
    COMMIT WORK.

Hope you can help me guys. Thank you and take care!