SAP---ABAP

Monday, May 12, 2008

ABAP/4 Interview Qns and Answers

131) How many types of tables exist and what are they in data dictionary?

Ans 4 Types of Tables:

  1. Transparent tables - Exists with the same structure both in dictionary as well as in database exactly with the same data and fields. Both Open SQL and Native SQL can be used.
  2. Pool tables
  3. Cluster tables - These are logical tables that are arranged as records of transparent tables. One cannot use Native SQL on these tables (only Open SQL). They are not manageable directly using database system tools.
  4. Internal tables


132) What is the step-by-step process to create a table in data dictionary?

Ans Steps to create a table:

Step 1: creating domains (data type, field length, Range).

Step 2: creating data elements (properties and type for a table field).

Step 3: creating tables (SE11).


133) Can a transparent table exist in data dictionary but not in the database physically?

Ans No, Transparent table do exist with the same structure both in the dictionary as well as in the database, exactly with the same data and fields.


134) In SAP Scripts, how will u link FORM with the Event Driven?

Ans In PAI, define function code and write code for the same.


135) Can you create a table with fields not referring to data elements?

Ans YES. e.g.:- ITAB LIKE SPFLI.

Here we are refering to a data object (SPFLI) not data element.


136) What is the advantage of structures? How do you use them in the ABAP programs?

Ans GLOBAL EXISTANCE (these could be used by any other program without creating it again).


137) What does an extract statement do in the ABAP program?

Ans Once you have declared the possible record types as field groups and defined their structure, you can fill the extract dataset using the following statements:

EXTRACT .

When the first EXTRACT statement occurs in a program, the system creates the extract dataset and adds the first extract record to it. In each subsequent EXTRACT statement, the new extract record is added to the dataset

EXTRACT HEADER.

When you extract the data, the record is filled with the current values of the corresponding fields.

As soon as the system has processed the first EXTRACT statement for a field group , the structure of the corresponding extract record in the extract dataset is fixed. You can no longer insert new fields into the field groups and HEADER. If you try to modify one of the field groups afterwards and use it in another EXTRACT statement, a runtime error occurs.

By processing EXTRACT statements several times using different field groups, you fill the extract dataset with records of different length and structure. Since you can modify field groups dynamically up to their first usage in an EXTRACT statement, extract datasets provide the advantage that you need not determine the structure at the beginning of the program.


138) What is a collect statement? How is it different from append?

Ans Collect : If an entry with the same key already exists, the COLLECT statement does not append a new line, but adds the contents of the numeric fields in the work area to the contents of the numeric fields in the existing entry.

Append – Duplicate entries occurs.


139) What is OPEN SQL vs NATIVE SQL?

Ans Open SQL – These statements are a subset of standard SQL. It consists of DML command (Select, Insert, Update, Delete). It can simplify and speed up database access. Buffering is partly stored in the working memory and shared memory. Data in buffer is not always up-to-date.


Native SQL – They are loosely integrated into ABAP. It allows access to all functions containing programming interface. They are not checked and converted. They are sent directly to the database system. Programs that use Native SQL are specific to the database system for which they were written. For e.g. to create or change table definition in the ABAP.


140) What does an EXEC SQL stmt do in ABAP? What is the disadvantage of using it?

Ans To use a Native SQL statement, you must precede it with the EXEC SQL statement, and follow it with the ENDEXEC statement as follows:

EXEC SQL [PERFORMING

].

ENDEXEC.

There is no period after Native SQL statements. Furthermore, using inverted commas (") or an asterisk (*) at the beginning of a line in a native SQL statement does not introduce a comment as it would in normal ABAP syntax. You need to know whether table and field names are case-sensitive in your chosen database.




No comments: