42
SAP – ABAP INTERVIEW QUESTIONS Compiled By Pankaj Pravin

SAP ABAP Interview Question423351358753475

Embed Size (px)

Citation preview

Page 1: SAP ABAP Interview Question423351358753475

SAP – ABAP

INTERVIEW

QUESTIONS

TRANSACTION CODES

Compiled By Pankaj Pravin

Page 2: SAP ABAP Interview Question423351358753475

SE30 ABAP Objects Runtime AnalysisSE32 ABAP Text Element MaintenanceSE33 Context BuilderSE35 ABAP/4 Dialog ModulesSE36 Logical databasesSE37 ABAP Function ModulesSE38 ABAP EditorSE39 Splitscreen Editor: Program CompareSE40 MP: Standards Maint. and TranslationSE41 Menu PainterSE43 Maintain Area MenuSE51 Screen PainterSE52 Parameterized screenpainter callSE55 Internal table view maintenance callSE56 internal call: display table viewSE57 internal delete table view callSE61 R/3 DocumentationSE62 Industry UtilitiesSE63 Translation: Initial ScreenSE71 SAPscript formSE72 SAPscript StylesSE73 SAPscript font maintenance (revised)SE74 SAPscript format conversionSE75 SAPscript SettingsSE76 SAPscript: Form TranslationSE77 SAPscript Translation StylesSE78 SAPscript: Graphics administrationSE80 Object NavigatorSE81 Application HierarchySE82 Application HierarchySE84 R/3 Repository Information SystemSE85 ABAP/4 Repository Information SystemSE86 ABAP Repository Information SystemSE88 Development Coordination Info SystemSE89 Maintain Trees in Information SystemSE91 Maintain MessagesSE92 New SysLog Msg Maintenance as of 46ASE93 Maintain Transaction CodesSE94 Customer enhancement simulationSE95 Modification BrowserSEPS SAP Electronic Parcel ServiceSERP Reporting: Change Tree StructureSEU Repository BrowserSF01 Client-Specific File NamesSFAW Field Selection Maintenance

SCMP View / Table ComparisonSCU0 Table Analyses And ComparisonSCU1 Table Comparison - Export to TapeSCU2 Table Comparison Against TapeSCU3 Table HistorySE16 Display Table ContentSE17 Generate Table DisplaySE54 Generate table viewSM31 Table maintenance

Compiled By Pankaj Pravin

Page 3: SAP ABAP Interview Question423351358753475

SM31_OLD Old Table MaintenanceSM32 Maintain Table Parameter ID TABSM33 Display Table ParameterID TAB

IntroductionWhat is ERP? ERP is a package with the techniques and concepts for the integrated management of business as a whole, for effective use of management resources, to improve the efficiency of an enterprise. Initially, ERP was targeted for manufacturing industry mainly for planning and managing core business like production and financial market. As the growth and merits of ERP package ERP software is designed for basic process of a company from manufacturing to small shops with a target of integrating information across the company.

What is SAP R/3?Ans In 1972, five systems analysts began working nights and weekends to create standard software with realtime data processing SAP R/3 refers to Systems Application and Product for data processing Real-time having a 3 tier architecture i.e. Presentation layer, Application layer and Database layer. Their vision was to develop and market standard enterprise software which would integrate all business processes.

Facts about SAP Leading global provider of client/server business software solutions. Number one vendor of standard business application software. Fourth-largest independent software supplier in the world.

Available in 14 languages.

More than 7500 customers in over 90 countries have chosen SAP.

Why SAP?Ans

Highly configurable. Highly secure data handling. Minimize data redundancy, Maximize data consistency. Can capitalize on economic of sales like purchasing. Tight integration cross function.

Disadvantages of SAP? Ans

Expensive. Not very flexible. Difficult in customizing.

SAP Basics feature * Configuration of the SAP moduleso Transaction SPRO - this is the main tree for all the configuration.* Function Keyo F1 - Helpo F4 - Possible entries or matchcode for the field you are accessingo F5 - Selection screeno F7 - Previous screeno F8 - Next screeno F9 - Technical infoo CTRL+X - Cuto CTRL+C - Copyo CTRL+V - Paste* Navigationo /n Skip to the next record if you are processing one batch input sessiono /bend Cancel a batch input foreground processo /nend Close all R/3 sessions and logoffo /nxxx x Call the transaction xxxx in the same sessiono /o Generate a session listo /oxxx x Call the transaction xxxx in an additional session

Compiled By Pankaj Pravin

Page 4: SAP ABAP Interview Question423351358753475

o /i Delete the current sessiono /h Turn the debug mode ono /$tab Reset all buffers (for System Administrators)o /$syn c Synchronize instances buffers (for System Administrators)

In 4.x, you can have long SAP transaction code up to a maximum of 20 character

Different types of ERP ? SAP, BAAN, JD Edwards, Oracle Financials, Siebel, PeopleSoft. Among all the ERP’s most of the companies implemented or trying to implement SAP because of number of advantages over other ERP packages. Explain the concept of “Business Content” in SAP Business Information Warehouse?Business Content is a pre-configured set of role and task-relevant information models based on consistent Metadata in the SAP Business Information Warehouse. Business Content provides selected roles within a company with the information they need to carry out their tasks. These information models essentially contain roles, workbooks, queries, InfoSources, InfoCubes, key figures, characteristics, update rules and extractors for SAP R/3, mySAP.com Business Applications and other selected applications.

Why do you usually choose to implement SAP? There are number of technical reasons numbers of companies are planning to implement SAP. It’s highly configurable, highly secure data handling, min data redundancy, max data consistency, you can capitalize on economics of sales like purchasing, tight integration-cross function.

Can BW run without a SAP R/3 implementation? Certainly. You can run BW without R/3 implementation. You can use pre-defined business content in BW using your non-SAP data. Here you simply need to map the transfer structures associated with BW data sources (InfoCubes, ODS tables) to the inbound data files or use 3rd part tool to connect your flat files and other data sources and load data in BW. Several third party ETL products such as Acta, Infomatica, DataStage and others will have been certified to load data in BW.

What is IDES? International Demonstration and Education System. A sample application provided for faster learning and implementation.

What is WF and its importance? Business Work Flow: Tool for automatic control and execution of cross-application processes. This involves coordinating the persons involved, the work steps required, the data, which needs to be processed (business objects). The main advantage is reduction in throughput times and the costs involved in managing business processes. Transparency and quality are enhanced by its use.

What are presentation, application and database servers in SAP R/3? The application layer of an R/3 System is made up of the application servers and the message server. Application programs in an R/3 System are run on application servers. The application servers communicate with the presentation components, the database, and also with each other, using the message server. All the data are stored in a centralized server. This server is called database server.

What is SAP EASY ACCESS?Ans It displays a user menu that displays the option to perform tasks like creating & modifying transaction reports & web addresses.

What is SAP NetWeaver? SAP NetWeaver is SAP's integrated technology platform and is the technical foundation for all SAP applications since the SAP Business Suite. SAP NetWeaver is marketed as a service-oriented application and integration platform. SAP NetWeaver provides the development and runtime environment for SAP applications and can be used for custom development and integration with other applications and systems.

what is Web dyna pro? Web Dynpro (WD) is a proprietary web application user interface technology developed by SAP AG and exists in a Java Both have in general the same functionality, but usually one flavor is improved after the other, so temporary one flavor is more advanced than the other. Hence, the decision for one of the two flavors shall be based on organizational and business circumstances, but not on functionality. Main advantages of Web Dynpro over other technologies

typed access for design time checks, e.g. navigation links and messages are accessed via types instead of string keys like in JSF

diverse services for backend access, like aRFC, JEE and Web Service data models

integration with SAP Interactive Forms by Adobe, which are interactive PDF forms, during design (same IDE) and run time (data sharing)

Compiled By Pankaj Pravin

Page 5: SAP ABAP Interview Question423351358753475

integration with business process management and business rules management (since NetWeaver CE 7.1 EHP 1)

designed to support development big scale applications by adding multiple grouping layers on top of Java packages (DCs, SCs, products)

runs on different clients e.g. web browser, mobile device, widget engine

Main disadvantages proprietary, running only on SAP servers less flexible due to support for multiple clients (i.e. custom html is not possible). To reduce the limitations,

several measures have been taken. For example, WD supports so-called "islands" for e.g. flash applications that enrich the Web Dynpro UI element collection by rich UI elements.

Compiled By Pankaj Pravin

Page 6: SAP ABAP Interview Question423351358753475

ABAP DICTIONARY (SE11)

What is an ABAP data dictionary? ABAP/4 data dictionary describes the logical structures of the objects used in application development and shows how they are mapped to the underlying relational database in tables/views.

What are the different types of data dictionary objects? AnswerData Dictionary Objects

* Tables* Views* Domain* Data Element* Type Groups* Search Helps/Matchcode Objects* Lock objects* Structures* Table Types

What are tables?Ans It creates a structure – the table work area in a program for the database tables, views or structure

