‎2021 Apr 07 3:38 PM
Hi, i've got some problem,,, and would be grate if someone help me pls.
------------------------------------------------------------
DATA : GT_BKPF TYPE TABLE OF BKPF,
GS_BKPF TYPE BKPF.
GS_BKPF-BUKRS = 'MG00'.
GS_BKPF-BELNR = '1000000000'.
GS_BKPF-GJAHR = '2019'.
APPEND GS_BKPF TO GT_BKPF.
GS_BKPF-BUKRS = 'MG00'.
GS_BKPF-BELNR = '1000000001'.
GS_BKPF-GJAHR = '2020'.
APPEND GS_BKPF TO GT_BKPF.
GS_BKPF-BUKRS = 'MG00'.
GS_BKPF-BELNR = '1000000002'.
GS_BKPF-GJAHR = '2021'.
APPEND GS_BKPF TO GT_BKPF.
GS_BKPF-BUKRS = 'MG00'.
GS_BKPF-BELNR = '1000000003'.
GS_BKPF-GJAHR = '2021'.
APPEND GS_BKPF TO GT_BKPF.
INSERT BKPF FROM TABLE GT_BKPF.
-------------------------------------------------------
no problem to activate... but

this kind of problem happens. how can I Insert internal table into datbase table using Insert or Modify ?
Thank you very much to read this ��
‎2021 Apr 07 3:38 PM
Thank you for visiting SAP Community to get answers to your questions. Since this is your first question, I recommend that you familiarize yourself with our Q&A Tutorial: https://developers.sap.com/tutorials/community-qa.html, as it provides tips for preparing questions that draw responses from our members. Should you wish, you can revise your question by selecting Actions, then Edit.
By adding a picture to your profile you encourage readers to respond: https://www.youtube.com/watch?v=46bt1juWUUM
Many thanks!
‎2021 Apr 07 3:45 PM
Looks like your BKPF table already has records that have the same key (BUKRS, BELNR, GJAHR) as the ones you're trying to insert.
‎2021 Apr 08 3:45 PM
‎2021 Apr 08 6:14 PM
That's because modify modifies existing entries. It does not create new entries. Insert on the other hand creates new entries with those primary keys, hence the dump.
‎2021 Apr 07 3:51 PM
Hello chw0222
You should never update standard SAP tables directly. There is always a function for this purpose. In your case it's BAPI called BAPI_ACC_DOCUMENT_POST.
Kind regards,‎2021 Apr 08 3:45 PM
‎2021 Apr 07 8:39 PM