Hi,
You are trying to insert values into KNA1 table from I_KNA1 structure , So both the structures
i.e KNA1 and I_KNA1 must be equal, In you report I_KNA1 is having only 6 fileds and kna1 will have many fields.
So you need to change your declaration of I_KNA1 .
For testing purpose change your code as shown below
DATA : I_KNA1 TYPE standard TABLE OF KNA1 . " Change I_KNA1 to KNA1 sO BOTH THE STRUCTURES WILL BE SAME
DATA : WA_KNA1 TYPE KNA1 .
Regards,
Madhumahesh.
Hi,
Try like this
TYPES : BEGIN OF TY_KNA1 .
include STRUCTURE kna1.
* KUNNR TYPE KNA1-KUNNR , " CUSTOMER NUMBER
* NAME1 TYPE KNA1-NAME1 , " NAME1
* NAME2 TYPE KNA1-NAME2 , " NAME2
* ORT01 TYPE KNA1-ORT01 , " CITY
* PSTLZ TYPE KNA1-PSTLZ , " POSTAL CODE
* REGIO TYPE KNA1-REGIO ,
types END OF TY_KNA1 .
Gourav.
The work area or record of the internal table must meet the prerequisites for use in every Open SQL statements. Easiest way is to use the actual structure of the database table.
Regards,
Raymond
Hi,
with the answers to your question, you will be technically able to insert records in KNA1 table, but you should know that using INSERT statements for saving data in SAP master data table is not a good solution and may lead to data inconsistencies. You should use standard interfaces for doing the same.
Add a comment