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: 

regarding select statement

Former Member
0 Kudos

Hi everybody,

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 ststement

Thanks in advance

1 ACCEPTED SOLUTION

Former Member
0 Kudos

hi,

Rajani

do neccasary data declarations

select f1 f2 f3

from ztable1

into (v1, v2, v3)

ztable2-f1 = v1.

ztable2-f2 = v2.

ztable2-f3 = v3.

append ztable2.

endselect.

<b><removed_by_moderator></b>

feel free to ask any quieries my mail id is

<b><removed_by_moderator></b>

6 REPLIES 6

Former Member
0 Kudos

hi,

Rajani

do neccasary data declarations

select f1 f2 f3

from ztable1

into (v1, v2, v3)

ztable2-f1 = v1.

ztable2-f2 = v2.

ztable2-f3 = v3.

append ztable2.

endselect.

<b><removed_by_moderator></b>

feel free to ask any quieries my mail id is

<b><removed_by_moderator></b>

former_member386202
Active Contributor
0 Kudos

Hi,

Declare internal table first

data : itab1 like ztable occurs 0 with header line.

select f1 f2 f3 from ztable into table itab1.

loop at itab1.

itab2-f1 = itab1-f1.

itab2-f2 = itab1-f2.

itab2-f3 = itab1-f3.

append itab2.

Endloop.

Regards,

Prashant

Former Member
0 Kudos

select fld1 fld2 fld3 from table into (itab-f1, itab-f2, itab-f3) where <condtion>.

append itab.

endselect.

Former Member
0 Kudos

Try this..


SELECT f1 as itab-f1     f2 as itab-f2    f3 as itab-f3
INTO CORRESPONDING FIELDS OF TBALE itab FROM <dbtab>
WHERE <COND>.

Former Member
0 Kudos

hi ,

DATA: ITAB OCCURS 10,

FIELD 1 TYPE ZTABLE-FIELD1,

FIELD 2 TYPE ZTABLE-FIELD2,

FIELD 3 TYPE ZTABLE-FIELD3.

SELECT FIELD1

FIELD2

FIELD3

FROM ZTABLE INTO CORRESPONDING FIELDS OF TABLE ITAB.

Former Member
0 Kudos

Hi Rajni

SUNIL is wrong......

watch this answer.......100% relavant.....