Category: SAP

  • MVC Architecture of Web Dynpro

    Preface – This post is part of the SAP ABAP Web Dynpro series.

    Introduction

    Web Dynpro follows MVC architecture. This model, view and controller design is very helpful while designing any web application as it properly segregates the business logic from (HTML-based) views. The three parts work in such a manner that it gives the user a very easy way of accessing the application.

    MVC Architecture

    Model

    As mentioned in the previous articles models are objects that contains business logic statements to read or write data into the database. This model can be developed in various forms depending on the requirements as like  Function Modules, BAPI`s, Classes, etc. Model, when created as a class (Model class), is nothing but a class which forms certain data in it which one will want to show in Web Dynpro Screen.

    View

    In simple words, the view is the screen that is displayed in the browser for the user. This is the place where the user actually interacts with the application. User will provide the input through view in order to fetch the required result. It is used to ensure the appropriate representation of data in a web browser.

    Controller

    Controller works like an interface between the model (which hold the data) and view (which displays the data). That means this is used to control communication between Model and View where it takes input from the users and gets the desired data from the model and displays the data in the browser.

    MVC

    How MVC Architecture works

    Basically, MVC segregates the web application into three different modules, for better understanding let us take an example. Suppose you went to a restaurant to have dinner with your friends, after a couple of minutes you decided what to eat then a waiter came and you gave the order, after noting down he went and gave order details to the chef. Now chef will gather ingredients to prepare your order. After completion of your order, he will notify the waiter to deliver the food to your table. So in a way you are giving your Model name to your View and your view is pulling the data from a model and showing with the help of the controller. This is how any MVC Architecture will work.

     

    Advantages of MVC Architecture

    1. It is easy to identify where the business logic and view design is. The model will contain only the business Logic, View will contain only the UI design, Controller will contain the code to get the value from UI and send it to Model and vice-versa.
    2. Due to the segregated design pattern, it is easy to enhance the design and business logic as per the requirement.
    3. Use of graphical tools in view part reduces the coding effort.
    4. Use of data binding and context mapping concepts in view part passes the data automatically from source to destination without handling the data.
    5. The goal of MVC is, by segregating models and views, to reduce the complexity in architectural design and to increase flexibility and maintainability of code.
  • Difference between Class and Function Module

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

    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 Module Class
    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 Static Method and Instance Method

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

    Introduction

    Before discussing the differences between an Instance 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.

    Instance Method

    Instance methods are defined using the METHODS statement. They get reinitialized every time an instance is created.  They can access all the attributes of the class and can trigger all its events. Instance methods have the flexibility to be inherited and can be redefined in subclasses.

    Syntax to call an instance method: 

    DATA instance_name TYPE REF TO class_name.
    
    CREATE OBJECT instance_name.
    
    CALL METHOD instance_name->instance_method(…).

     

    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.

    Syntax to call a static method:

    CALL METHOD class_name => static_method(..).

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

    Difference between Static Method and Instance Method

    Instance Method Static Method
    It requires instance. It doesn’t require instance.
    It is an example of pass by value. It is an example of pass by reference.
    It is defined using “METHODS”. It is defined using “CLASS-METHODS”.
    Involves declaration of reference variable, instantiating the class and then calling the class. Can be directly accesses by the class name.
    It can access all attributes of a class. It can access only static attribute of a class.
    Can be redefined in sub classes. Cannot be redefined in sub classes.

    Instance method over Static method

    It sounds simpler to use Static methods as it does not involve long steps such as the declaration of a reference variable, instantiating the object and then calling the method. Static methods can be directly accessed by the class name.

    But the question arises is that why instance methods are preferred over Static methods.

    One of the important concepts of OOABAP is Polymorphism i.e. replacing the default implementation of the method with a specific implementation. Polymorphism is achieved by Method Redefinition. Since Static methods are operable on their own and are independent of the instances of the class, they cannot be overridden. Whereas Instance methods can be inherited to sub classes, they can be redefined with the specific implementation.

  • Difference between SELECT-OPTIONS and PARAMETERS

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

    Before discussing the differences between SELECT-OPTIONS and PARAMETERS, let’s have a quick introduction of the two.

    Introduction

    SELECT-OPTIONS and PARAMETERS are components of the selection screen. SELECT-OPTIONS are assigned a selection table in the ABAP program as well as two input fields along with a push button for multiple selection.  Parameters are assigned a global elementary data object in the ABAP program as well as an input field. The name of the SELECT-OPTIONS and PARAMETERS is limited to a maximum of 8 characters whereas the length of the input field is restricted to a maximum of 255 characters.

    SELECT-OPTIONS and PARAMETERS statements are allowed in the global declaration part of executable programs, function groups, and module pools. In function groups and module pools, these statements are only allowed within the definition of a standalone selection screen. In executable programs, these statements are automatically assigned to the standard selection screen.

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

    Difference between SELECT-OPTIONS and PARAMETERS in SAP ABAP

    SELECT-OPTIONS PARAMETERS
    It stores value in an Internal table with a predefined structure. It stores value in a variable.
    It can accept multiple single values, multiple ranges, exclusion of values and ranges. It accepts only a single value.
    It creates a Selection table having 4 columns SIGN, OPTION, LOW and HIGH. It does not create a selection table
    If left blank, then all the data is selected from the database. If left blank, then no data is selected from the database.
    For value checking, IN operator is used in WHERE condition. For value checking, operators like =, >, <, <> are used in WHERE condition.
    Value check cannot be forced through Foreign key or domain values. Value check can be forced through Foreign key or domain values.
    Radio buttons or checkbox cannot be created using it. Radio buttons and checkbox can be created using it.

     

  • Difference Between Abstract Class and Interface

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

    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

    Interface Abstract 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.

     

  • Quorum on SAP Cloud Platform

    Preface – This post is part of the Blockchain on SAP Cloud Platform series.

    Introduction

    Smart contracts brought a new vision to improve for existing enterprise systems. These enterprises have multiple ledgers/data base with replicated data that is based upon duplicated business logics. The only problem with the smart contracts that was stopping their use in banking sectors were their data privacy. In July 2015, J.P. Morgan Chase & Co., an American multinational investment bank introduced an enterprise-ready distributed ledger and smart contract platform known as Quorum which processes private transactions within a permissioned group of known participants. In this article we will do implement Quorum on SAP Cloud Platform.

    In another article, we have discussed “Hyperledger Fabric on SAP Cloud Platform”. This article is similar to it. Here we will explore Quorum and discuss how SAP has integrated it in to its SAP Cloud Platform. Before we start with Quorum platform, it is recommended to read What is Blockchain?

     

    What is Quorum

    Quorum is a blockchain platform built upon Ethereum. It is a private/permissioned blockchain network. To achieve data privacy, Quorum utilizes cryptography and segmentation.

    As per Quorum whitepaper, A Quorum transaction contains the following:

    • The recipient: the one sending the money
    • Signature identifying the sender: to authenticate the sender
    • An amount of ether (although having an ether balance is not required within Quorum): This is the amount that gets transferred
    • An optional list of parties that the transaction should be private to: If the transaction is among multiple parties
    • An optional data field (containing hash in the case of private transaction): This makes the transaction private and secure

    Consensus in Quorum

    According to oxford dictionary, the meaning of consensus is “A general agreement”. A consensus in a Blockchain is a mechanism of validating a transaction based on general agreement i.e. an agreement of more than 51% voters in Quorum.

    In Quorum, consensus has been termed as Quorum Chain Consensus. Quorum Chain Consensus utilizes voting-based consensus mechanism.

    For example, Gargi sends $100 worth of Ether to Rudra, Gargi will lose 100$ worth of Ether from her wallet, and Rudra will gain 100$ worth of Ether in his wallet. It needs to be validated or verified that if Gargi had 100$ worth Ether in her wallet or not. This can be validated by the voters in the Quorum Blockchain and if more that 51% voters agreed upon this transaction, then only the transaction will be validated.

    Implementation of Quorum using SAP Cloud Platform

    Generic Architecture

    Architecture of Quorum on SAP Cloud Platform

    In the above diagram, it has been shown “how SAP Cloud Platform communicates with a Quorum Node”. To explore more about Quorum Architecture please refer here.

    Setup of Quorum on Cloud Platform

    To implement Quorum on SAP Cloud Platform, we need to setup our trial Global Account on SAP Cloud Platform and create a Quorum enabled sub-account. Then only we can proceed with the implementation.

    Follow the following steps to enable Quorum on your SAP Cloud Platform:

    Step 01: Go to your SAP cloud platform Cockpit and if you don’t have trial account, go here and click Free Trial and then select region as Europe (Rot) – US East(VA).

    Step 02: Create a sub account there by giving your desired display name and subdomain name.

    Step 03: Click Entitlements button from the left menu bar and it will display the list of entitlements.

    Step 04: Inside Entitlements menu we can see Edit button. Click it to change the mode to editable. Scroll down to Quorum as shown below:

    Add dev and channel nodes by clicking addition button icon ‘+’.

    Quorum Setup 01

    Step 05: Click your sub account to open it, as shown below. Click Spaces and create a new space to that space. Also give all the authorization as shown below:

    Quorum Setup

    Step 06: Click on the newly space created. Select Service Marketplace and scroll down to Quorum. Click to open it as shown below:

    Quorum Setup 03

    Once the initial setup of Quorum is achieved. Then you can create your own nodes and instances by following Hands on Exercise to create your own SAP Quorum service.

  • Hyperledger Fabric on SAP Cloud Platform

    Preface – This post is part of the Blockchain on SAP Cloud Platform series.

    Introduction

    Bitcoin was the first cryptocurrency launched in late 2008. Bitcoin is based on blockchain. Since then many techno players have launched multiple platforms based on Blockchain. In 2015, several companies interested in blockchain technology realized that they could achieve more by working together than by working separately. This marked the birth of Hyperledger Platform. SAP later introduced Hyperledger Fabric on SAP Cloud Platform.

    In this article, we will explore Hyperledger Fabric and how SAP has integrated the same in to its SAP Cloud Platform. Before we kick start with Hyperledger, it is recommended to read What is Blockchain?

     

    Types of Blockchain

    Blockchain classification is based upon restrictions on block or simply data accessibility. Following are the three types of Blockchain networks in the market:

    • Public Blockchains

    A public blockchain is a blockchain network which has absolutely no access restrictions and anyone on internet can become a user or validator/miner. These blockchains are widely used by crypto currencies. These blockchains utilizes a consensus mechanism to keep their transactions valid. Well known examples include Bitcoin and Ethereum.

    • Private Blockchains

    A Private Blockchain is just like a relatioal database i.e. fully centralized and owned by a single organization. All the participants are vetted before entering into this blockchain network. These types of blockchains are mainly used by banking organization, where data cannot be shared with and validated by anyone. Multichain is a tool to create private blockchains.

    • Consortium Blockchains

    The literal meaning of consortium is “an association of several companies”. As the name suggests, it is a blockchain that is jointly controlled by a group of organizations. It is best suited for business and ERP solutions. As of now, Hyperledger and R3Cev are leading blockchain networks in consortium area.

    What is Hyperledger

    In late 2008, Bitcoin was introduced in the market. Since then many companies started different platforms. However, in 2015, several companies decided to come together and create an open source Consortium blockchain platform under the guardianship of Linux Foundation and named it Hyperledger. Hyperledger, since then, has evolved a lot. It has launched multiple frameworks and tools for the same. Among them, Hyperledger Fabric is the most suited and stable framework for Enterprise.

    According to the Hyperledger whitepaper, “Hyperledger fabric is a platform for building distributed ledger solutions with a modular architecture that delivers a high degree of confidentiality, flexibility, resiliency, and scalability. This enables solutions developed with Fabric to be adapted for any industry”.

    To explore how Hyperledger Fabric works, watch this video.

    Consensus in Hyperledger

    According to oxford dictionary, the meaning of consensus is “A general agreement”. A consensus in a Blockchain is a mechanism of validating a transaction based on general agreement i.e. agreement of more than 51% miners in Bitcoin.
    For example, Gargi sends $100 worth of Bitcoin to Rudra, Gargi will lose 100$ worth of Bitcoin from her wallet, and Rudra will gain 100$ worth of Bitcoin in his wallet. But it needs to be validated and verified that if Gargi had 100$ worth Bitcoin in her wallet or not. This is validated by the miners in the Blockchain and if more that 51% miners agreed upon this transaction, then only the transaction will be validated.

    In Hyperledger fabric, consensus is the process by which block of transactions and their ordering are validated by the miners.

    According to Hyperledger Whitepaper, consensus must provide the following core functionality:

    • Confirms the correctness of all transactions in a proposed block, according to endorsement and consensus policies
    • Agrees on order and correctness and hence on results of execution which actually implies agreement on global state
    • Interfaces and depends on smart-contract layer. This layer verifies the correctness of an ordered set of transactions in a block

    Within Hyperledger, there are different types of consensus algorithms. These algorithms are used by different Hyperledger frameworks like Kafka, RBFT, Sumeragi and PoET. Hyperledger Fabric utilizes Kafka algorithm.

    Consensus in Hyperledger Fabric

    Consensus in Hyperledger Fabric consists of following three stages:

    1. Endorsement: To Endorse means “to approve”. In Hyperledger Fabric, predefined policies are defined under which it is stated that who will endorse whom. These policies of Endorsement are strictly followed and implemented during transaction validation.
    2. Ordering: This phase validates the order in which transaction are committed to the blockchain.
    3. Validation: At this phase, both endorsement and ordering are validated with double-spending.

    Implementation of Hyperledger Fabric using SAP Cloud Platform

    Generic Architecture

    Architecture of Hyperledger Fabric on SAP Cloud Platform

    Above a generic architecture is shown which defines how SAP Cloud Platform communicates with a Fabric Node. To explore more about Hyperledger Fabric Architecture refer here.

    Setup of Hyperledger Fabric on Cloud Platform

    To implement Hyperledger Fabric on SAP Cloud Platform we need to setup our Global Account on SAP Cloud Platform and create a Hyperledger Fabric enabled sub-account.

    Follow the following steps to enable Hyperledger Fabric on your Cloud Platform:

    Step 01: Go to your trial SAP cloud platform Cockpit [If you don’t have, go here and click Free Trial] and select region as Europe (Rot) – US East(VA).

    Step 02: Create a sub account there by giving your desired Display name and Subdomain name.

    Step 03: Click Entitlements button. You can find it in the left menu bar.

    Step 04: Inside Entitlements menu, you will see Edit button. Click it to change the mode to editable. Scroll down to Hyperledger Fabric as shown below:

    Hyperledger Setup 01

    Add dev and channel nodes by clicking ‘+’ button.

     

    Step 05: Click your sub account that you have just created to open it. Click Spaces and create a new space. Give all authorization to that space as shown below:

    Hyperledger Setup 02

    Step 06: Click on the newly space created and select Service Marketplace. Scroll down to Hyperledger Fabric and click to open it as shown below:

    Hyperledger Setup 03

    Once the initial setup of Hyperledger Fabric is done then you can proceed with creation of your own nodes and instances. Follow this Hands on Exercise and create your own SAP Hyperledger Fabric service.

  • MultiChain on SAP Cloud Platform

    Preface – This post is part of the Blockchain on SAP Cloud Platform series.

    Introduction

    Everybody is well aware with bitcoin. Bitcoin is the first cryptocurrency based on blockchain. Apart from cryptocurrency, this blockchain can be used as a platform for other data based sectors. Keeping this in mind, a private blockchain network was introduced by Multichain for Enterprises and finance sectors. In this article, we will explore basics of Multichain and how SAP has integrated it in to its SAP Cloud Platform. Before we start with Multichain, we recommend you to read What is Blockchain?

     

    What is Multichain

    According to the official Multichain whitepaper, Multichain is a platform which uses integrated management of user permissions to create private blockchains. Even, Multichain is derived from bitcoin. Multichain supports Windows, Linux and Mac servers. Multichain based blockchain network was developed to overcome shortcomings of Bitcoin such as generic mining, privacy and openness.

    Pros and Cons of Private Blockchains

    Multichain has both pros and cons. Private blockchains, such as Multichain, are the one that are controlled by single or multiple organizations that determines who can read it, submit transactions to it, and participate in the consensus or mining process. Thus, it brings both advantages and disadvantages with itself.

    One major disadvantage is that it does not support smart contracts [Although upcoming versions might have Smart contracts too]. According to official SAP website, “Since they are 100% centralized, private blockchains are useful as sandbox environments, but not for actual production.”

     

    Mining in Multichain

    Unlike Bitcoin, from which it is derived, Multichain does not depend only upon the concept of Proof of Work that can be owned by a single institute in some situation. It utilizes a round-robin schedule, in which the permitted/authorized miners have to create blocks in rotation to generate a valid blockchain. This scheme is implemented in Multichain using a parameter called Mining diversity.

    A mining diversity is a concept in which its values are defined value between 0(No restriction) and 1(Every permitted miner must be included into rotation). In actual scenario, mining diversity is kept 0.75 which means if some miners are inactive, still the mining and rotation is possible. Now, based upon mining diversity value fixed by the blockchain administrator or moderator, following are the steps for validations that are required to add a block in the blockchain:

    1. All the changes that a transaction defines should be applied successfully and in order (It means an incomplete and unordered transaction cannot be added into a block)
    2. Count the miners that are permitted to mine (suppose 10)
    3. Multiply the miner count to mining diversity (suppose 10 * .75 = 7.5), round it up to get spacing (here 8)
    4. If the miner of this block has already mined the previous spacing (spacing – 1, here 7) then the block is invalid

    Miners in Multichain neither charge transaction fees nor block rewards. Hence, transaction is free between two parties. However, a miner or an administrator can charge a fixed service fee from the blockchain network participants. SAP too applies this type of fees methodology and charges a fixed amount for a Block per hour.

    Configuration of Blockchain in Multichain

    In a configuration file, Multichain allows a user to set all the blockchain’s parameter that are mentioned below:

    • Type of chain protocol (Private Blockchain for Enterprises or Bitcoin like Public Blockchain)
    • Target time for each block (time taken to add block, e.g. 1 min)
    • Active permission types (e.g. Anyone can connect, only some can send/receive)
    • Mining diversity (as discussed above, it will be a value and it is mainly 0.75)
    • Level of consensus (authorization) required for creating/removing administrators, moderators and minors
    • Mining reward or fees (as discussed above, it can be zero too)
    • IP ports for peer-to-peer connection and the JSON-RPC API (will discuss later)
    • Permitted transaction type (e.g. pay-to-address, etc.)
    • Maximum block size (e.g. 1 MB)
    • Maximum metadata per transaction i.e. size of file that can be sent to the blockchain as transaction (termed as OP_RETURN; e.g. 4096 bytes)

    As discussed in the earlier blog, these configurations are maintained in the first node or Genesis block. To add a new node, Multichain requires to be run from another computer using a node address (e.g. chain1@12.34.56.78:8571) with three parameters:

    1. The destination blockchain name (here chain1)
    2. Its IP port number (here 12.34.56.78)
    3. The IP address of an existing node (here 8571)

    Implementation of MultiChain using SAP Cloud Platform

    Generic Architecture

    MultiChain on SAP Cloud Platform Architecture

    This is a generic architecture where it is shown how a MultiChain network is setup and how SAP Cloud Platform communicates with a MultiChain Node. If you want to explore more regarding Multichain Architecture, then refer here. We will be publishing individual courses of Multichain soon.

    Setup of MultiChain on Cloud Platform

    To Create a MultiChain on SAP Cloud Platform, initially we need to setup our Global Account on SAP Cloud Platform and create a MultiChain enabled sub-account. Then only we can proceed with development.

    Following the following steps to enable MultiChain on your Cloud Platform:

    Step 01: Go to your trial cloud platform and select region as Europe (Frankfurt) – Canary.

    Step 02: Create a sub account under your cloud platform space [Give your desired Display name and Subdomain name].

    Step 03: Click Entitlements button from the left menu bar as shown in image below.

    Step 04: Inside Entitlements menu, you will see Edit button, click it to change the mode to editable and scroll down to Multichain as shown in the image below:

    Multichain Setup 01

    Step 05: Click your sub account (the one you created above) to open it. Click Spaces and create a new space giving all authorization to that space as shown in the image below:

    Multichain Setup 02

    Step 06: Click on the space that you have just created above and select Service Marketplace. Scroll down to MultiChain and click to open it as shown in the image below:

    Multichain Setup

     

    Once the initial setup of MultiChain is done, you can create your own nodes and instances. Follow Hands on Exercise  created by a SAP developer to create your own SAP MultiChain service.

  • What is A Block in A Blockchain

    Preface – This post is part of the Blockchain Basics series.

    Introduction

    A block in a Blockchain is the smallest unit which contains list of records known as transaction data, a timestamp (i.e. a  UNIX time) and cryptographic hash (mainly SHA-256) of previous block (hash converts the previous block data into a fixed length of random data).

    The first block of a blockchain is known as Genesis block. This process of saving block is as shown below:

    blocks of blockchain

    Genesis Block

    The literal meaning of Genesis is origin. Hence, it is the origin block of any Blockchain. Since there is no previous block, hence the value is always hard coded. Since no previous block existed before it, hence the previous hash remains ‘0’ or null in this situation. All the transactions are maintained in the later blocks and the next block will store the Hash value of Genesis block in the “previous hash” section as shown in figure above.

    genesis block

    How a block is created in Blockchain

    The Genesis block, as discussed above, is created by default. All the records for given period are stored in the first block. Then Hash value of current block is created. This hash value is stored in a new block. In this these two blocks are connected. This new block saves hash of previous block, new records and hash of its own records.

    Important Topics associated with a block

    Hashing

    Hashing is a cryptographic process in which an algorithm converts a variable length string to a string of fixed length. Bitcoin uses SHA-256 algorithm to achieve the same.

    Transaction Data

    All the transaction records of a blockchain are stored as Transaction Data in a block.

    Merkle tree

    A Merkle tree represents data (in this case hash key of our transaction data) in a form of leaf and child node. Blockchains utilizes Merkle tree to store transactional data.

    Timestamp

    A timestamp in a blockchain is a converted value of GMT. Blockchain stores data with Unix Timestamp.

    Nonce

    According to oxford dictionary, the literal meaning of a nonce is “unique for particular occasion”. A nonce is a cryptographic term mainly discussed in terms of Bitcoin. It decides the difficulty level of blockchain’s block mining.

    Consensus Mechanisms

    A consensus in a Blockchain is a mechanism used by miners to validate a transaction based on general agreement (agreement of more than 51% miners in Bitcoin).

  • Differences between Web Dynpro ABAP and Web Dynpro Java

    Preface – This post is part of the SAP ABAP Web Dynpro series.

    Introduction

    Web Dynpro is a framework that is used to design web-based UI applications. We can utilize Web Dynpro in both JAVA and ABAP programming languages. Both of them are utilized in such a way that it incorporates the graphical environment comprising special UI elements which help in building an attractive UI and then resulting in minimization of coding effort.

    Web Dynpro ABAP

    As explained in last article, Web Dynpro ABAP incorporates the complete ABAP workbench in designing web based UI application. One must be having skill set in ABAP programming, ABAP Objects, Database concepts and Development tools to develop the application. ABAP based applications can be created in one system and can be transported to the destination server with the help of transport request like any other usual ABAP objects.

    Web Dynpro Java

    Web Dynpro JAVA attracted a bit less commercial success in comparison to web Dynpro for ABAP although it was introduced one year before that is in 2004. So as per SAP, this has been placed in the state of maintenance that means it will be supported till the time, any bugs will get fixed. Web Dynpro JAVA programs cab be executed by JAVA server which accesses remote system in order to obtain business functionality, while model objects are required in order to incorporate the communication functionality.

    Difference between web Dynpro ABAP and Web Dynpro Java

    1. WEB DYNPRO JAVA was introduced first by SAP that is in 2004 while WEB DYNPRO ABAP was introduced in 2005 due to very less popularity of WEB DYNPRO JAVA it is in the state of maintenance as per SAP rules.
    2. It is easier to transport WEB DYNPRO ABAP programs from one server to the destination server using transport request while WEB DYNPRO JAVA programs need to be transported by SAP Net Weaver Development Infrastructure (NWDI). It means if one wants to move the changes from one server to another they will have to additionally install NWDI.
    3. As WEB DYNPRO ABAP is incorporated into the ABAP workbench, database access is simple, just like in report programs and function module. One can access the database directly using the select statement. While in WEB DYNPRO JAVA, BAPIs (Business Application Programming Interfaces) are needed in order to eat up the business logic.
    4. WEB DYNPRO ABAP applications can be customized on both application level and component level. This configuration is done at design time which offers much flexibility and developers can change the look of the UI, quite easy to meet the business requirements. This is not the case for customization of WEB DYNPRO JAVA applications because for that custom development component (DC) needs to be created in Net Weaver developer studio.
    5. With all the points listed, we can easily summarize that Web Dynpro for ABAP is a better option with much more flexibilities in comparison to Web Dynpro for JAVA.