AMAZON BEST DEALS

https://amzn.to/3Fq4ABu

Tuesday 26 January 2016

SAP ABAP Interview Questions & Answers

Interview Questions & Answers:

What types of objects can be created in the ABAP Dictionary?

Tables
Views
Data Elements
Structures
Table Types
Type Groups
Domains
Search Helps
Lock Objects

What types of tables can be created in the ABAP Dictionary?

Transparent Tables
Pooled and Clustered Tables

Which field differentiates a table from client-dependent and client-independent?

The MANDT field of the table specifies whether the table is client independent or not.

What is the difference between Pooled tables and Cluster tables?

Cluster tables and Pooled tables have many to one relationship with the underlying database.
A table pool corresponds to a table in the database in which all records from the pooled tables assigned to it are stored.
Several logical data records from different cluster tables can be stored together in one physical record in a table cluster.
  • A pooled table cannot have the name having more than 10 characters.
  • All the key fields of the pooled table must be of character data type.
  • In pooled tables, the maximum length of the key field/data fields should not exceed the length of varkey/vardata of the pool respectively.
  • In cluster table the records having the same key are stored in a single key in the cluster.
  • If there is an overflow of the data records a continuation record is created with the same table key.

What is the difference between Database tables and Views?

The Table has a physical storage of data whereas views do not have physical storage of data.
The view is derived from one or more tables which is created only with the required fields from the database table(s). It can also be created with table inner joins and specifying conditions for data retrieval.

What are the different types of Views?

  • Projection view - Just retrieves some fields from a single table.
  • Help View - This is used for search help.
  • Database View - This is inner join view of one or more tables
  • Maintenance View - Helps in creating maintaining data of the application object. The data can be distributed among several tables.

Can I use all the views in the ABAP program ?

No. You can use only projection view or database view in your ABAP program.

What is Table Maintenance Generator?

The Table Maintenance Generator is used to create table maintenance program to add, modify or delete records in the database table. This can be accessed using transaction SE54 or in SE11 using the menu Utilities->Table Maintenance Generator.

What is One step, two step in Table Maintenance Generator?

This specifies the screens to be created in the Table Maintenance Program.
Single step: Only overview screen is created i.e. the Table Maintenance Program will have only one screen where you can add, delete or edit records.
Two step: Two screens namely the overview screen and Single screen are created. The user can see the key fields in the first screen and can further go on to edit further details.

How do you activate the database table after making changes to it?

After making changes to the table, inorder to reflect the changes go to transaction SE14 and Choose Edit and then choose Activate and Adjust Database.
OR
You can directly activate it from the SE11.

In which table are the programs stored in?

The programs are stored in the table TADIR and the development class packages in TDEVC.

I have recently added a few fields to a custom table. But I don't get these fields in the table maintenance program?

You have to delete and recreate your own existing table maintenance program to see your new fields.

What is the difference between INSERT and MODIFY?

Whenever you need to create new records in the database table use INSERT. Whenever using INSERT be sure that a duplicate entry having the same values for the primary key fields are not present. Else it may throw a dump.
When you use MODIFY it makes a check for the matching key field values. If present it modifies the matching record, else it creates a new record in the database table.

How do I create index on a database table?

Go to transaction SE11, open your database table. Choose the menu, Goto->Indexes to create index. Give your index name and choose the fields of the table. Be careful, an additional index may vanish with the next upgrade or hotpackage.

What is the difference between Check Table and Value Table?

The Check Table is the dependent table to which the relationship is defined using foreign keys. The contents of the check table field are shown in the input help for the referenced field.
The Value table is the table attached to a field at the domain level, where the entry to the field can be only from the value table. They are not used in the Input Help.

What is the difference between Domain and Data Elements?

The Domain specifies the Technical attributes of the field such as the data type, length and the value range.
The data element is an elementary type defining the description/text for the field when displaying on the screen and Parameter ID.

When I create new entries in the table the field values are always in Uppercase. How do I get the data with mixed case?

The reason for this is that the Domain for the field in the table might have Lowercase checkbox unchecked. Check the Lowercase checkbox to preserve the case of your data.

What is the need of reference table and reference field in Currency/Quantity fields?

The reference table and reference field are the fields which specify the currency key or Unit of Measure. Suppose if the user specifies a currency amount say 1000$, the currency amount field would indicate the amount 1000 and the currency key indicates that the currency specified is in Dollars.

SAP ABAP- Creation Of a Table Pool and Pool Table

Creation Of a Table Pool and Pool Table

In this Tutorial, we create a Table pool first and then create/ (add a table to Table pool) a Pooled Table.  
Step 1:

 Go to transaction SE11. Go to Utilities à Other Dictionary Objects


Step 2:
Select Radio button Table pool/Cluster Give table Pool Name: ZTBL_POOL.
Then press F5 or choose Create.  

