2008 May 14 10:46 AM
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!
2008 May 14 10:49 AM
this might sound like a dirty solution but i have experienced this and used this to over come this problem...
try to put ...
wait for 1 seconds. after your delete statement. may be it works...if not then try to increase the delay to may be 2 or 3...(i know the performance will go for a toss)...i have experienced this in the past but still to figure out the reason for this.
check if the internal table structure and the table structure is same or key fields name.
2008 May 14 10:49 AM
this might sound like a dirty solution but i have experienced this and used this to over come this problem...
try to put ...
wait for 1 seconds. after your delete statement. may be it works...if not then try to increase the delay to may be 2 or 3...(i know the performance will go for a toss)...i have experienced this in the past but still to figure out the reason for this.
2008 May 14 11:03 AM
Hi again guys,
I think putting WAIT UP TO 5 SECONDS before the DELETE statement works. I just requested transport to QAS server and I will let you know if it works:)
2008 May 15 2:26 AM
2008 May 14 10:51 AM
check if the internal table structure and the table structure is same or key fields name.
2008 May 14 10:55 AM
Hello,
Try like this.
loop at gt_zsalesorder.
DELETE zsalesorder where object_id = gt_zsalesorder-object_id.
" Hope object_id is the only key field of the Z table.
COMMIT WORK.
endloop.
Regards,
Vasanth
2008 May 14 10:58 AM
Hi,
Please try this
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.
WAIT UP TO '5' SECONDS.
DELETE zsalesorder FROM TABLE gt_zsalesorder.
COMMIT WORK.
If its useful reward points
| User | Count |
|---|---|
| 6 | |
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |