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

Doubts

Former Member
0 Likes
768

Hi Experts,

I want to know about

1) Select single

and

upto one row

2)refresh

and

clear

3) i want to delete the entire data in a table, write the statement for it

4)events in internal tables

5) events in sap

6)types of internal tables and difference between them

points will be awarded

Regards,

nagaraju tankala

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
746

select single is used to fetch only one record which is required

here if u mention where condition then u get the required record

where as in select upto one row

u get only single record that too only first record of the table.

refresh is used used too clear the contents of the table

where a s clear is used to refresh the contents of the work area

if the table is with header line then to clear the body contents we use clear itab[] this is similar to refresh.

if the table is with out header line then we use refresh itab

to clear the body contents.

if u want to delete the table contents the use keyword DELETE

Deleting from a Database Table

- DELETE FROM dbtab. or

DELETE FROM (dbtabname).

- DELETE dbtab FROM wa. or

DELETE (dbtabname) FROM wa.

- DELETE dbtab FROM TABLE itab. or

DELETE (dbtabname) FROM TABLE itab.

Delete from an internal table

- DELETE itab.

- DELETE TABLE itab WITH TABLE KEY k1 = v1 ... kn = vn.

- DELETE TABLE itab [FROM wa].

- DELETE itab INDEX idx.

- DELETE itab FROM idx1 TO idx2.

events in report

INITIALZATION.

AT SELECTION-SCREEN OUTPUT.

AT SELECTION-SCREEN ON FIELD.

AT SELECTION-SCREEN ON BLOCK.

AT SELECTION-SCREEN.

START-OF-SELECTION.

END-OF-SELECTION.

TOP-OF-PAGE

END-OF-PAGE

Standard tables. In a standard table, you can access data

using either the table index or the key. Since the key of a

standard table always has to be non-unique for

compatibility reasons, the system searches the whole table

each time you access it using the key. Consequently, you

should always use the index to access a standard table

whenever possible.

Sorted tables. In a sorted table, the system

automatically stores the entries and inserts new entries

sorted by the table key. The system uses a binary search on

the table when you access it using the key. You can specify

the key of a sorted table as unique. You will often use the

key to access a sorted table, but it is also possible to

use the index. Standard tables and sorted tables are

generically known as index tables.

Hashed tables. You can only access a hashed table using

the key. There are certain conditions under which you can

considerably reduce the access times to large tables by

using a hashed table. The key of a hashed table must always

be unique.

Edited by: Kodandarami Reddy.S on Mar 27, 2008 2:55 AM

Edited by: Kodandarami Reddy.S on Mar 27, 2008 3:01 AM

Edited by: Kodandarami Reddy.S on Mar 27, 2008 3:06 AM

Hi Experts,

I want to know about

1) Select single

and

upto one row

2)refresh

and

clear

3) i want to delete the entire data in a table, write the statement for it

4)events in internal tables

5) events in sap

6)types of internal tables and difference between them

points will be awarded

Regards,

nagaraju tankala

4 REPLIES 4
Read only

Former Member
0 Likes
746

Hi Nagaraju,

For all of u r qns u can answers in the forum. Plz search the forum. you will get quick and good answers from deferent peoples.

Regards,

Naresh.

Read only

Former Member
0 Likes
747

select single is used to fetch only one record which is required

here if u mention where condition then u get the required record

where as in select upto one row

u get only single record that too only first record of the table.

refresh is used used too clear the contents of the table

where a s clear is used to refresh the contents of the work area

if the table is with header line then to clear the body contents we use clear itab[] this is similar to refresh.

if the table is with out header line then we use refresh itab

to clear the body contents.

if u want to delete the table contents the use keyword DELETE

Deleting from a Database Table

- DELETE FROM dbtab. or

DELETE FROM (dbtabname).

- DELETE dbtab FROM wa. or

DELETE (dbtabname) FROM wa.

- DELETE dbtab FROM TABLE itab. or

DELETE (dbtabname) FROM TABLE itab.

Delete from an internal table

- DELETE itab.

- DELETE TABLE itab WITH TABLE KEY k1 = v1 ... kn = vn.

- DELETE TABLE itab [FROM wa].

- DELETE itab INDEX idx.

- DELETE itab FROM idx1 TO idx2.

events in report

INITIALZATION.

AT SELECTION-SCREEN OUTPUT.

AT SELECTION-SCREEN ON FIELD.

AT SELECTION-SCREEN ON BLOCK.

AT SELECTION-SCREEN.

START-OF-SELECTION.

END-OF-SELECTION.

TOP-OF-PAGE

END-OF-PAGE

