Follow SAPSPOT on Feedspot

Continue with Google
Continue with Facebook


In this blog will see how to create Employee as a Business Partner which involves HCM Module as well, let me quickly explain why it’s required to create employment as a BP.

As with 1511 onwards, BP is mandatory and also Employee with User ID assignment is mandatory for a few of the Fiori Apps like Work Flow & Supplier Evaluation, so that’s the reason Employee has to be created as BP and Syncronized with HR Data

Now, let us start the process.

1. Go to PA30

2. Select Actions Infotype and click create

3. Enter the Parameters as shown Below

4. Click save it will name next screen

5. Maintain Employee details

6. Click on save will take to next screen

7. Enter sub-area

8. Save

9. Maintain Address

10. Select main back (0)

11. Save

12. In the highlighted area select info type “communication” and sty “00001”

13. Click on Create

14. Enter the USER ID and save

NOW Employee is created with Personnel Number

15. BP Creation Go to BP T.Code

16. Select BP Category as Person and BP Grouping as “BPEE”

17. Enter all the Parameters as per the requirement as shown Below

18. Once all details are filled click on check to validate details.

19. Go to Identification Tab

20. In ID Type enter HCM001 and previously created personal number in PA30 and click save

21. Now select FLNV00 role and click company code

22. Enter CC and Reconciliation account and scroll down

23. Enter the personal number and save

24. Now select FLVN01 Roll and select Pur.Org

25. Enter Pur.org and Order Currency and save

26. Now Select FS0000 roll and open company code and check its extended or not and save

27. Select BUP001 Role and check all address details are populating or not and save

28. With this BP is created

Now Synchronization with EMP and BP

1. Open SA38 Transaction


3. And execute

4. Give the personal number which is created in PA30 and run the program

5. Now will check log in SLG1 Transaction

6. Main below data in object and subobject fields


Subobject BUPA_SYNC

7. Once object & Sub-Object are maintained as shown Above execute the log.

8. Now EMP ID and BP have Synced.

9. Open SU01 Transaction

Its Synced with BP as shown

Now Fiori Apps Like Manage Work Flow or Manage Purchasing Categories your Employee ID with USER ID details will be shown or else we can’t perform those activities as Fiori is the only option to perform those activities these steps are mandatory

Read More: SAP MM Certification Preparation Guide

The post Employee as a Business Partner and Synchronization with HCM Data appeared first on SAPSPOT.

  • Show original
  • .
  • Share
  • .
  • Favorite
  • .
  • Email
  • .
  • Add Tags 

This document covers SAP credit management (FIN-FSCM-CR available in FSCM) functionality from SD perspective mainly keeping in mind the difference between the current credit management (FI-AR-CR) that we are using before S4 HANA Vs the SAP credit management (FIN-FSCM-CR) functionality available in S4 HANA. It only talks about the credit management functionality at high level, may be helps as an outset for someone who is looking to know about S4 HANA credit management config and flow.

When it comes to credit management, we all know that transaction OVA8 which drives the credit check, plays an important role. This has all the checks and validations that is required to perform credit check:

But in SAP credit management (FIN-FSCM-CR available in FSCM), this transaction has less settings, due to the fact the checks are now controlled thru different transaction in FSCM. So, in general, SAP credit management transaction OVA8 will act as a control mechanism to activate/deactivate SAP credit management FIN-FSCM-CR, further the checks on the static, dynamic, max doc value etc are all going to be carried out at in different transaction at FSCM.

Below is the current OVA8 screen:

where the check box “SAP credit management” activates a BADI (BADI_SD_CM) which has 2 methods one for sale order and the other for delivery:



This BADI carries the data to the FSCM credit management during order creation/delivery, thus the checks defined in the FSCM credit management will become effective. So, the OVA8 transaction is now going to act as a trigger point to carry out SAP credit management (FIN-FSCM-CR).

Credit Segment:

Apart from the credit control area hierarchy, we will come across one more hierarchy in credit management organisation structure which is credit segment. Credit segment is a hierarchy in FSCM SAP credit management and therefore you must link the credit control area with the credit segment, which is one to many.

Definition of credit segment as explained by SAP:

Organizational unit of SAP Credit Management that companies can define, for example, by product type or business area.

In a telecommunications company, a subclassification of relevant business transactions according to the following credit segments could be useful:

Fixed network


Mobile telephones

Where in the above example we can have different credit segment for each sector and manage with one credit control area. Also, there is a partner relationship functionality to link Higher Level Credit Account of or Lower Level Credit Account of; where we can restrict relationship to one credit segment, which acts like a functionality of maintaining credit limit at customer hierarchy level in old credit management.

Above are the some of the main points which explains the difference between FIN-FSCM-CR and FI-AR-CR credit management, now we are going to cover the list of minimum configurations that is required to activate SAP credit management (note credit control area definition/assignment and sales doc /item catg credit activation is not covered here as it follows the existing process).

1. Activation of SAP credit management- SPRO->Financial Supply chain management->Credit Management->Integration with Sales and Distribution->BADI activation of SAP credit Management.

This is an important step, else credit management FIN-FSCM-CR will not be called from SD.

2. Creation of Credit segment:

3. Assignment of credit control area and credit segment:

4. Define “checking Rule”, very important config which holds the static, dynamic, maximum document value etc related checks:

The list of credit checks that is required to be performed is set-up here for a checking rule:

Note: The checks that we see in OVA8 is available in FSCM credit management as shown below in form of steps where the old credit management (right) is also shown as a comparison:

You can select a step to see the detail set-up where you can fine tune the config:

Example in step 030, dynamic credit check that is included in checking rule 04, has further settings of defining the credit horizon period in days:

Likewise, we have to add other required steps against a checking rule that needs to be checked during credit check.

Since all the required settings are in place, we can now perform the transactions which starts with Master data creation followed by sale order process.

Creation of Credit master data for business partner – Transaction UKM_BP:

Select the BP Role UKM000, and under general->credit profile tab select the Checking Rules that we have defined above which is going to drive the type of credit check,also risk category is now named as risk class which needs to be selected:

Apart from the above, we must enter the credit segment and credit value in the “Credit Segment data” view as shown below, also in the same screen we can also see the credit utilization and credit horizon:

Sale order creation-Credit check:

During sale order creation as usual we get the credit exceeding warning in below format:

In the old credit management, info structures S066 and S067 are used for updating open sales orders and deliveries/billing respectively, as per FSCM these info structures are not used, where as UKM_ITEM is the table which will get updated. Credit exposure category in UKM_ITEM table represents whether it is a sale order or delivery or billing document:

Where 100 stands for Open sale orders:

400 – Open delivery (PGI not done):

500-Open Billing document (w/o accounting document):

Successful posting of invoice will remove the entry from this table.

More Info: SAP SD Certification Preparation Guide

The post S/4 HANA SAP credit management (FIN-FSCM-CR)-Integration with SD appeared first on SAPSPOT.

  • Show original
  • .
  • Share
  • .
  • Favorite
  • .
  • Email
  • .
  • Add Tags 

When We are Implementing SAP S/4HANA solution, We can migrate our master data and business data from SAP systems or non-SAP systems to SAP S/4HANA. By using SAP S/4HANA migration cockpit.

