SAP ABAP Interview Questions,Answers and Learnings

6/13/2010 No Comment
What is the difference between the function module and a normal ABAP/4 subroutine?

In contrast to normal subroutines function modules have uniquely defined interface. Sub routines do not return values.
Sub routines do not return exceptions. Sub routines cannot be tested independently. Declaring data as common parts is not possible for function modules. Function modules are stored in a central library. What is a function group? A function group is a collection of logically related modules that share global data with each other. All the modules in the group are included in the same main program. When an ABAP/4 program contains a CALL FUNCTION statement, the system loads the entire function group in with the program code at runtime. Every function module belongs to a function group.

What is the difference between internal tables and extract datasets?

A. The lines of an internal table always have the same structure. By using extract
datasets, you can handle groups of data with different structure and get statistical figures from the grouped data.
B. You have to define the structure of the internal table at the begining. You need
not define the structure of the extract dataset.
C. In contrast to internal tables, the system partly compresses extract datasets
when storing them. This reduces the storage space required.
D. Internal tables require special work area for interface whereas extract datasets
do not need a special work area for interface.

LOGICAL DATABASE.
What are logical databases?
What are the advantages/disadvantages of logical databases? Ans :- A Logical Database is a hierarchical structure of tables. Use the GET statement to process Logical Databases. - LDB consists of logically related tables grouped together ¬ used for reading and processing data.
- Advantages = 1. No need of programming for retrieval , meaning for data selection
- 2. Easy to use standard user interface, have check completeness of user input.
Disadvantages = 1. Fast in case of lesser no. of tables But if the table is in the lowest level of hierarchy, all upper level tables should be read so performance is slower.

Preparation of the data records by the L.D.B and reading of the data records in the actual report are accomplished with the command pair.
- Put and Get.

The three main elements of LDB are - Structure, Selections, Database Program.

What sort of tables one can use in designing the hierarchy of a LDB ?
- Tables which are having Foreign key relations.

The structure of Logical Databases relfects the ________________ dependencies of hierarchical tables in the SAP System.
- Foreign key

If you want to improve the response time ( time to access data ) Logical DataBases permits you to achieve this using ______________
- VIEWS.

What are the advantages of Logical DataBases ?
- It offers an easy-to-use selection screen.
You can modify the pre-generated selection screen to your needs. It offers check functions to check whether user input is complete, correct, and plausible.
It offers reasonable data selections.
It contains central authorization checks for database accesses.
Enhancements such as improved performance immediately apply to all report programs that use the logical database.
Report FORMATTING In order to suppress the leading zeros of a number field the keywords used are : NO-ZERO. The Command that allows for vertical alignment of fields one below the other. UNDER. In order to concatenate strings only for output purposes the command _________ can be used in conjunction with the 'Write' statement. NO-GAP. Data can be moved from one field to another using a 'Write:' Statement and stored in the desired format. TRUE. Write : Date_1 to Date_2 format DD/MM/YY. In order to have boldfaced text as output the command used is Write : INTENSIFIED. Background and foreground colors can be interchanged using the command Format inverse. Which datatype cannot be used to define parameters. Type F. For each new event, the system resets all formatting options to their default values. TRUE.
The processing block following END-OF-PAGE is processed only if you reserve lines for the footer in the LINE-COUNT option of the REPORT statement.
To execute a page break under the condition that less than a certain number of lines is left on a page is acheived by ________________________. RESERVE n lines. What is the limit for the length of a page if the page length is not specified in the report statement. 60,000 Lines. How can Symbols or R/3 icons be output on the screen? WRITE AS SYMBOL. WRITE AS ICON.
REPORTING - GENERAL What are reports? and how do you set up reports? A report program reads and analyzes data from one or more database tables without modifying the database. Usually, the result of such a report program is in the form of a list which is output to the screen or sent to a printer. What are the different types of programs? I
Include Program
M
Module Pool
F
Function Modules
S
External Subroutines
1
Online program

Events in Reporting ? Explain ?
The following events occur at runtime of a typical report program which uses logical databases: Event keyword
Event

-- INITIALIZATION
Point before the selection screen
is displayed
When you start a program in which a selection screen is defined (either in the program itself or in the linked logical database program), the system normally processes this selection screen first. If you want to execute a processing block before the selection screen is processed, you can assign it to the event keyword INITIALIZATION.

AT SELECTION-SCREEN
Point after processing user input on the selection screen while the selection screen is still active
The event keyword AT SELECTION-SCREEN provides you with several possibilities to carry out processing blocks while the system is processing the selection screen.

START-OF-SELECTION
Point after processing the selection screen
The event START-OF-SELECTION gives you the possibility of creating a processing block after processing the selection screen and before accessing database tables using a logical database. You can use this processing block, for example, to set the values of internal fields or to write informational statements onto the output screen. At the START-OF-SELECTION event, also all statements are processed that are not attached to an event keyword except those that are written behind a FORM-ENDFORM block .