What are Foreign Keys?You can define the relationships between tables in the ABAP Dictionary by creating foreign keys.Using foreign keys, you can easily create value checks for input fields. Foreign keys can also be used to link several tables in a view or a lock object.Field Assignment in the Foreign KeyA foreign key links two tables T1 and T2 by assigning fields of table T1 to the primary key fields of table T2.Table T1 is called the foreign key table (dependent table) and table T2 the check table (referenced table). The pair of fields for the two tables must have the same data type and length. One field of the foreign key table therefore corresponds to each key field of the check table. This field is called the foreign key field.A foreign key permits you to assign data records in the foreign key table and check table. One record of the foreign key table uniquely identifies one record of the check table using the entries in the foreign key fields.Check Field and Value CheckOne of the foreign key fields is marked as the check field. This means that the foreign key relationship is maintained for this field.When an entry is made in the check field, there is a check whether the check table contains a record with the key defined by the values in the foreign key fields. If this is so, the entry is valid. Otherwise the system rejects the entry.

In this example the entry Field2 = 2 and Field4 = 2 would be rejected since T2 does not contain a record with the key Field5 = 2 and Field6 = 2.If you do not want to check against all the key fields of the check table, you can exclude fields of the foreign key table from the assignment of the fields to the check table with generic and constant foreign keys.

VariantsVariants allow you to save sets of input values for programs that you often start with the same selections. You can use them for any programs except subroutine pools

Search helpsSEARCH HELP:The input help (F4 help) is a standard function of the R/3 System. It permits the user to display a list of possible values for a screen field. A value can be directly copied to an input field by list selection.

What are all the differences between search helps and match code objects?  Match Code Matchcodes were replaced with Search Helps starting with Release 4.0. Please use search helps to assign an input help to a field. Existing matchcodes were automatically converted to search helps. A matchcode object is hereby converted to a collective search help with the same name. Each matchcode ID of the matchcode object is converted into an elementary search help with the same name and assigned to the collective search help created from the matchcode object.

Compiled By Pankaj Pravin

Page 7: SAP ABAP Interview Question423351358753475

A matchcode is a means of finding data records stored in the system. The matchcode is defined in the ABAP Dictionary in two steps: You first define the relevant tables and fields for the search in a matchcode object. A matchcode object describes the set of all possible search paths for a search string.  You then create one or more matchcode IDs for a matchcode object. A matchcode ID describes a special search path for a search string. The matchcode ID defines the fields or field combinations to be used in the search.

Search Help  With this function you can search for objects, thereby defining and linking different selection conditions for the search help. You can call this function by: - Selecting Object -> Search... () in the main menu bar of the Integration Builder - Placing the cursor on a software component version and selecting Search... () in the context menu (only in the Integration Repository) In this case the software component version is defined as the search criteria.

  What Function does data dictionary perform?Ans      Central information repository for application and system data. The ABAP Dictionary contains data definitions (metadata) that allow you to describe all of the data structures in the system (like tables, views, and data types) in one place. This eliminates redundancy.

What is the difference between data elements and domain? A: Data element      ABAP/4 Development Workbench (BC-DWB)      A data element describes the contents of a field. For example, a data element contains the F1 help texts and the key      word texts (field texts) for displaying the field on the screen.      Several table fields with identical contents can refer to the same data element.      Domain      ABAP/4 Development Workbench (BC-DWB)      A domain describes the technical attributes of a table field.      These technical attributes include the data type and the field length.      Several fields with the same technical attributes can refer to the same domain. In this case, each of these fields has      the technical attributes specified in this domain.

What are client-dependant tables and independent tables? In SAP systems we have many clients. A client independent table contains data that can be accessed from any client. Generally these tables contain SAP control data, language indicators and transaction codes. Client Dependent tables contain data which is applicable to one specific client. These tables contain data related to a particular company, for eg. structure of the company, basic commercial data etc..

How to distinguish them? All client – dep tables have the field MANDT, other don’t.

What is Primary key, foreign key ? what is primary index? secondary index? Ans: Primary index: the primary index contains key fields of a table and a pointer to non-key fields of the table. The primary index is created automatically when a table is created in database and moreover you can further define reference to the primary index which are known as Secondary index.

How many indexes can be created for a table? Ans: 9.

What is data class? Ans: The data class specifies in which table space the table is created in database.

Give few names of pooled tables in sap? Ans: A pool table has many to one relation with the table in the database. For one table in the database there are many tables in the dictionary. Tha table in the database has a diff name than in the table in the data dict, it has diff no of fields and field names are different. A pooled table is stored in the pool at the database level. A table pool is a databse table with a special struct that enables the data of many R3 tables to be stored in it. It can hold only pooled tables. 

Give few names of transparent tables? Ans: A transparent table has a one to one relataionship in the database. The table in the dictionary has the same name, same no of fields, and the fields have the same name as in the R3 table defn. A transparent tabel has application data (Master and Transaction).

Compiled By Pankaj Pravin

Page 8: SAP ABAP Interview Question423351358753475

What is a buffer and how many types? Ans: Buffer is nothing but which stores data temporarily. there are two types of buffers. they are Roll and Page areas. Pages : it stores the application data. Roll area: it stores the data of previous pages.Data areas of used programs are created in roll areas for each internal session.

What is table maintenance generator and how to create that? What is the transaction code? Ans: Table maintanence generator is nothing but  making a table available for adding records and deleting records. The transaction code used is SM30.

How to add new fields to a standard sap table? Ans:   1. Appended structures      2. Customizing tables

What are lock objects? Ans: Lock objects are nothing but which holds a data for particular field value until you remove a lock..

In Data dictionary in the table creation,What is the purpose of Technical settings. To identify the Size of the Table Created and to Set whether buffering needs to be done for the table or not.

What are the contents in technical specifications?Ans      There are five contents in Technical Settings: Data Class, Size Category, Buffering Permission, Buffering Type and Logging.

What is view? Different types of view. Explain?Ans      View - A view is a virtual table containing fields from one or more tables. A virtual table that does not contain any data, but instead provides an application-oriented view of one or more ABAP Dictionary tables.Different Types of View:1)      Maintenance2)      Database – It is on more than two tables.3)      Projection – It is only on one table.4)      Help

What are the advantages and disadvantages of using views in ABAP programming ?advantages: view is used to retrieve the data very fastly from the database tables *memory wastage is reduced *faster than joins to retrieve the data from database tables disadvantages: view is not a container,it will not hold the data *view memory is not permanent memory

How data is stored in cluster table? A cluster table conatins data from mulitple DDIC tables. It stores data as a name value pair ( varkey, vardata)

What are aggregate object?Aggregate Object – Views, Match Code and Lock objects are called aggregate objects because they are formed from several related table.

What is the difference between Table and Template? table is a dynamic and template is a static

What is the difference between Primary key and Unique Key?Ans Primary Key – It can accepts 0 value and cannot be NULL.Unique Key – It can be NULL.

What is the transaction code for Table maintenance?Ans SM30

What are the check tables and value tables?Ans Check Table: The ABAP Dictionary allows you to define relationships between tables using foreign keys . A dependent table is called a foreign key table, and the referenced table is called the check table. Each key field of the check table corresponds to a field in the foreign key table. These fields are called foreign key fields. One of the foreign key fields is designated as the check field for checking the validity of values. The key fields of the check table can serve as input help for the check field.Value Table: Prior to Release 4.0, it was possible to use the value table of a domain to provide input help. This is no longer possible, primarily because unexpected results could occur if the value table had more than one key field. It

Compiled By Pankaj Pravin

Page 9: SAP ABAP Interview Question423351358753475

was not possible to restrict the other key fields, which meant that the environment of the field was not considered, as is normal with check tables.In cases where this kind of value help was appropriate, you can reconstruct it by creating a search help for the data elements that use the domain in question, and using the value table as the selection method.Check table will be at field level checking.Value table will be at domain level checking ex: scarr table is check table for carrid.

What is the difference between tables and structures?Ans Tables:1) Data is permanently stored in tables in the database.2) Database tables are generated from them.Structure:1) It contains data temporarily during program run-time.2) No Database tables are generated from it.

What are lock objects?Ans Reason for Setting Lock: Suppose a travel agent want to book a flight. The customer wants to fly to a particular city with a certain airline on a certain day. The booking must only be possible if there are still free places on the flight. To avoid the possibility of overbooking, the database entry corresponding to the flight must be locked against access from other transactions. This ensures that one user can find out the number of free places, make the booking, and change the number of free places without the data being changed in the meantime by another transaction.The R/3 System synchronizes simultaneous access of several users to the same data records with a lock mechanism. When interactive transactions are programmed, locks are set and released by calling function modules (see Function Modules for Lock Requests). These function modules are automatically generated from the definition of lock objects in the ABAP Dictionary.Two types of Lock: Shared and Exclusive

What is the difference between a pool table and a transparent table and how they are stored at the database level?Ans Pool Table -1) Many to One Relationship.2) Table in the Dictionary has the different name, different number of fields, and the fields have the different name as in the R3 Table definition.3) It can hold only pooled tables.Transparent Table –1) One to One relationship.2) Table in the Dictionary has the same name, same number of fields, and the fields have the same name as in the R3 Table definition.3) It can hold Application data.

