Blog

  • SAP OOPS ABAP Interview Questions

    Introduction

    SAP and SAP technology provides enormous opportunity in IT industry. With increasing operations and market, the need of SAP technical consultants has observed sharp increase in job opportunities. The main job profile for SAP technical consultants is primarily based on ABAP (core ABAP and OOPs ABAP). In this article we will discuss the SAP OOPS ABAP Interview questions asked by interviewers from both technical as well as functional consultants of different years of experiences. You can also check ABAP Interview Questions.

    Object Oriented Concept

    1. What is Object Oriented Programming?
    2. What are the four pillars of OOPs concept? Explain them.
    3. Differentiate between Polymorphism and Encapsulation.
    4. What is the difference between Abstract Class and Interface?
    5. What is the difference between Inheritance and Polymorphism?
    6. What is the concept of class?
    7. What is the concept of Objects?
    8. Explain Public, Private and Protected class. Also mention the differences between them.
    9. What are Constructors and Destructors?
    10. What is a garbage collector?
    11. What is a reference variable?
    12. What is the difference between pass by value and pass by reference?
    13. What is a Super Class?
    14. What is a Sub class?
    15. What is the difference between class and interface?
    16. What are the types of Polymorphism?
    17. What is the difference between overloading and overriding?
    18. What is the need of Private and Protected class?
    19. What are design patterns?
    20. Differentiate between Singleton and Factory Design Patterns.

    Basic OOPs ABAP Interview Questions

    1. What is the transaction code for a class builder in SAP?
    2. Explain the following classes in terms of SAP:
      1. Friends Class
      2. Singleton Class
      3. Final Class
      4. Persistent Class
      5. Abstract Class
      6. Super Class
      7. Global Class
      8. Local Class
      9. Public Class
      10. Private Class
      11. Protected Class
      12. Exception Class
      13. Message Class
      14. Unit Testing Class
    3. Differentiate between Constructor and Class Constructor.
    4. Explain the concept of Exceptions in a class
    5. Explain the concept of Events in a class
    6. What are the Types in ABAP Class?
    7. Explain the concept of Aliases in ABAP Class
    8. Explain the concept of casting in ABAP Class
    9. Define the structure and implementation of a local class in ABAP Program
    10. Differentiate between Read only attributes and constants in SAP ABAP.
    11. Explain the triggering concept of Constructor and Class Constructor in SAP ABAP
    12. Differentiate the concept of Importing, Exporting, Changing and returning parameters in ABAP Class
    13. What are the types of inheritance in ABAP Class? Which type of Inheritance is not supported in ABAP?
    14. What is the concept of ‘SUPER’ and ‘ME’ in SAP ABAP Class?
    15. Differentiate Overloading and overriding in ABAP Class. Which one is not supported?
    16. What is the use of Interface in ABAP Class?
    17. Explain the concept of casting in ABAP Class. Why we need casting?
    18. What are the types of Exception classes?
    19. How Enhancement of Classes are Implemented in ABAP Class?
    20. What is a container? Explain different types of container in ABAP Class.

    Advance OOPs ABAP Interview Questions

    1. Explain the concept of type casting in ABAP Class. Also differentiate between wide and narrow casting in ABAP.
    2. Explain the concept of Object Oriented ALV.
    3. Explain the concept of Class and Interface Pool in ABAP
    4. Explain the concept of BADI in ABAP.
    5. Explain the concept of BOPF in ABAP.
    6. Explain the concept of Garbage collection in ABAP Class.
    7. How to use ABAP Development tools in Eclipse to develop class in SAP
  • SAP ABAP Interview Questions

    Introduction

    SAP and SAP technology provides enormous opportunity in IT industry. With increasing operations and market, the need of SAP technical consultants has observed sharp increase in job opportunities. The main job profile for SAP technical consultants is primarily based on ABAP (core ABAP and OOPs ABAP). In this article we will discuss the basic ABAP Interview Questions asked by interviewers from both technical as well as functional consultants of different years of experiences.

    SAP ABAP Dictionary Questions

    Basics ABAP Interview Questions

    1. What is the T-Code of ABAP Dictionary?
    2. What all objects we can create using ABAP Dictionary?

    Tables/Structures

    1. What are the types of SAP tables?
    2. What is a Delivery Class in SAP table?
    3. What are the data browser options allowed in a table (Delivery & Maintenance)?
    4. What is the significance of MANDT in SAP Table?
    5. What is a check table?
    6. What is the difference between check table and Value Table?
    7. What is the difference between Append and Insert operation?
    8. What is the difference between Tables and Structures?

    Views

    1. What is a view in SAP?
    2. What are the types of Views in SAP?
    3. What are the uses of Views in SAP?
    4. What is the difference between Database View and Maintenance View in SAP?
    5. How many tables can a projection view hold?
    6. When a Help View is needed?

    Domain

    1. Can you delete a Domain that is being used by a Data Element?
    2. What is a function of a Domain?
    3. Can we use same domain for multiple fields?

    Search Help

    1. What is the shortcut to open a Search Help?
    2. What are the types of Search Helps in SAP?
    3. What are the uses of the different types of Search Helps?

    Lock Objects

    1. What are lock objects in SAP?
    2. What are the function modules used for lock objects?
    3. What are lock arguments?
    4. What are different types of lock objects?

    SAP ABAP Report Questions

    1. What is the select statement to bypass buffer and directly get data from database?
    2. What is the difference between OPEN SQL and NATIVE SQL?
    3. Explain the uses of ABAP Reports.
    4. What are the Events of a classical report? Also, explain the order in which they are executed.
    5. What is the difference between user exit and customer exits?
    6. Write the Select statement to get data of specific number of rows.
    7. Write the Select statement to get results in ascending order or descending order.
    8. Can we develop ALV Reports without using function modules?
    9. What are the different types of message commands used in reports?
    10. What is the significance of insert and append statement in ABAP Reports?
    11. What is the use of pretty printer in ABAP?
    12. Classify Various events related to screen programming.

    SAP ABAP Function Module Questions

    1. What is the Transaction code (T-Code) of SAP function module?
    2. What is a function group?
    3. How many predefined function modules does exist in SAP?
    4. What are the types of function modules in SAP?
    5. What is the significance of RFC function module in SAP?
    6. How can you call RFC function module in SAP?
    7. How are function modules different from subroutines in SAP?
    8. When can be Update Function Module used in SAP?

    SAP OOPS ABAP Interview Questions

    1. Why OOABAP is required?
    2. What is the use of interface in OOABAP?
    3. Can we use multiple inheritance in a SAP Class, if yes how?
    4. What is polymorphism in OOABAP? How it can be achieved?
    5. Can events be raised in interface?
    6. What is single-ton-class?
    7. What are the concepts of classes in OOABAP?
    8. How can polymorphism be implemented?
    9. What are types of classes used in OOABAP?
    10. Where can a protected method be accessed from?
    11. What are different types of exception classes?

    SAP ODATA Questions

    1. Why SAP needed OData?
    2. What is the T-code to create an OData project?
    3. What is the difference between entity type and entity set in OData?
    4. What are CRUD operations in ODATA?
    5. OData can be a combination of REST AND HTTP based service. Is the given statement true or false?
    6. In ODATA protocol the resources are exposed in which format?
    7. Where is ODATA performed?
    8. What is a data model in ODATA?
    9. What is the use of associations and navigations in ODATA?
    10. What are the various operations that can be performed in ODATA?
  • How to Create SAP OData

    Preface – This post is part of the SAP ABAP OData Tutorial series.

    Introduction

    In our previous article, we have already discussed what an OData is. In this article we will go through step by step process to create a SAP OData service. Later on, we will register our service and also test if it is working fine. In this article, we will not write any code related to CRUD (create, write, update and delete). To learn CRUD in OData, click here.

    Step by Step Process to create SAP OData service

    In this section we will follow multiple predefined steps to create an OData, these are:

    1. We will use SAP Service Gateway Builder (SEGW) to create a new project
    2. We will Import DDIC/CDS or other Structure to create an OData Model
    3. We will Generate our OData
    4. We will Register and test our Service

    Create a new Service Builder project

    To create a new project, follow the given steps:

    1. Go to transaction code SEGW, it will start the Gateway Service Builder.
    2. Click on the Create Project button, as shown below:
    3. Enter the given information
    Field Description Example
    Project It is the name of your SAP OData Service. It will start with Z or Y ZPROJECT_NAME
    Description Enter a description for your OData Demo OData Project
    Project Type SAP Provides given four Project Options:

    1.       Service with SAP Annotations

    2.       Service with Vocabulary-Based Annotations

    3.       Annotation Model for Referenced Service

    4.       OData 4.0 Service

    We will learn about them in details, later.

    Service with SAP Annotations

     

    Generation Strategy It will be preloaded as Standard which means, it has all standard configurations. Standard
    Package Enter your project package or temporary package i.e. $TMP $TMP
    Person Responsible It will be preloaded with your User ID/ User Name barryAllen

    OData creation

    1. Press Continue and Save.

    Import a DDIC structure

    To use an OData Service, it should be designed in such way that it will read/update one or more table. Therefore, we need to import any table, structure or view. These are part of DDIC structure. We can also import Data model from file, RFC/ BOR Interface or a search help. But in this section, we will learn how to import a DDIC structure:

    1. Click on the Data Model under the project we have recently created to expand it.
    2. Right Click on Data Model and click Import and then click DDIC Structure
      OData DDIC Import
    3. Now, a Wizard will open. Enter the following details, there:
    Field Description Example
    Name Enter a name of Model. It should be explanatory. CustomerData
    Type We have two options here:

    1.       Entity Type: This means a simple DDIC structure/table/view will be imported

    2.       Complex Type: This means a complex DDIC structure/table/view will be imported

    Choose Entity Type
    ABAP Structure Choose your required table or structure name. Just copy and paste the name of your DDIC table/structure/view zcustomer_data
    Create Default Entity Set It will create an Entity Type with the same fields as of Entity. Also, the name will remain same. We recommend you to leave it check marked. Leave it check marked

     

    The above details are shown below:
    OData Entity Set Creation

    1. In the next step, the wizard will show all the fields of the imported table. Just select them all and click next as shown below:
      OData Entity Set Creation2
    2. In the next step, the wizard will show all the checked fields. Here you need to check the primary keys and finish, as shown below:
      OData Entity Set Creation3

     

    Generate OData Service

    Now, we have created an OData object with a model. Now to use this Object we need to generate all the required classes. To generate, press the Generate Runtime Objects  OData Generate Icon button, as shown below:

    OData Generate Runtime Objects

    Note: The Generate Runtime Objects button automatically saves the project before generating classes.

    Pressing the above button, will open a dialog box as shown below:

    OData Class Generation

    Just press Continue, as shown above. The above process will generate following classes:

    Class Name Description
    MPC Class MPC stands for Model Provider Class. This is generated and refreshed every time, we generate a class. It is not recommended to extend this class for Model Annotations, because all the methods are deleted whenever the OData is generated.
    MPC EXT Class This is the Extended MPC class, and all the methods are conserved even the OData is generated.
    DPC Class DPC stands for Data Provider Class. This is generated and refreshed every time, we generate a class. It is not recommended to extend this class for CRUD operation, because all the methods are deleted whenever the OData is generated.
    DPC EXT Class This is the Extended DPC class, and all the methods are conserved even the OData is generated.
    MDL Class The is the Model Class.
    SRV Class This is the Service Class.

     

    Just click on Lock Object to generate the classes, as shown below:

    OData Service Generation

    Register SAP OData using the Gateway client

    Once the OData is generated, now it is the time to register the service. Once the service is registered, then only it can be used anywhere.

    To generate an OData, follow the given steps:

    1. Double click the node Service Maintenance
    2. Select any System and click Register as shown below:
      OData Service Register
    3. Enter an Alias, if asked as shown below:
      OData System Alias
    4. Now, in the next screen you get following options:
    Field Description
    Technical Service Name This is auto generated service name
    Service Version It is auto generated service version
    Description It is the Description of the OData you have mention earlier
    External Service Name It is same to the auto generated service name
    Namespace It is by default bank
    External Mapping ID It is by default Empty
    External Data Source Type It is by Default set to source type C
    Technical Model Name It is auto generated Model Name
    Model Version It is auto generated Model Version
    Package Assignment Assign your package name here, or just choose Local Object from the button below. It will be then $TMP
    ICF Node It is by default “Standard Mode”
    oAuth Enablement It provides option to add extra authentication, in case you need oAuth2 enablement choose it, else leave it blank

     

    In our case, we just need to choose package and click confirm, as shown below:

    OData Service Registration

    Once the service is registered, the Registration will turn green, as shown below:

    OData Service Status

    Test the OData service

    1. To test the OData service, click the SAP Gateway Client button, as shown below:OData Test Service
    2. It will open a new screen, here click Add URI Option as shown below:
      OData Add URI Option
    3. Choose $metadata, here:
      OData $metadata
    4. Click Execute as shown below:
      OData Service Status 200

    If the status is 200, as shown above, then it means your OData is working fine.

    In upcoming articles, we will learn how to perform CRUD operation using OData.

    Tutorial Video

    You can watch the below video to learn implementation:

    [embedyt] https://www.youtube.com/watch?v=2rEZrFj2haE[/embedyt]
  • Difference between Procedural Programming and Object-oriented Programming

    Preface – This post is part of the Differences in ABAP for Interviews series.

    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.

    Procedural OOPs
    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 specifier They 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 SAP Memory and ABAP Memory

    Preface – This post is part of the Differences in ABAP for Interviews series.

    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 Memory ABAP 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 session It makes data available multiple session within same session.
    Data can be exchanged using GET/SET. Data can be exchanged using EXPORT/IMPORT.

     

  • Data Class vs Delivery Class in SAP ABAP: Differences

    Preface – This post is part of the Differences in ABAP for Interviews series.

    Introduction

    The most common question of an ABAP Interview is the difference between Data Class and Delivery class of an ABAP Table. In our previous articles, we have discussed both in detail and now we will discuss their differences.

    Before jumping to the difference between a Data Class and Delivery class, let’s have a short introduction of the two.

     

    Data Class

    A Data Class represents a physical area in the database where all the data of the table assigned to this Data Class are stored.

    Data Class in ABAP can be assigned to a table using its Technical Settings. SAP was smart while creating properties for tables. With the help of Data Class, SAP divides and organize the Tables according to their type of Data. It keeps all Master Data together, all Transaction Data together, all User Data together and all Organizational Data together. This increases system performance as well as increases system availability.

    Types of Data Class are:

    • APPL0 (Master Data): Data which is rarely changed.
    • APPL1 (Transactional Data): Data which is changed frequently.
    • APPL2 (Organizational Data): Data defined when the system is installed and seldom
    • USER and USER1 are provided for the customer.

     

    As Data Class determines the type of data the table contains, the Delivery class determines the behaviour of the table.

     

    Delivery Class

    A delivery class defines:

    • Transport control of Data within Landscapes and customer systems
    • Transport control of Data for an installation and upgrade
    • Transport control of Data of client copy
    • If data can be maintained in Extended Table Maintenance [SM30] using TMG or not.

     

    In short, we can say a delivery class determines whether data of the table can be maintained & transported or not.

    Types of Delivery Class are:

    • A: Application table (master and transaction data).
    • C: Customer table, data maintained by the customer only.
    • L: Table for storing temporary data

     

    Difference between Data Class and Delivery class

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

    Data Class Delivery Class
    It determines the actual physical area of database where table is created It controls the degree to which SAP or customer is responsible for table maintenance
    It is set in Technical settings for the table It is set in Delivery & Maintenance
    It determines the type of data the table contains. It determines the table type.
    They are of 5 types:

    APPL0 à Master Data

    APPL1 à Transactional Data

    APPL2 à Organizational Data

    USER, USER1

    Following are the delivery classes:

    Aà Application table

    Cà Customer table

    L,G,E,S,W

     

     

  • Difference between Domain and Data Element

    Preface – This post is part of the Differences in ABAP for Interviews series.

    Introduction

    Before jumping to the difference between a Domain and Data Element, let’s have a short introduction of the two. We need to use data in ABAP reports and it needs to be define in ABAP Dictionary and for that we need to define Domain, Data Element and, Tables.

     

    Domain

    A domain is a reusable object which describes the technical characteristics of an attribute. It defines a value range, which sets the permissible data values for the fields, data types, conversion routine, etc. A single domain can be used for any number of fields of identical structure.

    With the help of domain, lowercase letters can be entered into the table fields.

     

    Data Element

    A domain cannot be directly used in a Report/Program or as a table field, it is assigned to a data element that adds some semantic information to the field i.e. Field Label, heading, etc.

    Data Element is the smallest individual component of the complex types and is used to provide field labels, documentation, parameter ID, and search help for the table field.

     

    At Domain level, Search Help fetches data either from defined fixed value or Value Table while Search help assigned to Data Element fetches data from Global Search help created via SE11.

     

    Difference between Domain and Data Element

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

    Domain Data Element
    It is used to describe the technical characteristics of an attribute. It is used to describe the semantic definition of the table field.
    It describes the value range, data types, and conversion routine. It provides field labels, documentation, parameter ID, and search help for the table field.
    Search help assigned to it fetches data from either fixed value or Value Help Table. Search help assigned to it fetches data from Global Search help created via SE11.
    It is assigned to a data element. It is assigned to a table field or structure.
    It cannot be referenced in ABAP programs. It can be referenced in ABAP programs with TYPE.
    It is stored in Standard Table DD01L and Domain texts are stored in DD01T. It is stored in standard Table DD04L and Data Element texts are stored in DD04T.

     

  • Subroutine in SAP ABAP

    Preface – This post is part of the ABAP Beginner series.

    Introduction

    A good coder always tries to reduce repetitive codes and implements codes in such way that it can be reused. Subroutine in SAP ABAP provides us the same functionality. In this article we will learn what it is and how to implement it in SAP ABAP.

    What are Sub Routine

    A Subroutine in SAP ABAP is a well-defined reusable procedures used for code modularisation. Subroutines can be used locally in a program.

    It is written between FORM and ENDFORM.

    PERFORM subroutine is used to invoke subroutine.

    Passing values with Subroutines

    There are 2 ways to pass values with subroutines:

    Pass By Value

    • In this the actual and formal parameter refers to different memory.
    • IF the value of formal parameter is changed then the value of actual parameter won’t change.
    • Keyword VALUE identifies that the parameter is passed by value.

    Pass by Reference

    • In this the actual and formal parameters refer to same memory.
    • If the formal parameter is changed, actual parameter also changes.

    Types of Subroutines

    Internal Subroutines

    Subroutines that are defined in the same program and called within the same program.

    External Subroutines

    Subroutines that are defined in a program and are called in a different program are called as external subroutines.

    How to create a are Sub Routine Module in SAP

    1. Go to SE80
    2. Select your program for which you want to create a subroutine -> select -> create a subroutine (name it).
    3. Write a code in FORM and ENFORM and if u want to call it as an internal subroutine then PERFORM has to be included.

    Calling a Subroutine

    Internal Subroutines

    REPORT PROGRAM NAME.

    PERFORM SUBROUTINE NAME.

    FORM SUBROUTINE NAME.

    P1 TEXT

    FORM SUBROUTINE NAME.

    Write:  ‘This is internal subroutine’.

    ENDFORM.

    External Subroutines

    FORM FORMNAME.

    Select *from MARA into table it_mara where matnr is s_matnr.

    ENDFORM.

    To call this form in a program.

    PERFORM subroutine_name IN PROGRAM program_name.

    Advantages of Sub Routine

    • Pass by value allocates new memory location for use in subroutines
    • Pass by reference passes a pointer to a memory location.

     

  • Message Class in SAP ABAP (SE91): Create & Use Examples

    Preface – This post is part of the Object Oriented ABAP series.

    Introduction

    To issue a message or warning or error or any kind of information in ABAP, either we have to hard code that message or maintain it in text symbols. What if the same message is required somewhere else like in any other program or class, again hard coding it or maintaining in text symbol would be recurring and inefficient procedure.

    Instead of doing this, we can collect all the messages at one place and use it multiple times and at multiple places, that one place is nothing but a message class. Any message can be identified with a unique number assigned to it. To use a message from message class in any ABAP program or in any class, we only need to specify the message class, message number and message type.

    Definition

    Message Class is like a container which contains all messages in it. All the messages from different message classes are stored in database table T100.

    Message Class Creation

    A message class can be created in two ways:

    1. Through transaction code SE91.

     

    Message class creation through T-Code SE91
    Message class creation through T-Code SE91

     

    Message class Maintenance Screen
    Message class Maintenance Screen
    • Syntax of calling these messages from message class in ABAP Programs:

            MESSAGE <type of message><message number>(message class name) WITH <parameter>.

    Example 1 : MESSAGE I000(ZTEST_CLASS).                                                     “Information Message

    Example 2 : MESSAGE E0001(ZTEST_CLASS) WITH 0001.                                     “Error Message

    Note: In figure 2, message text at 001 position is having ‘&’. With this operator we can pass text/literals whatever we want to display. So, for example 2 message will get displayed as:

     ‘The value 0001 is invalid’.

    1. Through report.

    Syntax : REPORT <Report Name> message-id <Message Class>

    “Double click on message class name to create a message class.

    Advantages

    A single message can be used multiple times at multiple places, we don’t need to hard code same message or maintain the same text symbols in different programs.

  • What is SAP OData

    Preface – This post is part of the SAP ABAP OData Tutorial series.

    Introduction

    If you plan to expose your SAP Data (Table or Query Data) to external environment like UI5/Fiori or HANA, then you need to push your data in a form of API. By API we mean, using OData we will generate a service link that can be accessed via internet and can be used to perform CRUD operations. SAP OData in SAP ABAP environment is just like another ABAP Class. We can access the methods of this class using SEGW transaction. We can write our required code here for the data manipulation and once we activate the class, the service link that we generate will act accordingly.

    Definition

    SAP OData is a standard Web protocol used for querying and updating data present in SAP using ABAP, applying and building on Web technologies such as HTTP to provide access to information from a variety of external applications, platforms and devices.

    In SAP, we use SEGW transaction code to create an OData Service. SEGW stands for Service Gateway.

    Architecture of SAP OData

    Here, we will discuss about the High level architecture of SAP OData.

    SAP OData High Level Architecture
    SAP OData High Level Architecture

    Why we need ODATA

    SAP OData comes with multiple advantages. It not only helps us to expose data but also helps a customer to access data from anywhere and any device. If there will be no OData services, then the data will remain on premise and in case a user needs to access their data, they might have to visit the data location, which is uncomfortable for the digital world.

    Advantages of an ODATA

    Using SAP OData provides us following advantages:

    • It helps to obtain human readable results i.e. you can use your browser to see the output data
    • It is very easy and relatively fast to access data
    • It uses all the standards of web protocols i.e. GET, PUT, POST, DELETE, and QUERY
    • It uses Stateless Applications: It means Server does not save any data of Client (e.g. UI5 Application) and treats every OData call as a new call
    • It receives data in form of related pieces of information, one leading to another: It is an interaction pattern known as “alert-analyse-act”, “view-inspect-act”, or “explore & act”. According to this pattern not all data are loaded together, and a user analyses a data and reaches its required information after navigation. In this way the data loads quickly and correctly.

    SAP OData V2 (Version 2)

    OData v2 is a set of new standards which are add-ons to SAP OData V1, and these are as follows:

    • Client-side sorting and filtering
    • All requests can be batched
    • All data is cached in the model
    • Automatic Message handling

    You can read more about SAP OData v2 vs OData v1 here.

    SAP OData V4 (Version 4)

    OData v4 is the latest upgradation to the SAP OData services which comes with some addition and some reduction of features, such as:

    • The new version brings simplification in terms of data binding. The new OData V4 model simplifies the data binding parameter structure.
    • OData v4 requires only asynchronous data retrieval.
    • The Batch groups are solely defined via binding parameters in the new OData v4 calls with the corresponding parameters on the model as default.
    • It supports use of an operation binding. And now it is much easier to bind operation execution results to controls.
    • Create, Read, Update and Delete (Remove) operations are available implicitly via the bindings
    • In OData v4, the Metadata is only accessed via ODataMetaModel

    You can read more about SAP OData v4 vs OData v2 here.