Step 3:

Then Select Radio button Table Pool. Press Enter.

Step 4:  

Then you go to maintain Poll Screen there give Short Description.

Step 5:

Then go to Technical settings.

Step 6:

In the “Maintain technical Settings” screen Provide Size category.
 





SAP ABAP - Creating a secondary index

Creating a secondary index
There are two types of indexes: Primary index and secondary index. Primary index is automatically created using the primary keys defined. 
Secondary index could be created as per the user requirement. This article discusses about creating a secondary index. 
Go to transaction SE11.
 For our demo purpose, we have considered the table ZAUTHOR. 
To know if there are any secondary indexes available, click on Goto à Indexes
 Following popup appears:


From the above screenshot, it is evident that there are no secondary indexes already created. 
Click on Create à Create Index
 Enter the name of the index. 


Fill in the details – Short description and the fields in the index.
 Save and activate. 
Now you can observe the index created above in the list now:
 Maximum number of secondary indexes we can have are 9.

SAP ABAP- Creating Search Helps (Elementary and Secondary)

Creating Search Helps (Elementary and Secondary)
Go To SE11 T-code.


Select the radio button of search help.


Provide the search help name. Select the create button. 


Select ELEMENTARY search help.


Press Enter. 
Provide the short description, the selection method.
Provide the fields.

Save it, Check It & Activate it.
Then execute it.

We can see the screen like this, and then press F4 in this page.

Then press F4 View the output like this.

This is the output for elementary search help.




The Collective Search Help is like this. 


Goto T-Code Se11.
Provide name. Select collective search help button.
Press enter.

Provide the Values

Select include search help.
Then provide search help name, which is already define by the same fields.

Then save it, activate it & execute it. 

Press F4 we can see the output like this.


Diff Between Elementary search helps & Collective search helps 

1) Elementary search helps describe a search path. The elementary search help must define where the data of the hit list should be read from (selection method), how the exchange of values between the screen template and selection method is implemented (interface of the search help) and how the online input help should be defined (online behavior of the search help).

2) Collective search helps combine several elementary search helps. Collective search help thus can offer several alternative search paths.

3) An elementary search help defines the standard flow of an input help.

4) A collective search help combines several elementary search helps. The user can thus choose one of several alternative search paths with collective search help.

5) A collective search help comprises several elementary search helps. It combines all the search paths that are meaningful for a field.

6) Both elementary search helps and other search helps can be included in a collective search help. If other collective search helps are contained in collective search help, they are expanded to the level of the elementary search helps when the input help is called.

Fundamentals of SAP ABAP Tables


Transparent
Pool
Cluster
Contain a single table. Used to store master data
They are used to hold a large number of very small tables(stores customizing data or system data)
They are used to hold data from a few number of large tables.(stores system data)
It has a one-to-one relationship with a table in the database
It has a many-to-one relationship with a table in the database
It has a many-to-one relationship with table in the database
For each transparent table there is one associated table in the database
It is stored with other pooled tables in a single table called table pool in the database
Many cluster tables are stored in a single table in the database called a table cluster
The database table has the same name, same number of fields and the fields have the same names
The database table has different name, different number of fields and fields have different names
The database table has different name, different number of fields and fields have different names
There is only a single table
Table pools contain more tables than table clusters
Contains less tables than table pools
Single table can have one or more primary key
Primary key of each table does not begin with same fields or fields
Primary key of each table begins with same fields or fields
Secondary indexes can be created
Secondary indexes cannot be created
Secondary indexes cannot be created
They can be accessed using open and native SQL
They can be accessed using open SQL only
They can be accessed using open  SQL only
USE: They are used to hold master data e.g. Table vendors or table of customers. Example of transaction data is orders placed by customers
USE: They reduce the amount of database resources needed when many small tables have to be opened at the same time
USE: They would be used when the tables have primary key in common and data in these tables are all accesses simultaneously


SAP ABAP Fundamentals


Comment: Part "working with files" moved to a new wiki
Before looking into application server and its architechture we just check where an ABAP program lies in the whole process.
Let's see the simple figure to under stand the linkage of sata base,presentation and application servers : 

