07-27-2016 6:31 AM
Hi All,
I am trying to insert some data into a custom data. This table has no primary key ( except MANDT ).
I tried using modify, insert and update statement , but it is not working.
Only the last record in updated in the table.
Please let me know how this can be corrected ?
1. MODIFY zifrsadj FROM TABLE it_tc1.
COMMIT WORK.
2.
LOOP AT it_tc INTO wa_tc.
wa_tc1-fyear = p_year.
wa_tc1-period = p_period.
wa_tc1-hkont = wa_tc-hkont.
* INSERT INTO zmonthadj VALUES wa_tc1.
MODIFY zmonthadj FROM wa_tc1.
CLEAR : wa_tc, wa_tc1.
ENDLOOP.
3.
LOOP AT it_tc INTO wa_tc.
wa_tc1-fyear = p_year.
wa_tc1-period = p_period.
wa_tc1-hkont = wa_tc-hkont.
* INSERT INTO zmonthadj VALUES wa_tc1.
CLEAR : wa_tc, wa_tc1.
ENDLOOP.
Regards
Meenakshi
07-27-2016 6:44 AM
If "This table has no primary key ( except MANDT )." then it can only contain one record per client. Your program is working absolutely correctly.
This is very basic - I think you should re-read your course notes on data dictionary and ABAP programming.
07-27-2016 6:52 AM
07-27-2016 6:52 AM
07-27-2016 7:17 AM
The table include just 1 row which there are not any primary key ( expect MANDT ),