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

regarding select statement

Former Member
0 Likes
679

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
Read only

Former Member
0 Likes
649

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
Read only

Former Member
0 Likes
650

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>

Read only

former_member386202
Active Contributor
0 Likes
649

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

Read only

Former Member
0 Likes
649

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

append itab.

endselect.

Read only

Former Member
0 Likes
649

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>.

Read only

Former Member
0 Likes
649

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.

Read only

Former Member
0 Likes
649

Hi Rajni

SUNIL is wrong......

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