The SAP S/4HANA migration cockpit uses migration objects to identify and transfer the relevant data. A migration object describes how to migrate data for a specific business object to SAP S/4HANA. It contains information about the relevant source and target structures, as well as the relationships between these structures. It also contains mapping information for the relevant fields, as well as any rules used to convert values that are migrated from source fields to target fields. The SAP provides predefined migration objects that you can use to transfer your data.

The Tool used to perform Migration is LTMC – (Legacy Transfer Migration Cockpit)

You can access the SAP S/4HANA migration cockpit by using transaction LTMC.

Note the following considerations when deciding on the most suitable approach for your project:

Consideration Files  Staging Tables 
Size Limit 200MB limit for SAP S/4HANA Migration Cockpit .* No Limit.
System Considerations  None.  Staging system uses an SAP HANA database. 
Data Provisioning  Enter data manually in each Microsoft Excel XML file.  Fill tables manually or by using preferred tools (for example SAP Agile Data Preparation). 

For on-premise systems, parameter icm/HTTP/max_request_size_KB controls the size of the http request. The value of this parameter is the maximum size (in KB) of an HTTP request. This parameter has the standard value 102400 kb (100MB) but can be changed if required. For more information

Now let’s See Spets to upload Supplier As BP in SAP HANA System

Steps to Use LTMC
  1. Enter LTMC T.Code

2. LTMC Web page / Fiori App will get opened

3. Click on Create for Starting New Migration Project

4. Provide Project Title & Data Retention Time and hit Create

5. In the Search bar, we can look for an object which we want to use and upload data

6. Select Required Object and click open

It’s just an information and press ok

7. Click on Download Template so XML file will be downloaded

8. A pre-filled Template with detailed of each field and business is available

9. In Field, List Sheet will find each sheet which and all are mandatory based on that we will fill data and upload

10. In General, Sheet Fill All the mandatory fields and also other important fields

  • If you want to create an organization: fields 4-7 are relevant;
  • If you want to create a person: fields 8-12 are relevant.

Read More: SAP Fiori System Administration Certification

11. In BP Roll Sheet maintain BP Supplier Finance Accounting & Supplier Roles As its Supplier Template General Roll will be created automatically as we maintain General Data in General Sheet

12. In Additional Address, Sheet maintain All Mandatory fields along with Address fields

Please make sure in General Sheet and in Additional Address sheets maintain External Address Number differently it’s just for identification purpose

13. in Company Code Sheet Maintain Reconciliation Account Number As per Business

14. In Purchase Organization Sheet maintain All mandatory fields along with other parameters which are important to business

15. In Partner Functions, Sheet maintain Partner Function “LF” if its Supplier and Vendor name Same as Vendor Which is Creation

16. Once the template is ready with all required data need to follow below Steps

A. Upload File
B. Activate
C. Start Transfer
D. Data Validate
E. Convert values
F. Simulate
G. Execute Import

17. Click Activate

18. Click Start Transfer

19. Data will get Transferred once its done Close button will get enabled

20. If any error or data is missing will get error hear if all data in templet is good we can proceed further

21. Click next

22. When we are executing for the first time particular object in a project we need to Map fields.

23. Click each line item and do Mapping of Values

24. Select Line Item and Click check once status turns in to Green Light click save so next time system will do the mapping automatically

25. Once all the mapping is completed and no open items click next to simulate Import

26. Similar to upload once its completed click close to proceeding further

27. Backed Program will execute and data gets simulated if any missing data of mandatory fields and fields Mapping is wrong

28. If any error go back and fix and repeat same if no error click Next

29. If all the steps are completed without any error will get above message then click finish.

Migration Status is now Finish
  1. Now Check whether BP Is created or not is created or not
  2. Open Maintain Business Partner App

3. The supplier has been Created As BP with Required Roles

For uploading data without any error try with one Supplier and will get a lot of errors when doing initially do trial and error so will get Expert in LTMC.

More Info: SAP Fiori Application Developer Certification

The post LTMC BP – Supplier Step by Step Process appeared first on SAPSPOT.

  • Show original
  • .
  • Share
  • .
  • Favorite
  • .
  • Email
  • .
  • Add Tags 

Studying for the SAP certification exam seems intimidating in the beginning. You may have many months ahead of you to finish your entire syllabus. But the question is, how are you going to study for your exam?

Effective learning is more than joining for class and reading from a book from time to time. Most successful applicants become successful by producing and practicing intelligent, efficient study habits. These study habit will be beneficial while you’re learning, and will also benefit you when you start your new SAP career.

So what kind of study habits you need to score well in your SAP exams. To crack the SAP certification, you need to study smarter, not harder. Regular study habits that help you not only read but remember and moreover understand the concepts, the information is given are the ones that will take you through learning with the most amount of retention is the most powerful. Here are some to get you started.

What Type of Learner Are You?

The best study time is when you’re active and alert. If you can study well in the morning for you, and you consider yourself a morning person’. If you’re more of an “evening person,” you should spend time in the evening for effective studying.

A daily routine for studying sets out the time in your day. To study efficiently and helps you keep up the habit, make a practical study plan. Delaying may be easy for just one day, but that should not become a habit. Sticking to your studying schedule will help you learn the subject matter and become more successful with it.

Study from Books

Books always have been an excellent resource for any exam. Learning from books makes you understand the topics thoroughly. And it will also help you take more effective notes. You can also note down questions if you’re unclear on some of the topics.

Study from Videos

To study videos, you need to be a good listener. There are many platforms available which provide the best videos for SAP certification exam preparation. But one of our most significant obstructions can prevent you from learning is your phone.

Checking email, texting, and otherwise, not paying attention isn’t helpful to listen. Listening carefully helps you both understand the subject and take useful notes.

Hint: Learning to take notes now is a skill you’ll practice later in your SAP career. You’ll require listening and good note-taking for meetings, too.

Study Regularly

“Cramming” isn’t an adequate study method. Studying regularly is an excellent way to not only study a lot of information but understand it and remember it as well. Having a regular study routine generates a commitment to study that will also help you to progress in your career.

Revise from your notes within 24 hours of learning it. You could forget as much as of 80% what you have studied.

Persistence is the key to not only getting started but staying on path as your learning—and your career development. Repetitive exposure to the study topics helps to remember it in the long-term, with repetition being a major factor in reviving.

Choose a time where you can completely concentrate on your studying, whether it’s after dinner or early morning. Consider the rest of your time, and what liabilities you have to equalize.

Of course, there are times when life surpasses your study schedule. If something stands in the way, get back to your usual study times as quickly as you can.

Find a Study Partner for SAP Certification Preparation

Working with other students is an excellent way to discuss your study topics and acquire help when you require it. Being together with like-minded people is always a fabulous way to learn more by working with others who are involved in the same thing, such as determining the basics of SAP. By discussing the information and making contact with others, you’ll strengthen your understanding and improve your knowledge of the subject matter.

Facebook and other social media are loaded with many groups from where you can find like-minded people to study with. You can also come in interaction with other SAP aspirants using Skype, Google Hangouts, Zoom, and other video chat services that let you meet online if in-person meetings don’t carry out.

The Pomodoro Technique

This simple productivity technique is excellent for students. The Pomodoro Technique is a time management technique presented by Francesco Cirillo. The method practices a timer to break down work into intervals, traditionally 25 minutes in length, separated by short breaks. Wikipedia

The technique is simple:

  • Determine what you need to complete; make a list, if required
  • Spare your timer for a particular interval (usually 25 minutes, you may wish to longer durations like 55 minutes for studying)
  • Work on the topic without a break, or being attentive to anything but what you’re doing.

