Thursday, December 29, 2016

Fundamentals of Machine Learning

Machine learning is a branch out of research in artificial intelligence area. It is a field of study  that gives computers the ability to learn with out being explicitly programmed.

Computer program is said to learn from experience E with respect to some task T and some performance measure P

and its performance on T measured by P improves with experience E.



Supervised learning

Given a data set and already knowing what our correct output should look like, meaning, having an idea that there is a relationship between the input and the output.

Mainly categories into regression and classification.

Regression

Predict results with in a continuous output,

meaning, trying to map input variables to some continuous function.

Predicting the price of the house based on size is an example for regression learning. Where price as a function of size is a continuous output, so it is a regression problem.

If the question is whether the house can be sold for more of less than the asking price, then it becomes classification problem as here we are classifying the houses based on price into two discrete categories. "More" or "Less"

Given the picture of a person, predict the age. here picture is an input variable for the person.

Classification


trying to predict results in a discrete output. trying to map input variables
into discrete categories.

Example: Given a patient with tumor we have to predict whether the tumor
is malignant or benign(non-malignant).


Unsupervised Learning

Allows us to approach problems with little or no idea what our results should like like. We can derive structure from data where we dont necessarily know the effect of the variables.

with unsupervised learning there is no feedback based on the prediction results.

By clustering the data based on relationships among the variables in the data, we can derive this structure.

Social network analysis
astronomical data analysis
market segmentation
organize computing clusters

Octave or Matlab tools are optimized for rapid vectorized calculations, which is very useful in maching learning. Apart from that
R, Python, Julia, Clojure tools are used in Maching leanring.

Clustering

Example: Take a collection of 1000000 different genes, and find a way to automatically group these into group that are somehow similar or related by different variables, such as lifespan, location, roles, and so on.

Non Clustering

Example: The cocktail party algorithm allows you to find structure in a chaotic environment (i.e. identifying individual voices and music from a mesh of sounds at a coctail party.)

Saturday, January 30, 2016

BW on HANA Migration

Recently I have completed a BW on HANA migration. Just writing important notes/takeaways from the project for reference.

You are in BW 3.x ?



You have to first upgrade BW 3.x to BW 7.x for you to migrate BW on non HANA to HANA.
Importantly the authorization concept should be migrated to analysis based authorization as role based authorization of BW 3.x no longer exists.
Object types relevant to BW 3.x such as update rules, transfer rule, infospoke, no long exists.


Major activities for BW HANA Migration?


Ensure you have applied the latest SP as lot of changes pre and post migration activities will be taken care of if we have the latest SP with SAP BW 7.5 or BW 7.4.

If you are already in BW 7.x running on any RDBMS. Then you can start migrating the DB to HANADB using DMO (Data base Migration  Option) of SUM (Software Update Manager).


Before you do there are certain BW specific housekeeping activities needed to be performed.

1. You can use standard task list SAP_BW_BEFORE_MIGRATION in stc01 tcode. Many of the housekeeping activities are taken care of here.

2. If you have plans of archiving, then go for NLS approach. This is a separate excercise.

3. If you are you production, either you can follow copy approach(copy of the production box) where you will use delta cloning to minimize the downtime of the production system. Else you can empty all the delta queues and ensure the info packages do not run before migration. The delta queues in R/3 will be populating as normal. Once you are ready post migration, you can extract  those delta queues.

4. SAP_BW_POST_MIGRATION task list will executed.

5. Check for SNOTES/SPAU for inconsistent notes and fix it. Also run index creation job using program RSDDB_INDEX_CREATE_MASS

6. Check for table consistency using RSDU_TABLE_CONSITENCY.There is a separate program RSDU_PSA_PARTNO_CHECK to repair inconsistent PSA tables.  Ideally this can be taken care by the previous program mentioned.


7. Regenerate all transformation rules using RSDG_TRFN_ACTIVATE.

8. Convert Infocubes to HANA In memory optimized using RSMIGRHANADB tcode.

9. DSO will already be HANA optimized during migration - So no action required.

10. Multiprovider can be converted to Composite provider - As such converting MPRO to CPRH does not optimize any performance because MPRO is based on Union and converting it to CPRH will only change the object type.

It is required only if below cases

a. You want to create a HANA model using Composite provider and generate it as external HANA view.

b. You want to further perform changes in Composite Provider to perform Join and Union both.

11.  Migrate and Adjust BW Workspaces using below set of programs.

a. RSL_WSP_ADJUSTMENT_AIX
B. RSL_WSP_ADJUSTMENT_COMPLETE

12.  Perform a test load and extract all the delta queues into BW.

13. Configure and Implement BW - MT tools using Eclipse based HANA studio. Just install software for BW-MT ABAP and other required perspectives. Add BW system and check if the objects create in studio is getting created in RSA1.

