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

table

Former Member
0 Likes
515

Hello,

can any body send me sample code for....

i have some (5) common fields from different 4 data base tables. I want to built internal table which includes this 5 common fields for further processing.

thanks.

1 ACCEPTED SOLUTION
Read only

b_deterd2
Active Contributor
0 Likes
499

Hi,


Types: begin of ty_data.
types: custfield1 type ...
types: custfield2....
etc...
Types: end of ty_data.

*then create your itab based on the type
Data: itab type table of ty_data.

Regards,

Bert

4 REPLIES 4
Read only

b_deterd2
Active Contributor
0 Likes
500

Hi,


Types: begin of ty_data.
types: custfield1 type ...
types: custfield2....
etc...
Types: end of ty_data.

*then create your itab based on the type
Data: itab type table of ty_data.

Regards,

Bert

Read only

Former Member
0 Likes
499

hello ,

Thanks for reply.

But my problem is my x ,y fields is in 1 data base table .

y,z,a,b fields in 2nd DB table.

I want all field a,b,x,y,z in my internal table .

So i want to know how data can be stored in itab.

should i use join?

if yes how?

Thanks again.

Read only

Sm1tje
Active Contributor
0 Likes
499

using a join would be a possibility.

select (list all fields you want in same order as in internal table like this table1-fieldx

table1-fieldy

table2-fieldz

from table1 inner join

table2 on table1fieldx = table2fieldx

into (corresponding fields of) table itab

where .....

Use F1 help on select for better understanding of INNER JOIN.

Read only

Former Member
0 Likes
499

Hi Rani,

Suppose that the common fields are a,b,c,d,e. Then declare a internal table like this:

Data: Begin of itab occurs 0,

a type a,

b type b,

c type c,

d type d,

e type e,

End of itab.

It will fulfill your requirement.

Regards,

AMK.

<REMOVED BY MODERATOR>

Edited by: Alvaro Tejada Galindo on Apr 15, 2008 4:50 PM