2008 Jan 16 4:20 AM
Edited by: anil kumar on Jan 16, 2008 9:51 AM
Edited by: anil kumar on Jan 22, 2008 5:08 PM
Edited by: anil kumar on Jan 16, 2008 9:51 AM
Edited by: anil kumar on Jan 22, 2008 5:08 PM
2008 Jan 16 4:36 AM
Hi Anil,
Just replace
move-corresponding temp_it_data to w_zcpdhtry.
w_zcpdhtry-erdat = sy-datum.
w_zcpdhtry-erzet = sy-uzeit .
w_zcpdhtry-author = sy-uname .
w_zcpdhtry-zcounter_cpd = gv_ln.
insert zcpdhtry from w_zcpdhtry .
move-corresponding temp_it_data to w_zcpdcurr.
delete zcpdcurr from w_zcpdcurr .
clear : w_zcpdhtry , w_zcpdcurr .
commit work.
with
move-corresponding temp_it_data to w_zcpdhtry.
w_zcpdhtry-erdat = sy-datum.
w_zcpdhtry-erzet = sy-uzeit .
w_zcpdhtry-author = sy-uname .
w_zcpdhtry-zcounter_cpd = gv_ln.
MODIFY zcpdhtry from w_zcpdhtry .
IF SY-SUBRC EQ 0.
commit work.
ELSE.
ROLLBACK WORK.
ENDIF.
-
also, when you declare an internal table with occurs 0 , no need to explicitly mention "with header line".
Regards,
Aditya
2008 Jan 16 4:49 AM
after word i have to delete
move-corresponding temp_it_data to w_zcpdcurr.
delete zcpdcurr from w_zcpdcurr .
clear : w_zcpdhtry , w_zcpdcurr .
moving data not working temp_it_data to w_zcpdcurr
and deletion not possibling
2008 Jan 16 4:56 AM
Hi Anil,
My mistake, sorry didnt see there were two different tables being operated on in the equation.
Well, the deletion is probably failing because the primary key fields of database table zcpdcurr are not populated in the temp_it_data record and hence the DELETE statement does not find any record to delete and returns sy-subrc as 4.
Please debug and check whether the key fields of the Z table are present and in correct format, e.g. VBELN, could be getting saved as 1 in your work area, but it is actually saved as 00000001 in DB (conversion exit). You can use the entries as retrieved from debugging and check from SE16 whether a corresponding entry exists.
Also, you mention move-corresponding is not working. I hope you know it maps fields with the same names from source to target structure. Hence please ensure the key fielsd of DB ZCPDCURR have the same names in temp_it_data and w_zcpdcurr.
Regards,
Aditya
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |