Thursday, 6 February 2014

ABAP Interview Questions

SAP OOPS ABAP INTERVIEW QUESTIONS AND ANSWERS

  What is OOPS ABAP ?
  • Object orientation (OO), or to be more precise, object-oriented programming, is a problem-solving method in which the software solution reflects objects in the real world.
  • A comprehensive introduction to object orientation as a whole would go far beyond the limits of this introduction to ABAP Objects. This documentation introduces a selection of terms that are used universally in object orientation and also occur in ABAP Objects. In subsequent sections, it goes on to discuss in more detail how these terms are used in ABAP Objects. The end of this section contains a list of further reading, with a selection of titles about object orientation.
  What is the Difference between Class and Object ?
A Class is actually a blueprint or a template to create an Object. Whereas an Object is a an actual instance of a Class. For example Employee ia a class, while John is a real employee which is an Object of Employee Class.
   How polymorphism can be implemented ?
Some examples to implement polymorphism:
  1. Method Overriding
  2. Method Overloading
  3. Operator Overloading
   What is Inheritance ?
In OOPs terminology, inheritance is a way to form new classes using classes that have already been defined. Inheritance is intended to help reuse existing code with little or no modification. The new classes, known as derived classes, inherit attributes and behavior of the pre-existing classes, which are referred to as base classes.
   What is Method Overriding ?
  • Method overriding allows a subclass to override a specific implementation of a method that is already provided by one of its super classes.
  • A subclass can give its own definition of methods but need to have the same signature as the method in its super class. This means that when overriding a method the subclass's method has to have the same name and parameter list as the super class's overridden method.
   What is Method Overloading ?
Method overloading is in a class have many methods having same name but different parameter called overloading or static polymorphism
   What is Aggregation ?
Aggregation is a special form of association. Aggregation is the composition of an object out of a set of parts. For example, a car is an aggregation of engine, tyres, brakes, etc.
Aggregation represents a "Has" relationship like a car has a engine.
    What is object oriented programming language ?
Object oriented programming language allows concepts such as abstraction, modularity, encapsulation, polymorphism and inheritance. Simula is the first object oriented language. Objects are said to be the most important part of object oriented language. Concept revolves around making simulation programs around an object.
    What are the core ABAP oops concepts ?
  • Inheritance: Inheritance is the ability of an object to inherit the properties and methods of another object. This characteristic leads to the creation of families of objects (just like families exist for humans) with parent objects and child objects.
  • Polymorphism: Polymorphism is about an objects ability to provide context when methods or operators are called on the object.
    Definition: Polymorphism
In object-oriented programming, polymorphism (from the Greek meaning "having multiple forms") is the characteristic of being able to assign a different meaning to a particular symbol or "operator" in different contexts. The simple example is two classes that inherit from a common parent and implement the same virtual method.
    Definition: Encapsulation
  • Encapsulation: Encapsulation is the ability that an object has to contain and restrict the access to its members. Encapsulation is a key concept of object programming that ensures the autonomy and integrity of the objects.
  • Abstraction: Another OOPS concept related to encapsulation that is less widely used but gaining ground is abstraction.
    Definition: Abstraction
Through the process of abstraction, a programmer hides all but the relevant data about an object in order to reduce complexity and increase efficiency. In the same way that abstraction sometimes works in art, the object that remains is a representation of the original, with unwanted detail omitted. The resulting object itself can be referred to as an abstraction, meaning a named entity made up of selected attributes and behavior specific to a particular usage of the originating entity.
   What is UML ?
  • UML (Unified Modeling Language) is a standardized modeling language. It is used for the specification, construction, visualization and documentation of models for software systems and enables uniform communication between various users.
  • UML does not describe the steps in the object-oriented development process.
  • SAP uses UML as the company-wide standard for object-oriented modeling.
  • UML describes a number of different diagram types in order to represent different views of a system.
    What are the types of Objects and Classes ?
In general there are two types of Objects: Instance Object and Static Object and as such there are two types of Classes: Instance class and Static Class. Specifically when it comes to visibility, Private class, Protected class and Public classes are the types of classes one can have.
   What are the types of classes which can be created ?
  • We can create four types of classes under final and only modeled category(optional) with the private, protected, public and abstract instantiation.
  • Usual Abap Class.
  • Exception Class(With/Without messages).
  • Persistent Class.
  • Test Class(ABAP Unit).
   What are the types of classes which can be created ?
  • We can create four types of classes under final and only modeled category(optional) with the private, protected, public and abstract instantiation.
  • Usual Abap Class.
  • Exception Class(With/Without messages).
  • Persistent Class.
  • Test Class(ABAP Unit).
   What is a reference variable ?
Objects can only be created and addressed using reference variables. Reference variables allow you to create and address objects. Reference variables can be defined in classes, allowing you to access objects from within a class.
   What is a reference variable ?
Objects can only be created and addressed using reference variables. Reference variables allow you to create and address objects. Reference variables can be defined in classes, allowing you to access objects from within a class.
   What is the difference between Abstract method and a Final method ?
  • Abstract method
  • Abstract instance methods are used to specify particular interfaces for subclasses, without having to immediately provide implementation for them. Abstract methods need to be redefined and thereby implemented in the subclass (here you also need to include the corresponding redefinition statement in the DEFINITION part of the subclass). Classes with at least one abstract method are themselves abstract. Static methods and constructors cannot be abstract (they cannot be redefined).
  • Abstract (instance) methods are defined in the class, but not implemented
  • They must be redefined in subclasses.
   What is a super class ? How can it be implemented ?
A super class is a generalization of its subclasses. The subclass in turn is a specialization of its super classes.
   What is a Narrowing Cast ? How can you implement it ?
The assignment of a subclass instance to a reference variable of the type "reference to superclass" is described as a narrowing cast, because you are switching from a more detailed view to a one with less detail.
   What is a Widening Cast ?
The widening cast is, as with inheritance, the opposite of the narrowing cast: Here it is used to retrieve a class reference from an interface reference.
   What is a singleton ?
