Skip to Content
0
Former Member
Dec 28, 2015 at 12:31 PM

Modify DBTable

33 Views

Hi All,

I try to modify or insert data to database table but the code just modify only 1 row.

I just added only 1 data to ztable.

Do you know why i cant add data to ztable.

Thanks for help.

LOOP AT IT_REPORT INTO WA_REPORT WHERE TEDARIK IS NOT INITIAL.

READ TABLE GT_TEDRK_TESM WITH KEY KUNET = WA_REPORT-KUNET

KUNWE = WA_REPORT-KUNWE

RMATNR = WA_REPORT-RMATNR

NAMET = WA_REPORT-NAMET

TARIH = WA_REPORT-TARIH

SFRTR_TX = WA_REPORT-SFRTR_TX.

IF SY-SUBRC IS NOT INITIAL.

MOVE-CORRESPONDING WA_REPORT TO WA_TEDRK_TESM.

INSERT ZPP_T_TEDRK_TESM FROM WA_TEDRK_TESM.

ENDIF.

ENDLOOP.


LOOP AT IT_REPORT INTO WA_REPORT WHERE TEDARIK IS NOT INITIAL.

READ TABLE GT_TEDRK_TESM WITH KEY KUNET = WA_REPORT-KUNET

KUNWE = WA_REPORT-KUNWE

RMATNR = WA_REPORT-RMATNR

NAMET = WA_REPORT-NAMET

TARIH = WA_REPORT-TARIH

SFRTR_TX = WA_REPORT-SFRTR_TX.

IF SY-SUBRC IS NOT INITIAL.

MOVE-CORRESPONDING WA_REPORT TO WA_TEDRK_TESM.

MODIFY ZPP_T_TEDRK_TESM FROM WA_TEDRK_TESM.

ENDIF.

ENDLOOP.



LOOP AT IT_REPORT INTO WA_REPORT WHERE TEDARIK IS NOT INITIAL.

READ TABLE GT_TEDRK_TESM WITH KEY KUNET = WA_REPORT-KUNET

KUNWE = WA_REPORT-KUNWE

RMATNR = WA_REPORT-RMATNR

NAMET = WA_REPORT-NAMET

TARIH = WA_REPORT-TARIH

SFRTR_TX = WA_REPORT-SFRTR_TX.

IF SY-SUBRC IS NOT INITIAL.

MOVE-CORRESPONDING WA_REPORT TO WA_TEDRK_TESM.

APPEND GT_TEDRK_TESM.

ENDIF.

ENDLOOP.


MODIFY ZPP_T_TEDRK_TESM FROM WA_TEDRK_TESM.

THANKS FOR YOUR HELP