14. If you want to enable hidden objects  you can do so using RSCUSTV32 tcode.

15. Enable Web Dynpro by activating services usng SICF_INST and SGEN.

/default_host/sap/bc/webdynpro/sap/RSDMDM_MD_NEW_APP
/default_host/sap/bc/webdynpro/sap/RSDMDM_MD_MAINTENANCE_APP


16. Enable UI5 process monitor - then you can access RSPCM process chain monitor in web using RSPCM_WEB


For details, you can refer SAP First guidance - Using the DMO option to migration BW on HANA available publicly.







Thursday, September 03, 2015

Important CRM tables for HANA/BI reporting and analytics

CRM Tables
These are some important tables in CRM :
- BUT000 : BP: General data - Contains Business Partner Number, Partner Category, Partner Type, First Name, Last Name etc.
- BUT020 BP: Addresses
- BUT050 BP relationships/role definitions: General data - Contains Relationship, Partner Number (PARTNER1), Relationship Category
- BUT051 BP Relationship: Contact Person Relationship Similar to
- BUT050 additionally contains Contact Person's Address data
- BUT0BK Business Partner: Bank Data & Details BP Number, Bank Key, Bank Country Key, Bank Account Number
- BNKA Bank Master Data
- BUT100 BP: Roles
- ADR2 Telephone Numbers (Business Address Services)
- ADR6 SMTP Numbers (Business Address Services) - Contains Email - Id of the BP.
- ADRC Addresses (Business Address Services) - BP's Complete Address Details- City, Country, Post Code, District,
Street, Title No Etc
- TSAD3T Table containing the Title text against a Title No.
- COMM_PRODUCT Master Table for Product
- CRMM_BUAG Master table for Business Agreement
- CRMM_BUAG_H Header Data for Business Agreement such as Tax Category, Tax Characteristic, Form key, Business Agreement Class. Data in this table correspond to ISU
- CRMD_OPPORT_H OPPORTUNITY HEADER DATA
- CRMD_ORDERADM_H Contains the Header Information for a Business Transaction.
Note:
1. It doesn't store the Business Partner responsible for the transaction. To get the Partner No, link it with
CRMD_ORDER_INDEX.
2. This table can be used for search based on the Object Id(Business Transaction No).
- CRMD_OPPORT_H OPPORTUNITY HEADER DATA
- CRMD_CUSTOMER_H Additional Site Details at the Header Level of a Business Transaction
- CRMC_PROC_TYPE Master table Business Transaction Type
- CRMC_PARTNER_FCT Definition of Partner Functions
- SCPRIOT Priorities for Activities with priority text.
- CRMC_PROC_TYPE_T Text for a transaction type
- CRMC_ACT_OBJ_T Objective Number and Text for Activities
- TJ30T All the status code and text
- CRMC_PR_ASSIGN : Transaction Type and its Transaction Type Object.
- IBIB : Installed Base/Ibase
- IBIN : Installed Base Components
Other important tables are given below,

CRMD_ORDER_INDEX Index table for one-order document
CRMD_LINK Transaction - Set - Link
CRMD_PARTNER Partners
BUT00 BP: General data I
CRMD_ORDERADM_I Business Transaction Item
CRMD_ACTIVITY_H Activity
CRMC_ACT_CATEGORY Activity Category

Along with these the other tables such as
ID Numbers                                                              But0ID
Industries                                                                But0IS
Contact Person Relationship                                   But051
Assignment BP - Address                                      But020
Assignment BP Relation Address                          But052
Address                                                                 ADRC
Address                                                                 ADRP
Sales Classification                                               CRMM_BUT_FRG0041
Sales Area - Partner Function                               CRMM_BUT_FRG0081
Map Business Partner Customer                           CRMM_BUT_CUSTNO
Mapping Table Business Partner
Relationship - Contact Person                                 CRMM_BUT_CONTNO
Segment Builder Profile Set                                     CRMD_MKTTG_SET_H
Profile                                                                       CRMD_MKTTG_PF_H
Filter                                                                         CRMD_MKTTG_PF_S
Filter Conditions                                                       CRMD_MKTTG_PF_SR
Target Group                                                           CRMD_MKTTG_TG_H
                                                                                CRMD_MKTTG_TG_I
Attribute List                                                            CRMD_MKTTG_SAL
Attribute                                                                   CRMD_MKTTG_SA
Attribute Filter                                                          CRMD_MKTTG_SAF
Data Source                                                             CRMD_MKTTG_SDS
Assignment AL / DS                                                 CRMD_MKTTG_SALDS
Status tables in CRM (Very useful)
 CRM_JEST, CRM_JCDS, CRM_JSTO, CRM_JCDO   table for the status of a business transaction. 

Wednesday, April 22, 2015

SAP BW upgrade to BW 7.4 and DB migrate to SAP HANA

