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

Verify the code!

Former Member
0 Likes
982

Dear All,

Below I am giving you the code, which I have got from one friend of mine. In this particular code you will see zseco. Now as its defined as 'Z'. So when I copied my program I also define zseco in se11 as a structure. But this program is not generating and showing the error "ZSECO" is not defined in the ABAP Dictionary as a table, projection view or database view. "

Can any body tell me what is wrong I am doing.

Regards,

Abhay.

**********************************************************************

**********************************************************************

tables:bseg.

data: it_bseg like bseg occurs 0 with header line.

data: it_zseco like zseco occurs 0 with header line.

selection-screen begin of block b1 with frame title text-001.

select-options:s_bukrs for bseg-bukrs,

s_gjahr for bseg-gjahr,

s_belnr for bseg-belnr.

selection-screen end of block b1.

start-of-selection.

perform get_data.

&----


*& Form get_data

&----


form get_data .

select *

from bseg into table it_bseg

where belnr in s_belnr and

bukrs in s_bukrs and

gjahr in s_gjahr.

if sy-subrc = 0.

loop at it_bseg .

move-corresponding it_bseg to it_zseco.

it_zseco-bupla_old = it_bseg-bupla.

it_zseco-zdate = sy-datum.

it_zseco-usernam = sy-uname.

it_zseco-ztime = sy-uzeit.

if it_bseg-bupla ne '1001'.

it_bseg-bupla = '1001'.

modify it_bseg.

endif.

it_zseco-bupla_new = '1001'.

append it_zseco.

clear it_zseco.

endloop.

modify bseg from table it_bseg.

modify zseco from table it_zseco.

message i000 with 'tables BSEG & ZSECO updated successfully'.

else.

message i000 with 'No data found'.

endif.

endform. " get_data

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
922

You defined ZSECO as a structure. Not as a Data base table.

modify zseco from table it_zseco.

This statement tells the system to UPDATE database table ZSECO. That's why u r getting error.

remove the statement or declare ZSECO as a DB table depending on requirement.

6 REPLIES 6
Read only

Former Member
0 Likes
923

You defined ZSECO as a structure. Not as a Data base table.

modify zseco from table it_zseco.

This statement tells the system to UPDATE database table ZSECO. That's why u r getting error.

remove the statement or declare ZSECO as a DB table depending on requirement.

Read only

former_member404244
Active Contributor
0 Likes
922

Hi,

Instead of using it as a structure define it as table in SE11 and check.

Regards,

Nagaraj

Read only

RaymondGiuseppi
Active Contributor
0 Likes
922

ZSECO should be a Table and not a structure, cause :

modify zseco from table it_zseco.

try to insert/update records in this database table. So this explains the error message which give you the file types allowed to be used.

Regards

Read only

rainer_hbenthal
Active Contributor
0 Likes
922

First of all do not use like any more, use type. Second to not use tables with header lines any more, use standard tables and working areas which are separated.

To your problem: If the compiler says he cant find your structure it is

- not defined

- not activated

Did you check the spelling O versus 0 ?

Read only

Former Member
0 Likes
922

try this definition.

data: it_zseco <b>type</b> zseco occurs 0 with header line.

Read only

Former Member
0 Likes
922

HI

ZSECO this as the TABLE in in SE11 so that your problem will solve