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

intertable

Former Member
0 Likes
1,252

Hi,

this is my code:

types: begin of type_s1,

num type n,

name(2) type c,

end of type_s1.

types: begin of type_s2,

num type n,

name1(2) type c,

mark type n,

end of type_s2.

****itab

data: t_s1 type type_s1,

t_s2 type type_s2.

retrieved data for t_s1.

retrieving data for t_s2 here the cond is

num = t_s1-num.

the error its giving is t_s1 is a itab without header line so no num in that.

i am not getting this.

regards,

kb

1 ACCEPTED SOLUTION
Read only

RoySayak
Active Participant
0 Likes
1,195

Hi,

sort <first itab> by <key field>.

if <first itab>[] is not initial.

select f1 f2 f3 f4 f5 f6

from <db table name> into table <your second itab>

for all entries in <first itab>

where <key field> = <first itab - key field>.

endif.

Thanks,***************************************"reward if it is useful"

Sayak

10 REPLIES 10
Read only

Former Member
0 Likes
1,195

declare

data: t_s1 type type_s1 with header line occurs 0,

Pankaj

Read only

Former Member
0 Likes
1,195

Hi,

types: begin of type_s1,

num type n,

name(2) type c,

end of type_s1.

types: begin of type_s2,

num type n,

name1(2) type c,

mark type n,

end of type_s2.

****itab

data: t_s1 type table of type_s1,

t_s2 type table of type_s2.

data: wa_s1 type type_s1,

wa_s2 type type_s2.

retrieved data for t_s1 into wa_s1.

retrieving data for t_s2 here the cond is

num = wa_s1-num.

regards,

Santosh Thorat

Read only

RoySayak
Active Participant
0 Likes
1,195

Hi,

You can try like this...

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

--


WORK AREA DECLARATION--

data: wa_type_s1 type type_s1,

wa_type_s2 type type_s2.

--


INTERNAL TABLE DECLARATION FOR WORK AREA--

data: it_type_s1 type table of type_s1,

it_type_s2 type table of type_s2.

*********************************************************************************reward if it is useful*********************

Thanks,

Sayak

Read only

Former Member
0 Likes
1,195

Hi,

wht i have done is the same thing.

types: begin of type_s1

..

..

then work area

data: w_s1 type type_s1.

..

....

then itab

data: t_itab type table of type_s1.

...

...

then retrieval into first itab

now sec

select matnr mbrsh from mara into table t_itab2

where matnr = t_itab-matnr.

its giving error t_itab is not with hl so no matnr.

pls help its urgent

regards,

kb

Read only

Former Member
0 Likes
1,195

Hi,

you are missing for all entries.

do like this

select matnr mbrsh from mara into table t_itab2

for all entries in t_itab

where matnr = t_itab-matnr.

pankaj

Read only

Former Member
0 Likes
1,195

Hi,

i have used but of no use

pls help

urgent

regards,

kb

Read only

Former Member
0 Likes
1,195

can you please post your entire code (till where u get the error )

Read only

soumya_jose3
Active Contributor
0 Likes
1,195

Hi,

ur declaration

types: begin of type_s1,

num type n,

name(2) type c,

end of type_s1.

as above will create only a work area, it is not an internal table with header line.

change it to this

types: begin of type_s1 occurs 0,

num type n,

name(2) type c,

end of type_s1.

Regards,

Soumya.

Read only

RoySayak
Active Participant
0 Likes
1,196

Hi,

sort <first itab> by <key field>.

if <first itab>[] is not initial.

select f1 f2 f3 f4 f5 f6

from <db table name> into table <your second itab>

for all entries in <first itab>

where <key field> = <first itab - key field>.

endif.

Thanks,***************************************"reward if it is useful"

Sayak

Read only

Former Member
0 Likes
1,195

Thanks it helped me a lot