Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

THE WORK AREA itab IS NOT LONG ENOUGH ..

Former Member
0 Kudos

I am getting this issue.check the attachment for actual code and do reply me.

6 REPLIES 6

koolspy_ultimate
Active Contributor
0 Kudos

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.

gouravkumar64
Active Contributor
0 Kudos

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.

raymond_giuseppi
Active Contributor
0 Kudos

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

bharat_rathod2
Active Participant
0 Kudos

Dear,

Declare I_KNA1 type structure of kna1 structure and try.

Former Member
0 Kudos

Hi,

You can declare the work area and Internal table as below...

Data:

   wa_kna1 like kna1.

DATA:

   i_kna1 LIKE TABLE OF wa_kna1.

Now you can able to Insert the records into the database table as you required.

Regards,

Mallikarjuna

former_member194797
Active Contributor
0 Kudos

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.