A table in the database in which all records from the pooled tables assigned to the table pool are stored corresponds to a table pool. The definition of a pool consists essentially of two key fields (Tabname and Varkey) and a long argument field (Vardata).Table Clusters Several logical data records from different cluster tables can be stored together in one physical record in a table cluster.A cluster key consists of a series of freely definable key fields and a field (Pageno) for distinguishing continuation records. A cluster also contains a long field (Vardata) that contains the contents of the data fields of the cluster tables for this key. If the data does not fit into the long field, continuation records are created. Control information on the structure of the data string is still written at the beginning of the Vardata field.

What are Hashed Tables?Ans Hashed 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. The response time for key access remains constant, regardless of the number of table entries. 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.

Name the tables, which is used to see all the transaction available.Ans See tables, TSTC and TSTCT for all the transaction available

What happens when a table is activated in DD?Ans When the table is activated, a physical table definition is created in the database for the table definition stored in the ABAP dictionary. The table definition is translated from the ABAP dictionary of the particular database.It is available for any insertion, modification and updation of records by any user.

Compiled By Pankaj Pravin

Page 10: SAP ABAP Interview Question423351358753475

ABAP WORKBENCH (SE38)

What is ABAP WorkBench?ABAP Workbench is a set of programs for developing enterprise resource management (ERM) applications that run in the R/3 subsystem from SAP. The latest version includes ABAP Objects, an object-oriented programming language. R/3 will also run programs written in the earlier ABAP/4 language.

What is the typical structure of an ABAP program?Ans HEADER, BODY, FOOTER.

What is the meaning of ABAP editor integrated with ABAP data dictionary?Ans ABAP Editor: Tool in the ABAP Workbench in which you enter the source code of ABAP programs and check their syntax. You can also navigate from the ABAP Editor to the other tools in the ABAP Workbench.

Compiled By Pankaj Pravin

Page 11: SAP ABAP Interview Question423351358753475

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.

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.

What are the differences between SAP memory and ABAP memory?Ans ABAP Memory is a memory area in the internal session (roll area) of an ABAP program. Data within this area is retained within a sequence of program calls, allowing you to pass data between programs that call one another. It is also possible to pass data between sessions using SAP Memory.SAP Memory is a memory area to which all sessions within a SAPgui have access. You can use SAP memory either to pass data from one program to another within a session (as with ABAP memory) or to pass data from one session to another.

What are field symbols and field groups? Have you used “component idx of structure” clause with field groups?Ans Field Symbols – They are placeholder or symbolic names for the other fields. They do not physically reserve space for a field, but point to its contents. It can point to any data objects.Field-symbolsField Groups – Field groups does not reserve storage space but contains pointers to existing fields.An extract dataset consists of a sequence of records. These records may have different structures. All records with the same structure form a record type. You must define each record type of an extract dataset as a field group, using the FIELD-GROUPS statement

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).

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

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.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.

What are ranges? What are number ranges?Ans Main function of ranges to pass data to the actual selection tables without displaying the selection screen.Min, Max values provided in selection screens.It is often necessary to directly access individual records in a data structure. This is done using unique keys. Number ranges are used to assign numbers to individual database records for a commercial object, to complete the key. Such numbers are e.g. order numbers or material master numbers.

164) Name a few system global variables you can use in ABAP programs?Ans SY-SUBRC, SY-DBCNT, SY-LILLI, SY-DATUM, SY-UZEIT, SY-UCOMM,SY-TABIX…..SY-LILLI is absolute number of lines from which the event was triggered.

How do you take care of performance issues in your ABAP programs?

Compiled By Pankaj Pravin

Page 12: SAP ABAP Interview Question423351358753475

Ans Performance of ABAP programs can be improved by minimizing the amount of data to be transferred. The data set must be transferred through the network to the applications, so reducing the amount of time and also reduces the network traffic.Some measures that can be taken are:- Use views defined in the ABAP/4 DDIC (also has the advantage of better reusability).- Use field list (SELECT clause) rather than SELECT *.- Range tables should be avoided (IN operator)- Avoid nested SELECTS.

How to find the return code of an stmt in ABAP programs?Ans Open SQL has 2 system fields with return codes:1) SY-SUBRC2) SY-DBCNT

What are the different types of ABAP statements?Ans There are six types of ABAP statements:1) Declarative - Types, Data, Tables2) Modularization - Event Keywords and Defining Keywords3) Control - If…Else, While, Case4) Call - Perform, Call, Set User Command, Submit, Leave to5) Operational - Write, Add, Move6) Database - Open SQL & Native SQL

What is runtime analysis? Have you used this?Ans It checks program execution time in microseconds. When you go to SE30. If you give desired program name in performance file. It will take you to below screen. You can get how much fast is your program.

Is ABAP a GUI language?Ans Yes, ABAP IS AN EVENT DRIVEN LANGUAGE

What are user exits? What is involved in writing them? What precautions are needed?Ans User defined functionality included to predefined SAP standards. Point in an SAP program where a customer’s own program can be called. In contrast to customer exits, user exits allow developers to access and modify program components and data objects in the standard system. On upgrade, each user exit must be checked to ensure that it conforms to the standard system.There are two types of user exit:

1. User exits that use INCLUDEs - These are customer enhancements that are called directly in the program.2. User exits that use TABLEs - These are used and managed using Customizing. Should find the customer enhancements belonging to particular development class.

2. How do you get help in ABAP?Ans HELP-SAP LIBRARY, by pressing F1 on a keyword.

What are the events used in ABAP in the order of execution?Ans Events are:1. INITIALIZATION2. AT SELECTION-SCREEN3. AT SELECTION-SCREEN ON4. START-OF-SELECTION5. TOP-OF-PAGE6. TOP-OF-PAGE DURING LINE SELECTION7. END-OF-PAGE8. END-OF-SELECTION9. AT USER-COMMAND10. AT LINE-SELECTION11. AT PF12. GET13. GET LATE.14. AT User Command

In the ‘select’ statement what is “group by”? Group by clause is used to fetch the data from the table by the specified field ex.select count (*) from emptable group by deptno where deptno = 1. It is used to find the number of employees present in the specified department no.

What are the various types of selection screen event?Ans      SELECTION-SCREEN BEGIN OF BLOCK ABC WITH FRAME TITLE T01.SELECTION-SCREEN BEGIN OF SCREEN 500 AS WINDOW.

Compiled By Pankaj Pravin

Page 13: SAP ABAP Interview Question423351358753475

CALL SELECTION-SCREEN 500 STARTING AT 10 10.

What is step-loop? Explain all the steps?Ans      A step loop is a repeated series of field-blocks in a screen. Each block can contain one or more fields, and

can extend over more than one line on the screen.Step loops as structures in a screen do not have individual names. The screen can contain more than one step-loop, but if so, you must program the LOOP…ENDLOOPs in the flow logic accordingly. The ordering of the LOOP…ENDLOOPs must exactly parallel the order of the step loops in the screen. The ordering tells the system which loop processing to apply to which loop. Step loops in a screen are ordered primarily by screen row, and secondarily by screen column.Transaction TZ61 (development class SDWA) implements a step loop version of the table you saw in transaction TZ60.Static and Dynamic Step Loops

What are the system fields? Explain?Ans      The ABAP system fields are active in all ABAP programs. They are filled by the runtime environment, and you can query their values in a program to find out particular states of the system. Although they are variables, you should not assign your own values to them, since this may overwrite information that is important for the normal running of the program. However, there are some isolated cases in which you may need to overwrite a system variable. For example, by assigning a new value to the field SY-LSIND, you can control navigation within details lists.

What are the system fields u have worked with? Explain?Ans I had worked with the following (30) system fields:1) SY-DBSYS - Central Database2) SY-HOST - Server3) SY-OPSYS - Operating System4) SY-SAPRL - SAP Release5) SY-SYSID - System Name6) SY-LANGU - User Logon Language7) SY-MANDT - Client8)SY-UNAME - Logon User Name9) SY-DATLO - Local Date10) SY-DATUM - Server Date11) SY-TIMLO - Local Time12) SY-UZEIT - Server Time13) SY-DYNNR - Screen Number14) SY-REPID - Current ABAP program15) SY-TCODE - Transaction Code16) SY-ULINE - Horizontal Line17) SY-VLINE - Vertical Line18) SY-INDEX - Number of current loop Pass19) SY-TABIX - Current line of internal table20) SY-DBCNT - Number of table entries processed21) SY-SUBRC - Return Code22) SY-UCOMM - Function Code23) SY-LINCT - Page Length of list24) SY-LINNO - Current Line25) SY-PAGNO - Current Page Number26) SY-LSIND - Index of List27) SY-MSGID - Message Class28) SY-MSGNO - Message Number29) SY-MSGTY - Message Type30) SY-SPONO - Spool number during printing

How are the date and time field values stored in SAP?Ans DD.MM.YYYY. HH:MM:SS

Are programs client dependent?Ans Yes, group of users can access these programs with a client number.

What are the different types of data types?Ans There are three types of data types:Data TypesElementary Complex ReferencesFixed Variable Structure Table Data ObjectVariable

What is Asynchronous and Synchronous Update?

Compiled By Pankaj Pravin

Page 14: SAP ABAP Interview Question423351358753475

Ans Asynchronous Update – The program does not wait for the work process to finish theupdate. Commit Work.Synchronous Update – The program wait for the work process to finish the update.Commit Work and Wait.

