Saturday 30 October 2021

ABAP Managed Database Procedure

The technology is evolving and SAP has developed techniques like CDS View or AMDP to solve the performance issues of fetching data from the database and also to take advantage of the HANA power.

Let’s keep up with innovations!

I would like to share with you some of the basic information we need to have about AMDP.

ABAP Managed Database Procedures (AMDP)  was introduced in Release 7.40, SP05, allowing developers to create their software and write directly in ABAP. Database procedure, but fully managed on ABAP.

Friday 29 October 2021

Code Pushdown – CDS date interval slicing

Interval slicing is a task that developers need to deal with when working with overlapping records with validity periods – such as conditions in SAP. At single point in time multiple records can be valid (perhaps with different condition type). This blog will show you how to achieve this in CDS views without writing single line of ABAP.

ABAP Development, SAP CDS, SAP ABAP Tutorial and Material, SAP ABAP Exam Prep, SAP ABAP Career, SAP ABAP Learning, SAP ABAP Database
Overlapping intervals

Such data is saved in SAP in database table as per picture below – lets call the table ZSLICE_DB  (it has 4 records – corresponding with picture above).

Monday 25 October 2021

Display Short Material Product Hierarchy Level Keys with ABAP CDS Views

Material Product Hierarchy displays long levels key based on T179 table, but users accustomed to see individual level short keys the ways they maintained in MM02 transaction. Take Material Product Hierarchy to a next level addressing user requirements.

Below is how users assign hierarchy levels are maintained in MM02 transaction

ABAP CDS Views, SAP ABAP Exam Prep, SAP ABAP Tutorial and Materials, SAP ABAP Career, SAP ABAP Preparation, SAP ABAP Jobs

Sunday 24 October 2021

ABAP SQL: Indicator Structures

From ABAP release 7.55 you can declare indicator structures along with the statement TYPES. The indicator structure is the last component of the structured type and mirrors the preceding components as indicators of type x of length 1. The new addition WITH INDICATORS to the statement TYPES allows to define an indicator structure as a substructure, i.e., structured component of a nested structure, of a given structured type.

ABAP SQL Indicator

Generally speaking, an indicator is a one-byte character field that is either set on (‘1’) or off (‘0’). Indicators are like switches which normally used to indicate the result or to control the processing of an operation. You can use an indicator structure as an ABAP SQL indicator representing a null indicator in ABAP SQL read or as a set indicator in write statements. In read statements, the indicators can store information while in write statements, indicators can be used to mark columns for change. The components of the null indicator indicate which columns of the result set contain the null value to indicate an undefined value or result and which don’t. The indicator structure is created equally for each data type of a first-level component of structure. This means that, for example, each substructure or each reference variable is mirrored in the same way as an indicator component is mirrored as an elementary component of structure.

Friday 22 October 2021

Send password protected ZIP file (PDF file inside ZIP folder) from SAP via email

This blog describes the procedure to email a ZIP file (PDF file inside ZIP folder) with password protection, as an attachment. Normally, we have a scenario where we convert the OTF output of a Smartform, or a spool request to PDF.

Without using any third-party tool, we can password protect the ZIP file (pdf file inside the ZIP folder) and send it via email using SAP.

Business Scenario

Generate a payslip using smartform, encrypt it with a password and send it to the employee via email.

Prerequisites

◉ You are able to generate a smartform with OTF data

Wednesday 20 October 2021

New kinds of ABAP expressions

New ABAP expressions for generic and dynamic programming in ABAP Platform 2021:

Part I – Dynamic Access to (maybe generic) references

Do you use the new ABAP expressions like constructor operators or table selectors in your coding? But you often find that when using generic programming, i.e. data types like REF TO DATA, DATA or ANY you fall back to programming style of the 70th? Then the new ABAP platform 2021 (which shipped with kernel 7.85 last week) has some new features to get you clean up your coding.

The main mantra of the new release is: “Get rid of field-symbols!

Monday 18 October 2021

A new generation of CDS views: how to migrate your CDS views to CDS view entities

With ABAP release 7.55, a new type of CDS view has been released: the CDS view entity. CDS view entities are an improvement over the “classic” CDS DDIC-based views.

CDS Views, SAP ABAP, SAP ABAP Tutorial and Materials, SAP ABA Certification, SAP ABAP Preparation, SAP ABAP Guides, SAP ABAP Career

New migration tool available


Now, a new migration tool is available that automates many steps of a migration from a CDS DDIC-based view to a CDS view entity. But that’s not the only helper to facilitate a migration. The following support has been released:

Friday 15 October 2021

Design Patterns in ABAP: Factory and singleton (and the wonderous world of OO-Abap)

Introduction

Did you ever encounter that even after the statement DEFINITION DEFERRED you still need to move the definition of your class? Or have you ever wondered that if a singleton-class has several subclasses, why all those subclasses will be singletons, or that all classes in the tree will be one singleton? Those experiences were new to me, but I encountered them and I wanted to share my amazement.