If it is to be impossible to instantiate a class more than once (for example, because it serves as a data administrator or data container), you can use the singleton concept. The class is defined with the addition CREATE PRIVATE and FINAL and instantiated using its static constructor. A public static component could then make the reference to the class available to an external user.
   What are the limitations of redefining a method ?
Inherited methods can be redefined in subclasses Redefined methods must be re-implemented in subclasses. The signature of redefined methods cannot be changed Static methods cannot be redefined. In inheritance, static components are "shared": A class shares its non-private static attributes with all its subclasses. In ABAP Objects, you can not only add new components, but also provide inherited methods with new implementations. This is known as redefinition. You can only redefine (public and protected) instance methods, other components (static methods, attributes and so on) cannot be redefined. Changes to method parameters (signature changes) are not possible.
  What are static components? What is a component selector ?
In inheritance, static components are "shared": A class shares its non-private static attributes with all its subclasses. => and -> are the component selectors used to refer.
   What are component instance ?
A component instance is a running component that can be run in parallel with other instances of the same component.
   How is Encapsulation implemented in OOPs ?
Encapsulation means that the implementation of an object is hidden from other components in the system, so that they cannot make assumptions about the internal status of the object and therefore dependencies on specific implementations do not arise.
   What are BADIs? What are BADI filters ?
BADI - Business Add Ins are enhancements to the standard version of the code of SAP.
Filter Badi- Business Add-Ins may be implemented on the basis of a filter value. If an enhancement for country-specific versions is provided for in the standard version, it is likely that different partners will want to implement this enhancement. The individual countries can create and activate their own implementation.
   What are the types of Exception classes ?
a. Global
b. Local Exceptions Class.
   Where can a protected method be accessed ?
Protected components Only visible within the class and its sub classes.
   What is a signature of a method ?
  • Methods have a parameter interface (called signature ) that enables them to receive values when they are called and pass values back to the calling program.
  • In ABAP Objects, methods can have IMPORTING, EXPORTING, CHANGING, and RETURNING parameters as well as exception parameters.
  • CLASS DEFINITION. ... METHODS: [ IMPORTING TYPE EXPORTING TYPE CHANGING TYPE RETURNING VALUE() TYPE EXCEPTIONS RAISING ]. ENDCLASS.(signature of a method). CLASS IMPLEMENTATION. METHOD . ... ENDMETHOD. ENDCLASS.
   What is a functional Method ?
Methods that have a RETURNING parameter are described as functional methods. These methods cannot have EXPORTING or CHANGING parameters, but has many (or as few) IMPORTING parameters and exceptions as required.
   What is a de-referenced variable ? What is a garbage collector ?
To go to an address before performing the operation a dereference variable is a pointer to the variable, not the variable itself. A pointer can be re-assigned any number of times while a reference cannot be reassigned after initialization. Field symbols are similar to dereference pointers. Thus, you can only access the content of the data object to which the field symbol points. (That is, field symbols use value semantics). If you want to access the content of the data object, you need to dereference the data reference first.
   Can a class be defined without a constructor ?
Yes, class can be created without any constructor. Default constructor will be created when we define a class without constructor.

SAP DATA DICTIONARY QUESTIONS:


  1. What are the layers of data description in R/3?
·            The external layer.
·            The ABAP/4 layer.
·            The database layer.
  1. Define external layer?
The external layer is the plane at which the user sees and interacts with the data, that is, the data format in the user interface.  This data format is independent of the database system used.
 
  1. Define ABAP/4 layer?
The ABAP/4 layer describes the data formats used by the ABAP/4 processor.
 
  1. Define Database layer?
      The database layer describes the data formats used in the database.
 
  1. What is a Data Class?
The Data class determines in which table space the table is stored when it is created in the database.
 
  1. What is a Size Category?
The Size category describes the probable space requirement of the table in the database.
 
  1. How many types of size categories and data classes are there?
There are five size categories (0-4) and 11 data classes only three of which are appropriate for application tables:
·        APPL0- Master data (data frequently accessed but rarely updated).
·        APPL1- Transaction data (data that is changed frequently).
·        APPL2- Organizational data (customizing data that is entered when system is configured and then rarely changed).
The other two types are:
·            USR
·            USR1 – Intended for customer’s own developments.
 
  1. What are control tables?
The values specified for the size category and data class are mapped to database-specific values via control tables.
 
  1. What is the function of the transport system and workbench organizer?
The function of the transport system and the Workbench Organizer is to manage any changes made to objects of the ABAP/4 Development Workbench and to transport these changes between different SAP systems.
 
  1. What is a table pool?
A table pool (or pool) is used to combine several logical tables in the ABAP/4 Dictionary.  The definition of a pool consists of at least two key fields and a long argument field (VARDATA).
 
  1. What are pooled tables?
These are logical tables, which must be assigned to a table pool when they are defined.  Pooled tables can be used to store control data (such as screen sequences or program parameters).
 
  1. What is a table cluster?
A table cluster combines several logical tables in the ABAP/4 Dictionary.  Several logical rows from different cluster tables are brought together in a single physical record.  The records from the cluster tables assigned to a cluster are thus stored in a single common table in the database.
 
  1. How can we access the correction and transport system?
Each time you create a new object or change an existing object in the ABAP/4 Dictionary, you branch automatically to the Workbench Organizer or correction and transport system.
 
  1. Which objects are independent transport objects?
Domains, Data elements, Tables, Technical settings for tables, Secondary indexes for transparent tables, Structures, Views, Matchcode objects, Matchcode Ids, Lock objects.
 
  1. How is conversion of data types done between ABAP/4 & DB layer?
Conversion between ABAP/4 data types and the database layer is done within the database interface.
 
  1. How is conversion of data types done between ABAP/4 & external level?
Conversion between the external layer and the ABAP/4 layer is done in the SAP dialog manager DYNP.
 
  1. What are the Data types of the external layer?
ACCP, Char, CLNT, CUKY, CURR, DATS, DESC, FLTP, INT1, INT2, INT4, LANG, LCHR, LRAW, NUMC, PREC, QUAN, RAW, TIMS, UNIT,VARC.
 
  1. What are the Data types of the ABAP/4 layer?