What are the general naming conventions of ABAP programs?Ans Should start with Y or Z.

Internal Tables

What are Internal Tables?An internal table is a temporary table stored in RAM on the application server. It is created and filled by a program during execution and is discarded when the program ends. Like a database table, an internal table consists of one or more rows with an identical structure, but unlike a database table, it cannot hold data after the program ends

Size of the internal tables? The size of the internal tables are set using the 'occurs n' clause. Here n refers to a integer number that specifies the size. Usually its given as 'occurs 0' which creates an itab with the memmory space of 8kb.

What is the basic difference internal tables and database tables? How can we differentiate by looking at the tables? Handling of internal tables The basic difference is database tables are stored in DB server and the internal tables are virtual tables these are created run time only Internal tables are created dynamically, the memory of internal tables is not permant memory, for internal tables the memory will be created in the application server and it is external memory and terminates after the program termination.  Types of internal tablesThere are three types of Internal Tables exist.1.Standard Internal Tables: These tables have a linear index and can be accessed using the index or the key. The response time is in linear relationship with number of table entries. These tables are useful when user wants to address individual table entries using the index.

Compiled By Pankaj Pravin

Page 15: SAP ABAP Interview Question423351358753475

2.Sorted Internal Tables: These tables also have an index and the key. But, the response time is in logarithmic relationship with number of table entries, since it uses binary search algorithm instead of linear search. These tables are useful when user wants the table to be sorted while additional entries have to be added.

3.Hashed Internal Tables: These tables have no index, but have the key. The response time is constant irrespective of number of table entries, since it uses a Hash algorithm. These tables are useful when user wants to access the entries with key only.

Effective ways of using Internal Tables?Create Internal table without Header.Do all the internal table operations by Creating Workarea. This would be the effecient way of coding. <br>Don't forget to CLEAR Workarea whenever it is required.

How to Eliminate duplicate entries in the internal tables?To delete all duplicate entries from a sorted internal table (e.g. just after SORT), you can use the DELETE ADJACENT DUPLICATES FROM itab statement. You can use the COMPARING adition to limit the fields that are used to test for duplicate entries e.g.SORT i_tab by matnr werks logort.DELETE ADJACENT DUPLICATES FROM itab COMPARING matnr werks.All duplicates withe same combination of matnr and werks will be deleted

How to control Internal Tables?The control breaks in an Internal Table areAt firstAt newAt end ofSumControl Levels are of 5 types :1) AT FIRST2) AT NEW3) AT END OF4) AT LAST5) ON CHANGE OF

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 DDIC LEVEL.

Explain internal table with and without header?Internal tables are of two types 1. tables with header line 2. tables without header line.

With header line. Data can be directly go to header first and will be placed in body when we used APPEND statement. It can't be used for nesting of internal tables. ex: data: itab like mara occurs 0 with header line. or itab like standard table of ekko with header line. Then itab is a internal with header line so you can use itab directly. ex: select * from itab INTO TABLE itab where matnr in p_matnr. loop at itab. write:/10 itab-fld1. ,,,,,,,,,,,,,,,,,, ,,,,,,,,,,,,,,,,,, ,,,,,,,,,,,,,,,,,, endloop.

Tables without header line: For these tables we need to create a explicit header [workarea] and doing anything for data should be through that explicit header only. ex: data: itab like mara, wa like mara. itab is a internal table without header line [only body] and wa is the explicit workarea.  for this itab when you want to populate data you have to do like this.

Compiled By Pankaj Pravin

Page 16: SAP ABAP Interview Question423351358753475

select * from mara into wa where mantr in p_matnr. append itab from wa. endselect. For accessing data of internal table loop at itab into wa. write:/10 wa-fld1, ................ ............ endloop.

SCREEN PAINTER (SE51)

What are Screen Painters?Screen Painter is an ABAP Editor tools allowed us to create dialog screen. Dialog screen usually created as a screen to catch user input. It can be accessed by tcode SE51.

Screen Painter Architecture:1. Screen AttributesDefine screen title, define its type (normal, subscreen).

2. Flow logicFlow logic control flow of program. The event block is introduced by the corresponding keyword statement, and it concludes either when the next block is introduced, or at the end of the program.There are four event blocks, each of which is introduced with the screen keyword PROCESS:PROCESS BEFORE OUTPUT....PROCESS AFTER INPUT....PROCESS ON HELP-REQUEST....PROCESS ON VALUE-REQUEST.

Flow logic structured on event, in above example we can see there are two event involved, "process before output" (PBO) and "process after input" (PAI).PBO processed before the screen is displayed. It allow us to define toolbar and title, positioning the cursor, showing and hiding fields and changing field attributes dynamically.PAI processed after user command (double click, push button). It is allow us to validate user input, and determine next process based on user command.In flow logic, we only define module name to define program flow, to create "real code", double click on module name to create it, then write program in it.

3. Layout Editor

Compiled By Pankaj Pravin

Page 17: SAP ABAP Interview Question423351358753475

We use layout editor to place screen element in screen layout. There are two modes in editing layout: Graphical and alphanumeric. Both modes offer the same functions but use different interfaces. In graphical mode, you use a drag and drop interface similar to a drawing tool. In alphanumeric mode, you use your keyboard and menus. It is easier to work in graphical mode, to toggle between this mode, in SE51 go to: Utilities->Settings: in screen painter tabs check graphical layout editor.Layout editor containing this tools:i. Element palleteOn left screen you will find list of element (textbox, label, checkbox) you can use. Drag and drog element to put it on screen.ii. Name & TextAftef put element on screen, write its name and text (in textbox, text will set default value).iii. Attributes WindowDouble click the element to display its attributes, or select it then click :Goto->Secondary window->attributes. For example, in textbox element, we can set its length, read only mode, in this window.iv. Dictionary/program field.If we want to create a field refer to field in data dictionay or field already declared in program, use this menu to create text field with the same type compared to its referral.

4. Element list.Element list shown all element in screen. We rarely use this menu, because it easier to maintain element in layout editor.

What are the events in Screen Programming?Ans There are two events in Screen Programming:1. PBO (Process Before Output) – Before the screen is displayed, the PBO event is processed.2. PAI (Process After Input) – When the user interacts with the screen, the PAI event is processed.3. POH (Process On Help) - are triggered when the user requests field help (F1). You can program the appropriate coding in the corresponding event blocks. At the end of processing, the system carries on processing the current screen.4. POV (Process On Value) - are triggered when the user requests possible values help (F4). You can program the appropriate coding in the corresponding event blocks. At the end of processing, the system carries on processing the current screen.

What are the difference between call screen and leave screen?Ans Call Screen: Calling a single screen is a special case of embedding a screen sequence. If you want to prevent the called screen from covering the current screen completely, you can use the CALL SCREEN statement with the STARTING AT and ENDING ATCALL SCREEN 1000.CALL SCREEN 1000 STARTING AT 10 10 ENDING AT 20 20.LEAVE SCREEN statement ends the current screen and calls the subsequent screen.LEAVE SCREEN.LEAVE TO SCREEN 2000.

What are differences between At selection-screen and At selection-screen output?Ans AT SELECTION-SCREEN event is triggered in the PAI of the selection screen once the ABAP runtime environment has passed all of the input data from the selection screen to the ABAP program.AT SELECTION-SCREEN OUTPUT - This event block allows you to modify the selection screen directly before it is displayed.

What are the elements of selection screen?Ans There are 5 elements of selection screen:Selection-screen include blocks Selection-screen include parametersSelection-screen include select-optionsSelection-screen include commentSelection-screen include push-button

List of Screen elements.Ans There are 13 screen elements:i. Input / output fieldsii. Text fieldsiii. Checkboxiv. Radio buttonv. Push Buttonvi. Drop down listvii. Subscreenviii. Table controlix. Tabstrip control

Compiled By Pankaj Pravin

Page 18: SAP ABAP Interview Question423351358753475

x. Custom controlxi. Boxxii. Status iconsxiii. OK_CODE fields

How many default Tab Strips are there? How to insert more Tabs in it?Ans There 2 default Tab strips. Screen painter attributes contain Tab Title, which is used to insert more tabs in tab strip.

What are different types of screen keywords?Ans There are four types of screen keywords: Module, Loop, Chain and Field.

What are screen painter? Menu painter? Gui status? ..etc.Ans dynpro - flow logic + screens.menu painter -GUI Status - It is subset of the interface elements (title bar, menu bar, standard tool bar, push buttons) used for a certain screen.The status comprises those elements that are currently needed by the transaction.

Does SAP has a GUI screen painter or not? If yes what operating systems is it available on? Ans Yes.Operating System – Windows basedScreen Painter – Alpha numeric Screen Painter

Menu PainterPurposeThe Menu Painter is one of the tools of the ABAP Workbench. You use it to design user interfaces for your ABAP programs and to define the functions that you want to use within these interfaces.

Features :ABAP programs contain a wide variety of functions which fall into different categories within the user interface. An instance of the user interface consisting of a menu bar, a standard toolbar, an application toolbar, and a function key setting, is called a GUI status. The GUI status and GUI title defines how the user interface looks and behaves in an ABAP program.

MODULARIZATION TECHNIQUES

