Application Development 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: 

intertable

Former Member
0 Kudos

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

RoySayak
Active Participant
0 Kudos

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

Former Member
0 Kudos

declare

data: t_s1 type type_s1 with header line occurs 0,

Pankaj

Former Member
0 Kudos

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

RoySayak
Active Participant
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

Hi,

i have used but of no use

pls help

urgent

regards,

kb

0 Kudos

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

soumya_jose3
Active Contributor
0 Kudos

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.

RoySayak
Active Participant
0 Kudos

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

Former Member
0 Kudos

Thanks it helped me a lot