Skip to Content
0
May 09, 2008 at 07:03 AM

MODIFY and DELETE statement does not work...

26 Views

Hello Experts,

I am encountering a problem when using the MODIFY and DELETE statement in my

program because it seems that it does not work when I run the program. But if I check it in

debugging mode, it works. Below is my code:

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

      APPEND lcl_data_def=>wa_status TO lcl_data_def=>gt_status.

      IF lcl_data_def=>wa_status-status = lc_s.
        <fs_zsalesorder>-flag = 'X'.
        MODIFY zsalesorder FROM <fs_zsalesorder>.
        COMMIT WORK AND WAIT.
      ENDIF.
      CLEAR lcl_data_def=>wa_status.
    ENDLOOP.
    DELETE zsalesorder FROM TABLE lcl_data_def=>gt_zsalesorder.
    COMMIT WORK AND WAIT.

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