What is an instance?Ans      When you call a function module, an instance of its function group plus its data, is loaded into the memory area of the internal session. An ABAP program can load several instances by calling function modules from different function groups.

What is Function group? Difference between function group and function module?Ans      Function Groups act as containers for Function Modules that logically belong together. Function Groups1)      These cannot be defined in a Function Module.2)      It cannot be called.3)      They are containers for Function Module.Function Modules1)      These must be defined in a Function Group.2)      It can be called from any program.3)      They are not containers for Function Group.

How to Create any functions? How to go about it?Ans Steps for creating the Functions:First Procedure:1) /nSE372) Goto3) Function Group (FG)4) Create Group5) Name of FG (ZREKHA_FG)6) Short Text7) Save

Compiled By Pankaj Pravin

Page 19: SAP ABAP Interview Question423351358753475

Local ObjectSecond Procedure1) Environment2) Inactive Object3) Function Group (ZREKHA_FG)4) Activate5) BackThird Procedure1) Name of Function Module (ZREKHA_FM)2) Create3) Write FG Name (ZREKHA_FG)4) Short Text5) SaveFourth Step:Call function ‘ZREKHA_FM’.

Function modules used in F4 help.Ans There are two types of function modules used in F4 help:1) F4IF_FIELD_VALUE_REQUEST2) F4IF_INT_TABLE_VALUE_REQUESTWhat are the exceptions in function module?Ans Exceptions: Our function module needs an exception that it can trigger if there are no entries in table SPFLI that meet the selection criterion. The exception NOT_FOUND serves this function.COMMUNICATION_FAILURE & SYSTEM_FAILURE

What are different types of attributes of Function Module?Ans There are 6 attributes of FM:1. Import2. Export3. Table4. Changing5. Source6. Exception

What are the include programs?Ans When the same sequence of statements in several programs is to be written repeatedly. They are coded in include programs (External programs) and are included in ABAP/4 programs.

What is the difference between macro and subroutine?Macros can only be used in the program the are defined in and only after the definition are expanded at compilation / generation. Subroutines (FORM) can be called from both the program they are defined in and other programs . A MACRO is more or less an abbreviation for some lines of code that are used more than once or twice. A FORM is a local subroutine (which can be called external). A FUNCTION is (more or less) a subroutine that is called external. Since debugging a MACRO is not really possible, prevent the use of them (I’ve never used them, but seen them in action). If the subroutine is used only local (called internal) use a FORM. If the subroutine is called external (used by more than one program) use a FUNCTION.

Can you call a subroutine of one program from another program?Ans Yes, only external subroutines Using ‘SUBMIT’ statement

Compiled By Pankaj Pravin

Page 20: SAP ABAP Interview Question423351358753475

BDC (Batch Data Communication)

What are Conversion & Interface programs in SAP?Ans CONVERSION: Legacy system to flat file.INTERFACE: Flat file to SAP system.What is the structure of a BDC sessions.

What is BDC?It is a type of CONVERSION in SAP. To convert Non-SaP data to SAP

Types of BDC’s?Ans There are two types of BDC’s:1) Transaction Method2) Session Method

Advantages & Disadvantages of different types of BDC’s?Ans Transaction Method:1) It is faster than session method.2) While executing, it starts from starting.Session Method:1) It is slower than transaction method.2) While executing, it does not start from starting.

How to write a BDC - how do u go about it?Ans Steps for writing BDC1) /nSE382) Declare Tables, Data (for ITAB) and Data (for BDCITAB)3) Call function ‘Upload’.4) Write code for the First Screen, Radio Button, Filename, Change Button, Second Screen, Utilities (Create Entries), Third Screen and Save.5) Call transaction ‘SE11’ using BDCITAB mode ‘A’.

Compiled By Pankaj Pravin

Page 21: SAP ABAP Interview Question423351358753475

6) Save, Check Errors, Activate and Execute.

What is a batch input session?Ans BATCH INPUT SESSION is an intermediate step between internal table and database table. Data along with the action is stored in session i.e. data for screen fields, to which screen it is passed, program name behind it, and how next screen is processed.Create session – BDC_OPEN_GROUPInsert batch input – BDC_INSERTClose session – BDC_CLOSE_GROUP

What is the alternative to batch input session?Ans Call Transaction Method & Call Dialog

A situation: An ABAP program creates a batch input session. We need to submit theprogram and the batch session in background. How to do it?Ans Go to SM36 and create background job by giving job name, job class and job steps(JOB SCHEDULING)

What are the problems in processing batch input sessions? How is batch input processdifferent from processing on line?Ans Two Problems: -1) If the user forgets to opt for keep session then the session will be automatically removed from the session queue (log remains). However, if session is processed we may delete it manually.2) If session processing fails, data will not be transferred to SAP database table.

Is Session Method, Asynchronous or Synchronous?Ans Synchronous

What are the fields in a BDC_Tab and BDCDATA Table?Ans Fields of BDC_Tab & BDCDATA Table:Sr.No Fields - Description1) Program - BDC Module pool2) Dynpro - BDC Screen Number3) Dynbegin - BDC Screen Start4) Fname - Field Name5) Fval - BDC field valueAns BDCDATA

What do you do when the system crashes in the middle of a BDC batch session?Ans We will look into the error log file (SM35). Check number of records already updated and delete them from input file and run BDC again.

What do you do with errors in BDC batch sessions?Ans We look into the list of incorrect session and process it again. To correct incorrect session, we analyze the session to determine which screen and value produced the error. For small errors in data we correct them interactively otherwise modify batch input program that has generated the session or many times even the data file.

What are the function module in BDC?Ans There are three function module in BDC:1) BDC_OPEN_GROUP2) BDC_INSERT3) BDC_CLOSE_GROUP

Write the steps to execute session method.Ans Steps for execution Session Method:1) System2) Service3) Batch Input4) Session5) Choose Session Name6) Process7) Asks for Mode (Display All Screen, Display Errors & Background)

What are the different types of mode (run code) in Call Transaction method?Ans There are three modes in Call Transaction:A – Displays All Screen

Compiled By Pankaj Pravin

Page 22: SAP ABAP Interview Question423351358753475

E – Display ErrorsN – Background Processing

Difference b/w call transaction and session. Call transaction session 1. synchronous updation only synchronous updation optional 2. errors can handled error log is created explicitely 3. faster slower 4. less amount of data more can transfer 5. updation takes place updation takes place during program execution once the session being created.

What is the difference between Upload and WS_Upload ? The diffrence between WS_Upload and Upload is when you use function Upload it prompts for a dailog box where in you need to key in the file location.Where as in case of WS_Upload you specify the file location in the function input parameters itself

If I want to execute a program only in background not in foreground is there any option for this? The sm37 transaction can be used for running a program in the background. Also in the session method while processing the session you can specify the processing type as background or foreground.

What kind of BDC programs are written ?There are five types of BDC methods available. They are 1.Batch input session 2.Call Transaction 3.Recording 4.Direct Input and 5.LSMW

How to read files and process BDCs automatically? To read file from Presentation server use Upload or GUI Upload or WS upload and to read file from Application server use Opend Dataset,Read dataset and Close dataset

In session method sy-subrc is not returned whereas in call transaction method sy-subrc is returned . what does it mean? While to transfer the data from the through if any errors occurs until the errors are the complete the data is not transfer to the SAP system. the system compulsory shows the errors. that errors are stored into the error logs (Transaction is SM35). so the session method should not return any value. In call transaction method data is directly pass to the SAP system. So its compulsory return the value. Because of the call transaction is the function. A function should return the value mandatory.

Compiled By Pankaj Pravin

Page 23: SAP ABAP Interview Question423351358753475

LSMW

LSM Workbench: What is it?The LSM Workbench is an R/3-based tool that supports You when transferring data from non-SAP systems ("Legacy Systems") to SAP systems1 once or periodically.The tool supports conversion of data of the legacy system in a convenient way. The data can then be imported into the SAP system via batch input, direct input, BAPIs or IDocs

Advantages

The main advantages of the LSM Workbench: Part of the SAP system and thus independent of individual platforms A variety of technical possibilities of data conversion: Data consistency due to standard import techniques:

Batch input Direct input BAPIs (Business Application Programming Interfaces) IDocs (Intermediate Documents)

The import technique to be used in an individual case depends on the business object. Generation of the conversion program on the basis of defined rules Clear interactive process guide Interface for data in spreadsheet format Creation of data migration objects on the basis of recorded transactions Charge-free for SAP customers and SAP partnersProject, Subproject and ObjectOn the initial screen, you can create a new project, corresponding subprojects and objects via Edit -> Create new entry. Project: An ID with a maximum of 10 characters to name your data transfer project. If you want to transfer data

from several legacy systems, you may create a project e.g. for every legacy system. Subproject: An ID with a maximum of 10 characters that is used as further structuring attribute. Object: An ID with a maximum of 10 characters to name the business object.

What is difference between BDC & LSMW?The differences between LSMW and BDC are as follows: LSMW is generally for normal SAP applications, while BDC is mainly for any customized application. LSMW provides various methods for the migration of data, namely, those of direct input, Batch input recording and IDOC. BDC however, simply makes use of recording. There are two ways of implementing BDC, the call transaction 1