Until HANA was invented. SAP BW the data warehousing and reporting application is running on SQL server, IBM DB2, and Oracle.

SAP HANA which is in-memory computing  and columnar database technology has made real-time reporting with SAP BW an easy job.

With SAP BW 7.4 on HANA
Understanding each object and its properties will help rearchitecting BW system for faster reporting environment.

1. HANA optimized DSO
2. HANA optimized Infocube
3. Virtual Provider/Transient provider
4. Composite Provider
5. Open DSO


Wednesday, April 15, 2015

SAP S/4 HANA - Overview

S/4 HANA is SAP Business Suite for HANA.

Lets recap a bit, Business Suite by SAP covers ERP, SRM, CRM, PLM, and SCM. These modules are available as different system. So there is a need to establish connection between these systems inorder to combine data sets and do reporting. Even in case of SAP BW , you need to connect with each system to pull respective data.


With the invent of HANA, SAP has introduced entire suite on HANA which provides the existing customer to completely reimagine the data models, business processes, and ofcourse business decision.
All the modules in the suite is now packaged as one. Morever, it is OLAP + OLTP. The system will be so powerful and faster that you can analyze the real time data.

Also, enterprise who intends for digital transformation, S/4 HANA is the right choice as it it allows you to remodel things and gives you SAP Fiori UX. 

Tuesday, February 17, 2015

Enable Real time reporting - Using SAP BW, Business Objects, HANA, and BODS


While SAP ECC has been the largest enterprise software used for business processing across the world. The huge data accumulated as a result of daily transactions across business functions like Finance and Accounting, Controlling, logistics is moved from ECC to SAP BW for analysis and data mining purpose. The data is moved post business hours to SAP BW and T-1 reporting is made possible.  However, there are various ways and means through which real-time reporting is possible which is cumbersome and add work load to both ECC and BW system.

SAP Business objects suite of products, the enhanced user experience is achieved. Highly formatted complex reports, dashboards, and scorecards leveraging the SAP security model on an web-based portal is enabled.

With the change in business, the C-suite has started looking for real-time data. Instead of waiting for 24 hours to know what has happened yesterday, real-time information allows them to take more proactive decisions. With this in mind, SAP HANA has been introduced which stands for High Analytics Appliance. An appliance is combination of high configuration hardware and software.

SAP HANA is faster:

In-memory computing:

 It works in-memory, that is the data is stored in volatile memory RAM and not in hard disk which is conventional way.  The administration of HANA deals with the backup strategies of RAM data.

Multi-core architecture:

Let us look into hardware part, which uses multi core architecture for speed processing. Core is an integral part of CPU which does parallel processing of the read, write actions being performed. The blade server which is used by SAP HANA supplied by its partners which includes CISCO, HP, IBM and Fujitsu uses many boards which is nothing but multiple cores. This drastically reduces the write, read time we perform for reporting.

Column Store:

If you see a typical database, the records are stored in rows. When you perform a search operation, it reads one by one line and picks the relevant record.

Let us see the below example

Customer Material Quantity
C001    M001    100
C002    M002     200
C002    M003     40


The data in HANA DB is stored as below


Customer   Material    Quantity

C001   M001    100
C002   M002    200
            M003    40

It stored the unique values pertaining to the dimension. The read is performed using the indexes between dimensions. More details in below link.

https://blogs.saphana.com/2013/08/21/hana-columns-and-oltp/


SAP BW on HANA

The underlying database for SAP BW typically been used is Oracle, SQL Server, and IBM DB2. SAP BW on HANA offers great features and tools to leverage the power of HANA and BW. The Open DS view, composite provider allows seamless integration of HANA analytic views (in replication  SAP tables). There are lot of advantages of using SAP BW on HANA in comparison to directly using SAP HANA with BO for customers who already have SAP BW.

The role of SAP BODS

With SAP BW 7.4, SAP BODS can be used as a datasource, just like DBCONNECT, UDCONNECT.
The data from SAP ECC is moved instantly to SAP HANA using BODS and SLT tools.


SAP HANA with BO

when the SAP tables are replicated into HANA. Attribute views, analytic views are created in HANA and this can be exported to BO reporting. All BO suite of products can be used for real-time reporting.





Saturday, January 10, 2015

Asset Accounting in BW

Personnel data/Manpower data sources in SAP  BW


0HR_PA_1
0HR_PA_2


Payroll integration in SAP BW requires datasources 0HR_PY_**



Asset Accounting

0FI_AA_11
0FI_AA_12

0FI_AA_20 has transaction and depreciation data.

Checking active datasources in BW and ECC

Checking active datasources in BW regardless of source system:

 RSDS (header) and RSDSSEGFD (fields)


Checking active datasources in ECC

 ROOSOURCE (for header) and ROOSFIELD (fields).