Possible ABAP/4 data types:
C: Character.
D: Date, format YYYYMMDD.
F: Floating-point number in DOUBLE PRECISION (8 bytes).
I: Integer.
N: Numerical character string of arbitrary length.
P: Amount of counter field (packed; implementation depends on h/w platform).
S: Time Stamp YYYYMMDDHHMMSS.
V: Character string of variable length, length is given in the first two bytes.
X: Hexadecimal (binary) storage.
 
  1. How can we set the table spaces and extent sizes?
You can specify the extent sizes and the table space (physical storage area in the database) in which a transparent table is to be stored by setting the size category and data class.
 
  1. What is the function of the correction system?
The correction system manages changes to internal system components. Such as objects of the ABAP/4 Dictionary.
 
  1. What are local objects?
Local objects (Dev class$TMP) are independent of correction and transport system.
 
  1. What is a Development class?
Related objects from the ABAP/4 repository are assigned to the same development class.  This enables you to correct and transport related objects as a unit.
 
  1. What is a data dictionary?
Data Dictionary is a central source of data in a data management system.  Its main function is to support the creation and management of data definitions.  It has details about
·            what data is contained?
·            What are the attributes of the data?
·            What is the relationship existing between the various data elements?
 
  1. What functions does a data dictionary perform?
In a data management system, the principal functions performed by the data dictionary are
·            Management of data definitions.
·            Provision of information for evaluation.
·            Support for s/w development.
·            Support form documentation.
·            Ensuring that the data definitions are flexible and up-to-date.
 
  1. What are the features of ABAP/4 Dictionary?
The most important features are:
·            Integrated to aABAP/4 Development Workbench.
·            Active in the runtime environment.
 
  1. What are the uses of the information in the Data dictionary?
The following information is directly taken from the Data dictionary:
·            Information on fields displayed with F1 help.
·            Possible entries for fields displayed with F4 help.
·            Matchcode and help views search utilities.
 
  1. What are the basic objects of the data dictionary?
·            Tables
·            Domains
·            Data elements
·            Structures
·            Foreign Keys
 
  1. What are the aggregate objects in the data dictionary?
·            Views
·            Match codes
·            Lock objects.
 
  1. In the ABAP/4 Dictionary Tables can be defined independent of the underlying database (T/F).
True.
  1. ABAP/4 Dictionary contains the Logical definition of the table.
  2. A field containing currency amounts (data type CURR) must be assigned to a reference table and a reference field. Explain.
As a reference table, a system containing all the valid currencies is assigned or any other table, which contains a field with the currency key format.  This field is called as reference field.  The assignment of the field containing currency amounts to the reference field is made at runtime.  The value in the reference field determines the currency of the amount.
 
  1. A field containing quantity amounts (data type QUAN) must be assigned to a reference table and a reference field. Explain?
As a reference table, a system table containing all the valid quantity units is assigned or any other table, which contains a field with the format or quantity units (data type UNIT).  This field is called as reference field.
The assignment of the field containing quantity amounts to the reference field is made at runtime.  The value in the reference field determines the quantity unit of the amount.
 
  1. What is the significance of Technical settings (specified while creating a table in the data dictionary)?  By specifying technical settings we can control how database tables are created in the database.  The technical settings allows us to
·            Optimize storage space requirements.
·            Table access behavior.
·            Buffering required.
·            Changes to entries logged.
 
  1. What is a Table attribute?
The table’s attributes determine who is responsible for maintaining a table and which types of access are allowed for the table.  The most important table attributes are:
·            Delivery class.
·            Table maintenance allowed.
·            Activation type.
 
  1. What is the significance of Delivery Class?
·            The delivery class controls the degree to which the SAP or the customer is responsible for table maintenance.
·            Whether SAP provides the table with or without contents.
·            Determines the table type.
·            Determines how the table behaves when it is first installed, at upgrade, when it is transported, and when a client copy is performed.
  1. What is the max. no. Of structures that can be included in a table or structure.
Nine.
 
  1. What are two methods of modifying SAP standard tables?
·            Append Structures and
·            Customizing Includes.
 
  1. What is the difference between a Substructure and an Append Structure?
·            In case of a substructure, the reference originates in the table itself, in the form of a statement include….
·            In case of an append structure, the table itself remains unchanged and the reference originates in the append structure.
 
  1. To how many tables can an append structure be assigned ?
One.
  1. If a table that is to be extended contains a long field, we cannot use append structures why?
Long fields in a table must always be located in the end, as the last field of the table.  If a table has an append structure the append line must also be on the last field of the table.
 
  1. Can we include customizing include or an append structure with Pooled or Cluster tables?
No.
  1. What are the two ways for restricting the value range for a domain?
·            By specifying fixed values.
·            By stipulating a value table.
 
  1. Structures can contain data only during the runtime of a program (T/F)
True.
  1. What are the aggregate objects in the Dictionary?
·            Views
·            Match Code.
·            Lock Object.
 
  1. What are base tables of an aggregate object?
      The tables making up an aggregate object (primary and secondary) are called aggregate object.
 
  1. The data of a view is not physically stored, but derived from one or more tables (t/f)
True.
 
  1. What are the 2 other types of Views, which are not allowed in Release 3.0?
·            Structure Views.
·            Entity Views.
 
  1. What is a Match Code?
      Match code is a tool to help us to search for data records in the system. Match Codes are an efficient and user-friendly search aid where key of a record is unknown.
 
  1. What are the two levels in defining a Match Code?
·            Match Code Object.
·            Match Code Id.
 
  1. What is the max no of match code Id’s that can be defined for one Match code object?
A match code Id is a one character ID that can be a letter or a number.
 
  1. Can we define our own Match Code ID’s for SAP Matchcodes?
Yes, the number 0 to 9 are reserved for us to create our own Match Code Ids for a SAP defined Matchcode object.
 
  1. What is an Update type with reference to a Match code ID?
If the data in one of the base tables of a matchcode ID changes, the matchcode data has to be updated.  The update type stipulates when the matchcode is to be updated and how it is to be done.  The update type also specifies which method is to be used for Building matchcodes.  You must specify the update type when you define a matchcode ID.
 
  1. Can matchcode object contain Ids with different update types?
