Events in a classical report
Load-of-praogram
This event is used to load program into memory for execution and this is the first event in execution sequence.
Initialization
This event is used to initialize variables, screen default values and other default actions.
At Selection-Screen output
By using this event we can manipulate dynamic selection-screen changes.
At Selection-Screen on field
This event is used to validate a single selection-screen input parameter.
At Selection-Screen on value request
This event is used to provide value help ( field help ) for a input field.
At Selection-Screen on help request
By using this event we can provide F1 help for a input field.
At Selection-Screen
This event is used to validate multiple input fields
Start-of-Selection
This is default event which is used to write actual business logic.
End-of-Selection
We can use this event just to state that start-of-selection is ended, this event is used with logical databases, logical databases are in HR ABAP only. In normal ABAP we don`t have much importance .
Top-of-Page
This event prints constant heading for all pages.
End-of-Page
This event prints constant footer for all pages.
Before using this event, we need to reserve some lines for displaying
Free Clear Delete Refresh Append and Collect in ABAP
What is the difference between free clear and refresh in sap abap.
When you define a variable or a table in a program. And execute it the processor will allocate appropriate memory to the variable hope you know this.
Ex:
DATA : Variable(1) type c.
Then the processor will allocate memory(With memory ID Some say 412536) equal to size 1 character size.
Then if you assign a value for the above variable like
Variable = ‘X’. the variable or memory id 412536 contains this ‘X’ value.
If you write:
1. FREE Variable.
The memory allocated is refreshed and freed. Means after this statement the memory to the variable is no more. It is freed from the program and can be used for some other program are purpose.
2. REFRESH i_tab.
Used for table to clear all the entries from the internal table body. but sill memory allocation exist and you can use some other with in the program.
3. CLEAR variable .
it clears the memory of the variable i.e. variable will be empty.
4.DELETE variable or I_tab index i etc.
It deletes a specific value from a I_tab body based on condition.
what is the use of collect in SAP
APPEND: This keyword will append the current contents of the table header or the structure to the end of the table as a new record.. This will not affect the any existing record of the table.
COLLECT : This keyword is used for summation purposes.. when you collect a record to an internal table, it will find that is the table already have any record with the same key values? If yes, then it will add all the numeric values of the new record to the existing record without changing the non numeric values.
Internal table operations in abap
APPEND statement is used to append or add a record from work area to internal table, the new record will be added at the end of the internal table.
INSERT statement is used to insert or add a record from work area into internal table at the specified location
SORT is used to sort a Internal table data in ascending order or descending order, by default it will sort the data in ascending order. In addition to this we can able to sort data based on specified fields.
DESCRIBE TABLE is used to count the no of records in a internal table
READ TABLE WITH KEY .. BINARY SEARCH is used to read a single record from an internal table into work area specified by field name and field value .
BINARY SEARCH is a search mechanism which is used to read a record from internal table into work area very fast, the functionality of binary search it divides the into parts and searches, for full details Binary Search mechanism in SAP ABAPThe internal table must be sorted in ascending order before using binary search.
READ TABLE WITH INDEX is used to read a single record from an internal table into work area specified by index.
MODIFY is used to modify a single or multiple internal table records based on condition
TRANSPORTING is a keyword which is used to specify a list of fields to be modified instead of all fields.
DELETE is used to delete single or multiple records from an internal table from work area based on some condition
DELETE ADJACENT DUPLICATES is used to delete delete duplicate records which are adjacent to each-other.Pre-requisite for this is the internal table must be sorted in ascending order
APPEND LINES OF is used to append multiple records to an internal table from another internal table.
INSERT LINES OF is used to INSERT multiple records to an internal table from another internal table at the specified location.
MOVE keyword is used to move one internal table data to another.
Difference between For all entries and inner join
Inner Join : here you are going to use two database tables having common fields, on the basis of which you will fetch the data.
For all entries: Here at first you are going to fetch data from Db1 into itab1 for specified condition. then again you will use one more select query to fetch the values from DB2 for the corresponding entries in internal table itab1. Some drawbacks of for all entries are :-
1. duplicate rows are automatically removed
2. if the itab used in the clause is empty , all the rows in the source table will be selected .
3. performance degradation when using the clause on big tables.