‎2016 Jul 27 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
‎2016 Jul 27 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.
‎2016 Jul 27 6:52 AM
Hi,
Try to define Primary key fields along with MANDT.
Thanks.
‎2016 Jul 27 6:52 AM
‎2016 Jul 27 7:17 AM
The table include just 1 row which there are not any primary key ( expect MANDT ),