cancel
Showing results for 
Search instead for 
Did you mean: 

Populating database tables in event handler method - error

Former Member
0 Kudos

Friends,

I am trying to insert values into ztable in an event handler method in a WDA application.

This is the code. ZDATA1 is a ztable with two fields: MANDT and ZKTOKD of data element char01.

-


types: begin of zs,

zktokd type char01,

end of zs.

data: zitab type table of zs,

zstruct like line of zitab.

zstruct-zktokd = 's'.

append zstruct to zitab.

INSERT zdata1 FROM TABLE zitab.

-


I am getting the error: "The Work area "ZITAB" is not long enough...

Please let me know what is missing.

Thanks and Regards.

Accepted Solutions (0)

Answers (3)

Answers (3)

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

This question is not directly related to Web Dynpro ABAP. There is a general ABAP forum for questions such as this. In the future please choose the correct forum for your questions.

Former Member
0 Kudos

Hi,

The error is here

types: begin of zs,

zktokd type char01,

end of zs.

data: zitab type table of zs ,
zstruct like line of zitab.

"passed the Internal table name which is wrong

Correct one

data:

zitab type table of zs,

zstruct like line of ZS. " Here we have to give the type you have declared above.

" Zstruct acts like a workarea.

Regards

Lekha

abhimanyu_lagishetti7
Active Contributor
0 Kudos

>types: begin of zs,

>zktokd type char01,

>end of zs.

>data: zitab type table of zs,

>zstruct like line of zitab.

>zstruct-zktokd = 's'.

>append zstruct to zitab.

>INSERT zdata1 FROM TABLE zitab.

this is noway related to web dynpro abap, remove types declaration

data: zitab type standard table of zdata1.

data: zstruct type zdata1.

zstruct-zktokd = 's'.

append zstruct to zitab.

insert zdata1 from table zitab.

Abhi