Differences

 Differences


SAP BDC

SAP BDC stands for Batch Data Communication, is an application interface framework, used to process batch input sessions resulting into batch data transfer. They are also simply called Batch Input.

Batch input sessions enter data non-interactively into an SAP system.  Batch input is typically used to transfer data from non-SAP systems to SAP systems or to transfer data between SAP systems. 

SAP BAPI

SAP BAPI stands for Business Application Programming Interface, are RFC function modules that enables external applications to access, process, migrate and store data in SAP. External applications mainly communicate with SAP using HTTP gateway.

SAP OData

SAP OData is a web gateway that converts SAP business data into a REST API. This REST API is capable of performing Create, Read, Update and Delete (CRUD) operations using HTTP gateway.

Difference between SAP BDC, BAPI and OData

SAP BDCSAP BAPISAP OData
BDC is the old method of moving legacy data to SAP.BAPI is the new Interface based system for data manipulation.SAP OData is an open source based API tool to perform activities over SAP data.
BDC is transaction oriented, hence where transactions run to extract data mainly from text file.BAPI is interface oriented, hence data is processed via standard interfaces.OData is API based on Object oriented methods, hence data is processed via API calls.
BDC is based upon reports.BAPI is based upon RFC.OData is based upon REST.
Good for uploading mass data internally.Good for connecting SAP system to others.Good for connecting SAP systems to UI5 and other UIs.

 




Difference between Enhancements and BADI

Introduction

Every year SAP provides a new update to its platform. All the SAP standard programs are designed in such a way that it meets almost all the requirements of a user of a particular sector. But sometimes, there comes a requirement that user wants something else that SAP program is providing. In this case, the simplest way is to modify the source code to meet the requirement. But the disadvantage in doing so is that the modification is erased as soon there is an update. To fix this issue, SAP introduced something called Enhancement framework. In this article we will discuss the difference between Enhancements and BADI.

Enhancements in SAP ABAP

As discussed earlier, SAP introduced Enhancement framework to enhance a particular piece of source code. To keep these process easy and flexible, SAP provides certain area where these enhancement codes can be added. These are called “hooks”. The best part of these enhancements is that they behave like the actual code and at the same time, they are transported separately among the different landscapes.

BADI in SAP ABAP

Earlier, we have seen that we were able to add code into the source code and transfer the same to different landscapes. SAP later created a new type of enhancement framework which uses Object Oriented concepts. This new Enhancement technique, thus, was created in form of class and objects and was available for reuse.

BADI stands for Business Add-Ins. They are object oriented based enhancement techniques that can be reused.

Now let us discuss the difference between Enhancements and BADI.


Difference between Enhancements and BADI

Standard EnhancementsBADI
A standard Enhancement technique can be used only once.A BADI can be used any number of times.
They are not object oriented.They are purely object oriented.
They are easy to implement.It is the most sophisticated enhancement.
These are mainly changed only by developer.The BADI codes are separated from the source code, hence customer too can do further implementations using BADI.

 





Difference between BAPI and RFC in SAP ABAP

Before discussing the difference between BAPI and RFC, let’s have a short introduction of the two.

BAPI

BAPI stands for Business Application Programming Interface. BAPIs are the specific methods that are stored in BOR (Business Object Repository) of the SAP system to carry out a specific business task. It enables the exchange of business data between SAP components, and between SAP and non-SAP components. It allows integration at the business level rather than technical level. It is stored as RFC enabled function modules in the ABAP Workbench Function Builder. To use a BAPI method to access the data in SAP business objects, an application program only needs to know how to call the method using the name of the BAPI and import/export parameters. Standard BAPIs are easier to use as it prevents the user from having to deal with a large number of different BAPIs. A standard BAPI is preferred over an individual BAPI.

RFC

RFC stands for Remote Function Call. It is a protocol for communication between applications of different systems in SAP environment that includes connections between SAP systems and between SAP systems and non-SAP systems.  It is a standard SAP interface for communication between different SAP systems. It describes an external interface to a system function module available in the SAP system. The functionality of R/3 applications can be extended from an external program using RFC interfaces.

Using only RFC, an SAP system cannot be connected to a non-SAP system to retrieve the data. Only through BAPI, RFC can access the SAP system from a non-SAP system or vice versa.