Yes.
 
  1. What are the update types possible?
The following update types are possible:
·            Update type A: The matchcode data is updated asynchronously to database changes.
·            Update type S: The matchcode data is updated synchronously to database changes.
·            Update type P: The matchcode data is updated by the application program.
·            Update type I: Access to the matchcode data is managed using a database view.
·            Update type L: Access to the matchcode is achieved by calling a function module.
 
  1. What are the two different ways of building a match code object?
A match code can be built in two different ways:
·            Logical structure: The matchcode data is set up temporarily at the moment when the match code is accessed. (Update type I, k).
·            Physical Structure: The match code data is physically stored in a separate table in the database. (Update type A, S, P).
 
  1. What are the differences between a Database index and a match code?
·            Match code can contain fields from several tables whereas an index can contain fields from only one table.
·            Match code objects can be built on transparent tables and pooled and cluster tables.
 
  1. What is the function of a Domain?
·            A domain describes the technical settings of a table field.
·            A domain defines a value range, which sets the permissible data values for the fields, which refers to this domain.
·            A single domain can be used as basis for any number of fields that are identical in structure.
 
  1. Can you delete a domain, which is being used by data elements?
No.
  1. What are conversion routines?
·            Non-standard conversions from display format to sap internal format and vice-versa are implemented with so called conversion routines.
 
  1. What is the function of a data element?
A data element describes the role played by a domain in a technical context.  A data element contains semantic information.
 
  1. Can a domain, assigned to a data element be changed?
Yes.  We can do so by just overwriting the entry in the field domain.
 
  1. Can you delete data element, which is being used by table fields.
No.
 
  1. Can you define a field without a data element?
Yes.  If you want to specify no data element and therefore no domain for a field, you can enter data type and field length and a short text directly in the table maintenance.
 
  1. What are null values?
If the value of a field in a table is undefined or unknown, it is called a null value.
 
  1. What is the difference between a structure and a table?
Structures are constructed the almost the same way as tables, the only difference using that no database table is generated from them.
 
  1. What is a view?
A view is a logical view on one or more tables.  A view on one or more tables i.e., the data from a view is not actually physically stored instead being derived from one or more tables.
 
  1. How many types of Views are there?
·            Database View
·            Help View
·            Projection View
·            Maintenance View
 
  1. What is Locking?
When two users simultaneously attempt to access the same data record, this is synchronized by a lock mechanism.
 
  1. What is database utility?
Database utility is the interface between the ABAP/4 Dictionary and the underlying the SAP system.
 
  1. What are the basic functions of Database utility?
The basic functions of database utility are:
·            Create database objects.
·            Delete database objects.
·            Adjust database objects to changed ABAP/4 dictionary definition.
 
  1. What is Repository Info. Systems?
It is a tool with which you can make data stored in the ABAP/4 Dictionary available.

On ABAP: Did you set up a workflow ? Are you familiar with all steps for setting up a workflow ?

  • Yes.
  • Execute the Txn SWDD (Creating a new Workflow).
  • In the header of the Workflow, define the Business Object and Event you refer to for triggering the Wf.
  • Create the Steps required for your workflow(Activity).
  • Inside the Activity, Create the task and assign the Business Object and the related method for that business object.
  • Activate the Workflow.
  Have you used performance tuning? What major steps will you use for these ?
The Main Transaction Code Involved in Performance Tuning is SE30-Run Time Analysis and ST05-SQL Tracer.
  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 emp table group by deptno where deptno = 1.
  • It is used to find the number of employees present in the specified department no.
   SAP R/3 screens how will you develop a table control having 3 columns with only one editable ?
  • we can develop it by giving the code in PBO (process before output) giving table control line = 3. it will give only 3 lines and we can make 2 lines disable in screen painter options available in table control
  • Elementary search helps, Collective search help.
  • Elementary search helps defines a search path where we will define the table from which the data has to be read and the selection criteria. Through import and export parameters. Used when we gets the data rom a single table.
  • Collective search helps: Combination of elementary search helps. When we need to fetch data based on multiple selection criteria's. More than one tables are Selection from multiple tables
  • Difference between Search Helps and Match Codes
  • search help: adding f4 functionality is search help(adding help for any topic)
  • match code: adding search help for the input field is called as math code object
   Have you created database tables ?
YES , IF WE HAVE CUSTOMISED DATA TO STORE IN TABLE , WE CREATE A TABLE.
   Difference between client dependent and client independent tables ?
  • tables which can be access by all user are client independent (no mandt field in table)
  • tables which can be access by some specific user are client dependent (use mandt field in table)
   How to create client independent tables ?
  • the table in which the first field is not mandt is the client independent tables
  • mandt is the field with mandt as the data element
  • automatically client which we login is populated to mandt
   Have you created Maintenance dialog or Table Maintenance ?
At the time of creating table through, there is a check box for table maintenance allowed.So if you want to activate the table maintenance, just mark this box. Once table gets activated, u can change its contents through SM30 ot Through Table Maintenance.
   List the various advantages of SAP Business Workflow
  • Workflow provides numerous advantages to SAP users and consultants:
  • It allows consultants to create new business processes without modifying the standard SAP code.
  • Workflow ensures that the tasks are executed in the correct sequential order, involving the relevant personnel.
  • SAP Business Workflow may be run through the internet or intranet web applications via the Webflow Engine.
  • Deadline Monitoring functionality is also incorporated within SAP Workflow.
  • The timely execution of activities is guaranteed even when a number of parties (users) are involved.
  • Workflow reduces both time and expense involved in managing business activities.
  What is a work item ? How does it differ from a simple SAP office mail item ?
  • A work item is a runtime object generated by a step within a workflow. Whenever user interaction is required, the respective users are informed via work items. These work items will be received by the user in their Business Workplace inbox, or other email application such as Microsoft Outlook&rights;
  • The work item may be a user decision or a dialog form that allow you to enter data for starting a process within SAP, or a confirmation of whether a particular task may be performed. The user then chooses an appropriate option which determines the subsequent behavior of the workflow in question. There are a variety of applicable work items. Each work item has a status reflecting the stage of processing at any given point in time.
  • A work item comprises of text explaining what action needs to be taken, whom to refer to and any information pertinent to the business object involved.
  • Unlike simple SAP office mails, work items are active entities, as they determine the subsequent direction of the workflow. SAP office mails can also be deleted from the inbox without viewing them whereas a work item has to be executed to have it removed from your inbox.
   What is a background work item ? Are they displayed in the Business Workplace ?
