Skip to Content
author's profile photo Former Member
Former Member

deletion not possibling check the code

Edited by: anil kumar on Jan 16, 2008 9:51 AM

Edited by: anil kumar on Jan 22, 2008 5:08 PM

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Jan 16, 2008 at 04: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

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      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

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.