Compiled By Pankaj Pravin

Page 24: SAP ABAP Interview Question423351358753475

method and the session method. In LSMW, mapping is taken care of with the help of SAP, whereas in BDC one has to provide explicit mapping directions. Coding is not very flexible in LSMW, whereas in BDC, coding is very flexible and applications can be easily customized. This is mainly because LSMW is devised specially for functional consultants who do not perform coding, while BDC is mainly made use of by technical consultants, who do perform coding

REPORTS

How many types of reports are there in SAP?

A report is a presentation of data in a specific format & organized structure.

1) Classical report2) Interactive report3) ABAP query4) LDB report5) ALV report6) SAPSCRIPT 7) SMARTFORMS

Classical Reports

What are Classical Reports? These reports consist of only one screen /list as an output. It displays data using the write statement inside a loop. They are normal reports & do not contain any sub report.

Events in Classical Report1. INITIALIZATION2. AT SELECTION-SCREEN3. START-OF-SELECTION4. END-OF-SELECTION5. TOP-OF-PAGE6. END-OF-PAGE

Clauses of Classical report LINE-SIZE LINE-COUNT MESSAGE-ID NO STANDARD PAGE HEADING

Compiled By Pankaj Pravin

Page 25: SAP ABAP Interview Question423351358753475

How do u display a data in a Detail List?Ans By using two statements:1) Top-of-page during line-selection2) At line-selection

Interactive Reports

What are Interactive Reports?Ans An output list which displays just the basic details & allow user to interact, so that a new list is populated based on user-selection. With interactive list, the user can actively control data retrieval and display during the session.

What are the commands used for interactive reports?Ans Top-of-Page during line-selection

What is PF-STATUS?Ans PF-Status is used in interactive report for enhancing the functionality. If we go to SE41, we can get menus, items and different function keys, which we are using for secondary list in interactive report.

What is the significance of HIDE?Ans Its stores the click value and display the related record in the secondary list.

Where do u code the HIDE statement?Ans In a LOOP statement

What are the events used in Interactive Reports.Ans There are three events of Interactive Reports:I. At PF(nn)II. At line-selectionIII. At user-command

Systems fields used for Interactive Lists AND ListsAns Interactive System Fields: SY-LSIND, SY-CPAGE, SY-LILLI, SY-LISEL, SY-LISTI,SY-LSTAT, SY-STACO, SY-STAROLists: SY-COLNO, SY-LINCT, SY-LINNO, SY-LINSZ, SY-PAGNO,SY-TVAR0…..SY-TVAR9, SY-WTITL

How do u move on to the next screen in interactive reporting?Ans Write code of the following:1) Top-of-Page during line-selection2) At line-selection

What is read line?Ans READ LINE and READ CURRENT LINE – These statements are used to read data from the lines of existing list levels. These statements are closely connected to the HIDE technique.

How do you validate the selection criteria of a report? And how do you display initialvalues in a selection screen?Ans The selection criteria is validated in the processing block of the AT SELECTION SCREEN event for the input values on the screen and respective messages can be sent.To display initial values in the selection screen:1) Use INITIALIZATION EVENT2) Use DEFAULT VALUE option of PARAMETERS Statement3) Use SPA/GPA Parameters (PIDs).Validate: - by using match code objects.Display :- Parameters default ‘xxx’.Select-options for spfli-carrid.Initial values in a selection screen:INITIALIZATION.DNO-LOW = 10.DNO-HIGH = 30SIGN I.OPTION NB.

Compiled By Pankaj Pravin

Page 26: SAP ABAP Interview Question423351358753475

APPEND DNO.

What is an interactive report? What is the obvious difference of such report comparedwith classical type reports?Ans An Interactive report is a dynamic drill down report that produces the list on users choice.Difference: -a) The list produced by classical report doesn’t allow user to interact with the system where as the list produced by interactive report allows the user to interact with the system.B) Once a classical report, executed user looses control where as Interactive, user has control.C) In classical report, drilling is not possible where as in interactive, drilling is possible.

ABAP QUERY

What Is SAP Queries ?Many times a need arises for SAP Users and Functional Consultants to generate quick reports without getting any ABAP coding done – time taken to complete the coding in development, transport and test it in QA system and then transport to production – is sometimes too long. In such cases, ABAP/4 query is a tool provided by SAP for generating these kind of reports. Type of Report Desired: Before starting to write an ABAP query, its advisable to decide the type of report that the user wants. ABAP query provides the following type of reports:   Basic List        Simple report    Statistics          Report containing statistical functions like Average &Percentage    Ranked List     Report written for analytical purpose 

What are the advantages and disadvantages of ABAP query tool?Ans Advantages: No programming knowledge is required.Disadvantages: Depending on the complexity of the database tables, it may not be easy for the user to select the necessary data correctly.

Is a logical database a requirement/must to write an ABAP query?Ans No, it is not must to use LDB. Apart from it, we have other options:1) Table join by Basis Table2) Direct Read of table3) Data Retrieval by Program

SAPScripts

What is SAP Script? What is the purpose of SAP Script? Difference betweenSAP Script and Report?Ans      SAP Script – It is the integrated text management system of the SAP R/3 System. Two types – PC Editor & Line Editor.Reports -  It is the way to display data fetched from database table onto screen or directly output it to a printer. Two types – Classical and Interactive.

What are the different functions used in sap script? What are the parameters used in each Function?Ans      There are three different functions used in SAP Script:

1) OPEN_FORM2) WRITE_FORM3) CLOSE_FORMParameters in Each Function:1) OPEN_FORM–

ExportingFormLanguage

2) WRITE_FORM–ExportingElementWindow

3)   CLOSE_FORM

What are standard layouts sets in the SAP Script?Ans      There are four standard layouts in the SAP Script:

1) Header

Compiled By Pankaj Pravin

Page 27: SAP ABAP Interview Question423351358753475

2) Logo3) Main Window4) Footer

Difference between UPLOAD and WS_UPLOAD?Ans      UPLOAD - File transfer with dialog from presentation server file to internal table. Data which is available in a

file on the presentation server is transferred in an internal table. ASCII & Binary files can be transferred.WS_UPLOAD - To read data from the presentation server into an internal table without a user dialog, use the function module WS_UPLOAD. The most important parameters are listed below.

What are the types of windows in SAP Script?Ans There are five Standard Layouts in SAP Script:1) Page2) Window3) Page Window4) Paragraph Format5) Character Format

What are the function modules used in a SAP Script driver program?Ans There are three functions used in SAP Script:1) OPEN_FORM2) WRITE_FORM3) CLOSE_FORM

64) Logo in SAP Script?Ans RSTXLDMC ORSteps for making and inserting Logo in SAP Script:First Procedure:1) Draw the picture2) Save it3) /nSE784) Write name & Choose Color5) Click on Import6) Browse picture7) EnterSecond Procedure1) /nSE712) Insert3) Graphics4) Click on stored on document server5) Execute6) Choose name of BMAP

If I forgot some command in SAP Script e.g.: suppress zero display - How to do find it?Ans Suppressing of entire screens is possible with this command. This command allows us to perform screen processing “in the background”. Suppressing screens is useful when we are branching to list-mode from a transaction dialog step.

Can there be more than 1 main window in SAP Script?Ans No, there cannot be more than 1 main window in SAP Script because in WRITE_FORM, it asks for the parameter Window that will create the problem.WRITE_FORM–ExportingElementWindow

What is the difference between OPEN_FORM and CLOSE_FORM?Ans OPEN_FORM – This module opens layout set printing. This function must be called up before we can work with other layout set function like WRITE_FORM.WRITE_FORM – Output text element in form window. The specified element of the layout set window entered is output. The element must be defined in the layout set.CLOSE_FORM – End layout set printing. Form printing started with OPEN_FORM is completed. Possible closing operations on the form last opened are carried out. Form printing must be completed by this function module. If this is not carried out, nothing is printed or displayed on the screen.

What are the page windows? How many main windows will be there in a page window?Ans Page Window: In this window, we define the margins for left, width, upper and height for the layout of Header, Logo, Main, & Footer.

Compiled By Pankaj Pravin

Page 28: SAP ABAP Interview Question423351358753475

How to debugg a script?Ans      Go to SE71, give layout set name, go to utilities select debugger mode on.

How many maximum sessions can be open in SAPgui?Ans      There are maximum 6 sessions open in SAPgui.

What are logical databases? What are the advantages/disadvantages of logical databases?Ans To read data from a database tables we use logical database.A logical database provides read-only access to a group of related tables to an ABAP/4 program.

What is SAP Script and layout set?Ans The tool, which is used to create layout set is called SAP Script. Layout set is a design, appearance and structure of document.

What are the ABAP commands that link to a layout set?Ans Control Commands, System Commands

What are the different elements in layout sets?Ans PAGES, Page windows, Header, Paragraph, Character String, Windows.

Can you use if then else, perform..etc statements in sap script?Ans Yes.

How do you number pages in SAP Script layout outputs?Ans & page & &next Page &

What takes most time in SAP script programming?Ans LAYOUT DESIGN AND LOGO INSERTION.

How do you use tab sets in layout sets?Ans Define paragraph with defined tabs.