Check off your learning as done

  1. Take a small break (no longer than 5 minutes) and come back to studying/working, and put your timer for another 55 minutes, and check off if the task is done.
  2. After four checkmarks, take a more extended break, (no longer than 30 minutes) re-set your list to zero, and again start over at step 1 or 2.

The “Pomodoro” part is the time you spend working. Of course, you can practice any time you have, comprising one in your smartphone. Just stick with the time limit, work on only one task, and outline everything else that can divert you. Keep your breaks short and come back to work as they completed. Phone Calls, Facebook, and other distractions can wait until your next break, or until you’ve accomplished your study schedule.

Understand Your Study Mojo

The best means of study are the ones that you use continuously and work well for you. Over time, you may develop your ways of studying that suit your routine, such as a little study time on your lunch hour, if you’re already ha.

It’s also essential not to give up, and continue the learning until you have a good grasp on all the topics. It’s challenging at first, but once you get started, you’ll be able to study more efficiently, retain more, and learn better. That interprets into better test scores, better grades, and ultimately, a great career.

Enroll for Your SAP Certification Today

SAP certified professionals are in high demand and hiring managers are yelling to hire the best. But in order for them to understand that you are the best, you must introduce yourself that way. Apart from the necessary certifications, your soft skills must be able to present you as an SAP expert.

Visit SAP Certifications for More Information.

The post Excel in SAP Certification Exam with these Effective Study Techniques appeared first on SAPSPOT.

  • Show original
  • .
  • Share
  • .
  • Favorite
  • .
  • Email
  • .
  • Add Tags 
Motivation and Introduction:

Rest Services are very popular and widely used. But Rest is only a programming paradigm and or an architectural approach as such it doesn’t set up any contract how services are offered, and which format the payload will have finally.

To address this contract there are a lot of service descriptions available meanwhile. You can have a look on how many there are at wikipedia. The ones I came accross the last years very frequently are oData and openApi.

SAP Netweaver comes with great support of oData and as both service descriptions have the same paradigm (Rest) underneath the differences between oData and openApi are not that great as one maybe think about.

Although it’s possible to write Restful Services with ABAP with some framework classes of package SREST you won’t have the service infrastructure of SAP Netweaver Gateway at hand and nonfunctional requirements, like technical error logging and tracing capabilities become crucial with distributed applications.

The OASIS group is maintaining a toolset to generate an openApi description from oData service description document.


Here I’d like to dive into that and see how to build a simple java client from such an openApi description which transparently accesses an oData service. That becomes especially interesting with oData v4, as the payload is ‘plain json’ there. So we’ve a good chance to see that working and leverage the SAP Netweaver Gateway features for openApi services built on the ABAP stack.

In order to do that we will:

  1. Build and deploy a simple v4 oData service
  2. Download and install the toolset to generate the openApi description
  3. Generate the openApi description the oData services description
  4. Download and build the swagger code generator
  5. Generate and install the openapi client from the openApi description
  6. Build and run a simple java program which uses the openapi client generated.

To follow the steps here the following software need to be available/installed:

  • Nodejs
  • Git SCM
  • JDK (here 1.8)
  • Apache Maven
  • SAP Netweaver ABAP 750 SP4
Build and Deploy a simple v4 oData service

Go to Transaction “SEGW” and click “New” button to create a new service

Create the project with the settings shown at the screenshot. Especially choose Project type “OData 4.0 Service” and store as local object.

Expand the node „Data Model“ double click on Entity Types, press the New button on the right pane, enter Entity Type Name „contractType“ and press enter.

  1. Expand the node „contractType“, double click on properties
  2. Press the New button two times.
  3. Set the first properties name to „contractId“, check the checkbox for „Key“, select type kind to „Core Type“ and choose data type „Edm.String“
  4. Set the second properties name to „contractName“, select „type kind to „Core Type“ and choose data type „Edm.String“
  5. Press „Save“

Double click on entity sets, press the new button on the right pane, set entity set name to „contract“ and entity type name to „contractType“, press enter and save

Press Generate

Leave the class names as provided and save as local object in the next dialogs.

  1. Expand the runtime artifacts
  2. Double click on „ZCL_ZTEST_SERVICE_V4_DPC_EXT“
  3. And double click on „ZCL_ZTEST_SERVICE_V4_DPC_EXT“ on the right pane in order to open the class editor.

Add the following method to ZCL_ZTEST_SERVICE_V4_DPC_EXT

Goto Transaction /IWBEP/V4_ADMIN

    clear ET_CONTRACTS.

    <fs_contract>-CONTRACTID = 1.
    <fs_contract>-CONTRACTNAME = 'Sample contract 1'.

    <fs_contract>-CONTRACTID = 2.
    <fs_contract>-CONTRACTNAME = 'Other contract'.

    <fs_contract>-CONTRACTID = 3.
    <fs_contract>-CONTRACTNAME = 'Test contract '.

    <fs_contract>-CONTRACTID = 4.
    <fs_contract>-CONTRACTNAME = 'Special contract'.

    <fs_contract>-CONTRACTID = 5.
    <fs_contract>-CONTRACTNAME = 'Final contract'.


Redefine the method CONTRACT_READ_LIST as follows:

*    IO_REQUEST  =
*    .

      ET_CONTRACTS = data(lt_contracts)
*    catch /IWBEP/CX_GATEWAY.    "

        ls_proc_info type /IWBEP/IF_V4_REQU_BASIC_CREATE=>TY_S_TODO_LIST.



Goto Transaction /IWBEP/V4_ADMIN

Click on Register Group

Create a service group with the following settings:

Service Group: ZTEST_SERVICE_V4

Description: Odata V4 Sample Services

Package: $TMP

Click on register

Register the service as shown in the screenshot

Finally you should see the Service we’ve created assigned to the service group we’ve created.

Goto Transaction /IWFND/V4_ADMIN

Click on “Publish Service Groups”

Choose System alias „LOCAL“ and press button „Get Service Groups“

Select the Service Group „ZTEST_SERVICE_V4“ (the group we’ve created) and press „Publish Service Groups“

Leave the settings as they are at the „Publish Service Group“ dialog and click „Ok“. Then create a new transport request an save the settings.

You should see a success message.

Go back to /IWBEP/V4_ADMIN find the service group and select the service and press the button „Service Test“

Choose local gateway system

Now you see the Gateway Client with the metadata url. Press „Execute“ to retrieve the services metadata.

Now we’ve the oData Service description document. Right click in the browser and save it as „odata_v4_service_description.xml“

Additionally we can do some testing. Use the url „/sap/opu/odata4/sap/ztest_service_v4/default/sap/ztest_v4_service/0001/contract“ and Execute

So we see the sample data we’ve provided at the mock data method.

For now, we’ve our oData v4 Test Service and the according service description document. So we can go on to translate the oData Service description to a openApi description.

Download and install the toolset to generate the openApi description

Open a command window go to a directory of you choice to download/clone the toolset from github:

C:\user\project> git clone https://github.com/oasis-tcs/odata-openapi.git
Cloning into 'odata-openapi'...
remote: Enumerating objects: 206, done.
remote: Counting objects: 100% (206/206), done.
remote: Compressing objects: 100% (82/82), done.
remote: Total 4291 (delta 157), reused 164 (delta 120), pack-reused 4085
Receiving objects: 100% (4291/4291), 6.50 MiB | 28.68 MiB/s, done.
Resolving deltas: 100% (3613/3613), done.

