‎2007 Dec 13 12:50 PM
I have to get only three fields form a Ztable and pass them to an internal table(which is of type another Ztable)
Field names are different in the Ztable and the internal table
Please give me the SELECT statement
The dataelements and lengths are same
Thanks in advance
‎2007 Dec 13 1:00 PM
hi Ajay,
fields in ztable: z1, z2, z3
fields in internal table: i1, i2, i3.
SELECT z1 AS i1
z2 AS i2
z3 AS i3
FROM ztable
INTO CORRESPONDING FIELDS OF TABLE itab
WHERE ...hope this helps
ec
‎2007 Dec 13 12:51 PM
‎2007 Dec 13 12:52 PM
hi,
i think its not possible...
If fieldname is different u will not get data from table.
‎2007 Dec 13 12:52 PM
Hi,
declare internal tabl etype ztable
data : itab1 like ztable occurs 0 with header line
select f1 f2 f3 from ztable into itab1 .
loop at itab1.
itab2-f1 = itab1-f1.
itab2-f2 = itab1-f2.
itab2-f3 = itab1-f3.
Append itab2.
Endloop.
Regards,
Prashant
‎2007 Dec 13 12:55 PM
hi,
i have no clue about your issue,but you could declare your internal table like
data: Begin of itab,
field1 like ztable1-fieldname,
field2 like ztable2-fieldname,
endof itab.
and you can use select * from zable1 into corresponding fields of table itab.
which i think would be easier way ...i any issue in this let me know
regards,
karthik
‎2007 Dec 13 12:55 PM
Hi ,
Try this select statement:
select single from Ztable-field name1 into itab-fieldname1.
select single from Ztable-field name2 into itab-fieldname2.
select single from Ztable-field name3 into itab-fieldname3.
May be helpful...
Reward points if found helpful
Cheers,
Chandra Sekhar.
‎2007 Dec 13 12:55 PM
hi
select f1 f2 f3 into itab-a1 itab-a2 itab-a3 from ztable1.
regards,
pavan
‎2007 Dec 13 1:00 PM
hi Ajay,
fields in ztable: z1, z2, z3
fields in internal table: i1, i2, i3.
SELECT z1 AS i1
z2 AS i2
z3 AS i3
FROM ztable
INTO CORRESPONDING FIELDS OF TABLE itab
WHERE ...hope this helps
ec