Skip to Content
0
Jul 27, 2016 at 05:31 AM

modify insert or update statement not working for multiple records

129 Views

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