How do you backup SAP Script layout sets? Can you download and upload? How?Ans SAP script backup :- In transaction SE71 goto Utilities -> Copy from client -> Give source form name, source client (000 default), Target form name.Download :- SE71, type form name -> Display -> Utilities -> form info -> List -> Save to PC file.Upload :- Create form with page, window, page window with the help of downloaded PC file. Text elements for Page windows to be copied from PC file.

LDB( Logical Database)

What is a Logical Database? Advantages & disadvantages.Ans Logical Databases are special ABAP programs that retrieve data and make it available to application programs.

Use of LDB – is used to read data from database tables by linking them to executable ABAP programs.

Advantages: - The programmer need not worry about the primary key for each table. Because Logical database knows how the different tables relate to each other, and can issue the SELECT command with proper where clause to retrieve the data.1) An easy-to-use standard user interface.2) Check functions, which check that user input is complete, correct, and plausible.3) Meaningful data selection.4) Central authorization checks for database accesses.5) Good read access performance while retaining the hierarchical data view determined by the application logic.6) No need of programming for retrieval, meaning for data selection

Disadvantages: -1) If you do not specify a logical database in the program attributes, the GET events never occur.2) There is no ENDGET command, so the code block associated with an event ends with the next event statement (such as another GET or an END-OF-SELECTION).3) 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.

What are the events used for Logical Database?Ans Two Events –1) GET - This is the most important event for executable programs that use a logical database. It occurs when the logical database has read a line from the node

Compiled By Pankaj Pravin

Page 29: SAP ABAP Interview Question423351358753475

and made it available to the program in the work area declared using the statement NODES

. The depth to which the logical database is read is determined by the GET statements2) PUT - The PUT statement directs the program flow according to the structure of the logical database.What is the difference between Get and Get Late?Ans GET - After the logical database has read an entry from the node

.GET LATE - After all of the nodes of the logical database have been processed that are below

in the database hierarchy.

If u are using Logical Databases how will u modify the selection-screen elements?Ans Select-options : dname for deptt-dname.

What is sequence of event triggered in report?Ans      There are 6 events in report:

1) Initialization2) At Selection-Screen 3) Start-of-Selection4) Get5) Get Late6) End-of-Selection7) Top-of-Page8) End-of-Page9) At Line Selection10) At User Command11) At PF (nn)

ALV Reports

What is ALV programming in ABAP? When is this grid used in ABAP?ALV is Application List viewer. Sap provides a set of ALV (ABAP LIST VIEWER) function modules which can be put into use to embellish the output of a report. This set of ALV functions is used to enhance the readability and functionality of any report output. Cases arise in sap when the output of a report contains columns extending more than 255 characters in length. In such cases, this set of ALV functions can help choose selected columns and arrange the different columns from a report output and also save different variants for report display. This is a very efficient tool for dynamically sorting and arranging the columns from a report output. The report output can contain up to 90 columns in the display with the wide array of display options.

Which call functions are used in ALV reports?The commonly used ALV functions used for this purpose are; 1. REUSE_ALV_VARIANT_DEFAULT_GET 2. REUSE_ALV_VARIANT_F4 3. REUSE_ALV_VARIANT_EXISTENCE 4. REUSE_ALV_EVENTS_GET 5. REUSE_ALV_COMMENTARY_WRITE 6. REUSE_ALV_FIELDCATALOG_MERGE 7. REUSE_ALV_LIST_DISPLAY 8. REUSE_ALV_GRID_DISPLAY 9. REUSE_ALV_POPUP_TO_SELECT

How you call this function in your report? After completion of all the data fetching from the database and append this data into an Internal Table. say I_ITAB. Then use follwing function module. CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'        EXPORTING             I_CALLBACK_PROGRAM       = 'Prog.name'             I_STRUCTURE_NAME         = 'I_ITAB'             I_DEFAULT                = 'X'             I_SAVE                   = 'A'        TABLES             T_OUTTAB                 = I_ITAB.   IF SY-SUBRC <> 0.     WRITE: 'SY-SUBRC: ', SY-SUBRC .

Compiled By Pankaj Pravin

Page 30: SAP ABAP Interview Question423351358753475

  ENDIF. ENDFORM.                    " GET_FINAL_DATA

ABAP List Viewer The common features of report are column alignment, sorting, filtering, subtotals, totals etc. To implement these, a lot of coding and logic is to be put. To avoid that we can use a concept called ABAP List Viewer (ALV).Using ALV, we can have three types of reports:1. Simple Report2. Block Report3. Hierarchical Sequential ReportThere are some function modules which will enable to produce the above reports without much effort.All the definitions of internal tables, structuresand constants are declared in a type-pool called SLIS.Simple ReportThe important function modules are: · Reuse_alv_list_display· Reuse_alv_fieldcatalog_merge· Reuse_alv_events_get· Reuse_alv_commentary_write· Reuse_alv_grid_display

A. REUSE_ALV_LIST_DISPLAY: This is the function module which prints the data.B. REUSE_ALV_FIELDCATALOG_MERGE: This function module is used to populate a fieldcatalog which is essential to display the data in ALVC . REUSE_ALV_EVENTS_GET: Returns table of possible events for a a list typeD. REUSE_ALV_COMMENTARY_WRITE : This is used in the Top-of-page event to print the headings and other comments for the list.E. REUSE_ALV_GRID_DISPLAY: A new function in 4.6 version, to display the results in grid rather than as a list.Parameters : same as reuse_alv_list_display

HIERARCHICAL REPORTSA. REUSE_ALV_HIERSEQ_LIST_DISPLAY

BLOCK REPORTThis is used to display multiple lists continuously.The important functions used in this report are:A. REUSE_ALV_BLOCK_LIST_INITB. REUSE_ALV_BLOCK_LIST_APPENDC. REUSE_ALV_BLOCK_LIST_DISPLAY D. REUSE_ALV_BLOCK_HS_LIST_APPENDA. REUSE_ALV_BLOCK_LIST_INITThis function module is used to set the default GUI status etc.B. REUSE_ALV_BLOCK_LIST_APPENDThis function module adds the data to the block.INTERNAL TABLES IN SLIS Slis_t_fieldcat_alv :This internal table contains the field attributes. This internal table can be populated automatically by using ‘REUSE_ALV_FIELDCATALOG_MERGE’.Important Attributes:a. col_pos : position of the columnb. fieldname : internal fieldnamec. tabname : internal table named. ref_fieldname : fieldname (dictionary)e. ref_tabname : table (dictionary)f. key(1) : column with key-colorg. icon(1) : iconh. hotspot(1) : hotspoti. Symbol(1) : symbolj. Checkbox(1) : checkboxk. just(1) : (R)ight (L)eft (C)entl. do_sum(1) : sum upm. no_out(1) : (O)blig. (X)no outn. outputlen : output lengtho. seltext-l : long key wordp. seltext_m : middle key word

Compiled By Pankaj Pravin

Page 31: SAP ABAP Interview Question423351358753475

q. seltext_s : short key wordr. reptext_ddic : heading(ddic)s. ddictxt(1) : (S)hort (M)iddle (L)ongt. datatype : datatypeSLIS_T_EVENT :Internal table for storing all the possible events of the ALV. This can be populated by the function module Reuse_alv_events_getThe columns are : name : name of the eventform : name of the routineSYNTAXES FOR THE ROUTINESI_CALLBACK_PF_STATUS_SET The table RT_EXTAB contains the function codes which are hidden in the standard interface.I_CALLBACK_USER_COMMAND The structure rs_selfield has the details about the current cursor position.

SMARTFORMS

What are SMARTFORMS?SAP Smart Forms is used to create and maintain forms for mass printing in SAP Systems.As output medium

SAP Smart Forms support a printer, a fax, e-mail, or the Internet (by using the generated XML output).SAP introduced SmartForms in 1998 to overcome the limitations in SAP Scripts. SmartForms are easier to

develop, maintain and transport than SAP Script.

Advanatges of Smart Forms They  help adapting forms without any programming knowledge due to entirely graphical user interface

When activating the smart form the system automatically generates the function module and at the runtime To make any changes we have to use the Drag & Drop, Cut & Paste. These actions do not include writing

of coding lines or using a script language. We can insert static and dynamic tables. These include the line feeds in the individual table cells,

triggering events for table headings and subtotals and sorting data before output. The smart forms allow the user to include graphics, which can be displayed as a part of the form or as

background graphics. During printout the user can suppress the background graphic as and when necessary.

Web Publishing is possible using the generated XML output

Difference b/w smartforms and scripts. Script Smartforms client dependant independant not possible multiple page formats are possible compulsory without main window it can labels are used labels cannot not generated once session created function module

Screens in SMARTFORMSThe screen is divided into three sections-Navigation window consist of nodes and sub nodes. They contain all the elements (text, window etc) that belong to sap formsMaintenance window shows attributes of the elements Form printer window shows the layout of the page Whenever we create smart forms, SAP creates/generates a function module.Unlike SAPscripts , SAP FORMS allow you to change language.In the navigation window  you will findGlobal Data Declarations : The Data defined here can be used throughout the smartform for coding purposes.Form Interface : Here all the data which will be passed to the smartform from the Print program is defined.Right-Clicking on the Pages will allow creation of New Page, Window, Graphic or Address.Printing will take place on the basis of ‘next page’ field.But processing will happen as per the sequence in navigation window!