A background work item (code B) represents tasks that do not require any user interaction. They are controlled and executed automatically by the workflow system, and do not appear in the Business Workplace. However, you may view them using the Work Item Selection Report.
  Which method is executed if space is passed for the method parameter of macro SWC_CALL_METHOD ?
The Default method of the object type is executed if a space is passed as the method parameter value. You can find the default method by viewing the applicable object using transaction SWO1 and going to menu option "Goto -> Basic Data" and clicking on the Defaults tab. The default method is located in the field "Method"
  Name the tables used for storing the event linkages ?
  • SWETYPECOU - Type Linkage Table
  • SWEINSTCOU - Instance Linkage Table

SAP Workflow Interview Questions & Answers

What are the different types of WF Agents?
1.Possible Agents
Users who are authorized to execute the task
Configured during Task definition (Org Unit, Position, User, Work Center, Role, Rule)
If a Task is configured as General Task, then all users become possible users.

2.Responsible Agents
The users to whom the work item needs to be sent.
This is set during Step definition. Note that Possible agents are defined during Task definition. (Org Unit, Position, User, Work Center, Role, Rule, Container Element)
Note: The work item recipients is determined by intersection of Possible Agents and Responsible Agents.

3.Actual Agents
Actual user who executed the dialog task

4.Excluded Agents
Users who are not supposed to execute the dialog task (even if they are in possible agents)



What are the agent determination techniques?
    Rule Resolution with responsibility: Helpful when a set of static positions are responsible for action.
    Rule resolution with Function (FM): Helpful when agents are determined dynamically from business logic.
    Rule resolution with OM: Usually used in CRM. Have not used
    Rule resolution with Function, but asynchronously: This is through a class and a method. Initially WI is created in status ready without agent. Later agent is assigned. This is suitable for agent determination having complex logic.
    Users: Rarely used.
    Role: Ex: ABAP_DEVELOPER
    OM objects (Position, Org Unit, work center)
    Expression: A container element containing the agents.

Containers
    Workflow Container:
    Task Container:

SWC_GET_CONTAINER
SWC_GET_TABLE
SWC_SET_CONTAINER
SWC_SET_TABLE

Event Container:
Method Container:
Rule Container: For resolving rules

Business Objects
    Key Fields:
    Attributes:
        Database: Automatically gets populated by system code
        Virtual: You determine the content and use SWC_SET_CONTAINER to populate
    Methods: Can be created using FM, Transaction, Report, Dialog Module, Other
        Synchronous: Finish execution before handling the control back to the task.
        Asynchronous: Return the control back immediately. Cannot have export parameters. They depend on events to return results back to the calling program.

Dialog: Something to user
Background: Cannot have messages or exceptions


What are the options to implement method of a BO?
    FM
    BAPI
    Tcode
    Dialog Module
    Report
    Other (BO program)

How to extend a BO?
Got SWO1 and enter a BO that you want to extend. Click on ‘New Subtype’ Give all the details.
Go back to SW01, enter the BO, and goto Settings Delegate.
Example:
BUS7051: Notification,
BUS1001: Material,
BUS2012: Purchase Order,
BUS1065: Employee

Various status of BO
    Modeled: Not accessible at runtime
    Implemented: Not ready to be used, Internal use only
    Released: For customer to use
    Obsolete: Don’t use anymore

 To change attribute values from methods of a BO
    SWC_GET_CONTAINER
    SWC_SET_CONTAINER

Events:
How to create Events?
        HR Tables: SWEHR2/3
        ABAP Code user Exit: SWE_EVENT_CREATE
        Change Document: SWEC
        Status management:
        Message Control:
    Event Linkage: SWE2

Subtype:
Key field cannot be created. Methods and attributes can be created.

Delegate:
    If you want to change the functionality of a method, define a sub type, redefine the method, delegate the parent business object to child object.
   
Interface
    Interface is a combination of Attributes, Methods and Events, to reduce the redundancy in definition.
    IFSAP: Common interface for all BOs. It has following methods
        Method: Display
        Method: Existence Check
        Attribute; ObjectType

Different Workflow Steps activities
    Condition:
    Multiple Conditions:
    Until Loop:
    Fork:
    Send Mail:
    Container Operations:
    Event Creator:
    Wait Event:
    Process Control

Different deadline conditions
    Requested Start: When this date is met, only then the work item will start execution, or available for taking action (dialog).
    Latest Start: When a date mentioned here is met, it can send an email, or can be modeled to do something action.
    Requested End: Same as Latest Start
    Latest End: Same as Latest Start

Important Tcodes
    Workflow Toolbox: SWUS
    Simulate Event: SWU0
    Business Object Repository: SW01
    Event Trace: SWEL (S)
    Workitems per task: SWI2_FREQ
    SWUE: Event simulate
    SWEL: Event log
    SWELS: Set event log ON
    SWE2: Linkage between Event and Workflow
    SWEHR2: Event linkage in HR
    SWU3: Workflow customizing
    SWU_OBUF: Synchronize buffers
    SWI5: Look into other user’s SBWP
   
What are the Important background Jobs for workflow?:
    SWWDHEX          For deadline monitoring
    SWWERRE           For error Monitoring
    SWEQSRV           For Event Queue Delivery
   
Workflow experience:
    What are the workflows created by you? Worked upon by you?

Function Module that creates workflow
    SAP_WAPI_START_WORKFLOW:
    SAP_WAPI_CREATE_EVENT
    SAP_WAPI_WORKITEM_RECIPIENTS
    SAP_WAPI_GET_WORKITEM_DETAIL

