Sunday, October 24, 2010

OPERATIONS OF INTERNAL TABLES:

ADDING SINGLE RECORD:

A) ADD at the END of Internal Table

APPEND TO .

B) ADD at the given Location

INSERT <> INTO <> INDEX . (N > 0)

NOTE: Fill the Data into Before APPEND/INDEX to <>.

Adding Multiple records:

A) At the END of Internal Table

APPAND LINES OF <> FROM TO TO .

B) At the Given Location .

INSERT LINES OF FROM TO TO <> INDEX .

Note: FROM TO is optional If We Ignore it, All the Records are Transferred, Else Only the records from TO are Transferred, Else only the records from TO are Transferred.

Finding No Of Records:

DESCRIBE TABLE <> LINES . (V_LINES TYPE I).

The No of Records from <> is collected Into V_LINES.

SORTING : To Arrange the Records into Ascending/Descending Groups.

SORT ASCENDING / DESCENDING BY …..

NOTE: Sorting is Ascending by Default.

NOTE: The default key is made up of the Non-Numeric fields of the table line in the order in which they occur.

Accessing / Reading Single Record:

READ TABLE INTO INDEX .

OR

READ TABLE INTO WITH KEY BINARY SEARCH.

NOTE: Make sure that the Internal Table is sorted to Apply BINARY SEARCH.

Accessing / Reading Multiple Records:

LOOP AT <> INTO FROM TO .

* Process the Data From .

ENDLOOP.

DELETEING Records:

Single Record: DELETE INDEX .

Multiple Records: DELETE WHERE .

DELETE FROM TO .

DELETEING ADJACENT DUPLICATES:

NOTE:

Make sure that the duplicates should be Adjacent. Which can be done through SHORTING. So that , sorting the is Mandatory.

NOTE:

The Duplication of Record (S), Depends on the Comparing Fields.

DELETE ADJACENT DUPLICATES FROM COMPAREING ……

NOTE:

Make Sure that, the is sorted by all the Comparing Fields in the Same Order.

MODIFY:

Either Single / Multiple Records Modification is always through .

* Fill the New Data into Fields.

MODIFY FROM TRANSPORTING …/ TRANSPORTING ALL FIELDS WHERE .

NOTE:

The Where Condition, Decides the No Of Records to be Modified.