Difference between BAPI and RFC in SAP ABAP

Now, let’s have a look at their difference.


BAPIRFC
It is an RFC enabled function module that provides external access to an SAP business application.It is a protocol for communication between applications of different systems in the SAP environment.
It can be wrapped in Business Objects.It cannot be wrapped in Business objects.
It can be compared to CGI applications.It can be compared to HTTP
All BAPIs are RFC.All RFCs are not BAPI.
Exceptions are not used in BAPI.Exceptions can be defined in the interface of the called function module

 





Difference between Class and Function Module

Introduction

Before jumping to the difference between Class and Function Module, let’s have a short introduction.

An ABAP program consists of program blocks and is executed sequentially. This is a classical approach for programming known as procedural programming model. This model uses functions and subroutines.

Object Oriented programming paradigm is based on class and object and aims to implement real-world entities such as inheritance, abstraction, etc.

Function Module

Function modules are procedures that have a set of re-usable statements with importing, exporting parameters, etc. These are created in ABAP workbench using the Function Module Builder. They are managed in the central function library. They play an important role in updating and in the interaction between different SAP systems, between SAP systems and remote systems through remote calls. Unlike Include, they can execute independently. Every function module needs to be assigned to a function pool called the function group. A Function group is a container that holds function modules that should be together logically. Function modules also support exception handling to catch any errors while they are running.

Class

Classes are a blueprint for objects and represent a set of properties or methods common to all objects of the same type. The components of a class are called data members. The class provides the flexibility to assign visibility to all its data members. Every instance or objects have unique identity and has its own set of values for the attributes. A class can inherit another class and interfaces. You can read more about classes here.

Now, let’s have a look at their difference.

Difference between Class and Function Module

Function ModuleClass
It is procedural oriented.It is object oriented.
It is created using Function Module Builder (T-code se37).It is created using Class Builder (T-Code SE24).
It is always public.A class can be Public, Private or Protected.
Variables are always Private.Variables can be Public, Private or Protected.
Cannot create any instances.Can create multiple instances.
Inheritance is not possible.Inheritance is possible.
Screens can be created using it.To create a screen, the class must call another program.

 




Difference between Update function module and Regular function module

Introduction

Before discussing the difference between Update function module and Regular function module in SAP ABAP, let’s have a short introduction of the two.

Function modules are procedures that have a set of re-usable statements with importing, exporting parameters, etc. They are created in ABAP workbench using the Function Module Builder. They play an important role in updating and in the interaction between different SAP systems, between SAP systems and remote systems through remote calls.

There are 3 Processing types of function module:

  1. Regular Function Module
  2. Remote-Enabled Function Module
  3. Update Module

Regular Function Module

Regular Function Module and Update Function module consists of a block of statements that are made available globally all over the SAP landscape.

Update Module

The Update function module is a function module for which the processing type property of the function builder is set to Update Module. This function module is not executed immediately but is scheduled for execution in a special work process called update work process. For this purpose, the name of the update function module along with the actual parameter is registered in the database table VBLOG as a log record.

Syntax to register the function module to the log table:

CALL FUNCTION <function_name> IN UPDATE TASK