As the toolset is cloned to you local repository change into the odata-openapi subfolder an use npm to install the tool locally:

C:\user\project>cd odata-openapi
C:\user\project\odata-openapi> npm install -g
C:\Users\Administrator\AppData\Roaming\npm\odata-openapi3 -> C:\Users\Administrator\AppData\Roaming\npm\node_modules\oda
+ odata-openapi@0.0.0
added 4 packages from 2 contributors in 1.819s
PS C:\user\project\odata-openapi>

With that we have the toolset installed locally and we can continue and create the openApi specification from the oData Service description.

Generate the openApi description the oData services description

Now give the the oData v4 service description document to the tool odata-openapi3 in order to generate the openApi specification from.

C:\user\project\oDataServiceAsOpenApi> odata-openapi3 --host hostname:port .\odata_v4_service_description.xml

Hint: You can get the hostname from Transaction SICF when searching for service „odata4“ and test the service. You see the host and port at the browser then.

The tool created a file „odata_v4_service_description.openapi3.json“

Open this file in an editor copy the content and go to https://editor.swagger.io/ and paste the files content into the editor pane:

Now we see the v4 oData service described by an openApi description

Read More: SAP ABAP 7.4 Certification

In order to support at least basic authentication with the java client we will generate apply security settings manually at the openApi specification in the swagger editor. I converted to YAML for convenience.

add the following to the components section:

basicAuth: # <– arbitrary name for the security scheme
type: http
scheme: basic

and the following security constraint at the end of file so it’s used for the whole service:

  - basicAuth: [basicAuth]  # <-- use the same name here 

After the security configuration it’s also necessary to care about the service-root path at the service description. So change the following default …/service-root:

to the actual path of our oData service:

Save the modified openApi specification in order to use it later to generate the java client.

Download and build the swagger code generator

To generate the java client from the openApi specification we will next download and build the swagger code generator tool.

Go to a directory of your choice and clone the repository of the swagger code generator:

git clone https://github.com/swagger-api/swagger-codegen.git

Change into the subfolder swagger-codegen and checkout the version 3.0.9

cd swagger-codegen
git checkout tags/v3.0.9

When checkout is finished start building and packaging with maven

mvn clean package -DskipTests

Building swagger-codegen can take a while, at the you should see a message that the Build was successful. Now we’re ready to generate the java client using the code generator.

Generate and install the openapi client from the openApi description

Although that’s not the best practice we’ll use the generator from its project folder (swagger-codegen) and place the files and output folders there to keep things simple.

To create the java client we create a java-config.json file in the swagger-codegen project folder with the following content:

“modelPackage” : “com.sample.test.model”,
“apiPackage” : “com.sample.test.api”,
“invokerPackage” : “com.sample.test.client”,
“groupId” : “com.sample.test”,
“artifactId” : “sample-openapi-client”,
“fullJavaUtil” : true,
“dateLibrary” : “java8”

We also copy the modified openApi specification into that folder. Here I renamed the file to odata-v4-service-description.openapi.yaml

It’s also necessary to create the empty output folder where the java client is generated to:

mkdir java-sample-client

Then we can call the code generator using the following command:

java -jar .\modules\swagger-codegen-cli\target\swagger-codegen-cli.jar
generate -i odata-v4-service-description.openapi.yaml
-l java -c .\java-config.json -o java-sample-client

After that we can see the generated client at the subfolder java-sample-client

To build and install the client to the repository go into this folder and use:

mvn clean install

After that you should see a success message:

As we’ve now created the client and installed it we can now write a program which uses this client to access the oData Rest service running on our abap netweaver.

Build and run a simple java programm which uses the openapi client generated

To create the test program here eclipse with M2Eclipse is used to make usage of maven as simple as possible.

Start eclipse and create a new Project:

Choose Maven project to create a new Maven project.

Check to create a simple project without archetype selection and press next.

  • Show original
  • .
  • Share
  • .
  • Favorite
  • .
  • Email
  • .
  • Add Tags 

In this blog post you’ll learn the settings required in SAP BW/4 HANA in order to connect SAP Data Hub. In particular it describes the authorizations required for the connecting SAP BW/4 HANA user. For this post a SAP BW/4 HANA 1.0 system was used. The settings are similar in every SAP Business Warehouse system however. To connect your SAP Business Warehouse to SAP Data Hub the following Support Packages are required.

SAP BW release Support Package 
SAP BW 7.40 20 
SAP BW 7.50  14 
SAP BW 7.51  10 
SAP BW 7.52 16 

Please note that this blog post focuses on the scenario of SAP Data Hub calling SAP BW4/HANA. The integration in the direction of SAP BW4/HANA calling SAP Data Hub is not part of the post.

Prerequisites in SAP Business Warehouse

In order to connect to a SAP Business Warehouse system, you need to make sure that certain services and SAP Notes are applied. It’s assumed that you have already made a Client Copy and, in case of SAP BW/4 HANA, for example the task list SAP_BW4_SETUP_SIMPLE has been executed via transaction STC01. Please make sure that you include the task ‘Activate InA Services for SAP Analytics Cloud Integration’.

As the InA protocol and the Business Warehouse REST-based Discovery service are used from SAP Data Hub to communicate with SAP BW4/HANA make sure that the SAP Business Warehouse system is reachable via HTTP or HTTPS (ensure that the ports are opened and, in case of HTTPS, that the relevant certificates are uploaded). You can maintain the required parameters in transaction RZ10 using the ABAP profile and restart the ABAP server afterwards to activate the entries. This is an example of HTTP port and HTTPS port:

icm/server_port_0 = PROT=HTTP, PORT=, PROCTIMEOUT=600, TIMEOUT=60
icm/server_port_1 = PROT=HTTPS, PORT=, PROCTIMEOUT=600, TIMEOUT=60

You can check if the InA protocol is working by use of transaction SICF. Choose Service as the Hierarchy Type and press the Execute button. Navigate to default_host –> sap -> bw -> ina right click on GetServerInfo and choose Test Service from the menu. If the services are not active, you need to activate them.

The Test Service functionality will open your browser to connect to the Service you specified. As a response a JSON Object should be displayed which contains some general information about your system (e.g. System Id and Client).

In case the endpoint cannot be reached you may try using the Gateway Client (transaction /IWFND/GW_CLIENT) to test it.

Go back and check if the services and the sub services of default_host –> sap -> bw -> whm; default_host -> sap -> bw4 and default_host -> public -> sap -> icf -> logoff are also active.

Related: SAP BW on HANA Certification Preparation Guide

Check if the following SAP Notes are applied in your system if required.

Note Description 
2701529 Scheme/term combinations in response to GET /sap/bw4/discovery are not correct
2685195  BW4 JSON Schemes: Error in discovery scheme  
2676083   GET /sap/bw4/discovery does not contain any entries with scheme = processchain, term = modelingUI/monitoringUI  
2675224  GET /sap/bw4/discovery terminates with 500 Internal Server Error  
2671554  GET /sap/bw4/discovery terminates with 404 Not Found 
2500019  SAP BW REST-based discovery service  
2765410  Enhancements of the BW4 MAPI  
2766598  BW4HANA: Missing information in catalog resources 
2415249  Required to read metadata of queries and InfoProviders via the INA layer. 
2236064  Describes how to make sure that only calculation views are generated in the BW system. If you still generate the old attribute and analytic views, you must migrate these to calculation views as described in the note  
2761552  Required for SAP Data Hub 2.4 and higher. It fixes the BW discovery service needed for a new API that is used in 2.4 and later.  
2715756  Required for SAP Data Hub 2.5 and higher. It provides fixes for the new query catalog service that SAP Data Hub uses in 2.5 and later.  
2799738 Incorrect JSON Schema for BW4 discovery  
Create connection in SAP Data Hub