When a infotype action is performed, an event should trigger, and a workflow subsequently. How can I configure it?
    Answer: Tcode SWEHR2

When a infotype action is performed, an FM should trigger, and a workflow subsequently. How can I configure it?
    Answer: Tcode SWEHR2

Workflow is not triggering... what can be the reason?
    What are the different ways of triggering a workflow?
          Triggering Events, which are set up in SWE2 (generic), SWEHR2 (HR)
    SAP_WAPI_START_WORKFLOW

Workflow triggered, but it did not come to the user, why?

What are the difference between a Business Object and a Class?

How to achieve dynamic parallel processing?
    There are three ways a parallel processing can be implemented
        Dynamic parallel processing using a multi-line container element
        Fork (3 out of 5)        Work queue
    In dynamic processing the type of each entry in the table have to be of same type.
    Same task will be processed for each line of the multi-line container. It can be a dialog or background task. Deadline monitoring, binding, agent determination will be same for each work item generated To achieve, go to “Miscellaneous” in the activity, and enter the multi line container element.


How to notify a user immediately in R/3 that he has got an email?
    Mark the priority as ‘1’ Express

How can we debug a workflow?
        If it is a dialog task, you can set breakpoint in the method called by the task
        If it is a method that you want to debug, use SWO1, and create a instance of the object and debug the methods
        If it is a background task, and you are in development client, you can do the following. Create an infinite loop in the method you want to debug. Go to SM50 (processes overview) and select the relevant item, and select debug from option.

Huge number of events is getting created in a short duration of time, and thus creating a huge load on the system and making it very slow. Solution?
        Enable event queue. It will ensure that triggered events are received in a phased manner. This needs to be done while providing event linkages.

Why ‘Process Control’ is used? What are its features?
    ‘Process Control’ is used to manipulate another work item of the workflow during runtime.
    ‘Process Control’ is usually used to model the workflow when deadlines are reached. SAP offers 4 standard behaviors as part of process control.

Cancel Work item: Target WI is logically deleted. Subsequent tasks are not executed. Precondition is that Process control and the target WI have to be in different branches of the same fork.
Set Work item to obsolete: The target WI is set to complete, and processing continues in the branch processing obsolete.
Cancel Workflow: Current workflow is set to ‘Complete’. If this is the sub workflow, then the control goes to super-ordinate workflow.
Complete (terminate) Workflow: Same as above, but the branch of super-ordinate workflow which contains the current sub-workflow will not be continued.
Cancel Workflow including all callers: Same as above, but all callers also will be ‘COMPLETE’d.

What is the integration point with ESS Portal?
Tcode SWFVISU
Portal config file for UWL

What are the types of work items?
    Dialog Work item - W
    Background work item
    Workflow work item
    Work queue work item
    Missed deadline work item: When a deadline is missed a missed deadline workitem with the message appears in inbox
   
What are the different statuses of a work item?
    Waiting
    Ready
    Reserved
    Inprocess
    Executed (‘confirm end of processing’ in task definition)
    Completed
    Logically deleted
    Error
   
Difference between Asynchronous and Synchronous methods in a task
    A work item created as part of synchronous in locked until end of the method execution. But in asynchronous, work item is locked only until start of method execution.
    At least one terminating event is required for a task using Asynchronous task

What is the use of secondary methods in an Activity?
          A modal call
          Before work item executing
          After work item execution

What is the BO method called for the task which calls UWL WD screens? Why?
EXTSRV --> PROCESS

What are Programmer exits? And why are they used?

What is the use of “Advance with dialog”?
If this indicator is set for an activity, workflow system checks if the processer of current task is also a recipient for next task. If yes, then the next task will be executed immediately.

SAP ABAP interview questions: 


Important 

Question 1: What is the difference between User Exit and Function Exit?

User Exit
Customer Exit
User exit is implemented in the form of a Subroutine i.e. PERFORM xxx.
Example: INCLUDE MVF5AFZZ
à
PERFORM userexit_save_document_prepare.  
A customer exit can be implemented as:
·         Function exit
·         Screen Exit
·         Menu Exit
·         Field Exit
Example: CALL Customer function ‘xxx’
INCLUDE xxx.
You modify this include.
In case of a PERFORM, you have access to almost all the data. So you have better control, but more risk of making the system unstable.
You have access only to the importing, exporting, changing and tables parameter of the Function Module. So you have limited access to data.
User exit is considered a modification and not an enhancement.
A customer exit is considered an enhancement.
You need Access Key for User Exit.
You do not need access key.
Changes are lost in case of an upgrade.
Changes are upgrade compatible.
User exit is the earliest form of change option offered by SAP.
Customer exits came later and they overcome the shortcomings of User Exit.
No such thing is required here.
To activate a function exit, you need to create a project in SMOD and activate the project.



  
 What is the difference between RFC and BAPI?
BAPI
RFC
Just as Google offers Image/Chart/Map APIs OR Facebook offers APIs for Comment/Like, SAP offers APIs in the form of BAPIs. BAPI is a library of function modules released by SAP to the public so that they can interface with SAP.
RFC is nothing but a remote enabled function module. So if there is a Function Module in SAP system 1 on server X , it can be called from a SAP system 2 residing on server Y.
There is a Business Object Associated with a BAPI. So a BAPI has an Interface, Key Field, Attributes, Methods, and Events.
No Business Object is associated with a RFC.
Outside world (JAVA, VB, .Net or any Non SAP system) can connect to SAP using a BAPI.
Non–SAP world cannot connect to SAP using RFC.
Error or Success messages are returned in a RETURN table.
RFC does not have a return table.



Question 3:
What is the difference between SAPSCRIPT and SMARTFORM? 
SAPSCRIPT
SMARTFORM
SAPSCRIPT is client dependent.
SMARTFORM is client independent.
SAPSCRIPT does not generate any Function module.
SMARTFORM generates a Function Module when activated.
Main Window is must.
You can create a SMARTFORM without a Main Window.
SAPSCRIPT can be converted to SMARTFORMS. Use Program SF_MIGRATE.
SMARTFORMS cannot be converted to SCRIPT.
Only one Page format is possible
Multiple page formats are possible.
Such thing is not possible in SCRIPT.
You can create multiple copies of a SMARTFORM using the Copies Window.
PROTECT … ENDPROTECT command is used for Page protection.
The Protect Checkbox can be ticked for Page Protection.