[EXPORTING p1 = a1 … fn = an] [TABLES  f1 = a1 … fn = an

 The actual execution of the program is triggered by the COMMIT WORK statement. The values of the actual parameters are received by the formal parameter of the function module from the VBLOG table. After registration of the function module, if the COMMIT WORK is not triggered then the function module is not executed and the entries are deleted from the log table when the program ends.

The regular function module does not need to be registered to be called. This is executed immediately whenever a call to this function module is made. Sy-subrc can be checked for success and failure.

Syntax to call a Regular function module:

CALL FUNCTION  <function_name>

[EXPORTING  p1 = a1 … fn = an] [IMPORTING  f1 = a1 … fn = an] [CHANGING   f1 = a1 … fn = an] [TABLES     f1 = a1 … fn = an] [EXCEPTIONS e1 = r1 … en = rn

[ERROR_MESSAGE = rE] [OTHERS = ro]].

Now, let’s have a look at their difference.

Difference between Update function module and Regular function module

Update Function ModuleRegular Function Module
It needs to be registered first in the log tableThere is no need to register
It is executed when COMMIT WORK statement is triggered.It is executed immediately when a call is made to this function.
Sy-subrc is undefined after executionSy-subrc can be checked after the execution

 

Difference between Procedural Programming and Object-oriented Programming

Introduction

Before jumping to the difference between a Procedural Programming and Object-oriented Programming, let’s have a short introduction of the two.

Programs are the instructions that tell the computer what to do to come up with the solution to a particular problem. There are several approaches to building solutions to specific types of problems with programming. Two of the most important approaches are procedural programming and Object-Oriented Programming.

 

Procedural Programming

Procedural Programming is a structured programming approach, based upon the concept of calling procedures which consists of a series of computational steps to be carried out. It follows Top Down approach to solve any problem. There is no accessing mode required to access the attributes or functions of a particular program. There is no proper way of hiding data, hence it is less secure.

Object-oriented Programming

Object-Oriented Programming is based upon the concept of Objects and Classes. It follows Bottom Up approach to solve the problem. The OOP paradigm focuses on the data rather than the algorithm to create the modules by dividing into the data and functions. An object contains the data in the form of attributes and codes in the form of methods. It provides data abstraction; hence it is more secure than procedural programming.

Procedural Programming and Object-oriented Programming

Procedural programming is simple and straight forward as it allows good isolation and containment for variables when properly scoped with functions and control loops. But it becomes more prohibitive to maintain the larger codes.  Here comes the Object-oriented Programming which makes it easy to maintain the codes as new objects can be created which control their data. SAP provides us option to implement of them altogether.

Difference between Procedural Programming and Object-oriented Programming

Now, let’s have a look at their difference.

ProceduralOOPs
It is process-oriented.It is result-oriented.
Follows Top down approach.Follows Bottom up approach.
Each function contains different data.Each object controls its data.
There is no access specifierThey have access specifiers such as Private, Public, Protected etc.
Adding new data and function is not easy.Adding new data and functions is easy.
Overloading is not possible.Overloading is possible.
It is less secure.It is more secure.
No concept of inheritance.Inheritance is allowed.

 

Difference between User Exits and Customer Exits

Introduction

Before discussing the difference between User Exits and Customer Exits in SAP ABAP, let’s have a short introduction of the two.

The enhancement allows the user to add their functionalities to the SAP standard applications without modifying the original application. Enhancement Framework is used to modify the standard SAP behavior as per the customer requirements. There are different ways to add custom functionalities in standard codes. User Exit and Customer Exit are among them.

User Exits

User exits are implemented in the form of subroutines and hence also called FORM EXITs. They are collected in Include and are attached to the SAP standard program. They are empty subroutines where one can fill their source code. They are the type of system enhancements originally developed for R/3 SD(Sales and Distribution). Technically they modify the existing code.

Syntax:

FORM USEREXIT_XXXX
INCLUDE ZZUSEREXIT_XXXX
ENDFORM.

Customer Exits

Customer exits act as hooks where one can hang their new functionalities. These are created for specific programs, screens, and menus within the standard applications. Technically, they are enhancements as they provide add-on functionality. They are used for all modules like MM, SD, FICO, PP etc.

There are 3 types of Customer Exits:

  1. Function Module Exits

    It is implemented as a call to the function module. It allows the developer to add code in include that is implemented in a function module at a specific location in an SAP application program.

Syntax:  CALL CUSTOMER-FUNCTION ‘910’


  1. Screen Exits

    It allows the customers to add fields to a screen in the SAP program via sub-screen which is called within standard screen’s flow logic.

Syntax:  CALL CUSTOMER-SUBSCREEN CUSTOM_SRC

  1. Menu Exits

    These are implemented by SAP and are reserved menu entries in the GUI interface. It allows adding functionalities to menus.

Syntax:   +CUS (additional item in GUI status)

Now, let’s have a look at their difference.

Difference between User Exits and Customer Exits

User ExitsCustomer Exits
It is implemented in the form of subroutineIt is implemented for specific programs, screens, and menu within standard applications
It is technically a modification as existing code are changedIt is technically an enhancement as this provides add-on functionality
It refers to SD module onlyIt refers to all modules like MM, SD, FICO, PP etc.
All variables, structures, internal tables, etc. are exposed to be viewed and/or changedOnly variables, structures, and tables that are passed into the function through the interface are restricted to be viewed and/or changed
It requires an access keyIt does not require any access key
Changes remain after the upgradeChanges are lost after upgrade
It gets automatically activated whenever the application/program is activatedTo implement this, a project is created in CMOD then activated

 


Difference between Object-Oriented ABAP and Function module

Before discussing the difference between Object-Oriented ABAP and Function module, let’s have a short introduction of the two.

Object-Oriented ABAP

Object-Oriented ABAP or OOABAP is the object-oriented extension of ABAP, which mainly focuses on the classes and object rather than the code flow. An object-oriented approach enables programmers to think like they are working with real-life entities.

The Object-Oriented concept of ABAP mainly revolves around the classes and objects, which are the basic elements of OOABAP. A class is like a blueprint of an object or a template that binds similar kinds of data. It defines the characteristics of an object. An object is a working entity of a class. Each object is unique at its own, meaning with unique identity and attributes. Attributes define the state of an object whereas the behavior of an object refers to the changes that occur in its attributes over some time.

The three pillars of OOABAP are:

Encapsulation: It is a concept of preventing the data from being arbitrarily accessed by some other outside interference or protects the data from being misused.


Polymorphism: It allows overwriting some functionality.

Inheritance: It allows a sub class or a child class to inherit the properties from a parent class.

Function module

The classical approach where the ABAP program consists of program blocks and is executed sequentially is known as the Procedural Programming model. Function modules are one of the techniques that separate the functionality of the program into independent, interchangeable modules, such that each contains everything necessary to execute only one aspect of the desired functionality.


This technique improves the readability and maintainability of ABAP programs as well as incorporates the reusability of functions.

Difference between Object-Oriented ABAP and Function module

Now, let’s have a look at their difference.

OOPSFunction Module
It is object-oriented.It is procedural oriented.
It uses objects and classes.It contains a block of code for a specific functionality
It is a bottom-up approach.It is a top-down approach.
Inheritance is possible.Inheritance is not possible.
Polymorphism is possible.Polymorphism is not possible.
Have access specifiers: Private, public, and Protected.Does not have any access specifier.
    

Difference between Local Classes and Global Class

Introduction

Before discussing the difference between Local classes and Global class, let’s have a short introduction of the two.

Class

Classes are a blueprint for objects and represent a set of properties or methods common to all objects of the same type. Classes in SAP ABAP can be defined either locally or globally.


Local classes

Local classes hide in a report source whereas Global classes sit themselves out centrally in the class pool within the class library of the R/3 Repository. If you are creating a report to do some specific task without worrying about the outside world, you can create a local class. But if you’re working on a class that may be of interest to other reports, consider creating a global class.

Let see an example of local class implementation below:

*---------------------------------------------------------------------*
* CLASS MAIN DEFINITION
*---------------------------------------------------------------------*
CLASS main DEFINITION.
PUBLIC SECTION.
"// Instance Methods ( Note: we use the statement 'METHODS'
"// to define an instance method )
METHODS set_data IMPORTING i_data TYPE string.
"// Instance Methods ( Note: we use the statement 'CLASS-METHODS'
"// to define a static method )
CLASS-METHODS set_classdata IMPORTING i_data TYPE string.
PROTECTED SECTION.
"// Instance Attribute ( Note we use the statement 'DATA'
"// to define an instance attribute )
DATA attribute TYPE string.
"// Static Attribute ( Note we use the statement 'CLASS-DATA'
"// to define a static attribute )
CLASS-DATA classattribute TYPE string.
PRIVATE SECTION.
"// Instace event ( Note we use the statement 'EVENTS'
"// to define aN instance event )
EVENTS event EXPORTING value(e_data) TYPE string.
"// Instace event ( Note we use the statement 'CLASS-EVENTS'
"// to define a static event )
CLASS-EVENTS classevent EXPORTING value(e_data) TYPE string.
"// For more informations about events see the following example:
"// ABAP Objects - Creating your First Local Class - Using Events
ENDCLASS. "main DEFINITION
Class Implementation
Error rendering macro 'code': Invalid value specified for parameter 'lang'
*---------------------------------------------------------------------*
* CLASS main IMPLEMENTATION
*---------------------------------------------------------------------*
CLASS main IMPLEMENTATION.
METHOD set_data.
CONCATENATE 'Instance Attribute value' i_data
INTO attribute SEPARATED BY space.
ENDMETHOD. "set_data
METHOD get_data.
MOVE attribute TO r_data.
ENDMETHOD. "get_data
METHOD set_classdata.
CONCATENATE 'Static Attribute value' i_data
INTO classattribute SEPARATED BY space.
ENDMETHOD. "set_classdata
METHOD get_classdata.
MOVE main=>classattribute TO r_data.
ENDMETHOD. "get_classdata
METHOD print_attribute.
WRITE: lv_data, /.
ENDMETHOD. "print_attribute
METHOD print_classattribute.
WRITE: lv_data, /.
ENDMETHOD. "print_classattribute
ENDCLASS. "main IMPLEMENTATION

 


When a class is used in an ABAP program, the system first searches for the local class with the specified name, if not found, it looks for a global class.

As the Local class is visible to a particular program, visibility of all the component can be set to PUBLIC. A Local class can be defined in a global class. It is defined in the Local Types section and implemented in the Implementation section of the Class Editor.

Global Class

The Global class is visible to all the programs, visibility to all components are explicitly assigned. The components with PRIVATE visibility are only accessible in the class itself and are not visible to the subclass.


SAP ABAP Global Class Builder

Now, let’s have a look at their difference.

Difference between Local Classes and Global Class

Local ClassGlobal Class
It is defined within a program.It is defined in Class Builder (T-Code SE24).
It can be only used in programs in which it is defined.It is stored in class pools and can be used by any ABAP programs.
It can be designed “more open” as it is only accessible to within the context.It can be designed “less open” as it is accessible to all the ABAP programs.
It can be defined in a global class.It cannot be defined in a local class.
    

Difference Between Abstract Class and Interface

Before jumping to the Difference between Abstract Class and Interface, let us have a short introduction of the two.

Introduction

Classes, their instances/objects, and access to objects using reference variables forms the basics of ABAP Objects.  A class represents a set of properties or methods that are common to all the objects of one type. However, it is necessary for similar classes to have similar functions that behave differently in each class and having a uniform point of contact.

ABAP objects make it possible by using Interface and abstract class.

Like Classes, interface acts as a data type for the objects. The components of interface are the same as of classes. Interface is used when similar classes have same method with the same name but different functionalities. Interface along with inheritance provides a base for polymorphism because methods of the interface can behave differently in different classes.

Abstract class is a class that contains one or more abstract methods i.e. methods without implementation. This class cannot be instantiated, as the abstract methods have to be implemented in a subclass of the inheritance tree. It can inherit only one class and multiple interfaces. You can explore more about Abstract class in SAP ABAP here.


Now, let us have a look at their difference.

Difference between Abstract Class and Interface

InterfaceAbstract Class
It is not a class. It is an independent structure that is used in a class to extend the functionality of a class.It is a special class which can’t be instantiated.
It is an entity that doesn’t have an implementation.It can contain methods with implementation as well as without implementation.
No common behaviour is implemented via Interface.For non-abstract methods, common behaviour can be implemented.
It can inherit multiple interfaces but cannot inherit a class.It can inherit a class and multiple interfaces.
Multiple inheritance can be achieved.There is only one abstract class as Super Class.
For new methods, all the implementing classes must implement the new methods.For new non-abstract methods, there is no need to redefine the method.
All components are PUBLIC by default.   The visibility of each component can be set.
             
    

Difference between SAP Memory and ABAP Memory

Introduction

Before jumping to the differences between SAP memory and ABAP Memory, let’s have a short introduction.

ABAP programs utilize two types of memory: SAP memory and ABAP memory. The main difference between the two memories is their scope.


SAP Memory and ABAP Memory

ABAP memory is very limited as it can only accessible within one internal session and programs running outside the session are not able to read or write this memory. Whereas, SAP Memory is a global memory and is accessible to all the programs running under that session as well as across different main sessions. SAP memory can be used to pass data from one program to another either within a session or to another session.

In terms of usage, the main use of ABAP memory is to make data accessible to multiple programs within the same session. Whereas, SAP memory also makes data available across multiple sessions.

When dealing with SAP memory, GET/SET parameters are used to exchange data. To set these parameters for a user or a program, SET PARAMETER is used and other programs can then retrieve the parameter using the GET PARAMETER command. On the other hand, ABAP memory can be accessed by the ABAP programs within the same internal session using IMPORT and EXPORT commands. Data within this memory remains intact during a sequence of program calls.

It is important to they are used appropriately to enhance the speed and efficiency of the application as well as resource usage.

Difference between SAP Memory and ABAP Memory

Now, let’s have a look at their difference.

SAP MemoryABAP Memory
It is a Global Memory.It is a local Memory.
All SAP GUI sessions have access to it.All programs within a session can have access.
It makes data available across main sessionIt makes data available multiple session within same session.
Data can be exchanged using GET/SET.Data can be exchanged using EXPORT/IMPORT.


Difference between Singleton Method and Static Method

Introduction

Before discussing the differences between a Singleton method and Static method, let’ have a quick introduction. A method is a block of codes that defines behaviour of an object of the class. The method can access all the attributes of the class and can change the object data content.

Static and Singleton methods in SAP ABAP are very different in their usage and implementation. So it is very important to choose wisely either of them in our WRICEF.

Singleton Method

Sometimes there is a need to instantiate an object at a time, that means only one instance is required at one point of time. This is a very common requirement while designing an application. To achieve such a scenario, there is one concept of ‘Singleton Pattern’ or ‘Singleton Class’ in OOABAP.

A class is said to be a singleton class if it can have the utmost one instance only.

Static Method

Static methods are defined using the CLASS-METHODS statement. They are called only once, when the program is started, irrespective to the class instance, and don’t get reinitialized throughout the execution of the program. They can access only static attributes and can trigger only static events of the class. They can be directly accessed by the class name itself.

When shall we use singleton method and when to go for static methods?

Static methods are the one that are meant to store the initialization information and should be available globally.  Whereas the most wide usage of singleton method is creating logs and single sign-on.

Difference between Singleton Method and Static Method

Singleton MethodStatic Method
It is a design pattern.It is not a design pattern.
It can be instantiated only once.It is triggered by a static component (static class, attributes and events) only and no instance components.
It is implemented in a specific scenario where we cannot have multiple instances like login.It is widely used for single time initialization.


Difference between Enhancements and BADI

Introduction

Every year SAP provides a new update to its platform. All the SAP standard programs are designed in such a way that it meets almost all the requirements of a user of a particular sector. But sometimes, there comes a requirement that user wants something else that SAP program is providing. In this case, the simplest way is to modify the source code to meet the requirement. But the disadvantage in doing so is that the modification is erased as soon there is an update. To fix this issue, SAP introduced something called Enhancement framework. In this article we will discuss the difference between Enhancements and BADI.

Enhancements in SAP ABAP

As discussed earlier, SAP introduced Enhancement framework to enhance a particular piece of source code. To keep these process easy and flexible, SAP provides certain area where these enhancement codes can be added. These are called “hooks”. The best part of these enhancements is that they behave like the actual code and at the same time, they are transported separately among the different landscapes.


BADI in SAP ABAP

Earlier, we have seen that we were able to add code into the source code and transfer the same to different landscapes. SAP later created a new type of enhancement framework which uses Object Oriented concepts. This new Enhancement technique, thus, was created in form of class and objects and was available for reuse.

BADI stands for Business Add-Ins. They are object oriented based enhancement techniques that can be reused.

Now let us discuss the difference between Enhancements and BADI.


Difference between Enhancements and BADI

Standard EnhancementsBADI
A standard Enhancement technique can be used only once.A BADI can be used any number of times.
They are not object oriented.They are purely object oriented.
They are easy to implement.It is the most sophisticated enhancement.
These are mainly changed only by developer.The BADI codes are separated from the source code, hence customer too can do further implementations using BADI.

Comments

Popular posts from this blog

CDS tutorial and interview questions

AMDP SAP HANA