The next thing you’ll need to do is to create a connection in the SAP Data Hub. To create a connection, go to the SAP Data Hub launchpad and choose the Connection Management tile.

Create a connection to SAP HANA

If you are using BW/4 HANA or SAP Business Warehouse powered by SAP HANA first create a HANA DB connection. This is required as the connection is used for the data transfer process to SAP Data Hub via HANA views. If you are using SAP Business Warehouse on another DB, this step is not necessary.

In the connection screen, click on the Create button

Enter the following data

Name Description 
ID Name of your connection
Description Describe your connection
Connection Type Type of system you want to connect to – in this case HANA_DB
Manage Metadata If set to True, this allows you to search connections in the Metadata Explorer. Only required if you want to see the HANA tables in the Metadata Explorer as well (in addition to the BW objects).
Host  Host name or IP address of the server
Port The SQL port of your HANA database. In case of a single DB, this is 3<instance number>15. In case of a tenant DB you need to check this for example by executing this SQL statement in your System DB
User Your HANA user
Password Password of your HANA user
TLS Choose True if you have set up SSL (recommended)

You should use a HANA user which has select access on the SAP Business Warehouse external views which you want to access. Otherwise you will get an error message, as the user needs this privilege to trigger the data transfer between SAP Business Warehouse and SAP Data Hub.

You can test the connection under Action Check Status

You should get the following success message.

Create a connection to SAP Business Warehouse

Click on the Create button again

Enter the following data

Name Description 
ID Name of your connection
Description Describe your connection
Connection Type Type of system you want to connect to – in this case BW
Manage Metadata If set to True, this allows you to search connections in the Metadata Explorer. In case of a BW connection set it to True
Orchestration Not changeable: Indicates that the BW system can be used to orchestrate processes, for example trigger BW process chain execution

Host name (or IP address) of the ABAP web server without protocol (HTTP or HTTPS).

The host name of the BW System is displayed for example in the “InA Testmonitor” (transaction RSBITT) after you selected a value for the protocol field. Other ways of displaying the host name are the service display of the ICM Monitor (transaction SMICM), or to display the Connection Properties of the BW Connection in your SAP Logon.

Port HTTP or HTTPS port of the BW server
Client Client to log on to. If left empty, the BW default client is used
Protocol (HTTP or HTTPS) – defaults to HTTPS

For security reasons, we recommend using the default https protocol.

If using http you will not be able to schedule BW process chains by the Data Hub.


User to log on to BW system (can be a service user)


Password of your BW user

HANA DB Connection ID

ID of the HANA connection created in the previous step

Test the connection and check if you get a success message.

SAP Business Warehouse Process Chain

With the BW Process Chain operator, you can start an SAP Business Warehouse process Chain from SAP Data Hub. You need to parameterize the operator using the BW connection and an existing process chain from you SAP Business Warehouse system.

It is assumed that you activated the necessary services as described in the prerequisites chapter. The execution might still fail however with a message like “forbidden” or “no suitable resource found” if the user doesn’t have the required authorization in the SAP Business Warehouse system.

Please be aware that only the minimum authorization to orchestrate a Process Chain in SAP Business Warehouse is shown in the following steps. Every customer has its own authorization concept, and you need to know what best suits your particular requirements.

Authorization Check for Service /sap/bw/whm/backend/discovery

SAP Data Hub calls two services for which your user needs authorization. These services are /sap/bw/whm/backend/discovery and /sap/bw4/v1/monitoring/processchains//start. To make things easier you can use the SAP Gateway Client tool to test the services directly in SAP Business Warehouse using transaction /IWFND/GW_CLIENT. Log on to your SAP Business Warehouse system with the user you are using for the connection between SAP Data Hub and SAP BW.

First test the service /sap/bw/whm/backend/discovery and add an HTTP Request to it. The request is Header Name: accept and value: application/vnd.sap.bw.whm.discovery+json;version=1.0.0

Check the result. If all notes have been applied but you don’t have the required authorization you’ll receive a message with status code 403 “Forbidden”.

To find out which authorization is missing in this case, use transaction SU53 for your user. In this example, you don’t have the authorization for the S_BW4_REST authorization object.

To give a user authorization, a new authorization role needs to be created using transaction PFCG. Create a new role, go to the Authorizations tab and choose Change Authorization Data

Add the authorization object S_BW4_REST manually and enter the required data. As an example, enter the values which are shown from the authorization log in transaction SU53. As the POST activity is also required later on, choose both activities and enter the URI /sap/bw/whm/backend/discovery*. Then save and activate the authorization role.

After defining the role you need to assign it to the user who is used in the connection from SAP Data Hub. Then execute the service again in SAP Gateway client /IWFND/GW_CLIENT. This should work now.

Authorization Check for Service /sap/bw4/v1/monitoring/processchains

In the next step you can check if the process chain can be executed using the relevant web service. Please note that the uri can vary according to the SAP Business Warehouse release.

Go to transaction /IWFND/GW_CLIENT again. In case there is an entry under HTTP Request from the previous chapter, delete this line. Then set HTTP Method to POST and enter the following URI /sap/bw4/v1/monitoring/processchains//start. In the pop up window delete the default request and replace it with /sap/bw/whm/backend/discovery. Then execute the service.

If you don’t have the required authorizations an error message is displayed. You need to enhance and change the role you just created by making the required settings.

Once again, you can call SU53 to find out which authorizations are missing for your user.

In this example a minimal role is built using the following settings:

