Thursday 27 October 2016

ABAP CDS in SAP BW

Introduction

ABAP Core Data Services (CDS) Views were introduced with SAP ABAP 7.40 SP05. CDS allows the creation of rather complex views that by far exceed the capabilities of database views created in SE11. Besides their role in the ABAP Programming Language, CDS Views are the technology behind the virtual data model on top of the SAP S/4HANA application tables which, e.g. is used in SAP S/4HANA Analytics.

This aspect – the role of CDS in SAP S/4HANA Analytics – frequently brings up the question whether or how CDS might be used in the context of SAP BW powered by SAP HANA or SAP BW/4HANA.

Wednesday 26 October 2016

SAP Screen Personas for Web Dynpro ABAP – Cross Session Scripting

Introduction

With SAP Screen Personas there is now the option to add client-side scripting to existing Webdynpro for ABAP applications.

With scripting it’s now possible to automate re-occurring or complex tasks. However there is a technical restriction: The script is always tied to the (technical) application. There is no possibility to define a script, which runs across different applications or even different browser windows. This heavily limits the applicability of scripting for automation.

Tuesday 25 October 2016

Creating a Class Handler for SICF Service (with code example)

This is both a tutorial for creating a SICF service with source code and also the documentation for zMIMESync service class. Check the open source project if you are a BSP developer.
Easy BSP JavaScript development with zMIMESync (Open Source)
My colleagues leverage new front-end technologies like JS frameworks. However each time they edit a JavaScript file they have to open the MIME file, edit it and close it to see the change in the … Continue reading
Go to transaction se24 or go to your development package to create class.
se24:

Monday 24 October 2016

Easy BSP JavaScript development with zMIMESync (Open Source)

Easy BSP JavaScript development with zMIMESync (Open Source)

My colleagues leverage new front-end technologies like JS frameworks. However each time they edit a JavaScript file they have to open the MIME file, edit it and close it to see the change in the web page. This workflow makes me cringe and I feel sorry for my fellow developers. I developed a solution for them and decided to share it with you.

Friday 21 October 2016

Introduction to CDS Test Double Framework – How to write unit tests for ABAP CDS Entities?

Motivation


By now we have all come to recognize the advantages of unit testing our code and have accepted it as a non-negotiable part of the development process. But with the paradigm shift to push our code to the database, we have been unceremoniously blasted back to the dark ages of software testing. We are now faced with the problem of how to test our code pushdown logic implemented in ABAP CDS entities.

CDS Test Double Framework enables developers to test the logic expressed in their CDS entities in an automated way using the well-known ABAP Unit Test Framework.

Thursday 20 October 2016

How to use C code via FBSL inside ABAP

The actual release candidate of Freestyle BASIC Script Language (FBSL) integrates a dynamic C JIT compiler, so is it possible to use ANSI C code inside FBSL. And with FBSLX, a COM library, you can use FBSL inside ABAP.

Here an example how to use ANSI C inside ABAP.

"-Begin-----------------------------------------------------------------
  Program zCMandelbrot.

Wednesday 19 October 2016

MD5 calculation via ABAP and JavaScript

  1. Calculate MD5 for string “Jerry” via ABAP
  2. Calculate via JavaScript
1. Calculate MD5 for string “Jerry” via ABAP

Source code:

DATA: md5_160 TYPE hash160.
CALL FUNCTION 'CALCULATE_HASH_FOR_CHAR'
  EXPORTING

Tuesday 18 October 2016

How To Use VBA Recorded Code in ABAP

With a tiny trick is it easy possible to use recoreded Microsoft Office VBA (Visual Basic for Applications) code in ABAP.

To do that I use only the Microsoft Script Control, with a little preparation for Excel. Then I read the content from an include, which contains the recorded VBA code. I concatenate the VBScript and VBA code and then I execute it – that’s all.

The only thing which is in addition to doing, is to set a point in front of each line of the VBA code. This is necessary because I use oExcel object in VBScript code.

Monday 17 October 2016

Smartforms OOPS (object oriented)

I have not had that much opportunity to work with SmartForms till very recently. I had already switched to Eclipse & ADT as my primary programming tool and thought I could get away this, not having to go back to SAPGui based development – and then I encounter SmartForms! I can’t even use normal day-to-day ABAP Editor tools, can’t use normal breakpoints, can’t do a where-used, several drill-throughs don’t work – what did I just get myself into!

After the first one that I volunteered making changes to, we realized I had to do one from scratch. Here is an opportunity – I moved all the code out to a class and called the class from within the SmartForm. This way I have all the tools that SAP & ABAP provide to work with code, I can use the ADT environment, test the data output independent of the SmartForm, use editor-based breakpoints, etc, etc…

Saturday 8 October 2016

Image in Mail body in ABAP

Objective


The requirement was to send the Birthday Mails to Employee along with image in mail body. Generally, the images are send as attachment in mail but to send the image in the mail body different approach is to be used.The main objective of this document is to send the image in email body. I searched on portals and google to resolve it but couldn't find proper solution , so decided to post the document on finding solution.

Friday 7 October 2016

Purchasing Document Approval Process with Manual Approver Selection Development

Business Overview

Our PSU Client one of the largest supplier to the Indians Rail Network, one major challenge was they have very complex authorization based on the Category’s annual limits  given to the approves.

Business Requirement
  1. A typical case will have a PR, PO and Contract with Original Value In System which will have a release code of the Approving Authorities of the Company. Now, Client requirement was to have below facility’s in Approval flow

Thursday 6 October 2016

SAPscript forms breakdown tool

Overview


"SAPscript forms breakdown helper" is a free tool for analysing forms. It has different features to help you understanding the structure of a form and the used SAPscript commands. Therefore you are quickly ready to decide what has to be changed to fulfill your requirements. Please note that you cannot make changes to a form with this tool. That's the task of transaction SE71.

Tuesday 4 October 2016

Custom function module to get the dates of last Friday/any day of given number of months and date

Purpose:

Purpose of this document is to develop a custom function module to get the dates of last Friday/any day of given number of months and date.

FM code:

Please maintain mentioned input parameters to the custom FM.

Custom function module to get the dates of last Friday/any day of given number of months and date

Monday 3 October 2016

How to create a custom TAB for MIGO Item Details

I have implemented a custom tab in MIGO, you can follow the steps.

My requirement was to add a new tab named “Warranty” in MIGO.

Step1 : Create a custom table to store the data of  “Warranty”  tab

How to create a custom TAB for MIGO Item Details

Saturday 1 October 2016

Converting Excel file data with multiple sheets to an internal table

PREREQUISITES

It is expected that the readers have the basic knowledge of Function modules and considerable experience in ABAP workbench.
Also Check that EXCEL is registered in R/3 via transaction SOLE.

INTRODUCTION

Reading data from files is a very common requirement in project implementations. Excel spread sheets are simpler and better readable to text files. The standard ABAP function module ALSM_EXCEL_TO_INTERNAL_TABLE reads data from Excel file into internal table of type ALSMEX_TABLINE.