The way SMARTFORM is developed and the way in which SCRIPT is developed is entirely different. Not listing down those here. That would be too much. 


Question 4:What is the difference between Call Transaction Method and the Session method ?
Session Method
Call Transaction
Session method id generally used when the data volume is huge.
Call transaction method is when the data volume is   low
Session method is slow as compared to Call transaction.
Call Transaction method is relatively faster than Session method.
SAP Database is updated when you process the sessions. You need to process the sessions separately via SM35.
SAP Database is updated during the execution of the batch input program.
Errors are automatically handled during the processing of the batch input session.
Errors should be handled in the batch input program.


Question 5: What is the difference between BDC and BAPI?

BAPI
BDC
BAPI is faster than BDC.
BDC is relatively slower than BAPI.
BAPI directly updates database.
BDC goes through all the screens as a normal user would do and hence it is slower.
No such processing options are available in BAPI.
Background and Foreground processing options are available for BDC.
BAPI would generally used for small data uploads.
BDCs would be preferred for large volumes of data upload since background processing option is available.
For processing errors, the Return Parameters for BAPI should be used.This parameter returns exception messages or success messages to the calling program.
Errors can be processed in SM35 for session method and in the batch input program for Call Transaction method.


Question 6: What is the difference between macro and subroutine?

Macro
Subroutine
Macro can be called only in the program it is defined.
Subroutine can be called from other programs also.
Macro can have maximum 9 parameters.
Can have any number of parameters.
Macro can be called only after its definition.
This is not true for Subroutine.
A macro is defined inside:
DEFINE …
….
END-OF-DEFINITION.
Subroutine is defined inside:
FORM …..
…..
ENDFORM.
Macro is used when same thing is to be done in a program a number of times.
Subroutine is used for modularization.



Question 7: What is the difference between SAP memory and ABAP memory?

SAP Memory
ABAP Memory
When you are using the SET/GET Parameter ID command, you are using the SAP Memory.
When you are using the EXPORT IMPORT Statements, you are using the ABAP Memory.
SAP Memory is User Specific.
What does this mean?
àThe data stored in SAP memory can be accesses via any session from a terminal. 
ABAP Memory is User and Transaction Specific.What does this mean?à The data stored in ABAP memory can be accessed only in one session. If you are creating another session, you cannot use ABAP memory.


Important
Question 8:
What is the difference between AT SELECTION-SCREEN and AT SELECTION-SCREEN OUTPUT?
AT SELECTION-SCREEN is the PAI of the selection screen whereas
AT SELECTION-SCREEN OUTPUT is the PBO of the selection screen.



Question 9: What is the difference between SY-INDEX and SY-TABIX?
Remember it this way
à TABIX = Table.
So when you are looping over an internal table, you use SY-TABIX.
When you use DO … ENDDO / WHILE for looping, there is no table involved.
So you use SY-INDEX.

For READ statement, SY-INDEX is used.

Question 10: What is the difference between VIEW and a TABLE?A table physically stores data.
A view does not store any data on its own. It can contain data from multiple tables and it just accesses/reads data from those tables.

Question 11:
What is the difference between Customizing and Workbench request?A workbench request is client independent whereas a Customizing request is client dependent.
Changes to development objects such as Reports, Function Modules, Data Dictionary objects etc. fall under Workbench requests.

Changes in SPRO / IMG that define system behavior fall under customizing requests.
An example would be ‘defining number ranges’ in SPRO.

In short, generally a developer would end up creating a Workbench request and a Functional Consultant would create a Customizing request.

Workbench vs Customizing work request

Question 12: What is the difference between PASS BY VALUE and PASS BY REFERENCE?These concepts are generally used for Function modules or Subroutines etc. and their meaning can be taken literally.

Say we are passing a variable lv_var:
CALL FUNCTION 'DEMO_FM'
   EXPORTING
     VAR  = lv_var.

When we PASS lv_var by VALUE , the actual value of lv_var is copied into VAR.
When we PASS lv_var by REFERENCE , the reference or the memory address of lv_var is passed to the Function module. So VAR and lv_var will refer to the same memory address and have the same value. 


Question 13: What is the difference between Master data and Transaction data?Master data is data that doesn’t change often and is always needed in the same way by business.
Ex: One time activities like creating Company Codes, Materials, Vendors, Customers etc.

Transaction data keeps on changing and deals with day to day activities carried out in business.
Transactions done by or with Customers, Vendors, and Materials etc. generate Transaction Data. So data related to Sales, Purchases, Deliveries, Invoices etc. represent transaction data

Some important transactions here for Master Data:
Material: MM01 MM02 MM03
Vendor: XK01 , XK02 , XK03
Customer: Xd01 , XD02 , XD03

Some Important transactions for Transaction data:
Purchase Order: ME21n , ME22n , ME23n
Sales Order: VA01 , VA02 , VA03
Goods Receipt: MIGO
Invoices: MIRO



Important
Question 14: What will you use SELECT SINGLE or SELECT UPTO 1 ROWS ?
What will you use SELECT SINGLE or SELECT UPTO 1 ROWS ?
There is great confusion over this in the SAP arena.
If you Google, you will see lots of results that will say SELECT SINGLE is faster and efficient than SELECT UPTO 1 ROWS.
But that is 100% incorrect.

SELECT UPTO 1 ROWS is faster than SELECT SINGLE.
If for a WHERE condition, only one record is present in DB, then both are more or less same.
However, If for a WHERE condition multiple records are present in DB, SELECT UPTO 1 ROWS will perform better than SELECT SINGLE. 

 
Question 15: What is the difference between .Include Structure and .Append structure? 
I have seen ridiculous answers for this at many places on the Web.
The true answer is this:

