Your contribution can keep this blog alive!!!

Saturday, 15 June 2013

SAP-Workflow-Interview-Questions






SAP Workflow Interview Questions, this post consist of real time interview questions on SAP ABAP Workflow. These questions are really helpful for the ABAPers refer this post for more details and read this article by clicking on read more.


SAP-Workflow-Interview-Questions


SAP Workflow Interview Questions, this post consist of real time interview questions on SAP ABAP Workflow. These questions are really helpful for the ABAPers refer this post for more details.


1. ABAP Classes and Business Workflow ?

We can use ABAP classes in the definition and runtime components of SAP WebFlow Engine in the same way as object types defined in the Business object Repository (BOR). Before proceeding further we need to know where to create and maintain ABAP Classes and ABAP Interfaces.


2. What is Class Builder and its purpose?

The Class Builder allows us to create and maintain global ABAP classes and interfaces. Both of these object types, like global data types, are defined in the ABAP Repository, thus composing a central class library. Together, they form a central class library and are visible throughout the system. We can display existing classes and interfaces in the class library using the Class Browser.

We can define local classes as well as global classes. They are defined locally in programs,function groups or as auxiliary classes of global classes of the class pools. Local classes are only visible within the defining module. ABAP classes are processed using the Class Builder.


3. How to reach Class Builder?

To reach the initial screen of the Class Builder, choose Developmen t à Class Builder from the initial screen of the ABAP Workbench or enter transaction code SE24.


4. How does it integrate?

The Class Builder allows us to create Web development objects within the ABAP Workbench. We can use the Class Browser to display and maintain existing global object types from the class library. 

The diagram below illustrates the architecture of the Class Builder and the relationships between its components (including the Class Browser) From here, we can either display the contents of the class library or edit a class using the Class Editor. 

Once we have defined an object type, we can implement its methods. From the initial screen or the Class Editor, we can also access the Class Builder’s test environment. 

We can define the object types immediately after implementing the method in the ABAP Editor. It is also possible to access the test environment from the initial screen or Class Editor.


5. How to use the Class Builder?


Use the Class Builder to:

· Display an overview (in the Class Browser) of global object types and their relationships.

·Maintain existing global classes or interfaces.

·Create new global classes and interfaces.

·Implement inheritance between global classes.

·Create compound interfaces.

·Create and specify the attributes, methods, and events of global classes and interfaces.

·Define internal types in classes.

·Implement methods.

·Redefine methods.

·Maintain local auxiliary classes.

·Test classes or interfaces in a simulated run time environment.



6. What are the constraints?

We cannot define object types on the basis of graphical object modeling.



7. Note before creating global classes and interfaces:

Global classes and interfaces that we create in the Class Builder are stored in the class library and
administered by the R/3 Repository: they therefore have the same namespace as all other Repository
objects. It is therefore necessary to have naming conventions for object types and their components and to
use them uniformly within program development.


8. Naming Conventions in ABAP Objects:

The following naming convention has been conceived for use within the SAP namespace. If we do not observe the naming conventions for object types (classes and interfaces), conflicts will occur when the system creates persistent classes, since it will be unable to generate the necessary co-classes.


9. Conventions for Object Types:


Class in the class library                       CL_<class name>

Interfaces in the class library                IF_<interface name>

Local classes in programs
(recommendation)                                LCL_<class name>

Local interfaces in programs
(recommendation)                                 LIF_<interface name>



10. Conventions for Components:


Method name                                        <method name>

Events                                                  <event name>

Local type definitions within a
class (recommendation)                           TY_<type name>

Data definitions (variables)                      <variable name>

Data definitions (constants)
(recommendation)                                  CO_<constant name>



Local Conventions within Methods:

For parameters:

IMPORTING parameters                           IM_<parameter name>

EXPORTING parameters                           EX_<parameter name>

CHANGING parameters                            CH_<parameter name>

RESULT                                                     RE_<result>



11. How to create ABAP Classes that support IF_WORKFLOW interface?

· Go to transaction SE24 and create a customized class.

· Next the pop up appears where we need to mention the detail as follows:

· Save it and the class is created.

· Now the class is to implement IF_WORKFLOW interface. For this go to the tab and declare the IF_WORKFLOW as the interface there and press Enter; two sub-interfaces appear:

BI_OBJECT and BI_PERSISTENT. 

Save the Class.

· The ZCL_TEST class now contains the existing methods of IF_WORKFLOW interface.



12. Lights on Key Attributes and Attributes:

The key attributes are used to define the object key. There can also be other defined attributes other than key attributes. The SAP WebFlow Engine can access all public attributes of a class. 

Key Attributes:

In the Class Builder there is an additional column Key Attributes on the attributes tab page as shown below:

We need to check this box when we are defining any attribute as the Key Attribute.

All key fields must be character-type fields (elementary types: CHAR, NUMC) and have a defined length. The maximum length allowed for all key fields is 32 characters. 

The length of the key field for the persistent display is 32 characters.

In the case of persistent ABAP objects we can use the GUID, which is generated automatically by the object manager when an instance is created.

Attributes:

In addition to all the other data types that the Class Builder supports, we can also define attributes with reference to an object from the Business Object Repository (BOR). 

To do this,we have to use the structure SWOTOBJID as the data type. The BOR object is determined using the corresponding value.

To assign a BOR object instance to an attribute we need to use the corresponding BOR macros. Normally, this is implemented within the CONSTRUCTOR of a class.

To use the BOR macros in a class, two INCLUDES must be included.


·  Include <CNTN03>……………contains the local types


