Category: ABAP Differences

  • What is the difference between SAP Crystal Reports and SAP SmartForms

    SAP Crystal Reports and SAP SmartForms are two different tools used for reporting and form generation within the SAP ecosystem. Here are the key differences between the two:

    1. Purpose and Functionality

    – SAP Crystal Reports: It is primarily a reporting tool used to design and generate pixel-perfect, highly formatted reports. Crystal Reports allows you to connect to various data sources, create complex reports with sorting, grouping, aggregations, and add interactive features like drill-downs, charts, and parameters.

    – SAP SmartForms: It is a form generation tool that enables the creation of structured, interactive forms. SmartForms are typically used for printing purposes, such as generating purchase orders, invoices, or other business documents. SmartForms provide basic layout capabilities, support for tables, graphics, and can be integrated with SAP workflows.

    2. Design and Layout

    – Crystal Reports: It offers a rich and flexible design environment with a WYSIWYG (What You See Is What You Get) editor. You have precise control over the placement of elements, formatting options, and can design complex reports with multiple sections, subreports, and cross-tabulations.

    – SmartForms: The design and layout capabilities in SmartForms are more structured and focus on generating forms with fixed positioning. It provides a hierarchical layout, allowing you to define pages, windows, and individual elements within them. SmartForms have limited design features compared to Crystal Reports but are optimized for printing scenarios.

    3. Integration with SAP Systems

    – Crystal Reports: It can connect to various data sources, including SAP systems, and leverage the SAP BusinessObjects suite for advanced reporting and analytics. Crystal Reports can access data from SAP’s Business Warehouse (BW) and other databases, making it suitable for creating comprehensive reports across different systems.

    – SmartForms: It is tightly integrated with SAP systems and is part of the SAP application server. SmartForms directly access SAP data and can utilize the system’s business logic and integration with workflows. It is well-suited for generating forms that are closely tied to SAP processes.

    4. User-Friendliness and Learning Curve

    – Crystal Reports: It provides a more comprehensive and feature-rich reporting environment, which can result in a steeper learning curve for new users. Designing complex reports may require advanced knowledge of the tool and database querying concepts.

    – SmartForms: Compared to Crystal Reports, SmartForms have a simpler and more structured design interface, making it relatively easier to create basic forms. Users familiar with SAP transactions and workflows may find it easier to work with SmartForms.

    In summary, SAP Crystal Reports is a powerful reporting tool suitable for designing detailed reports with various data sources, while SAP SmartForms is a more specialized form generation tool integrated with SAP systems, primarily used for creating structured, printable forms tied to SAP processes. The choice between the two depends on your specific reporting or form generation requirements within the SAP environment.

  • Difference between SAP BDC, BAPI and OData

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

    Introduction

    SAP has always been all about data. Since its evolution, SAP has deployed so many ways to play around data. It is also important for any business to access, transfer and store its data from internal and external sources. Keeping these things in mind, SAP has introduced (in different timelines) different ways to process data transfer. In this article, we will be focusing upon three of them as well the difference between SAP BDC, BAPI and OData.

    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.

    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 BDC SAP BAPI SAP 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 Enhancement point and Enhancement spot

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

    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. These enhancements are added in form of small hooks also known as Enhancement points. In this article we will discuss the difference between Enhancement point and Enhancement spot.

    Enhancement Point

    Enhancement points are the position in a SAP ABAP program where enhancement are made. The enhancements, when complied with the current source code work as if it was a part of the source code.

    Enhancement Spot

    All the enhancements can be added as per the SAP framework guidance or directly by the developer (explicitly). These positions available to a developer is termed as Enhancement options.

    When the enhancement is made based upon the developers choice, then these information are required to be stored in a container with their positions. These containers are termed as Enhancement Spot.

    Difference between Enhancement point and Enhancement spot

    Enhancement Point Enhancement Spot
    It is mainly predefined locations in SAP ABAP. It is mainly explicit and created by developers.
    It is placed with the help of ENHANCEMENT-POINT statement. It is placed with the help of SAP Enhancement Wizard in SE80.
    Enhancement point basically contains codes. Enhancement Spot basically contains the positions of Enhancement Options or Enhancement points.

     

  • Difference between Singleton Class and Persistent Class

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

    Introduction

    SAP OOABAP provides different types of classes to handle different types of scenarios. Some of the classes are the part of SAP Design patterns to perform a specific type of workflow, whereas others are there to perform core functions. In this article we will compare two of them. Let us discuss the difference between Singleton Class and Persistent Class in SAP ABAP.

    Singleton Class

    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.

    Persistent Class

    Before going for persistent class, let’s first discuss the meaning of ‘persistent’.  A data is said to be persistent if it can be preserved beyond the runtime of program.

    For a session, ABAP program stays in local ABAP memory till the runtime of that program. To store it permanently, we use persistence service (implemented by persistence class).

    Difference between Singleton Class and Persistent Class

    Singleton Class Persistent Class
    It can have only one instance. It can have multiple instances.
    It cannot store data beyond runtime. Data can still persist beyond runtime.
    It is used for functions like single sign-on and logger. It is used for functions like booking system where particular transaction blocks a seat/item.

     

  • Difference between Enhancements and BADI

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

    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 Enhancements BADI
    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 OPEN CURSOR and FETCH CURSOR

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

    Introduction

    In previous article we have discussed the difference between Cursor and Select Statements. In this article we will focus upon the differences between Open Cursor and Fetch Cursor. Both Open Cursor and Fetch statements are part of SQL queries. Interestingly, both statements are dependent upon each other and are used to extract data or perform operations on SAP tables.

    OPEN CURSOR

    A cursor in SAP is like a pointer in other coding languages. It points towards the result of specific data selection. Unlike SQL query like SELECT, cursor doesn’t store any data in a variable, rather it points data with the help of a variable. To use cursor, we need to open it up, fetch required data and the close the cursor after its use. SAP allows 17 Open cursors at a time.

    OPEN CURSOR is a SQL statement that is used to open a database cursor and hold the pointer/cursor in a local variable.

    Syntax:

    OPEN CURSOR [WITH HOLD] dbcur FOR
      SELECT { select_clause
               FROM source }
            |{ FROM source
               FIELDS select_clause }
               [[FOR ALL ENTRIES IN itab] WHERE sql_cond]
               [GROUP BY group] [HAVING group_cond]
               [UNION [ALL|DISTINCT] select]
           [ORDER BY sort_key]
               [additional_options].

     

    Here the local variable dbcur is holding the cursor value. Select statement tells the cursor, what to hold.

    FETCH CURSOR

    Once we open a cursor, then we need to use the same with the help of another SQL query i.e. FETCH. A FETCH query extracts the requested row from the result set of the previously opened cursor (dbcur) and assigns them to a local variable.

    Syntax:

    FETCH NEXT CURSOR dbcur INTO|APPENDING ....

    Difference between OPEN CURSOR and FETCH CURSOR

    OPEN CURSOR FETCH CURSOR
    OPEN CURSOR does not store the data in any variable during runtime. A FETCH statement stores the data of a cursor in a local variable during runtime.
    OPEN CURSOR points to a data of a table. A FETCH statement actually stores data of a table in local variable.
    OPEN CURSOR is the very first step of a CURSOR pattern. FETCH statements are second and most important step of CURSOR pattern.
  • Difference between Singleton Method and Static Method

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

    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 Method Static 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 Structure and work area

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

    Introduction

    We have already discussed Work Area and Structure in SAP ABAP. We already know how they are created and used within the ABAP Report programs. Structure and Work Area in ABAP coding are almost same. It is hard to specify any difference. In this article we will discuss the difference between Structure and work area.

    Structure in SAP ABAP

    A Structure in SAP ABAP is a part of group TYPES in SE11, which consists components that also, refer to a type.

    In simple terms, a structure is a reusable component that contains fields and holds single records at runtime.

    Work Area in SAP ABAP

    A work area in ABAP represents single row of an internal table and it is used to process internal table line by line. It holds only single data at runtime.

     

    Difference between Structure and work area

    Structure Work Area
    A structure is created using SAP Data Dictionary (SE 11) as well as within a ABAP program. A work area is created within a report or Function Module.
    A structure can be a global as well as a local component. A work are is a local component
    A structure is reusable across all the ABAP programming interfaces and data dictionary. A work area is reusable within the report it is created.
    A structure can be nested at multiple levels. A work area cannot be nested.
  • Difference between BAPI and RFC in SAP ABAP

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

    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.

    BAPI RFC
    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 Exception handler and Event handler

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

    Before discussing the difference between Exception handler and Event handler, let’s have a short introduction of the two.

    Exception handler

    Exceptions are events that interrupt the flow of executions and make the program to execute further impossible. So, the exceptions need to be handled.

    Exception situations can be detected and raised by either the program or runtime environment. Exceptions in the runtime environment are generally caused by the error situation that cannot be detected by the static program.

    Exceptions can be either handleable or non-handleable. Handleable exceptions are class-based that are predefined in the system or can be custom-defined. They can be raised by the RAISE EXCEPTION or THROW statement and handled by TRY – CATCH – ENDTRY.

    Non-handled exceptions create runtime error and the program terminates with a short dump.

    Event handler

    Events are messages raised by the object when a condition is met. The events are caught by the event handler method that implements the logic to handle the event. These are used by objects or classes that trigger the event handler methods in other objects or classes. Any number of handler methods can be called when the event is triggered. The link between the trigger and the event handler method is decided at run-time.  The event handler decides the event to which it wants to react.

    Using RAISE EVENT statement, the events of a class can be triggered in the methods of the same class. A method of the same or different class is declared as event handler method for the event evt of class class using the addition FOR EVENT evt OF class.

    Difference between Exception handler and Event handler

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

    Exception Event Handler
    Exceptions are the error that occurs during the execution of a program that interrupts the normal flow of the control. Events are the messages raised by an object which is raised when a condition is met
    Exception handler is a unit of code that is executed after detection of an exception. Event handler is a unit of code that is executed in response to an event.