Professional Documents
Culture Documents
Knowledge Repository
Internal Table
1. What is structure?
Structure is a data object.
That is made up of components of any data type.
Stored one after the other in the memory.
A structure may have only a single record at run-time.
But a table can have many records.
4. Components of structure.
Structure is a data object that is made up of components of any data type stored
one after the other in the memory.
from VIDHAI TECH. Knowledge Repository
But structure is defined in the data They should have the same format as any of
dictionary and can be used in both data the internal tables.
dictionary as well as in program.
Internal table with header line allows us to pass data directly into body of
internal table.
We can directly use same name [table name] for both header n body of that
table.
16.Explain With header line and without header line in internal table.
Internal Tables with Header Line Internal Tables without Header Line
The work area has the same data Work area is to be explicitly
type as internal table. specified when we need to access
such tables.
A Table Type in SAP ABAP is a global reusable object which is used to define
structure and functional attributes of an internal table in ABAP.
Unique key
Non-unique key.
from VIDHAI TECH. Knowledge Repository
APPEND INSERT
Two statements are commonly used to read the data from an internal table.
Loop at
Loop at is used to read multiple rows from the internal table.
Read table
Read table is used to read a single row.
To read some or all rows from an internal table, you can use the loop at statement. loop at
reads the contents of the internal table, placing them once at a time into a work area.
SYVLINE is a standard DATA Element within the SAP ABAP dictionary and is
associated with fields that store Vertical Line information.
SKIP
Positions the list cursor in a line of the current list.
Uline:
Uline is used to draw a horizontal line on the screen.
Uline can be used with length & position specification.
Uline cannot be used inside write statement.
Uline is itself a statement.
Sy-TABIX SY-INDX
SY-TABIX is a system variable which SY-INDEX is a system variable which acts
stores the index current processing as a loop iteration counter, it stores loop
record of an internal table. iteration number.
So when you are looping over an internal table, you use SY-TABIX.
from VIDHAI TECH. Knowledge Repository
Change the value of a specific field within that internal table with and without a
header line.
With and without specifying the index of the record being updated and do you
need to use the INDEX addition.
Use CLEAR and FREE for workarea, and REFRESH and FREE for internal
table.
Clear deletes the content of a work area, REFRESH deletes the lines of an
internal table.
Now, the difference between FREE and the others, is in the fact that FREE
liberts memory that was allocated for the internal table or workarea also.
Use FREE if you won't need an internal table/work area more in the program.
from VIDHAI TECH. Knowledge Repository
38.ITAB [] denotes.
Select Single is used to read a single first matching line from the
database table and not from the internal table.
Ex: SELECT SINGLE * FROM MARA INTO WA_MARA WHERE MATNR =
'000001'.
43.What are the coding standards to be followed while writing ABAP program?
Follow the Naming Conventions as per the requirement and standards.
44.What is control level statement?
At first
At new
At end of
At last
from VIDHAI TECH. Knowledge Repository
AT LAST - This statement is executed / triggered for the last iteration of loop.
AT END OF - This statement is executed whenever the new value ends on
specific field.
EXIT: The behavior of EXIT keyword is depends on where you use it.
If you use EXIT keyword inside IF .. ENDIF., it will comes out of the program.
If you use EXIT inside LOOP .. ENDLOOP., it will come out of loop.
If you use EXIT inside FORM .. ENDFORM., it will comes out of form (
The INSERT statement allows you not only to insert lines in any type of internal
table, but also to change them using a line index. You can insert either a single line
or a group of lines into index tables using the index.
Select into corresponding is used to get data from a database table into a user
defined internal table or work area without specifying the list of fields.
The addition INTO assigns the content of the found row to a work area. This
addition can be used regardless of which way itab is specified.
The addition ASSIGNING assigns the found row to a field symbol <fs>. This
addition is possibly only if an existing internal table is specified for itab.
Obsolete form of the assignment of data objects and reference variables source to
target variables destination.
If EXACT is specified, only data objects can be specified for source.
MOVE is used to store the values from one structure/variable to another
structure/variable.
You can do away with the comparing addition if you want to compare all the
fields for duplicate values...this way the duplicates for exactly same rows will be
deleted.
We should use 'AT NEW' within the loop and for single field only.
But we can use ON CHANGE OF outside of the loop and it allows multiple fields
also.
After ON CHANGE OF, any number of data objects dobj1, dobj2... of any data
type can be added, linked by OR.
Data can be read from an internal table using the following 2 statements.
READ TABLE Used to read single row.
LOOP AT / ENDLOOP Used to read multiple rows.
Comments are texts that you can write between the statements of your ABAP
program to explain their purpose to a reader. Comments are distinguished by the
preceding signs * (at the beginning of a line) and " (at any position in a line).
from VIDHAI TECH. Knowledge Repository
If the addition INDEX is used, the statement READ reads the row of the row
number specified in index with respect to a table index.
The addition INDEX can only be specified for index tables and determines the row
to be read from the primary table index.