Internal Tables-Questions and Answers - SAP ABAP



INTERNAL TABLE Interview Questions & Answers

1. Which ABAP Dictionary object types is a description of an internal table?
Table type

2. You write an application that stores data in an internal table temporarily. Since the application is runtime critical, you consider which type of internal table to use. Which statements about internal tables are correct?

-> You can use the INSERT TABLE statement to add data records to all types of internal table.
-> if you want to add an entry to a sorted table, the sort sequence must remain the same.

3. Which statements about internal tables concerning the program performance are correct?

- The Costs for Reading a Data Record from A Hashed Table Do Not Depend On the Number of Entries in The Table.
- If A Field Symbol Is Assigned with The Read ... Assigning <Fs> Statement, The Entry in The Internal Table Can Be Changed Directly Using This Field Symbol.
- If A Field Symbol Is Used to Access the Content of an Internal Table, The Data Record Is Not Copied to The Work Area.


4. Which table types do you choose internal table if it is to contain a large number of entries and to be read only via fully qualified key access?
 HASHED

5. What are the different types of structures?
There are three types of structure:
1. Flat structure (elementary fields)
2. Nested structure (type reference to other structure)
3. Deep structure (type reference to database tables)

  • Flat Structures contain only fields of the elementary types C, N, D, T, F, I, P and X or structure.
  • Deep structures contain strings, internal tables and field or object references in addition to the elementary types.
  • Nested structures that contain substructures as components,
  • Non-Nested structures are structures that do not contain any substructures.

6. What is internal tables, and work area?
An internal table is a run time instance. It gets created when program starts execution. It gets destroyed when program terminates.
It has two different parts:  Header Line (optional) and Body (Compulsory). Any value that comes to or goes from internal table travels through header line.


7. What is Size of the internal tables?
The size of the internal tables is set using the 'occurs n' clause. Here “n” refers to an integer number that specifies the size. Usually it’s given as 'occurs 0' which creates an Itab with the memory space of 8kb.

8. Explain ROW Type and LINE Type concept?
Line type refers to the structure of an internal table, whereas row type is the actual part that contains the data and it refers to the table body. Creating internal table using line type and row type concept is for reusability purpose. Line type and Row type are defined at Data Dictionary level.

9. Explain Hashed tables in SAP Internal 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. 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.

10. What types of internal tables exist?
The Internal table types are:
Standard table:
Standard tables have a linear index. You can access them using either the index or the key. If you use the key, the response time is in linear relationship to the number of table entries. The key of a standard table is always non-unique. This table type is particularly appropriate if you want to address individual table entries using the index. This is the quickest way to access table entries. To fill a standard table, append lines using the (APPEND) statement.
Hashed table:
Hashes tables have no internal linear index. You can only access hashed tables by specifying the key. The response time is constant, regardless of the number of table entries, since the search uses a hash algorithm. The key of a hashed table must be unique, and you must specify UNIQUE in the table definition.
This table type is particularly suitable if you want mainly to use key access for table entries. You cannot access hashed tables using the index.
Sorted table:
Sorted tables are always saved correctly sorted by key. They also have a linear key, and, like standard tables, you can access them using either the table index or the key. When you use the key, the response time is in logarithmic relationship to the number of table entries, since the system uses a binary search. The key of a sorted table can be either unique, or non-unique, and you must specify either UNIQUE or NON-UNIQUE in the table definition. Standard tables and sorted tables both belong to the generic group index tables. This table type is particularly suitable if you want the table to be sorted while you are still adding entries to it. You fill the table using the (INSERT) statement, according to the sort sequence defined in the table key.

Index table:

Index table is only used to specify the type of generic parameters in a FORM or FUNCTION. That means that you can't create a table of type INDEX. Internal tables are not DB tables. Standard and Sorted tables in combined are basically called as Index tables and there nothing else. Here is the hierarchy


11. Differences between READ Statement and Write?
A)  READ TABLE        -> you can always read only one record at a time.
      Write Statement-> Used to display the output.

12. Pre-requisite for read Statement?
The internal Table must be sorted using key field/fields.

13. How do we describe the “Check” statements and what is their mechanism?
The “Check” statement is used for finishing one loop pass conditionally, when the condition says true the rest of the statements from the actual statement block will be ignored and will begin the next loop.

14. How can we describe the following commands: MODIFY LINE and READ LINE?
The MODIFY LINE statement is meant for changing the lines of a full list from inside the program and the READ LINE statement is used for reading data found on the lines from the current levels. READ LINE is the same as READ CURRENT LINE and they are both related to HIDE.

15. What is the Version Catalog and what types of versions exist?
The version catalog is the list that contains very (latest) version of an object in existence. The version types are:
         -Active version: is the version made at the program activation.
         -Revised version: is the version made at the editing of the current project.
         -Temporary version: is the version made at the temporary copying of the active version in the  
          Database that has store version functions.
          -Historical version: is the version made at the making of the correction and at the release of the
           Correction.

16. What is Generic key and Generic area?
The Generic key is the left part of the first table key. The Generic area represents every record that corresponds to generic key fields.

17. What is an internal table?
Internal table is a temporary table stored in the RAM of the application server. It gets created during the program execution and gets deleted once the program ends.