·  Include <CNTN02>……………contains the BOR macros



13) Why IF_WORKFLOW Interface?

The IF_WORKFLOW interface is necessary when using an ABAP class within the SAP WebFlow Engine. The interface contains methods that allow the object to be used within the SAP WebFlow Engine.

The SAP WebFlow Engine handles all objects generically. Objects have to be saved in the event of a context change. Therefore, it is necessary to convert object references in such a way that they can be saved persistently. Conversely, we have to be able to generate the corresponding instance of an ABAP class from the persistently saved key.


There are also a number of SAP WebFlow Engine components, for example, the Workflow Log that can display objects. In this case the object has to provide corresponding functions.


The IF_WORKFLOW interface puts a logical parenthesis round the BI_PERSISTENT (instance management) and BI_OBJECT (object behavior) interfaces. The IF_WORKFLOW interface contains the following methods:


 BI_PERSISTENT~FIND_BY_LPOR

 BI_PERSISTENT~LPOR

 BI_PERSISTENT~REFRESH

 BI_OBJECT~DEFAULT_ATTRIBUTE_VALUE

 BI_OBJECT~EXECUTE_DEFAULT_METHOD

 BI_OBJECT~RELEASE


A class that implements the IF_WORKFLOW interface can be used in any workflow. The class is automatically released for use in workflows when the interface is implemented. Therefore, we can only make compatible changes to a class after implementation (we cannot delete attributes, change types or delete methods). There is no where-used list to show which workflows the class is used in.


Internal classes of an application should not implement the IF_WORKFLOW interface, since this could mean that each method of the class is used in the workflow. Therefore, we should encapsulate the workflow functions in another class that calls the selected methods of the internal class.


Each method of the IF_WORKFLOW Interface as mentioned earlier has its distinct functionality, which is discussed below.


14. BI_PERSISTENT~FIND_BY_LPOR Method:

If we want to convert a persistent saved display of an object into an instance of the corresponding ABAP class, SAP Webflow Engine calls the BI_PERSISTENT~FIND_BY_LPOR method.

Features:

The method parameter LPOR is the persistent object reference and is of SIBFLPOR structure type. A reference of BI_PERSISTENT type is returned.

The following table shows the components of the SIBFLPOR structure:


Field                                      Description

CATID                            Describes the object type ( CL for ABAP classes)

TYPEID                          ABAP class name

INSTID                          Object key. The key is limited to 32 characters.


We can implement this method in several ways. In the case of persistent classes we can create the ABAP object instance using the generated classes. 

In the case of individual persistence management we have to implement the individual actions (such as creating an instance, performing an existence check, entering public attributes, and so on) manually within the
class.

Instance management takes place automatically in the case of persistent classes. In the case of individual persistence management we also have to carry out instance management by class.


The SAP WebFlow Engine does not provide any instance management. We must therefore implement our own instance management in the case of individual persistence management. The FIND_BY_LPOR method should always return the same instance if the following problems are to be avoided:


· Inconsistency in the data display

· Instance data being overwritten by another instance

· Locking conflicts


There is an implementation example in the CL_SWF_FORMABSENC demo class.




"You found the information helpful and want to say thanks? Your donation is enough to inspire us to do more. Thanks a bunch!"

0 comments:

Post a Comment

Note: only a member of this blog may post a comment.

Categories

ABAP Interview Questions (107) ABAP Open SQL Statements (1) ABAP Syntax Rules (6) ABAP WORKBENCH (2) ALE IDOC (6) ALE IDOC Interview Questions (6) ALV Interview Questions (4) BADI (2) BAPI (1) BAPI Interview Questions (1) BDC (6) BDC Interview Questions (6) Classical Reports Interview Question (2) Conditional Statements (1) Cross Applications (3) Data Dictionary (22) Data Type Questins (1) Data types (1) Dialog programming (5) Dialog Programming Interview Questions (4) DOMAIN Interview Questions (1) Function Module (2) IDoc Tutorials (6) Interactive Report Interview Questions (4) Internal Tables (1) Lock Object Interview Questions (1) Logical Database (1) Modularization Interview Questions (4) Module Pool Programming (5) Object Oriented ABAP (19) Object Oriented ABAP Interview Questions (15) OOABAP (9) Reports (13) Reports Interview Questions (9) RFC (1) RFC Interview Questions (1) SAP ABAP Interview Questions (36) SAP ABAP Introduction (46) SAP ABAP Message Types (2) SAP BADI Interview Questions (2) SAP Basics (68) SAP Books (2) SAP Certification (1) SAP CONSULTANTS (5) SAP CRM (1) SAP ENHANCEMENTS (3) SAP EXITS (2) SAP EXITS ( SAP ENHANCEMENTS ) Interview Questions (1) SAP Free Books (1) SAP HR (2) SAP Lock Object (1) SAP Open SQL Statements (1) SAP R/3 Architecture (4) SAP Search help (1) SAP Smartforms (1) SAP Smartforms Interview Questions (2) SAP Tables (5) SAP Tcodes (10) SAP Views (1) SAP Webdynpro ABAP (12) SAP Work Processors (2) SAP Workflow (3) Scripts (3) Scripts Interview Questions (2) Search Help Interview Questions (1) Smartforms (1) Table Maintenance Generator (1) Tables in SAP (2) Tables Interview Questions (3) Type Group Interview Questions (1) Variable Declaration (1) Views Interview Questions (1) Webdynpro (12)

Protected Blog

 
This blog is not affiliated to SAP AG |SAP is trademark of SAP AG |The information collected from various sources use information with your own risk.