This blog is a mixture of a how-to create a factory-class for singletons with inheritance, some surprises I found during coding and a request for advice. So please, please comment and ask questions. I would love to learn from my mistakes and wrong assumptions. I chose to not use test-driven approach to keep this blog more readable.

Thursday 14 October 2021

Include Batch expiration in Material Requirement Planning

Why does Batch Expiry critical in MRP?

Life science (Pharmaceutical/Food/Chemical) products always have limited shelf life and also have limited environment exposure life. Product has to be manufactured and sold/consumed before expiry of its shelf life. I have been into SAP production planning and supply chain consulting practice for the last 20 years. This has been a pain area since decades for planning and manufacturing business function. This is important to find out a systematic solution to account batch level expiry of components in enterprise level material requirement planning in order to streamline material availability on time manufacturing lines and minimize waste due to expiry. This blog will help the SAP community to solve the long pending problem of  non-accountability of  batches with expiry dates in Net requirement calculation of SAP-MRP.

Monday 11 October 2021

Customized Fields in Dispute management of FSCM

My previous companion article demonstrated the enhancement to add customized fields at Case Management. In this article, I’m going to show how to add customized fields in Dispute management.

ABAP Development, SAP ABAP Exam Prep, SAP ABAP Career, SAP ABAP Learning, SAP ABAP Tutorial and Materials, SAP ABAP Certification, SAP ABAP Preparation, SAP ABAP Guides

Friday 8 October 2021

About Checked Credit Value at Credit Management

Checked Credit Value is wildly used in credit management. Sometimes it could be a little confused as it does not always equal the total credit value of the sales order. The simplest scenario, it’s the input amount value when performing a simulation of a credit check for a specific business partner along its credit segment. The log of results of UKM_BP simulation and its credit check displays like below:

ABAP Development, SAP ABAP Tutorial and Material, SAP ABAP Certification, SAP ABAP Career, SAP ABAP Learning

Wednesday 6 October 2021

Regular Expressions (RegEx) in Modern ABAP

In this blog post, I would like to share the latest news and changes made to Regular Expressions in modern ABAP, mainly from OP release 7.55 & 7.56.

Previously, POSIX style regular expressions or “Portable Operating System Interface for uniX” was used in ABAP. Hence, from now on, regular expressions in POSIX syntax are obsolete, then using this kind of regular expressions syntax leads to a warning from the syntax check. Although this can be hidden by the pragma ##regex_posix, it is strongly recommended to migrated to the other regular expression syntax supported by ABAP like PCRE regular expressions, XPath regular expressions or XSD regular expressions.

Tuesday 5 October 2021

ABAP – Past, Present & Future

What’s in a name?

SAP is notorious for rebranding its own acronyms to meet market requirements.

The original meaning of ABAP was “Allgemeines Beleg AuswertungsProgramm” meaning “general program to evaluate documents”. Later on it was changed to “Allgemeiner Berichts-Aufbereitungs-Prozessor” which means “”generic report preparation processor” and nowadays we talk about “Advanced Business Application Programming”.

Monday 4 October 2021

How to generate RAP BOs with custom entities?

With the latest version of my open source project the RAP Generator the tool is able to generate RAP business objects whose data model consist out of custom entities.

As a datasource you can use one of the follwoing datasource types:

◉ Abstract entities

◉ DDIC structures

◉ ABAP types (which currently have to based on DDIC structures as well)

Saturday 2 October 2021

Steampunk is going all-in

SAP BTP, ABAP Environment, ABAP Development, ABAP Extensibility, SAP Business Technology Platform, SAP Extension Suite, SAP ABAP Preparation, SAP ABAP Career

In Poker, going all-in can mean you’re really desperate. Or pretty confident that it’s the right thing to do. Judging by the spirit of optimism in our ABAP Platform dev teams, I don’t think we’re desperate, and here are some of the reasons why:

◉ The ABAP Platform unit has sort of rejuvenated. More than half of our employees have joined us during the past 4 years. ABAP is ready for the years to come.

◉ We feel we’re relevant. Our biggest issue now is to handle the growing demand of customers, partners, and internal stakeholders. Could be worse.

Friday 1 October 2021

Printing Charts / Graphs on Smart Forms Dynamically

In many requirement graphical charts are required by the clients since a graph is much more appealing to the user. As graphs enables a better analysis of data to the user. It is however quite simple to provide the same functionality for building graphical charts in your ABAP report itself by using CL_IGS_CHART_ENGINE.

Recently I had the requirement of printing Charts on Smart forms. In Smart forms we can print the image if the image is already uploaded to the Form Graphics (SE78). I search through the SCN but doesn’t find the solution of printing the charts on Smart forms. Then I had an idea of uploading the graphical image generated by CL_IGS_CHART_ENGINE dynamically to Form Graphics (SE78).  I have used the same functionality as used in Form Graphics (SE78) import to upload the image dynamically in Form Graphics.