Question:
Hi guys, i write code for insert data in database table, all time run the report i need delete all records from the database table.
But sintaxis DELETE not working.
Check code please and help me in some idea.
Is ok sintaxis for delete ?
DELETE ZPS_TAFF.
The first syntax you used is for an internal table.
You do not need to specify the client number as this is implied and inserted by the compiler.
The first syntax is valid syntax for deleting A SINGLE entry from transparent table. The only reason why this doesn't work is .. when we declare the table in the tables .. this creates a work area .. and in the OP case, the work area is empty .. hence, it doesn't do anything ...
Answer:
Thank you guys, code working good.
I want Collect Records before insert in transparent table is posible ?
what code i need and where specify ?
Very thank you.
Answer:
What you can do is to use .. COLLECT ..
From your example:
Create an internal table, the same structure as your target table.
ITAB-ZMES = mes_ano.
ITAB-PSPNR = ZPSVAFDOC-SGTXT+3.
ITAB-ANLN1 = ZANLN1.
ITAB-ANLN2 = ZANLN2.
ITAB-DMBTR = ZPSVAFDOC-DMBTR.
ITAB-DMBE3 = ZPSVAFDOC-DMBE3.
COLLECT ITAB.
...
ENDSELECT.
...
INSERT ZPS_TAFF FROM TABLE ITAB.
..
Bare in mind, you need to make sure that you've a unique key combination or the insert will dump on you when multiple entries with the same key exist in your itab.