Category: SAP

  • Difference between Object-Oriented ABAP and Function module

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

    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.

    OOPS Function 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.
  • Class Constructor in a Class

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

    Introduction

    We have understood about constructors in our previous article, a constructor is a special method that is invoked automatically at the time object is created or instantiated. It has two types: Instance Constructor and Static Constructor. The static constructor also called as class constructor is invoked whenever there is first call to the class whether it is through an instance or class.

    The class constructor has some special properties like,

    • Each class has a single static constructor.
    • The class constructor is called exactly once for each class.
    • The method don’t have importing/ exporting parameters and cannot raise exception.

    The class constructor can also be used to set default values for global attributes irrespective of the instance or methods. Also, while declaring the class constructor one must keep in mind that the name of the constructor must be CLASS_CONSTRUCTOR and declared using the statement CLASS-METHODS in the declaration part of the class.

    Definition

    A class constructor is a method which is automatically invoked whenever the first call to the class is made, it may be through an instance or class.

    Example

    Let us look into an example:

    **** Class Definition****

    CLASS  ZCL_DEMO DEFINITION.

    PUBLIC SECTION.

    METHODS:  CONSTRUCTOR.                                                         “Instance Constructor”

    CLASS-METHODS: CLASS_CONSTRUCTOR.                              “Static Constructor”

    END CLASS.

    ****Class Implementation****

    CLASS  ZCL_DEMO IMPLEMENTATION.

    METHOD CONSTRUCTOR.

    WRITE: “Instance Constructor is initiated”.

    END METHOD.

    METHOD CLASS_CONSTRUCTOR.

    LV_DATE = SY-DATUM.                                                                  “Changing the value of attribute”

    END METHOD.

    END CLASS.

    START-OF-SELECTION.

    DATA: LO_DEMO TYPE REF TO ZCL_DEMO.

    **Class object creation**

    CREATE OBJECT LO_DEMO.

    **Whenever the first call to class is made CLASS_CONSTRUCTOR  is triggered

    WRITE: “INSTANTIATING CLASS CONSTRUCTOR”, ZCL_DEMO=>LV_DATE.

     

    A commonly asked question is that whether we can redefine the constructors? So, it is a big NO as the redefinition of constructors are not allowed and the program will fall into error “Constructor may not be over-defined”.

  • Difference between CURSOR and SELECT statement

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

    Introduction

    Before discussing the difference between CURSOR and SELECT statement, we will have a short introduction of the two. Both of these operations are used in SAP ABAP to perform operations on SAP Tables/Data.

    CURSOR

    CURSOR decouples the process of SELECT statement and INTO clause. This is done by opening a cursor for a select statement. This is used to extract data in chunks from the database table. Only after getting the complete data, the data is stored in the target area

    It follows the following three-stage process to access the data from the database.

    1. Opening the cursor

    Syntax to open the cursor for SELECT statement:

    OPEN CURSOR [WITH HOLD] <c> FOR SELECT    <result>
    FROM      <source>
    [WHERE    <condition>] [GROUP BY <fields>] [HAVING   <cond>] [ORDER BY <fields>].

    To open a cursor, it is required to declare it first. It is declared using the DATA statement and special data type CURSOR. All clauses of SELECT statement can be used except the INTO clause.

    After the OPEN CURSOR statement, the database cursor points to the first line of the result set. The open cursor points to an internal handler just like a reference variable pointing to an object.  More than one cursor can be opened parallelly for a single database.

    1. Fetching the data

    Syntax to read data :

    FETCH NEXT CURSOR <c> INTO <target>.

    This statement decouples the INTO clause from all other clauses in the SELECT statement. This extracts the requested row from the database cursor, assigns into the target area and the cursor moves one line further in the selection set.

    1. Closing the cursor

    Syntax to close the cursor:

    CLOSE CURSOR <c>.

    If a cursor is already opened, it cannot be reopened.  It is necessary to close all the cursors which are no longer required since only a limited number of cursors can be opened simultaneously.

    SELECT statement

    SELECT statement is an Open SQL statement for reading data from one or more database tables, classic views, or CDS views. The SELECT statement reads the data directly into the target area specified in the INTO clause. While using SELECT…END SELECT statement, database is accessed each and every time fetching the data row by row. A SELECT statement makes use of the CURSORS implicitly to fetch the data from the database.

    Difference between CURSOR and SELECT statement

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

     

    CURSOR statement SELECT statement
    This decouples the process of SELECT statement and INTO clause.  Only after getting the complete data, the data is stored in the target area. The data is stored directly into the target area specified in the INTO clause.
    This creates a pointer to database record and data is not copied to the ABAP server Data is directly copied into a data object in the ABAP memory

     

  • Differences between REFRESH and CLEAR

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

    Introduction

    Before discussing the differences between REFRESH and CLEAR statement, we will have a short introduction of the two. Both of these Statements are part of SAP ABAP Reports/Editors and are mainly used to clear out the used variables and save memory or reuse the variables.

    REFRESH

    REFRESH statement sets the internal table to its initial size by deleting all the rows of the internal table. This frees up the allocated memory for the internal table.  A FREE statement is used to delete entire rows and free all the memory(used when the internal table is no longer needed).

    Syntax of REFRESH statement:

    REFRESH <itab>.

    For an itab, an internal table has to be specified.

    If an internal table itab has a header line, then the table body is initialized, not the table header. If itab has no header, it acts as a CLEAR itab statement. Hence, it is recommended to always use CLEAR statement instead of REFRESH.

    The use of a table with a header line is forbidden in classes, which makes the use of the REFRESH statement obsolete.

    CLEAR

    CLEAR statement clears the header line as well as the rows of the internal table and work area. This frees up the allocated memory required for the internal table and sets it to its initial size.

    Syntax of CLEAR statement:

    CLEAR <dobj>.

    For a dobj, itab or itab[] has to be specified.

    CLEAR itab is used to clear only the header line and the table rows i.e. clear the content of the structure. If the table header line is not defined, CLEAR itab clears the table content.

    CLEAR itab[] is used to clear the internal table contents.

    Differences between REFRESH and CLEAR

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

    REFRESH statement CLEAR statement
    It always refers to an internal table. It refers to an internal table as well as a work area.
    Header line cannot be cleared using this statement. Header line can be cleared using the CLEAR itab statement.
  • Differences between GET CURSOR and HIDE

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

    Introduction

    Before discussing the differences between GET CURSOR and HIDE, let’ have a quick introduction of the two.

    Interactive report in SAP ABAP is a report which displays the basic information on the basic list and the detailed information on the secondary list.

    Among various list events in the interactive report, the AT LINE-SELECTION is an event that is triggered when the user clicks on any list item. To know the selected list contents, there are 2 keywords or statements, GET CURSOR and HIDE.

    GET CURSOR

    GET CURSOR statement is used to read the name of the output field or the number of the list line on which the screen cursor in the displayed list is positioned and store the value into the variables field or line depending on how the FIELD or LINE is specified.

    Syntax: –

    GET CURSOR { {FIELD field [ field_properties]}
    | {LINE line [ line_properties]} }.

    HIDE

    HIDE statement is used to hide the content of the current output line into a temporary memory called hide area for further processing. HIDE statement is used withing loop…end loop to hide the values in the hide area.

    On double click on any list line, an event AT LINE-SELECTION is triggered and the system automatically identifies the line number and stores the corresponding record into the hide variable.

    Syntax:

    HIDE dobj.

    This statement places the contents of the dobj for the current output line (system field SY­LINNO) into the HIDE area. The data type of the dobj must be flat and no filed symbol or class attributes can be specified.

    Differences between GET CURSOR and HIDE

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

    GET CURSOR HIDE AREA
    It is used to store the value of the selected field name. It is used to store the line with line number.
    It responds for a particular field It responds for a particular line.
    Interactive reports can be generated using field name and field value Interactive report cannot be generated using this.

     

  • Constructor in a Class

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

    Introduction

    Focusing on the concept of the constructors in a class, we will discuss what is a constructor and its type with an example. So, a constructor can be understood as a special method in a class that is automatically called when an object is created. It does not require any explicit method call.

    Definition

    A constructor is a special method in a class that is invoked at the time object is created or instantiated.

    Type of Constructors

    Constructors are of two types:

    • Instance constructor
    • Static constructor

    Instance Constructors

    The instance constructor is the predefined instance method of the class called constructor. There are few points to consider while declaring the constructor. They are:

    • The name of the constructor method, irrespective of the class name or type, must be always CONSTRUCTOR.
    • It is declared using a method statement in the visibility section of the class.
    • The method signature can only have importing parameters or exceptions. There are no exporting parameters included.
    • The instance method can be used to set default values in the class.
    • The instance method anyhow can access both instance as well as static variables.
    • It is called each time the object is created.

    Static Constructors

    The static constructor is the predefined static method of the class called as class_constructor. There are few points to consider while declaring the static constructor. They are:

    • The name of the class_constructor method must be CLASS_CONSTRUCTOR.
    • It is declared using CLASS_METHODS statement in the public section of class.
    • The method signature cannot contain importing or exporting parameters or exceptions.
    • The static method can be used to set default values globally.
    • The static method can only access the static variables.
    • It is called exactly once before the class is accessed for the first time.

     

    Example

    Let’s spot one simple example:

    CLASS  demo DEFINITION.
    
           PUBLIC SECTION.
    
                 METHODS:  CONSTRUCTOR.                                                         “Instance Constructor”
    
                 CLASS_METHODS: CLASS_CONSTRUCTOR.                             “Static Constructor”
    
    END CLASS.
    
    CLASS  demo IMPLEMENTATION.
    
           METHOD CONSTRUCTOR.
    
                    WRITE: “Instance Constructor is initiated”.
    
           END METHOD.
    
           METHOD CLASS_CONSTRUCTOR.
    
                    WRITE: “Static Constructor is initiated”.
    
           END METHOD.
    
    END CLASS.
    
    **class object creation**
    
    DATA: demo_obj TYPE REF TO demo.
    
    CREATE  OBJECT  demo_obj.

    OUTPUT

    Static Constructor is initiated

    Instance Constructor is initiated

     

    In the definition part of the class, the CONSTRUCTOR is the instance constructor defined using Methods and static constructer is defined as CLASS_CONSTRUCTOR using class_methods. And their implementations are given the IMPLEMENTATION part. When the object  demo_obj is created, the instance and static constructor is called.

    As we can see that the output displays static constructer implementation before the instance constructor, this is because the CLASS_CONSTRUCTOR method is triggered before the CONSTRUCTOR method.

  • SAP Ariba Reporting Options

    Preface – This post is part of the SAP Ariba series.

    Introduction

    SAP Ariba provides reporting options and feature that is included with all modules and also includes upstream, downstream, sourcing, procure-to-order, procure-to-pay and others. In this article we will explore more about SAP Ariba Reporting Options.

    In earlier days we need to perform SQL quires to retrieve the required data, however now through the easy interface for reporting, the need to write SQL queries is abolished.

    This enables the users to run pre-packaged reports commonly known as standard reports as well as custom reports on the Ariba solution. Below are the lists of the reports supported in Ariba System:

    • Pre-packaged reports
    • Custom reports
    • Multi-fact reports
    • Compound reports
    • Exporting reports

    To create a custom report in Ariba Solution:

    • Login to the Ariba system and click on create.
    • Then click Analytical Report

    Permission to create custom reports is given to specific groups

    The users with the basic permissions are able to access pre-packaged reports and public reports as read-only users under manage in Ariba Solution. The public reports are the custom reports which are saved publicly for all to use. Under pre-packaged reports, there are various documents from different modules such as sourcing, contacting, P2P (Procure-to-pay) and many others. Also, Ariba Reporting allows adding the reports to your Ariba Solution accounts dashboard based on your requirement and reporting purposes.

    As the pre-packaged reports are the standard reports by Ariba we cannot modify them however, you can adjust it by specifying filters. You can also specify the report properties though integration events by modifying the CSV file that pulls report data. The integration events that can be used are:

    • ReportQueryPull Integration Event: The ReportQueryPull event is used to define Ariba Queries API queries associated with each report.

    In default configuration ReportQueryPull Integration Event reads from below path:

    BuyerServerRoot/variant/data/ReportQuery.csv

    • ReportMetaPull Integration Event: This event defines the visual appearance and properties of reports. ReportMetaPull Integration Event reads data of following CSV files from BuyerServerRoot/variant/data:
      • csv: Describes the attribute that applies to the entire report.
      • csv File: Describes how to restrict access to reports.
      • csv File: Describes attribute of a particular column.
  • SAP Ariba Supplier Membership Fees

    Preface – This post is part of the SAP Ariba series.

    Introduction

    As we know that Ariba Network is globally recognized as the digital platform for connecting the organizations with suppliers for trading purposes, it offers the option of membership fee to help the suppliers to gain the maximum benefit provided by the Ariba Network, this comes under the Supplier Membership Program (SME). In this article we will explore more about SAP Ariba Supplier Membership Fees.

    Supplier Membership Program has two components:

    • The subscription packages
    • The network transaction services

    Subscription Package

    The subscription package includes the plans which charge the fees based on the number documents transacts annually with the customers as well as it is based on the technology usage. The subscription plans provided by SAP Ariba are:

    • Ariba Network Standard: This is designed for the low-level suppliers or we can say for the new suppliers in Ariba Network. It includes the fundamental functionalities that are needed for the procurement process.
    • Ariba Network Select: This subscription enables the suppliers to build the additional collaborative commerce capabilities that will act as an add-on to deal better with the customers.
    • Ariba Network Premier: The premier subscription enables the suppliers to enhance collaborative commerce capabilities through integration and provide technical support to automate the procurement processes.
    • Ariba Network Enterprise: The enterprise subscription enables the suppliers to enhance collaborative commerce capabilities through Ariba Integration Connector, to enable the connectivity to back-end system, program management services and validation services.
    • Ariba Network Enterprise Plus: It includes the enterprise subscription plan as well as it delivers the services that can be needed to make collaborative commerce a competitive advantage.

    SAP Ariba Supplier Membership Fees

    Below table shows the plans, their monthly charges and transaction threshold:

    Plan Monthly Charges Transaction Threshold
    Standard account Free $50,000 to $250,000
    Select $50 $50,000 to $250,000
    Premier $495 $250,000 to $1,000,000
    Enterprise $2495 $1,000,000 to $10,000,000
    Enterprise Plus $7495 $10,000,000 or more

    Note: To get the latest and updated information regarding the SAP Ariba Pricing, you can visit here.

    The subscription fee for standard plan if free of cost until the supplier has reached the limit of five transaction or crosses the chargeable transaction volume threshold.

    SAP Ariba also provides five paid subscriptions levels which depend on the number of annual transactions of documents based on currency. The five levels are:

    • Premium: The premium plan includes unlimited access to portal, catalogs, customer support, reporting and supply chain collaboration.
    • Bronze: It includes all the features of the premium plan as well as the benefit of eCommerce consult team, Ariba achievement badges and free discovery RFI/RFQ responses.
    • Silver: It includes all the features of the bronze plan as well as provides the cXml and EDI integration, technical support and express integration support.
    • Gold: It includes all the features of the silver plan and additionally it provides unlimited responses to sales opportunities, eCommerce consultation services and priority support.
    • Platinum: It includes all the features of gold plan as well as it includes Ariba Live pass and extended Ariba Integration Support.

    Network Transaction Services

    The NTS enables the supplier to collaborate with the customers during the different procurement processes like order process, invoice and other related documents as well as managing the catalog in Ariba Network. The NTS fee is based on the volume of documents transacted annually with the customers.

     

  • SAP Ariba Integration with S/4 Hana

    Preface – This post is part of the SAP Ariba series.

    Introduction

    Ariba Network is a digital platform where buyers and suppliers connect for business transactions and to explore new business opportunities. Integration of Ariba Network with S/4 HANA on-premise and cloud follows two different methodologies. In this article we will explore more about SAP Ariba Integration with S/4 Hana.

    Types of Integration

    On-premise Integration

    On-premise S/4 HANA integration follows the same connectivity method which is followed for ECC system connectivity (by using BAPI or Intermediate Document).

    Cloud Integration

    For cloud integration of S/4 HANA with SAP Ariba the communication arrangement is set up in Communication Management of HANA system. Services like oData and SOAP must be configured in communication arrangements of the S/4 HANA system.

    The integration with SAP S/4 HANA cloud allows process:

    • Discount Management
    • Invoice Collaboration
    • Payment
    • Purchase Order Collaboration
    • Service Procurement

    Ways to connect SAP S/4 HANA with SAP Ariba system

    There are three ways to connect SAP S/4 HANA with SAP Ariba system:

    • Direct Connectivity: Ariba provides direct connectivity option under account settings. The Direct Connectivity method does not use any middleware for the integration of the SAP Ariba Network system and HANA.
    • Mediated connectivity using HCL: For the integration using HCL. a system connection is established between Ariba Network and S/4 HANA using SAP HANA Cloud Integration
    • Mediate connectivity using PI: For the integration using PI, middleware is used to establish a connection between SAP Ariba and SAP S/4 HANA.

    Advantages

    By digitalizing and integrating the end-to-end process, promotes the organization to achieve some objectives. The benefits are:

    • Lower total cost of ownership: You can avoid third party integration, maintenance and also the middle-ware cost.
    • Rapid ROI: An organization can achieve a fast return of investment compared to capital invested.
    • Quick and smooth deployment: SAP Ariba native, pre-built integration provides easy deployment with fewer risks.
    • Compliance: The ease to use of software’s increases the service quality provided by users which results in higher compliance.
    • Efficiency: The use of a standard interface across all the applications will eventually result in higher efficiency by adapting the changes quickly and resulting in fewer errors.
    • Effectiveness: The integration produces optimized data providing transparent and complete visibility, stronger collaboration and reliable KPI.
  • SAP Ariba Best Practices for Integration

    Preface – This post is part of the SAP Ariba series.

    Introduction

    The best practices optimized for S/4 HANA provides ready to run digitalized logistic and operational business processes that cover the fundamental business process as well as the integration and migration fundamentals to be performed in an organization, delivered through SAP Activate. Now looking into what is SAP Activate? SAP Activate is a combination of SAP best practices, methodologies, guided configuration which simplifies the use of SAP S/4 HANA. In this article we will explore more about SAP Ariba Best Practices for Integration.

    SAP Ariba Best Practices for Integration

    The best practices for SAP S/4 HANA provide quarterly updates regarding the latest innovation in your solution or we can conclude that the main goal is to enable the users to take the advantages of the potentials through S/4 HANA fitting in your business needs.

    The SAP Best Practice for SAP S/4 HANA Cloud can enable the organization to improve the finance, sourcing and procurement, supply chain, sales, services, application platform and infrastructure, SAP S/4 HANA Cloud integration, SAP S/4 HANA Cloud Extensibility and many more business areas.

    Steps to follow to check best practices

    • Open https://rapid.sap.com/bp/ and log in with valid username and password
    • Navigate to SAP S/4 HANA and then click on Integration
    • To get the brief idea of the best practices, follow the link under best practices page

    SAP Ariba Developer Responsibilities

    The role of SAP Ariba Developer requires expertise in the following mentioned areas:

    • Experience of Ariba Integration with SAP ERP system.
    • Technical knowledge of Ariba as well as the knowledge of Ariba products
    • Experience of Ariba On-Demand Implementation.
    • Experience in SAP Ariba Procurement solutions including SAP Ariba Guided Buying, SAP Ariba Buying and Invoicing, SAP Ariba Catalog Management, SAP Ariba Invoice Management.
    • Knowledge of SAP Ariba Payables and Supply Chain Collaborations.
    • Knowledge of SAP Ariba integration with SAP S/4 HANA.
    • Experience of implementing NOTES.
    • Knowledge of implementing best practices for integration.
    • Knowledge of customizing the solution as per the business requirements.