Compiled By Pankaj Pravin

Page 32: SAP ABAP Interview Question423351358753475

Miscellaneous

Why did u switch to SAP?Ans While pursuing BE I have gone thru a deep study about software market in world. I have found that the future of any software lies in the fact that how it can intergrate with other technologies. Bcos integration is the only process which drives the business in the future. And SAP has the power to integrate people, process and information in an efficient manner. I have also found that more and more companies are implementing SAP to run their enterprise business. More opportunities are rising in ERP Sector.

What will you code in START-OF-SELECTION & END-OF-SELECTON & why?Ans START-OF-SELECTIONSELECT * FROM DEPTT INTO CORRESPONDING FIELDS OF ITABWHERE DEPTNO IN DEPTNO.APPEND ITAB.ENDSELECT.LOOP AT ITAB.WRITE : / 10 ITAB-DEPTNO.HIDE : ITAB-DEPTNO.ENDLOOP.END-OF-SELECTION

What are joins and different types joins?Ans There are four types of Joins:1) Self Join2) Inner Join3) Outer Join4) Equi Join

Which is the default join?Ans INNER JOIN

What are Extracts?Ans Extracts are dynamic sequential datasets in which different lines can have different structures. We can access the individual records in an extract dataset using a LOOP.

What is get cursor field?Ans GET CURSOR statement transfers the name of the screen element on which the cursor is positioned during a user action into the variable .GET CURSOR FIELD [OFFSET ] [LINE] [VALUE ] LENGTH ].

What are select options and what is the diff from parameters? ANS:-select options provide ranges where as parameters do not.

SELECT-OPTIONS declares an internal table which is automatically filled with values or ranges of values entered by the end user. For each SELECT-OPTIONS , the system creates a selection table.

SELECT-OPTIONS <SEL> FOR <field>.

A selection table is an internal table with fields SIGN, OPTION, LOW and HIGH. The type of LOW and HIGH is the same as that of <field>. The SIGN field can take the following values: I Inclusive (should apply) E Exclusive (should not apply)The OPTION field can take the following values: EQ Equal GT Greater than NE Not equal BT Between LE Less than or equal NB Not between LT Less than CP Contains pattern GE Greater than or equal NP No pattern.diff:-PARAMETERS allow users to enter a single value into an internal field within a report. SELECT-OPTIONS allow users to fill an internal table with a range of values.

For each PARAMETERS or SELECT-OPTIONS statement you should define text elements by choosing Goto - Text elements - Selection texts - Change.

Compiled By Pankaj Pravin

Page 33: SAP ABAP Interview Question423351358753475

Eg:- Parameters name(30).when the user executes the ABAP/4 program,an input field for 'name' will appear on the selection screen.You can change the comments on the left side of the input fields by using text elements as described in Selection Texts.

What is the inside concept in select-options?Ans Select-options specify are displayed on the selection screen for the user to enter values.Different Properties of Select-options:1) Visible Length2) Matchcode Object3) Memory ID4) Lowercase5) Obligatory6) No Display7) Modify IDWhat is the difference between Free and Refresh?Ans Free - You can use FREE to initialize an internal table and release its memory space without first using the REFRESH or CLEAR statement. Like REFRESH, FREE works on the table body, not on the table work area. After a FREE statement, you can address the internal table again. It still occupies the amount of memory required for its header (currently 256 bytes). When you refill the table, the system has to allocate new memory space to the lines.Refresh - This always applies to the body of the table. As with the CLEAR statement, the memory used by the table before you initialized it remains allocated. To release the memory space, use the statementCan we have more than one selection-screen and how?Ans Yes, we can have more than one selection screen.Selection-screen begin of block honey with frame title text-101.Select-options : deptno for zrekha_deptt-deptno.Selection-screen end of block honey.Selection-screen begin of block honey1 with frame title text-102.Select-options : dname for zrekha_deptt-dname.Selection-screen end of block honey1.

How to declare select-option as a parameter?Ans SELECT-OPTIONS: specify are displayed on the selection screen for the user to enter values.Select-options: dname for dept-dname No Extensions No Intervals.

160) What is CTS and what do you know about it?Ans CTS stands for Correction and Transport System. The CTS provides a range of functions that help you to choose a transport strategy optimally suited to your requirements. We recommend that you follow the transport strategy while you plan and set up your system landscape.Correction and Transport System (CTS) is a tool that helps you to organize development projects in the ABAP Workbench and in Customizing, and then transport the changes between the SAP Systems and clients in your system landscape. This documentation provides you with an overview of how to manage changes with the CTS and essential information on setting up your system and client landscape and deciding on a transport strategy. Read and follow this documentation when planning your development project. For practical information on working with the Correction and Transport System, see Correction and Transport Organizer and Transport Management System.

write syntax for Message Error (Report)?Ans AT SELECTION-SCREEN.SELECT * FROM ZREKHA_DEPTT INTO CORRESPONDING FIELDS OF ITABWHERE DEPTNO IN DEPTNO.ENDSELECT.If SY-DBCNT = 0.MESSAGE E000 WITH ‘NO RECORDS FOUND’.ENDIF.

How can I copy a standard table to make my own Z_TABLE?Ans Go to transaction SE11. Then there is one option to copy table. Press that button. Enter the name of the standard table and in the Target table enter Z_table name and press enter.

What is the table, which contain the details of all the name of the programs and forms?Ans Table contains vertical and horizontal lines. We can store the data in table as blocks. We can scroll depends upon your wish. And these all are stored in database (data dictionary).

What are IDOCs?Ans IDOCs are intermediate documents to hold the messages as a container.

.

Compiled By Pankaj Pravin

Page 34: SAP ABAP Interview Question423351358753475

Common Tables used by SAP MM

Below are few important Common Tables used in Materials Management Modules:

EINA Purchasing Info Record- General Data EINE Purchasing Info Record- Purchasing Organization Data MAKT Material Descriptions MARA General Material Data MARC Plant Data for Material MARD Storage Location Data for Material MAST Material to BOM Link MBEW Material Valuation MKPF Header- Material Document MSEG Document Segment- Material MVER Material Consumption MVKE Sales Data for materials RKPF Document Header- Reservation T023 Mat. groups T024 Purchasing Groups T156 Movement Type T157H Help Texts for Movement Types MOFF Lists what views have not been created A501 Plant/Material EBAN Purchase Requisition EBKN Purchase Requisition Account Assignment EKAB Release Documentation EKBE History per Purchasing Document EKET Scheduling Agreement Schedule Lines EKKN Account Assignment in Purchasing Document EKKO Purchasing Document Header EKPO Purchasing Document Item IKPF Header- Physical Inventory Document ISEG Physical Inventory Document Items LFA1 Vendor Master (General section) LFB1 Vendor Master (Company Code) NRIV Number range intervals RESB Reservation/dependent requirements T161T Texts for Purchasing Document Types 

Following are the list of Important MM tables. Please check if its useful.

Inventory Management:|-------------------------+--------+--------------------------------------------------||                         | Table  | Description                             ||-------------------------+--------+--------------------------------------------------|| Material                | MSEG   | Material document / transaction details || Document/Movements     | MKPF   | Material document header information  ||-------------------------+--------+--------------------------------------------------|| Material Stock Balances | MARD   | Material stock                          ||                         | MBEW   | Material stock with valuation           ||-------------------------+--------+--------------------------------------------------|| Sales Order Stock       | MSKA   | Stock balance with associated sales     ||                         |        | order data                              ||-------------------------+--------+-----------------------------------------|| Stock Transport         | EKUB   | Index for Stock Transport Orders for    ||                         | MDUB   | Material                                ||                         |        | Reading View of Stock Transport Ord. for||                         |        | Release Ord.                            ||-------------------------+--------+-----------------------------------------|

Compiled By Pankaj Pravin

Page 35: SAP ABAP Interview Question423351358753475

| Special Stocks          | MKOL   | Consignment, material provided to       ||                         |        | vendor, etc.                            ||-------------------------+--------+-----------------------------------------|

Material Master Data:|-------------------------+---------+--------------------------------------||                         |Table    | Description                           ||-------------------------+---------+--------------------------------------|| Materials               | MARA    | General Data, material type, group,  ||                         |         | configurable & batch ind.            ||                         | MAKT    | Short Texts, descriptions            ||                         | MARM    | Conversion Factors                   ||                         | MVKE    | Sales Org, distribution channel      ||                         | MLAN    | Sales data, tax indicator, tax       ||                         | MARC    | classification                       ||                         | MBEW    | Plant Planning Data                  ||                         | MLGN    | Valuation Data                       ||                         | MLGT    | Warehouse Management Inventory Data  ||                         | MVER    | Warehouse Management Storage Type    ||                         | MAPR    | Data                                 ||                         | MARD    | Consumption Data                     ||                         | MCHA    | Pointer for Forecast Data            ||                         | MCHB    | Storage location data with stock     ||                         |         | balances                             ||                         |         | Batches                              ||                         |         | Batch Stocks                         ||-------------------------+---------+--------------------------------------|

Compiled By Pankaj Pravin