Application Development and Automation 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: 
Read only

Problem for insert data

Former Member
0 Likes
566

Dear All,

I am facing the problem whn am insert the data WORK AREA IS NOT LONG ENOUGH..I will tell the requirmrnt..

I have a Z table in that 15 fields is there i have to insert the data one by one means first time i have to insert 3 fields and second time 4 and again and again...in that table my primary key is emp id i dont want insert row again and again i want first time when i insert data in row and second time i have to update that roww and insert data in next 3 fields .....

my code is this ...

TYPES: BEGIN OF data_struc,

pernr TYPE p_pernr,

endda TYPE endda,

begda TYPE begda,

'

'

END OF data_struc.

DATA: data_tab TYPE TABLE OF data_struc,

data_tab_wa TYPE data_struc.

MOVE new_innnn-pernr TO data_tab_wa-pernr.

MOVE new_innnn-endda TO data_tab_wa-endda.

MOVE new_innnn-begda TO data_tab_wa-begda.

MOVE new_innnn-AEDTM TO data_tab_wa-AEDTM.

MOVE new_innnn-UNAME TO data_tab_wa-UNAME.

MOVE new_innnn-data1 TO data_tab_wa-massn.

data_tab_wa-massg = new_innnn-data1+2(2).

MODIFY ZDT_EMPINTF FROM data_tab_wa.

4 REPLIES 4
Read only

Former Member
0 Likes
525

Hi Sandeep ,

Just check the structure of Z table ZDT_EMPINTF and the workarea data_tab_wa has the same structure.

If the structure of both of this differs then you get such type of error.

Hope this will help you.

Regards,

Nikhil

Read only

Former Member
0 Likes
525

Hi,

This probleme ususlly occurs because of difference in the structures:

For Ex;

Consider ITAB1 and ITAB2 have some difference in the structuer maybe 1 field is missing in ITAB2

MODIFY ITAB1 FROM ITAB2.

Then, this will give that 'work area not long enough' error.

Check both the structures.

Read only

Former Member
0 Likes
525

Hi Sandeep

Please check all the fields and there type in Source and Destination Structure.

The problem lies in field mismatch.

Regards

Gaurav

Read only

Former Member
0 Likes
525

Hi,

You structure and internal table and work area decleration seems perfect....but I ma not sure the structure declraed has the same filed with same data elemnts as table ZDT_EMPINTF .

make sure the 2 are same ...in terms of the data element(size and type both).

If they are same ...run the code in the debugger, and check the value of the field being populated in the work area before the insert.

Hope this might help you.

Pooja