How do you read selected lines of database table into an internal table in packages of predefined size?.
SELECT * FROM INTO TABLE PACKAGE SIZE .
where 'n' is variable.
Name the WILDCARD characters which are used for comparisions with character strings & numeric strings.
'%' and '_'.
How to specify a client for database table processing.
TABLES SPFLI.
SELECT * FROM SPFLI CLIENT SPECIFIED
WHERE MANDT BETWEEN '001' AND '003'.
...
ENDSELECT.
Activation ¬ During activation, the runtime object of aggregate object or tables is created. The runtime object is buffered so that the application program can access it quickly. Runtime object has information about the following objects of table - domain ¬ data elements ¬ field definition ¬ table definition
Lock Mechanism ¬ prevents a new database operation being started an existing one has been correctly completed. When conversion is done, lock is created automatically and released only when conversion is successful. Clearing of locks ¬ restart adjustment ¬ attempt is made to continue conversion at the point of
termination
Cancel adjustment ¬ lock entry is simply deleted from table
Version Management functions ¬
- Canceling changes ¬ reset revised version to active version
- Storing changes ¬ active version will be temporarily stored in version
Switching changes ¬ switch between active and revised versions
Version catalog ¬ list of all existing versions of an object
- Revised version ¬ produced when we edit an existing object
- Active version ¬ produced when we activate an object
- Temporary version ¬ produced when we copy the active version temporarily to the database with store version functions
- Historical versions ¬ created when 1. Correction is created 2 correction is
released
Table Buffering : Possible buffering types
- full buffering ¬ either, whole table or none of the table is located in the buffer (Tables up to 30 kb done in client dependent fully buffered tables)
- Generic buffering ¬ generic areas of the table are fully buffered.
- Generic key ¬ left justified section of primary key of a table.
Single record buffering ¬ records actually being accessed are loaded to buffers, large records where few records are accessed.
Internal Tables ? Types ?
STANDARD table Key access to a standard table uses a linear search. This means that the time required for a search is in linear relation to the number of table entries. You should use index operations to access standard tables.
SORTED table Defines the table as one that is always saved correctly sorted. Key access to a sorted table uses a binary key. If the key is not unique, the system takes the entry with the lowest index. The runtime required for key access is logarithmically related to the number of table entries.
HASHED table Defines the table as one that is managed with an internal hash procedure You can only access a hashed table using the generic key operations or other generic operations ( SORT, LOOP, and so on). Explicit or implicit index operations (such as LOOP ... FROM oe INSERT itab within a LOOP) are not allowed.
INDEX table A table that can be accessed using an index. 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. Standard tables and sorted tables are index tables.
Syntax : DATA itab TYPE table type of line type [WITH UNIQUE/NON-UNIQUE KEY ] [Iinitial size n] [WITH HEADER LINE]
What are DATA CLUSTERS ?
You can group any complex internal data objects of an ABAP/4 program together in data clusters and store them temporarily in ABAP/4 memory or for longer periods in databases. You can store data clusters in special databases of the ABAP/4 Dictionary. These databases are known as ABAP/4 cluster databases and have a predefined structure.Storing a data cluster is specific to ABAP/4. Although you can also access
cluster databases using SQL statements, only ABAP/4 statements are able to decode the structure of the stored data cluster.
Describe the functions of the debugger screen.
- Single step(F5) - Use this option to step through the program statement by statement. This allows you to branch into subroutines and function modules, and to execute these routines step by step as well. Once a subroutine or function module has been processed, control returns to the statement following the CALL FUNCTION or PERFORM statement.
- Execute(F6)- Use this option to process a program line by line. All of the statements on the current line are processed in a single step. If you are positioned on a line that calls a subroutine and you choose Execute, the Debugger processes the whole subroutine and then moves on to the line following the subroutine call. This allows you to jump through the statements within the subroutine.

- Return(F7) - The Debugger returns from a routine to the point at which control returns to the main program. Use this option to return from a subroutine, function module, or called program to the calling program.
- Continue(F8)- Use this option to process the program up to the next dynamic or static breakpoint or up to the cursor position. If there are no more breakpoints in the program and no cursor has been set, the system exits debugging mode and executes the rest of the program normally.
- Tables - Display the contents of internal tables.
Problem:How to run a program in background?
Solution :Execute the Report In the selection screen :After filling the screen fields press F9. A screen appears requesting U to print the Background Parameters *Enter the output device(Eg HPLJ /SAP2 etc) *In the spool options Uncheck Print immedietly,Uncheck delete after output,and new spool request. Press enter. Another screen appears with heading start time .U can press start immly ,then save Now the Background job is scheduled for the given program .
To View the status of background Job,The transaction code is SM37. Execute from the resulting screen . Job overview -->From the Job list select U'r program and select Spool from the application toolbar Output Controller :List of Spool Requests Select U'r Spool request and click Display icon from the overview screen . U will be displayed with the List. Caution :See to that the list with does not exceed 255 columns ,If it exceeds the extra columns will be truncated in Background
What are presentation and application servers in SAP?
A presentation server is actually a program named Sapgui.exe. It is usually installed on a user's workstation. Application server is a set of executables that collectively interpret the ABAP/4 programs and manage the input & output for them.
In an ABAP/4 program how do you access data that exists on a presentation server v/s on an application server?
For presentation server use UPLOAD or WS_UPLOAD function modules. For application server use OPEN DATASET, READ DATASET and CLOSE DATASET commands.
Describe the syntax and function of the AUTHORITY CHECK command?
Ans :- AUTHORITY ¬ CHECK OBJECT
ID FIELD ID FIELD ... IF SY-SUBRC NE 0. The AUTHORITY-CHECK checks whether a user has the appropriate authorization to execute a particular activity.

Related Posts


No comments :

 

Aired | The content is copyrighted and may not be reproduced on other websites. | Copyright © 2009-2016 | All Rights Reserved 2016

Contact Us | About Us | Privacy Policy and Disclaimer