I am getting problem with modify statement, i am modifying the table from internal table ,as i am changing the value of primary key field and keeping all fields of work area as it is so the modify statement not making new entry in Custom table created in data dictionary.
i am pasting my Code as below
data : it_final type table of zschd,
wa_final type zschd,
wa_schd type schd.
*it_final contains 4 records so i am changing s_date field which is primary key by t_date
LOOP AT it_final INTO wa_final'.
wa_schd-mandt = sy-mandt.
wa_schd-s_date = t_date.
wa_schd-gewrk = wa_final-gewrk..
wa_schd-appt = wa_final-appt.
t_date = t_date + 1.
APPEND wa_schd TO it_mod.
MODIFY zschd FROM TABLE it_mod .
But after executing this statement sy-subrc becoming 4 and new record is not going to be created,
i am not understanding what is the problem. Please provide solutions.