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

error

Former Member
0 Likes
923

Hi,

types: begin of t_xxx2,

zxxx11 like zxxx2-zxxx11,

zxxx01 like zxxx2-zxxx01,

zxxx02 like zxxx2-zxxxp02,

zxxx03 like zxxx2-zxxx03,

zxxx04 like zxxx2-zxxx04,

zxxx05 like zxxx2-zxxx05,

zxxx06 like zxxx2-zxxx06,

end of t_zxxx2.

data : i_Zxxx2 type t_zxxx2 occurs 0 with header line.

types: begin of t_xxx1

zxxx11 like zxxx1-zxxx11,

zxxx01 like zxxx1-zxxx01,

zxxx02 like zxxx1-zxxxp02,

zxxx03 like zxxx1-zxxx03,

zxxx04 like zxxx1-zxxx04,

zxxx05 like zxxx1-zxxx05,

zxxx06 like zxxx1-zxxx06,

end of t_zxxx1

*

data : i_Zxxx1 type t_zxxx1 occurs 0 with header line.

select * from Zxxx1

into table I_Zxxx1

where matnr = p_matnr.

while selecting the data into internal table i'm getting error like

"The work area i_zxxx1is not long enough"

Plz tell me why i'm getting error?

3 REPLIES 3
Read only

Former Member
0 Likes
772

hi,

Change to Standard table

data : i_Zxxx1 type STANDARD TABLE OF t_zxxx1.

Regards

Sudheer

Read only

0 Likes
772

Tanq sudheer,

but i should use occurs 0 with header line r not?

if i don't use i'm getting error?

Read only

Former Member
0 Likes
772

Hello Balu,

In your statement...

select * from Zxxx1

into table I_Zxxx1

where matnr = p_matnr.

you are sending some records with all fields from table l_Zxxx1 to Zxxx1.

Why you got error means...

your internal table is having some fields of the that table.

but you are passing all the fields of records to the internal table... thats the way u r getting error.

to avoid this error...

make sure that the fields you are selection from select statement should present in the internal table

or use the following code....

Data : itab1 type standard table tab1.

where tab1 is the standard table.

<b>Using header line ( oocrs 0 ) concept is your wish.

But better way of coding is uinsg work area instead of header lines.

why because...

Header line concept is not supported by OOPS. where in future reports will be in OOPS Concept. And also In NETVIEWR also it won't work...

So better to use Work area...

You can create work area as follows...

Data : itab1 type standard table tab1.

data : wa_itab1 like line of itab1.</b>

Reward If Helpful.

Regards

--

Sasidhar Reddy Matli.

Message was edited by:

Sasidhar Reddy Matli

Message was edited by:

Sasidhar Reddy Matli