ABAP applications are written in the ABAP programming language, and run within the application layer of the SAP Web Application Server.
These components are responsible for the presentation of data for users and the receiving of user entries. When web browsers are used as user interfaces, HTML pages prepared in the presentation layer are accessed by application programs through the classes and interfaces of the Internet Connection Framework (ICF), which wrap the HTML pages. The presentation in a web browser is based on Web Dynpro ABAP (MVC-based technology for creating platform-independent web-based interfaces) and also still Business Server Pages (BSP, HTML pages that incorporate server-side scripts written directly in ABAP). When you use the SAP GUI that is available in versions for MS Windows, Java and Web Browser, user interfaces are displayed in windows that are based on the (classical) dynpro technology. The layout of a dynpro can contain a set of predefined screen elements or GUI controls (wrapped by the classes of a Control Framework, CFW).
Here, application programs are executed. The application layer contains a kernel written primarily in C/C++ that serves as a platform for the application programs. The kernel of AS ABAP provides Virtual Machines for ABAP with ABAP Objects (main programming interface of AS ABAP for business applications), XSLT and ST (transformation languages for transforming ABAP data to XML and vice versa), and still JavaScript (obsolete, server-side scripting in BSPs beside ABAP).
Here, persistent data is held in a database. The database is accessed by ABAP programs through the database interface of AS ABAP that is subdivided into an Open SQL interface and a native SQL interface. Open SQL is a subset of the Structured Query Language (SQL) realized directly by ABAP statements. Native SQL are database-specific SQL instructions that are passed directly to the database system (either statically or dynamically via ADBC).
In addition to several work processes whose number and type are determined at the startup of NetWeaver AS ABAP, each ABAP application server contains a dispatcher, a gateway and the shared memory. The tasks of these components are briefly described in the following:


          
ABAP programs communicate with the database management system of the central relational database (RDBMS) and with the presentation layer. A SAP-specific graphical user interface (SAP GUI) for users logged on to a SAP System and Web browsers for Web-based applications are available to you as presentation layers.
Now, lets go through the main topic application server,ABAP. 
The Application Server ABAP (AS ABAP) allows you to program applications in ABAP. It provides the ABAP runtime environment (a virtual machine for ABAP programs), the ABAP Workbench, and an integrated change and transport system (CTS).
AS ABAP can be used either by people using user interfaces (Web Browsers or SAP GUI) or by other software components through the network. For sap gui two main protocols are used: HTTP/HTTPS/SMTP for Internet connections (controlled by the so-called Internet Communication Manager, ICM) and SAP's own Remote Function Call (RFC) protocol (via the RFC interface).
Most of the components of AS ABAP can be divided into three layers:
Presentation Layer :
Application Layer :
Persistence Layer :
we shall look into the structure of the ABAP-AS.
Ø  Structure of an ABAP Application Server
All ABAP application servers including the message server represent the application layer of the multi-tier architecture of an ABAP-based SAP System. These application servers execute ABAP applications and communicate with the presentation components, the database, and also with each other, using the message server.
The following diagram shows the structure of an ABAP application server:

 



·         Work Processes
Work processes are components that are able to execute an application (that is, one dialog step each). Each work process is linked to a memory area containing the context of the application being run. The context contains the current data for the application program. This needs to be available in each dialog step.
To link the work process and the users logged on the application server dispatcher is used.
·         Dispatcher
The dispatcher is the link between the work processes and the users logged onto the ABAP application server (that is, the SAP GUIs of these users). Its task is to receive requests for dialog steps from the SAP GUI and direct them to a free work process. In the same way, it directs screen output resulting from the dialog step back to the appropriate user.
·         Gateway
This is the interface for the communication protocols of NetWeaver AS ABAP (RFC, CPI/C). It can communicate with other ABAP application servers of the same NW AS, with other SAP Systems, or with external non-SAP systems.
·         Shared Memory
All of the work processes on an ABAP application server use a common main memory area called shared memory to save contexts or to buffer constant data locally.
The resources that all work processes use (such as programs and table contents) are contained in shared memory. Memory management in the NetWeaver AS ABAP ensures that the work processes always address the correct context, that is the data relevant to the current state of the program that is running. A mapping process projects the required context for a dialog step from shared memory into the address of the relevant work process. This reduces the actual copying to a minimum.
Ø  Advantages of this Type of Architecture
The structure of the ABAP application servers described here supports the performance and scalability of NetWeaver AS ABAP. The fixed number of work processes and dispatching of dialog steps leads to optimal memory use, since it means that certain components and the memory areas of a work process are application-independent and reusable. The fact that the individual work processes work independently makes them suitable for a multi-processor architecture.

Local buffering of data in the shared memory of the ABAP application server reduces the number of database reads required. This reduces access times for ABAP application programs considerably. For optimal use of the buffer, you can concentrate individual applications (financial accounting, logistics, human resources) into separate ABAP application server groups.

Database Connection
When you start up a NetWeaver AS ABAP, each ABAP application server registers its work processes with the database layer, and receives a single dedicated channel for each. While the NW AS is running, each work process is a user (client) of the database system (server). You cannot change the work process registration while the system is running. Neither can you reassign a database channel from one work process to another. For this reason, a work process can only make database changes within a single database logical unit of work (LUW), that is an inseparable sequence of database operations.


EARN ONLINE BY VIEWING ADDS ( WORK FROM HOME )

 YOU CAN EARN ONLINE BY VIEWING ADDS EVERY DAY Every day you will get 20 adds,you have to view those adds. For viewing those adds the compan...