cancel
Showing results for 
Search instead for 
Did you mean: 

Select Statements,Internal Tables

Former Member
0 Kudos

Hi All,

1. How to u use select statements in programming code.

2. What are main Select Statements in SAP-ABAP.

2. What is main difference between

1. Select Single

2. Select *

3. Select single *

4. Select Single * .......up to 10 rows.

3.Performance issue which statements we can use?

4.What is main difference between Inner Join and Outer join ?

INTERNAL TABLES :

5.What is Internal Table? How many types in internal table?.What is main feature in creating internal table?

6.How to create internal table in programs.

7.How to pass the values one internal table to another internal table.

Bye.

Srinivas.

Accepted Solutions (1)

Accepted Solutions (1)

mahaboob_pathan
Contributor
0 Kudos

1. How to u use select statements in programming code.

ans.

select statemetn is used to fetch data from tables.

2. What are main Select Statements in SAP-ABAP.

ans.

nothing is main in sap-abap,according to u r requirement u have to write it.

2. What is main difference between

1. Select Single

2. Select *

3. Select single *

4. Select Single * .......up to 10 rows.

3.Performance issue which statements we can use?

ans to above.

select single is used to fetch first single record in table.

select * used to retrieve all fields in the table.

select single * is used to fetch all fields from table but it will fetch only one record.

select single *...... upto 10 rows is used to retrieve all fields from table upto 10 rows(mean first 10 rows in table).

performence point of u u have to use select specific fields from table upto 1 row.

after that select single is better.

4.What is main difference between Inner Join and Outer join ?

if we need few records from few tables like mara,marc mard. we use joins.

inner joins:

if we use inner joins on two table it will check in the table and pick if it had and then next record like that it willretrieve the data.

outer joins:.

if we use outer joins from one table if will pick up all the records and match with the nother table and pick the matching records .

we generally use INNER JOINS.

we use joins if we have key fields common.

5..What is Internal Table? How many types in internal table?.What is main feature in creating internal table?

internal table is like the strcture which u want. like if u need some fields from table vbak u create and internal table.

internal table does not occupy any memory space.

they occupy dynamic memory and it will refresh.

they will hold bunch of records in memory.

-->

we can declare internal table in 5 ways.

1. DATA ITAB LIKE ZTEST-DEMO OCCURS 0 WITH HEADER LINE.

2.DATA:BEGIN OF ITABOCCURS 0,

F1 TYPE I,

F2(10) TYPE C,

END OF ITAB.

3.

DATA: BEGIN OF ITAB OCCURS 0,

F1 LIKE ZSDEMO-FLD1,

F2 LIKE ZSDEMO-FLD2,

F3 TYPE I,

END OF ITAB.

4.

TYPES: BEGIN OF T-STRUC,

F1 LIKE ZSDEMO-FLD1,

F2 LIKE ZSDEMO-FLD2,

F3 TYPE I,

END OF T-STRUC.

DATA STRUC TYPE T-STRUC.

DATA ITAB TYPE TABLE OF T-STRUC.

5.

DATA: BEGIN OF ITAB OCCURS 0.

INCLUDE STRUCTE VBAK.

IN THIS WAY WE HAVE TO USE INTERNAL TABLE.

MOSTLY BETTER USE IS 4TH. ONE.

u can values from one table to another useing

MOVE internaltable1 to internaltable2.

but here structure of both the internal tables should be same.

other wise uhaveto use

MOVE-CORRESPONDING.

Answers (4)

Answers (4)

Former Member
0 Kudos

hi,

regarding select statement, refer the below links:

[http://www.sapdb.org/7.4/htmhelp/40/1312152fa511d3a98100a0c9449261/content.htm][http://help.sap.com/saphelp_nw04/helpdata/en/62/10a423384746e8bf5f15ccdd36e8b1/content.htm][http://www.sapdb.org/7.4/htmhelp/40/1311fd2fa511d3a98100a0c9449261/content.htm]

regarding intenal tables:

[http://www.sapdevelopment.co.uk/tips/tips_select.htm]

[http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb35de358411d1829f0000e829fbfe/content.htm]

[http://help.sap.com/saphelp_nw70/helpdata/en/c6/617cf4e68c11d2b2ab080009b43351/content.htm]

[http://www.sap-img.com/ab009.htm]

[http://abapprogramming.blogspot.com/2007/04/internal-table-in-brief-in-abap.html]

reward if helpful.

Former Member
0 Kudos

hi,

regarding select statement see the links:

Former Member
0 Kudos

1. How to u use select statements in programming code.

like select single

select

for all entries in table ....

select

appending corresponding fields of table

2. What are main Select Statements in SAP-ABAP.

select

for all entries in table ....

select

appending corresponding fields of table

2. What is main difference between

1. Select Single

select single variable

2. Select *

selects complete table

3. Select single *

selects only one row of the table

4. Select Single * .......up to 10 rows

it will select upto 10 rows

.

3.Performance issue which statements we can use?

select single *

select .... For all entries

select.... Appending corresponding fields

4.What is main difference between Inner Join and Outer join ?

INTERNAL TABLES :

5.What is Internal Table? How many types in internal table?.What is main feature in creating internal table?

internal table is a runtime object. its allocate memory at runtime only...

6.How to create internal table in programs.

data : begin of itab occurs 0,

fields,

end of itab.

7.How to pass the values one internal table to another internal table.

by using loop

by using read statement.

Former Member
0 Kudos

Hi,

1) Select statemet is used normally as we use it in SQL/ORACLE.

Ex : Select kunnr from KNA1 into v_kunnr.

2) The statments which u have written are used in SAP ABAP. These are the basic statements. As and when u will start learning ABAP u will come to know.

3) Select Single will select single line item from database.

This statement will give high performance and process will be faster.

4) Select * is used to fetch complete data from database.

The performance issues will come with this statement and process will also slow down. It si advisable not to use Select *.

5) Internal table is used to store data.

6) Internal table creation :

************Structure declaratin*************

Types : begin of x_struct,

kunnr type kna1-kunnr,

endof x_struct.

*********Internal table declaration*********

data : it_struct type standard table of x_struct,

it_struct1 type standard table of x_struct.

7) Passing data from one internal table to another is '

it_struct[] = it_struct1[].

Reward if useful.

Thanks

Swati.

Edited by: Swati Khandelwal on Apr 15, 2008 7:53 AM