18. What is the difference between COLLECT and APPEND statements?
APPEND statement adds a new record to the end of the internal table. COLLECT statement adds a new record to the end of the internal table if there is no record already exists in the internal table with the same key. If a record exits in the internal table with the same key, then COLLECT adds the numeric values in the work area to the existing record.

19. How do you delete duplicate records from internal table?
Use SORT and DELETE ADJACENT DUPLICATES statements to delete the duplicate records from internal table.

20. How do you find number of records present in internal table?
Use DESCRIBE TABLE statement.

21. What is the difference between REFRESH and FREE statements?
REFRESH clears the contents of the internal table but the memory remains allocated. FREE clears the contents of the internal table and ALSO releases the memory space.

22. What are the different Control break statements available inside a LOOP?
  • AT FIRST / ENDAT
  • AT LAST / ENDAT
  • AT NEW / ENDAT
  • AT END OF / ENDAT
  • SUM
  • ON CHANGE OF / ENDON
23. What is the purpose of AT FIRST and AT LAST?
AT FIRST is used to write headings and loop initialization process. AT LAST is used to write grand totals and loop termination processing.

24. What is the purpose of SUM statement?
SUM statement is used to calculate the totals for the rows of a control level.

25. Can we use ON CHANGE OF between SELECT and ENDSELECT?
Yes. It can be used in any loop construct. It can be used within
-LOOP AT/ENDLOOP
-SELECT/ENDSELECT
 -DO/ENDDO
-WHILE/ENDWHILE.

26. What is the meaning of Data Clusters?
Data clusters are the way in which every type of complex internal data objects from an application in ABAP/4 are grouped. They are also deposited in the memory of ABAP/4 for a limited period of time or in databases for a longer time.

27. What is the meaning of these terms in SAP: application server and presentation server?
An application server manages the output /input of ABAP/4 programs and interprets them. Application servers are groups of executables. Presentation servers are programs from the workstations of users that are called like this: Sapgui.exe.

28. In what way are GET and SET different?
GET PARAMETER IF FIELD: The value deposited in ID is met in the variable by the statement, if a value is not found in SAP memory, the system configures SY-SUBRC to 4, in a different case is 0.
 SET PARAMETER ID FIELD: The field contents from ID are stored in SAP memory in a code with up to 20 characters in length. If a value is found there already it will be overwritten, if there is no ID we have to make a new parameter object by double-clicking the ABAP Editor.

29. What is the meaning of Field group, extract data set?
Extract data sets are made of records sequences, we can have various structures for the records, record types are in fact a group of records that have the same structure. Every record type that an extract data set has can be defined as a field group with the statement FIELD GROUPS. The FIELD GROUPS statement brings multiple fields together with providing one single name. Usually we should declare the field groups when the declaration part in a program is finished, this will make everything clear. Field groups don’t generate field space but they show the fields that already exist, they show us the records content if the records are met in the extract data set.

30. What is the way for accessing data that is found on an application server and on a presentation server in ABAP/4?
A5: We will have to make use of these modules: UPLOAD or WS_UPLOAD for the presentation server and OPEN DATASET, CLOSE DATASET, READ DATASET for the application server.

31. At the creation of internal tables what is the criteria configuration of the value of an occurs?
What we have to do for configuring the value of an occurs is to make optimizations and for this we have to keep in mind some things like:
        -The default declared size will be maintained in the roll area – faster program access.
        -The whole data area of the application will be 64 kilobytes.
        -The data inserted that is bigger than the default size is deposited in the roll file- the program is accessed slow. More, prior to deciding to do an optimization we have to analyze the rates of access and the volume

      32. What is the syntax and function used for command AUTHORITY CHECK?
Syntax: AUTHORITY=CHECK OBJECT
IF SY-SUBRC NE 0. The verification for authorization from the user part for starting a specific action is made by AUTHORITY CHECK.

33. What is an Internal Table?
Internal tables are used to obtain data from a fixed structure for dynamic use in ABAP.  Each line in the internal table has the SAME field structure. The main use for internal tables is for storing and formatting data from a database table within a program.

34. What is a Work Area?
Work areas are SINGLE ROWS of data. They should have the same format as any of the internal tables. It is used to process the data in an internal table ONE LINE at a time.

35. Difference between Internal Table and a Work Area?

36. Types of Internal Tables
There are two types of internal tables.
1.
Internal tables with HEADER line- Implicit WA.
2. Internal tables WITHOUT HEADER line. - Explicite WA.

A. Internal Tables with Header Line
-Here the system automatically creates the work area.
-
The work area has the same data type as internal table.
-This work area is called the HEADER line.
-It is here that all the changes or any of the action on the contents of the table are done. As a result of this, records can be directly inserted into the table or accessed from the internal table directly.

B. Internal Tables without Header Line:
-Here there is NO work area associated
with the table.
-
Work area is to be explicitly specified when we need to access such tables.
-Hence these tables cannot be accessed directly.



Comments

  1. This post is extremely radiant. I extremely like this post. It is outstanding amongst other posts that I’ve read in quite a while. Much obliged for this better than average post. I truly value it! sap training and placement in hyderabad

    ReplyDelete

Post a Comment

Popular posts from this blog

SAP ABAP-Internal Table Operations and Example Program

HR ABAP Interview Questions and Answers

BDC (Batch Data Communication) - SAP ABAP