Standard tables. In a standard table, you can access data

using either the table index or the key. Since the key of a

standard table always has to be non-unique for

compatibility reasons, the system searches the whole table

each time you access it using the key. Consequently, you

should always use the index to access a standard table

whenever possible.

Sorted tables. In a sorted table, the system

automatically stores the entries and inserts new entries

sorted by the table key. The system uses a binary search on

the table when you access it using the key. You can specify

the key of a sorted table as unique. You will often use the

key to access a sorted table, but it is also possible to

use the index. Standard tables and sorted tables are

generically known as index tables.

Hashed tables. You can only access a hashed table using

the key. There are certain conditions under which you can

considerably reduce the access times to large tables by

using a hashed table. The key of a hashed table must always

be unique.

Edited by: Kodandarami Reddy.S on Mar 27, 2008 2:55 AM

Edited by: Kodandarami Reddy.S on Mar 27, 2008 3:01 AM

Edited by: Kodandarami Reddy.S on Mar 27, 2008 3:06 AM

Read only

Former Member
0 Likes
746

Hi,

1.SELECT SINGLE ->SELECTS ONLY ONE ROW FROM DATABASE TABLE

2.REFRESH DELETES WHOLE DATA IN INTERNAL TABLE

CLEAR CLEARS THE HEADER OF THE INTERNAL TABLE

3.DELETE FROM <TABLE NAME> WHERE <CONDITION>

4.AT NEW...ENDAT,AT FIRST...ENDAT,AT LAST....ENDAT.

5.INITIALZATION.

AT SELECTION-SCREEN OUTPUT.

AT SELECTION-SCREEN ON FIELD.

AT SELECTION-SCREEN ON BLOCK.

AT SELECTION-SCREEN.

START-OF-SELECTION.

END-OF-SELECTION.

TOP-OF-PAGE

END-OF-PAGE

6.STANDARD(NORMAL),SORTED(SORTED BY KEY) AND HASHED(UNIQUE KEY)

Regards,

V.Balaji

Reward if Usefull...

Read only

Former Member
0 Likes
746

Hi,

1. Select Single is used to read single entry from the Database.

1.1 UPTO ONE ROW - To restrict the first line included in the selection.

2. Refresh - This always applies to the body of the table. As with the CLEAR statement, the memory used by the table before you initialized it remains allocated.

CLEAR CLEAR <itab>.

This statement restores an internal table to the state it was in immediately after you declared it. This means that the table contains no lines. However, the memory already occupied by the memory up until you cleared it remains allocated to the table.

If you are using internal tables with header lines, remember that the header line and the body of the table have the same name. If you want to address the body of the table in a comparison, you must place two brackets ([ ]) after the table name.

CLEAR <itab>[].

To ensure that the table itself has been initialized

3. Delete itab deletes contents of Internal Table

4. No events are present in Internal Table but you have events in Reports.

5.Events in Reports:

- Initialization

- At selection-screen output

- At Selection-screen on block

- At Selection-screen on field

- At Selection-screen

- Start-of-selection

- End-of-selcetion

- Top-of-page

- End-of-page

- At line-selection

- At pf<nn>

- At USer-Command

- Top-of-page during line-selection

6. We've 3 Types of Internal Tables:

Standard Internal Table,

Sorted Internal Table &

Hashed Internal Table

Standard tables

This is the most appropriate type if you are going to address the individual table entries using the index. Index access is the quickest possible access. You should fill a standard table by appending lines (ABAP APPEND statement), and read, modify and delete entries by specifying the index (INDEX option with the relevant ABAP command). The access time for a standard table increases in a linear relationship with the number of table entries. If you need key access, standard tables are particularly useful if you can fill and process the table in separate steps. For example, you could fill the table by appending entries, and then sort it. If you use the binary search option with key access, the response time is logarithmically proportional to the number of table entries.

Sorted tables

This is the most appropriate type if you need a table which is sorted as you fill it. You fill sorted tables using the INSERT statement. Entries are inserted according to the sort sequence defined through the table key. Any illegal entries are recognized as soon as you try to add them to the table. The response time for key access is logarithmically proportional to the number of table entries, since the system always uses a binary search. Sorted tables are particularly useful for partially sequential processing in a LOOP if you specify the beginning of the table key in the WHERE condition.

Hashed tables

This is the most appropriate type for any table where the main operation is key access. You cannot access a hashed table using its index. The response time for key access remains constant, regardless of the number of table entries. Like database tables, hashed tables always have a unique key. Hashed tables are useful if you want to construct and use an internal table which resembles a database table or for processing large amounts of data.

Reward if Useful.

Regards,

Iyswarya