‎2008 Apr 15 9:32 PM
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.
‎2008 Apr 15 9:37 PM
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
‎2008 Apr 15 9:37 PM
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
‎2008 Apr 15 10:23 PM
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.
‎2008 Apr 15 10:28 PM
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.
‎2008 Apr 15 9:46 PM
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