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

internal table

Former Member
0 Likes
838

load the data to internal table by using select statement and load the data to structure by using selct statement ...

is both r same ..

when we use SELECT AND ENDSLECT ?

Regards,

pandu.

10 REPLIES 10
Read only

Former Member
0 Likes
812

Hi,

if you are populating the structure...then you have to use SELECT..ENDSELECT.

Then inside that you either populate either an internal table or directly do the processing..performance wise it will be slower..

If you use SELECT ..INTO TABLE...Then it is directly populating the internal table with the database records...The performance will be much higher...

Thanks

Naren

Read only

Former Member
0 Likes
812

Hi Pandu,

If you want the fill the structure then you use

SELECT.... ENDSELECT.

If you want to fill the internal table directly from Database Table

Then u need to use

SELECT...INTO TABLE

Hope this clears your doubt.

Regards,

Chandru

Read only

Former Member
0 Likes
812

Hi,

Use of EndSelect statment should be avoided.

So use SELECT SINGLE to load data to structure and Use SELECT.....INTO TABLE <internal table> to load data to internal table.

Regards,

Amit

Read only

Former Member
0 Likes
812

hi,

<b>select * from kna1.

write: kna1-kunnr.

endselect.</b>------> Use it.

<b>select * from kna1 into table itab.

write: itab-kunnr.</b>

Endselect------> donot use it.

Read only

Former Member
0 Likes
812

hi,

<b>select * from kna1.

write: kna1-kunnr.

endselect.</b>------> Use it.

<b>select * from kna1 into table itab.

write: itab-kunnr.</b>

Endselect------> donot use it.

Warm Regards,

S.Suresh.

reward if useful......

Read only

0 Likes
812

when we use SELECT , ENDSELECT

and select into?

Regards,

pandu.

Read only

0 Likes
812

You should use SELECT..ENDSELECT when you want to copy the contents to structure from Database table.

You should use SELECT..INTO TABLE when you want to copy the contents to Internal Table from Database table.

In order to avoid ENDSELECT while copying data to Structure use

SELECT SINGLE. For this no need to use ENDSELECT.

Read only

Former Member
0 Likes
812

hi

you should always avoid using select and endselect.

if u want to copy it to a structure use select single.

Read only

Former Member
0 Likes
812

hai Pandu,

In some cases we have to go with SELECT ............ENDSELECT.

SELECT.........ENDSELECT is act like a loop.

SELECT * INTO CORRESPONDING FIELDS OF WF_AUFK FROM AUFK

WHERE AUFNR IN WP_AUFNR

AND BUKRS = WP_BUKRS

AND GSBER = WP_GSBER.

...................some logics...............................

SELECT * INTO CORRESPONDING FIELDS OF WF_EKKN

FROM EKKN

WHERE AUFNR = WF_AUFK-AUFNR

....................some logics.................................

CLEAR WT_DETAIL_TBL.

WT_DETAIL_TBL-WF_PSPID = WF_AUFK-AUFNR.

WT_DETAIL_TBL-WF_POST1 = WF_AUFK-KTEXT.

WT_DETAIL_TBL-WF_SUB_CD = WF_EKKN-SAKTO.

WT_DETAIL_TBL-WF_EBELN = WF_EKKN-EBELN.

WT_DETAIL_TBL-WF_SORT_PI = WF_EKKN-EBELN.

ENDSELECT.

ENDSELECT.

this statement will take first record from database table and perform the necessary logic present within the SELECT ............ENDSELECT.when the processing of the first record is over, endselect event will triger. after that it will goto above select statement and it will check database table for another record suitable for that selelction criteria.after processing the each record the records willl be stored in a internaal table. so interaction with the database is high.that is y some peoplpes asking u to avoid

SELECT ............ENDSELECT.

LOAD THE DATA INTO THE INTERNAL TABLE.

In this case, interaction with the database is less, bcoz u r retrieveing all the data at first time and storing it into internal table. after that u r processing it from internal table, these are the main differences.its quick processing.

i think ur doubt will be clear.

regards,

shafi.

Read only

0 Likes
812

after load the data into internal table, we will loop that internal table for further processing.