Let’s say you want to use the Structure X in your table Y.
With .Include X, you can include this structure in multiple tables.
With .Append X, you specify that structure X has been used in table Y and that this cannot be used in any other table now.  So you restrict structure X only to Table Y.
Important
Question 16: Can you describe the events in ABAP?

LOAD-OF-PROGRAM:
INITIALIZATION: If you want to initialize some values before selection screen is called
AT SELECTION SCREEN OUTPUT: PBO for Selection Screen
AT SELECTION SCREEN: PAI for Selection Screen
START-OF-SELECTION
END-OF-SELECTION
TOP-OF-PAGE
END-OF-PAGE

AT USER-COMMAND: When user click on say buttons in application toolbar. SY-UCOMM
AT LINE SELECTION:
Double click by user on basic list. SY-LISEL
AT PF##: When User Presses any of the Function Keys
TOP-OF-PAGE DURING LINE SELECTION


Question 17:

What events do you know in Module Pool Programming?
PBO:
you know this . If not you should know this . That's basic.
PAI: You know this. If not you should know this . That's basic.
POV: Process on Value request … i.e. when you press F4.
POH: Process on help request … i.e. when you press F1.
Question 18: Can you show multiple ALVs on a Single Screen?
Yes, there are multiple ways of doing this:
·         If you are using OOALV, you can create multiple custom containers  
   (cl_gui_custom_container)
& put an ALV control (cl_gui_alv_grid) in each of those.
·         You can even use a Splitter container control and place multiple ALVs in each of
    the split container.
·         If you are using Normal ALV, You can use the following FMS:
1.      REUSE_ALV_BLOCK_LIST_INIT
2.      REUSE_ALV_BLOCK_LIST_APPEND
3.      REUSE_ALV_BLOCK_LIST_DISPLAY
Question 19: A system has two clients 100 and 500 on the same application server. If you make changes to a SAPSCRIPT on client 100, will the changes be available in client 500?

No. SAPSCRIPT is client dependent. You will have to transport changes from client 100 to client 500. However, for SMARTFORMS, Changes will be made both for client 100 and client 500.
Question 20: There are 1000’s of IDOCs in your system and say you no longer need some of them? How will you get rid of those IDOCs?

One way is to archive the IDOCs using transaction SARA.
But what the interviewer was expecting was ‘How do you change IDoc Status’?
There are different ways of doing this:
A) Use FM IDOC_STATUS_WRITE_TO_DATABASE
B) USE FMs:
     EDI_DOCUMENT_OPEN_FOR_PROCESS and
     EDI_DOCUMENT_CLOSE_PROCESS


Question 21: What is the difference between CHAIN … ENDCHAIN and FIELD commands in Module Pool?

If you want to validate a single field in Module Pool, you use the FIELD Command.
On error, this single filed is kept open for input.

If you however want to validate multiple fields, you can use the CHAIN … ENDCHAIN command. You specify multiple fields between CHAIN and ENDCHAIN.
On error, all fields between CHAIN …… ENDCHAIN are kept open for input.



Question 22:
What are the types of Function Modules? What is an UPDATE function module?There are three types of Function Modules: Normal , RFC , UPDATE.
The aim of the Update function module is either to COMMIT all changes to database at once or to ROLLBACK all the changes. By definition, an update function module is used to bundle all the updates in your system in one LUW (logical unit of work).

This FM is called whenever COMMIT WORK statement is encountered in the calling program and the way you call it is CALL FUNCTION XXX IN UPDATE TASK. 

Have a look at FM EDI_DOCUMENT_CLOSE_PROCESS_UPD and do a where used.
This FM is used as Update FM in case you make changes to IDoc contents/status via your program.

Question 23: How is the table sorted when you do not specify field name and Ascending or Descending? On what criteria will the table be sorted? Do internal table have keys?

Yes, internal table have keys.
The default key is made up of the non-numeric fields of the table line in the order in which they occur.



Question 24: Explain what is a foreign key relationship?Explain this with the help of an example.
Let’s discuss about tables EKKO (PO header) and EKPO (PO line item).
Can you have an entry in table EKPO without having an entry in table EKKO?
In other words can you have PO line items without the PO header?

How does this happen? The answer is foreign key relationship.
So foreign keys come into picture when you define relationship between two tables.


Foreign key relationship in ABAP

 
Foreign keys are defined at field level.
Check the foreign key relation for field EBELN of table EKPO.
The check table is EKKO. This just means that whenever an entry is made in EKPO, it is checked whether the entered value for EBELN already exists in EKKO. If not, entry cannot be made to EKPO table.
 

Question 25 : What is the difference between a value table and a check table?Check table is maintained when you define foreign key relationships.
For Check table, read question above.
.
Value table is defined and maintained at a domain level.
At a domain level, you can mention allowed values in the form of:
1) Single values
2) Ranges
3) Value table
For example, have a look at domain SHKZG. Only allowed values are S and H for Debit/Credit indicator. Whenever and wherever you use this domain, the system will force you to use only these two values: S and H.

Another example is domain MATNR. For this domain the value table is MARA.
So whenever and wherever, you use this domain the system will force you to use values for MATNR in table MARA.


Question 26: How do you find BAPI?Approach1:
You can go to Transaction BAPI and then search for your desired object.
Say you want to find a BAPI for creating users in the system, in such case you can search for the ‘User’ and find the relevant BAPIs.

Approach2:
Another way is to find a Business Object. Say you want to find a BAPI for creating Material in SAP and you know the BO for Material is BUS1001006. You can go to Transaction SWO1 and enter the BO BUS1001006 in the BOR. Then have a look at the methods for this BO.
How to Find a BAPI ?



Important
Question 27: How do you find BADI?
Approach1:

Go to Class CL_EXITHANDLER in SE24 ---> Put a breakpoint in method GET_INSTANCE.Now go and execute your transaction code for which you want to find BADI.
You will find the BADI in the changing parameter exit_name:

How to find a BADI in ABAP ?

Approach 2:
Go to Tcode SE84 à Enhancements àBADIs à Definitions.
Find the package for the Tcode for which you are finding the BADI.
Enter it as shown and hit execute:


How do you find a BADI ?





Find BADI in SAP

No comments:

Post a Comment