Authorization Object Name   Value  
S_BW4_REST BW4_URI /sap/bw/whm/backend/discovery*
S_BW4_REST   BW4_URI   /sap/bw4/v1/monitoring/processchains/* 
S_RS_PC ACTVT   16 (Execution) 
S_RS_PC   RSPCAPPLNM  <Group of your Process Chain>
S_RS_PC   RSPCCHAIN  <Name of your Process Chain>  
S_RS_PC   RSPCPART   Runtime  
S_BTCH_NAM   BTCUNAME  <Background User>  

With these authorizations the web service is executed successfully.

You can now also orchestrate the process chain from SAP Data Hub.

Transfer Data from SAP Business Warehouse to SAP Data Hub

With the Data Transfer operator, you can transfer data from SAP Business Warehouse to SAP Data Hub. The user which is used for the SAP Business Warehouse connection needs authorization to access the Info Provider or the Business Warehouse query. If you want to access different providers/queries with the same connection the user entered in the connection need authorization for all of the providers/queries.

Please take a look at SAP Note 2711139, which describes the limitations of the BW data transfer operator.

You have to migrate generated analytic and attribute views to calculation views as described in SAP Note 2236064.

If it fails with a message like ”You do not have the authorization for component XX”, you have various ways of checking your authorizations.

In the following steps , please note that only the minimum authorization to read data from exactly one Info Provider or Query is shown. Every customer has its own authorization concept, and you need to know what best suits your particular requirements.

Authorization Check in SAP Business Warehouse

In SAP BW, use transaction SU53 to check which authorization is missing for a..

  • Show original
  • .
  • Share
  • .
  • Favorite
  • .
  • Email
  • .
  • Add Tags 

As most of the companies are moving to the S/4 HANA On-Premise.When you get a requirement to create a report which will perform month end posting especially in the S/4 Finance area.

How to you design an Application for such requirement.

Is it possible to Create a Ui5 App to perform both front end and month end background jobs moniter ? Yes but is it a good design as you have to do lot of reworks to make it work as a background job.

When i was going through certain Fiori Apps I found an interesting S/4 HANA standard Application Application Jobs from Fiori APP library : https://fioriappslibrary.hana.ondemand.com/sap/fix/externalViewer/#/detail/Apps(‘F1240’)/S14OP

Let explore the options in the above Appplication jobs

1. How to create job template

Open the transaction SAPJ and then Create Job Catalog Entry Name .

There are three options which SAP Provided in the transaction SAPJ in the tab HEADER :

Report : SAP GUI Report Name

Class : In case you wanted to re-use the class for a Fiori App you can also provide class here

Chain : In case you wanted to take this run the chain of Jobs then go with this option

Check Class : ABAP class that is used to check the parameter values the user enters.To be able to use all methods that are pre-delivered and up-to-date make sure that the check class inherits from the abstract class CL_APJ_JT_CHECK_BASE.

Value help : In case of value help inherit the interface IF_APJ_RT_VALUE_HELP_EXIT will inherited for the F4 helps.

Delete Exit : In case if you want to delete the jobs after sometime Inherit the interface IF_APJ_RT_DELETE_JOB_EXIT

Text Exit : In case if you want to display the text IF_APJ_DT_JCE_TEXT_EXIT

Scoping Relevant : If a job catalog entry is defined as Scoping relevant, the application job component makes it available only in clients with a corresponding tuple (, ). These are maintained in the APJ_C_SCOPE table. If the flag is not set, the job catalog entry is available in all clients.

To divide the screen into different section use the tab Sections

To divide the selection screen into different Selection Screen Blocks using the Groups Tab

How to get the selection scree fields in the Jobs Dynamically ?

Click on the synchronise parameters the selection screen parameters from the Se38 Report are transferred here with out additional coding .

As you see the selection screen fields are transferred automatically and the grouping can be Done.

Now Save and the Job catalog is successfully created.

Job template :

In the same transaction SAPJ Do the Job catalog and Job Template Mapping :

You can also define the define values and the default Job Period granularity.

How to Access the job catalog from the Application Job APP :

Open the App Application Jobs and then click on the create button as shown in the below screen shot

Then by default there will be the first Job template also the Parameters will be displayed.

But when you select the Job template created by you then the parameters will be changed dynamically.

How do you scheduling your recurring Jobs :

In the Tab scheduling options :

The below options are possible

Single Run or Define Recurrence Patterns :

Daily or Weekly or Monthly ( end of the month or starting of the month/ working Day or Holiday)

You can also select the different Calender also the day light saving :

Once you schedule the job you can also check the job results logs and spools as shown below :

How Can i create a separate App for your own functionality ?

Create a Own Tile and target mapping and in the target mapping provide the below details :

Pass the job Category in the input parameter :

Any inputs are highly appreciated.

More More: SAP S/4HANA Production Planning and Manufacturing Certification

The post S/4 HANA Schedule and monitor application related jobs appeared first on SAPSPOT.

  • Show original
  • .
  • Share
  • .
  • Favorite
  • .
  • Email
  • .
  • Add Tags 

SAProuter certificate is yearly based renewal process, This blog post will help audience to Renewing SAP Router Certificate.

What is SAPRouter?

It acts as a proxy in a network connection between SAP systems, or between SAP systems and external networks. A standalone SAP program that protects your SAP network against unauthorized access .

Steps for Renewing SAP Router

Stop SAPRouter Service.

  • Login to SAP Router Server and close the saprouter.exe command window.


  • Login to SAP Router Server and stop Router service.
Before executing the activity please take backup of SAPROUTER files from OS level.
  • Take a backup of file in usr/sap/saprouter : Cred_v2, srcert, certreq, local.pse

Also you can take a copy of SAPRouter folder

Generating the certificate.
  • Run the following command

“sapgenpse get_pse -v -r certreq1 -p local.pse”

to generate a certificate in OS level.

  • Enter the new PIN for PSE file two times –
  • Now it will ask to provide your Distinguished Name. Give DSN and press Enter.

CN=*, OU=0000123456, OU=SAProuter, O=SAP, C=DE

  • It will create a new Certificate file “certreq” in the sap router file system.
  • Open the file ‘certreq’ and copy the content or code from that file.
  • Open Support portal and navigate to SAP Router page where your Router is configured and click on Submit CSR
  • Paste the copied data from here as shown below and hit on Request Certificate.
  • Copy the generated response.
  • Paste it in “srcert” file and save.
  • Now run the following command and give the PSE Pin :–

sapgenpse.exe import_own_cert -c srcert -p local.pse

This command will import the response that copied into “srcert” file.

  • Now run the following command to create a file “cred_v2”.

sapgenpse seclogin -p local.pse -O

sapgenpse seclogin -p local.pse -O Administrator

  • Verification of the Router can be done by running following command.

sapgenpse get_my_name -v -n Issuer

Start SAP Router service

Post Verification checks.

Validation check in Support Portal

SAPRouter Status check

  • Run the command whether the Router is running or not.

Saprouter -l

SAPRouter Validity check

  • SAP Router Certificate Validity

sapgenpse get_my_name -n validity

This is the complete process of renewing SAP Router Certificate.

Visit SAP Certifications for More Information.

The post Renewal of SAPRouter Certificate appeared first on SAPSPOT.

  • Show original
  • .
  • Share
  • .
  • Favorite
  • .
  • Email
  • .
  • Add Tags 

You need to experience life after SAP Certification. It will not make any much change for the professionals who are already working in the SAP field. However, the life of the people, who are expecting a job in SAP field or breaking into SAP Consulting domain, is with full of stress and anxiety. Taking any SAP certification will surely require a significant amount of time, money, effort, resources, and patience.

Some people are fortunate enough to know which SAP Certification they are going to pursue. However, it is not the case with all the people. They have to, first of all, inquire which certification is appropriate for their prospective career. This may take several months of analysis in the market. Once they have determined which SAP certification you should take, then they will have to prepare for the Certification in terms of arranging for the money, asking for leave from the current employer (if any), etc. This would further take another two months. Some people are usually eager to give the certification in just two to three months preparation. This is good to some extent because you will be absolutely in that flow.

However, some people are doubtful about whether to go for SAP certification practice test for another month or so and then give the certification exam. This may also be beneficial to some degree that you can study thoroughly. By, putting all these items collectively, it may approximately take five months of your time from the day you have fixed for Certification in your mind to the day you attempted the Certification. If the people are not lucky enough to clear the SAP exam at first attempt, possibly, they may study for another month or so, which is stressful period. You are already giving the Certification for the second time; this makes it more nervous because you are investing more amount of money with a lot of uncertainty. Therefore, six months of the period in a professional’s life is a significant amount of time.

Once you have passed the exam, you are happy, and everybody is happy. However, the real exam would begin from the next day. The days are more excited after SAP certification, particularly for the people who are seeking for a job / SAP consulting job based on their certification. They might have spent a large amount of money, time, and effort, but it does not give any assurance that you will get a job in the market. The market has become quite competitive, and employers are more cost instinctive in rolling out the offer letters. You might be attending several interviews and skipping each interview with various reasons.

In some cases, you are going up to last round of interview, but at the end of the day, you are coming to know that you are not selected for the job. This type of interviews are painful to the heart; it will take a week to come out of that hatred. The number of interviews you are going to fail; you would be getting mentally much powerful.

I am not going to list down the pessimistic views, but even many individuals have undergo all these tough situations in their life. There could also be some lucky people who have taken a leave to prepare for SAP certification, but as soon as the certification, they had to continue with their previous job, which is in a distant area.

However, most of the consulting organizations are in cities, and they may need the people at shorter notice. Moreover, nowadays, organizations are requiring the applicants to attend the interviews by one to one interview. It would be difficult for such candidates every time to come for an interview from such a remote area to the cities and attend a personal interview. Due to coordination restraints, some of the opportunities might have been faded for such applicants.

Some of the people might have quit their jobs with the hope of getting a job after certification and take a considerable amount of loan. For those type of people, life is inconceivable. Because the monthly income from salary might have been reduced and the bank might be started charging the EMIs every month. For them, life is incredibly challenging, and every day is a restless night because of the amount they have spent on preparation. They would be praying every day, that any type of SAP job is OK, and even they are ready to conciliate in terms of salary. The managers who really can assess these applicants may benefit out of the salary negotiations. Those applicants who are sincerely looking for a break into the market may not be much worried about the salary, and eventually, this turns to be a heaven for the employers.

Let us think you have made everything you would like to do to receive a job. However, unfortunately, fate, market conditions, luck, economy is not in your favor. You have spent a considerable amount on SAP preparation. You have attended many interviews. Still, you have not got any job offer from any organization. What are the things you must focus on after passing for your SAP Certification?

1. Make an Updated CV

As soon as you have achieved SAP Certification, take 2 – 3 days rest, which you need, this would make your mind rejuvenate. Then prepare updated CV, you must focus on the following points while updating your CV.

a) Describe your SAP knowledge or skills you have acquired.
b) If you have worked on any SAP project, or you have end-user experience/core team member experience, write down accurately what type of essential tasks that you have carried out
c) Try to give more importance to SAP Skills than your earlier non-SAP skills
d) Always try to show a constructive attitude and compliance to learn qualities
e) Utilize your SAP Certification logo that you have acquired from SAP Education Team

2. Improve The Quality Of Your Networking

You do not know who will help you or direct you. Everybody is looking like an expert in their profession. You must have improved your listening skills for receiving the best and improved advice. You may take complete advantage of different social networking sites like Facebook, Linkedin, and Twitter, etc. First and foremost, you should utilize the influence of Linkedin and update all your achievements, SAP certifications, experiences, etc.

Furthermore, stay in touch with HR consultants who are hiring skilled SAP certified professionals. Also, regularly view job portal sites and various reputed companies’ websites. It would also be helpful if you can send your CVs to the companies through employee reference rather than directly applying for the job on their website, as thousands of people might be submitting their CV and they might not have any time to explore those.

3. Read and Practice Daily

As soon as you are SAP certified professional, your responsibility will be increased, and you should need to keep the habit of reading. There are many platforms, from where you can acquire a lot of knowledge and information. Consistently reading from important sites will provide you an up to date knowledge. This will not only enhance the experience but also make you familiar with what is happening with advanced technologies in the SAP arena. In addition to this, regularly practice on the system. The best way to practice is to obtain the documents and configure them. You have business process documents, configuration, and presentations for diverse industries/countries. The number of times you are configuring them, you will become more confident. No experience can substitute you a real execution of the project. However, these guides will help gain tremendous hands-on experience and keep you ready for the next assignment.

4. Keep Attending Interviews

An interview is a chance to demonstrate your knowledge and skills, and every interview is different in its way expectations. There would be no need to worry, even if an interview didn’t go well. There could be various grounds why an interview has gone well, and it is not necessarily relating to your skills and knowledge. However, each interview would allow you to know the expectations and what type of questions are expected. These interviews would enable you to revive your knowledge and better qualified for the next interviews. Usually, your confidence will be built from the interview number one to interview number five or so on, as you might be perceiving the level of expectations from the interviews. At some time point, you would reach a platform that you are going to influence the interviewers. This is almost like a driving test, wherein only a few lucky people can pass in the first attempt, but others have to try a little more attempts. Persistence is the key here.

5. Do not Give Up your Passion and Hard work

The most important thing you must remember is you have achieved SAP certification not just for job and money, but keeping up your passion for SAP. If you trust in your love and hard work for SAP exam preparation, the money will follow. Even after getting the job, you should always maintain the same interest and intensity on SAP. This intensity and enthusiasm to learn will always put you ahead in getting the new skills and expertise areas. Energy and passion for learning more and more features in SAP is the key to success. Please remember that the skills are not acquired overnight. It demands years and years of continuous hard work to get to a master level. The kind of projects you are working will also endure a crucial part in promptly developing skills. Working on a few ends to end implementation projects may give you more overview of the system than working on a few years of support project. Whatever be the project, be pro-active, and accept every challenge as an opportunity and try to help your co-workers and share knowledge. This is the key to your success.

Top Highest Paying SAP Certifications:

SAP is the most robust Enterprise Resource Planning System (ERP) nowadays. Systems Applications and Products in Data Processing or SAP comes with a broad range of distinctive software, which presents over the edge business solutions by employing a re-engineering software incorporated within the system.

SAP is extremely popular that it is executed by many organizations within many industry, for their everyday business operations.

Top Highest Paying SAP Certifications

  1. SAP S/4HANA (High-Performance Analytic Appliance)
  2. SAP FI (Financial Accounting)
  3. SAP PP (Production Planning)
  4. SAP HCM (Human Capital Management)
  5. SAP BI (Business Intelligence)

Before you opt for any SAP certification, you should gain overall Business Process Understanding. If you have industry-specific business process knowledge, then its nothing but a added benefit. For example, if you wish to choose for Materials Management, then preferably you should have understanding about Procurement, Vendor evaluation, Inventory Management, etc. processes. Similarly, Sales and Distribution Sales Processes, converting prospects into clients, Pricing and Discounts, making good available to the Client, i.e., shipment options, complaints management.

Read More: SAP Certifications

The post How the Life Will be After SAP Certification appeared first on SAPSPOT.

  • Show original
  • .
  • Share
  • .
  • Favorite
  • .
  • Email
  • .
  • Add Tags 

This blog post helps to connect with SAP HANA DB (Version 1.0 SPS12) then extract the data from HANA table/View and analyze the data using Python Pandas library. Then you can clean and select independent variables/features data to feed the Machine learning algorithms to predict dependent variables or find insights.

Scenario: I am taking the state wise startup company’s expenditure (R&D Spend, Administration Spend, and Marketing Spend) and profit data Source of the data in SAP HANA DB.

Goal is to predict the Profit for the given set of expenditure values. I am not explaining details about the ML Algorithm and the parameter tuning here. I would like to show the end to end process of Data extraction from SAP HANA DB, analyzing, cleaning, feature selection, and applying machine learning model and finally write back the results and ML algorithm performance metrics to the HANA tables.

The linear regression is the most commonly used model in research and business and is the simplest to understand, so using the random forest regression method we will predict the Profit.

The below diagram shows ML Prediction life cycle and steps fallowed in the use case.

The basic steps involved in this process are:

  1. Check the HANA Table data and analyze it using SQL in HANA Studio/WEB IDE. (Make sure you have required privileges to do DML Operations on the tables in SAP HANA DB.)
  2. Import pyodbc, pandas, Sklearn, Matplotlib, seaborn libraries in python.
  3. Create connection to HANA data base and execute required SQL.
  4. Extract all the historical data into data frame object and start analyzing it in Python using pandas.
  5. Do the feature engineering, data cleaning and then feed the final set of independent variables to Machine learning algorithm (Random Forest) to predict dependent variable (Profit).
  6. Analyze the Machine learning algorithm metrics and fine tune for the better accuracy by repeating the step 5.Store the Machine learning algorithm metrics in log table and also update the predicted value of historical data into the HANA Table.
  7. For the new data set, create the python program which reads the new data using pyodbc connection and predict the dependent variable (Profit) and updates the actual transactional table for reporting.
  8. Schedule this program and keep monitoring the model metrics and predicted value.
1. Check the HANA Table data and analyze it using SQL.

I have created two tables, one contains the actual company data which is used to store the transactional data. Second one to store the metrics of the Machine learning algorithm (Ex: MAE, R Squared, MAPE, RMSE, Accuracy etc.)

Please find the structures of both tables below.

Main transactional data table structure.

ML Metrics table to store the evaluation parameters.

The historical data (which is lesser than current month) before prediction with state wise expenditure and profit shown below. I added Predicted profit column as well, to store the predicted value by ML Algorithm using python and it is updated as NULL now.


Let us analyze the data using SQL in HANA Studio with available functions, we can find mean, standard deviation,median,max,min and count of nulls using below SQL. (You can try for all the measures)

Select State, sum(Profit),avg(Profit),count(Profit),max(Profit),

count( distinct profit) as “unique”,stddev(Profit),min(Profit),median(Profit),

sum(case when Profit IS NULL THEN 1 ELSE 0 END) AS “NO OF NULLS”

from “SCHEMA”.”STARTUP_DATA2″ group by State

order by State;

2. Import pyodbc, pandas, Sklearn libraries in python.

Now I am coming to Python scripting interface (Jupyter or spyder).

Import the required libraries.

PYODBC is an open source Python module that makes accessing ODBC databases simple. It implements the DB API 2.0 specification but is packed with even more Pythonic convenience. Using pyodbc, you can easily connect Python applications to data sources with an ODBC driver.

Typically, pyodbc is installed like any other Python package by running:

pip install pyodbc

from a Windows DOS prompt or Unix shell.

To install this package with conda run:
conda install -c anaconda pyodbc

Seaborn: Seaborn is a graphic library built on top of Matplotlib. It allows to make your charts prettier, and facilitates some of the common data visualization needs

Pandas: pandas is an open source, BSD-licensed library providing high-performance, easy-to-use data structures and data analysis tools for the Python programming language.

Numpy: NumPy is the fundamental package for scientific computing with Python. Besides its obvious scientific uses, NumPy can also be used as an efficient multi-dimensional container of generic data

Sklearn: Scikit-learn provides a range of supervised and unsupervised learning algorithms via a consistent interface in Python. It features various classification, regression and clustering algorithms including support vector machines, random forests, gradient boosting, k-means and DBSCAN, and is designed to interoperate with the Python numerical and scientific libraries NumPy and SciPy

3. Create connection to HANA data base and execute required SQL.

Establish the connection and once a connection has been established, your application can execute selects, inserts, or other ODBC operations supported by your driver and database.


Open connection to SAP HANA and check for count of records.

check if table has entries

cursor = conn.cursor()

sql_query1 = ‘SELECT count(*) FROM SCHEMA.STARTUP_DATA2’

dcount = pd.read_sql(sql_query1, conn)


print (‘Table exists and contains’, dcount.head(1), ‘records’ )

4. Extract the data into data frame object and start analyzing it in Python using pandas.

Execute the Select SQL and read the data and save it to data frame. Once you get the data into data frame, you can apply all statistical functions to analyze the data as shown below.

querying the sap hana db data and store in data frame


df = pd.read_sql(sql_query2, conn)




5. Do the feature engineering, data cleaning, feed the final set of independent variables to Machine learning algorithm (Random Forest) to predict dependent variable

Check for the missing values or nulls using the functions and replace the values with mean/mode accordingly.

For Example I have two empty values in Rnd Spend column, so replacing with Mean/Median value. If the column is having more null values, then you can drop the column form the analysis.

Encode the nominal values, for example State has 3 unique values (‘New York’,’California’,’Florida’) replacing them with 0,1,2 codes using map function

Map ({‘New York’:0,’California’:1,’Florida’:2})

Now find the correlation between the dependent variable and independent variables to finalize the final independent variables/features for prediction. After observing the data choosing (R&D Spend, Administration Spend, and Marketing Spend) as independent variables and profit as a dependent variable.

Now I am using random forest regression to predict the profit.

Random forests or random decision forests are an ensemble learning method for classification and regression (and other tasks) .Random forests are bagged decision tree models that train on a subset of features on each split (in each iteration).

6. Store the Machine learning algorithm metrics in log table and also update the predicted value into the HANA Table.

Using the insert and update statements you can send the data back to the data base tables (Ex: ML Metrics and Predicted values). Take care of the primary key while doing insertions.

SAP HANA table data :

updating the predicted profit value to data frame.

Check the data in SAP HANA table to see the updated values in predicted profit column.

7. For the new data set, create the python program which reads the new data using pyodbc connection and predict the dependent variable (Profit) and updates the actual transactional table for reporting.

In a business new transactional data will be flowing into Tables/data ware house. (In my case SAP HANA SQL data ware house). For the new data set, suppose you want to know what could be the profit if I spend “X” expenditure for next month.

Analyze whether this cost increase/decrease gives you return on investment/profit. Then,

Create the Python script in which you perform following tasks

  • fetch the new dataset and process it through the predictor/model
  • Update predicted value back to the DB.
  • Schedule this python script using windows Scheduler/ python scheduler
8. Schedule this program and keep monitoring the model metrics and predicted value using HANA Models/reports.

You can schedule the Python script using Windows Scheduler/ using the schedule Library.

Now in SAP HANA Client tools WEB IDE/ HANA Studio, Create the HANA model to join the main transactional data with dimension tables like (Time, Location) for reporting purpose.

State wise Actual Vs Predicted Profit Comparison Chart.

When using Python IDE’s such as Jupyter, the data is persisted to the client with the above approach and this means more processing time when you have large data set, which leads to drop the productivity of Data Scientists.

This is where the SAP HANA Data Frame can add real value to a Data Scientist’s work. More features and capabilities are included in SAP HANA 2.0 SPS03 Version to analyze / address the data science use cases with Python driver (hdbcli) and then the Python Client API for machine learning algorithms.

Lear More: SAP HANATEC 12 Certification Preparation Guide

The post End to End Model of Data Analysis & Prediction using Python on SAP HANA data appeared first on SAPSPOT.

Read for later

Articles marked as Favorite are saved for later viewing.
  • Show original
  • .
  • Share
  • .
  • Favorite
  • .
  • Email
  • .
  • Add Tags 

Separate tags by commas
To access this feature, please upgrade your account.
Start your free month
Free Preview