quinta-feira, 4 de julho de 2019

SAP Leonardo Machine Learning Service – Image Classifier

Hello All,
In this blog post we are going to see how to use SAP Leonardo Machine Learning Service call – Image Classifier .

Few Pre-requites
  1. SAP Cloud foundry account from here 
  2. Install CL Plugin on your local machine from here  

PS : There are good blog posts on SAP SCN  on how to use “Machine Learning Service”, you can try and check these SAP Experts blog posts as well such as @Lars Gregori @Fabian Lehmann,Divya Munnuru and @Alexey Ershov

Let’s Get Started –  We are going to perform Step- by-Step process on how to Use Machine Learning Image classifier API.
  1. Create your SAP CL account and activate the service . (You can find it here how to do that ) . Below are some screenshots


From the left hand side Click on Regions and Select FRANKFURT.

Create your Global Account and Sub-Account into your Main Account –



Click on your Sub-account (“Development” in my case ) and Create your Space.



Now , Your Account is ready and Space is also created , Let us go to Service from the left panel and click on Service Marketplace  . 
Click on SAP Leonardo Machine Learning service.


We are going to create an Instance of our service . Click on the SAP Leonardo Machine Learning Service and from the left panel click on Instance –


Once you create the New Instance you will find a new line item , Click on your instance and from the left panel create the Service Key –




IMPORTANT – Copy all your Service key and save it on a note pad , we are going to use these key through out this blog. 

         2. Install the CL plugin and login in your SAP CL account via command line interface

For the installation of SAP CL plugin just click here 
Once you are done –
Go to your command line by pressing “Crtl +R” and enter ” cmd”


Now from here , go to the path ( directory ) where you have installed the plugins and login into your SAP CL account –
PS : to change the path just type ” CD (path ) and enter and you will enter your plugin path.
Command – ” cf login” 


Give your email ID ( your user name ) and hit enter and enter your password ( password won’t be visible )


If you have reached here successfully login into your CF account via Command line interface ,
Great !!!! we have done the setup to use our SAP ML services !!

Before we move further ,We need to setup our postman to call our service . Which is very simple and in few steps it will be done
Setup an environment of your post man and enter the below parameters –
Go to Google chrome and type ” Postman Launch ” and enter the below credentials
URLhttps://development-ml.authentication.eu10.hana.ondemand.com/oauth/token?grant_type=client_credentials
Authorization tabBasic Authorization – ( From the service key which we get from SAP CF account – get the Client ID and Client Secret and enter those two values )
Tests tabpostman.setEnvironmentVariable(“token”, “Bearer ” +JSON.parse(responseBody).access_token);
Screenshots for the same –




Now test our ML url which we got it from Service key


Done !!
So we have created our SAP CF ( Cloud foundry ) account , Installed the CF plugin and login via cmd command and get the postman ready .

Our setup is almost ready to use !!
Let us get into the real part , that is Machine learning Image classifier api  . Before we start, let us get some knowledge on what we are going to do here –

MACHINE LEARNING – 
In Machine learning , we divide our data into 2 parts . Train data and test data  with divide ratio of 80% train data and 20% test data .
We put the machine learning regression (From sklearn library and import the classes ) on the train data to learn what the data is all about and later we  deploy this object onto test data and predict the value.  This prediction is later plot on the graph to visualize our data .

Here in this blog we are going to divide into 3 parts – Train/ Test / and Validate the data .
Once we have 3 folders on your machine – Train data /Test data/ Validate data . we are going to use ML rest api to understand and learn from the train data folder and later we will change the path to test data to predict what is the value .
Enough theory !! let us do practical 🙂
PS : I got my data from HANA ACADEMY as it was ready-made ( i do not need to divide the folders or anything )

STEP 1 . Check for the api available APIs –  Enter this in your CLI
"cf sapml config get"


STEP 2 , set the API in-order to use it , with the below commands
cf sapml config set auth_server ( Your Authenticate URL from service key )
cf sapml config set job_api ( job API )
cf samplf config set training_api ( retrain API)

STEP 3.  Initialize your CLI with command –
cf sapml fs init


STEP 4.  Uploading the data in SAP Cloud foundry using CLI and S3 – Minio with command –
cf sapml fs config


Now – Download the Minio from here
*****Put this downloaded file in the same path were your CLI Plugin is placed and we are good to run it****** 
Now , I change my directory and later i use the minio command ” mc” to check if it working or not


Now we need to login into minio so that we can upload the files into your SAP CF . To do this – give the below command with the endpoint acces key and secret key
mc config host add https:// ( Your End point  Access key Secret key ) 

We are ready to upload now !! with the command –
mc cp Brands mlfs3/data --recursive
NOTE – Brand is the folder name – in your case it will be different

In case you get session time out – enter the command –
mc session resume ( your sessionID )



Congratulations !! your date is uploaded .. .let us check it now – with command –
cf sapml fs list


STEP 5.  Retrain our data which we have uploaded in SAP CF via minio on CLI
Now a bit small coding –  Save the below in .Json format in the same path. ( ModelName and data set name will be yours own data set and any model name
{
 "dataset": "brands",
 "modelName": "brands",
 "learningRate": 0.001
}
and please note – this job will be running on the Instance which we have created on the SAP CF account and not on the local machine .
Command for this –
cf sapml retraining job_submit retraining job_submit retrain.json m-m image


Prefect !!! Now let us retrain it with command –
cf sapml retraining models -m image



STEP 6 Time to test !!!

Congratulation !! We have completed the setup and data is train, let us now test it  .
Upload your first image on the non train url –

"https://mlftrial-image-classifier.cfapps.eu10.hana.ondemand.com/api/v2/image/classification"


We can see our output as “Wool” 

Let us upload the image in our train url –
"https://mlftrial-image-classifier.cfapps.eu10.hana.ondemand.com/api/v2/image/classification/models/brands/versions/1"



We can see our model read the same image as ” Adidas ”

Congratulations !!

We have learned the below things –
  1. Create SAP CF account
  2. Install CF Plugins
  3. Login into CG via CLI command
  4. Connect to Postman
  5. Uploading the data to file system
  6. Retrain the model using the uploaded data.
  7. Deploy the Retrained model to your service instance.
  8. Testing from postman

Next blog post we are going to see how to use other APIs provided by SAP Leonardo Machine Learning .
Till then , Enjoy Machine Learning


Source: https://blogs.sap.com/2019/07/02/sap-leonardo-machine-learning-service-image-classifier/


SAP Fiori 3: agora você vai utilizar muito mais o Fiori.

Ha muito tempo atras em uma galáxia muito muito distante… 
  • Fiori 1, foi liberado em 2013.
  • Fiori 2, foi liberado em 2016 (vamos acordar que ainda tem coisas que não agradam tanto…)
  • Fiori 3, foi anunciado em 2018, mas de fato liberado ha alguns poucos meses, e agora agrada muito mais que a versão antiga.
O Fiori 3 é muito bacana! A começar pelo novo tema, SAP Quartz Light que é bem diferente do Belize, e privilegia um layout muito mais simples e limpo, trazendo uma maior possibilidade de integração e customização do layout com as necessidades dos clientes.

Fonte da imagem: https://experience.sap.com/news/sap-fiori-3
Em paralelo, o novo layout valoriza muito a área de notificação e integração com o SAP CoPilot, que é o assistente digital da SAP e que terá um protagonismo muito maior a partir da versão 1909. Caso você não tenha visto nada sobre o SAP CoPilot, e acredita que conversar com o SAP é coisa de quem está em fim de projeto já sem dormir ha um tempo, leia o blog da July Rizzo sobre chatbot e CoPilot; garanto que terá uma boa surpresa do caminho que o “S/4HANA” está tomando e as possibilidades que estão se abrindo.
Link para o blog O que é CoPilot? Assista a uma demo aqui.
Além do Fiori 3 ser bem bonito, clean, fácil de se utilizar, ele está mais preparado no tocante a layout e planejamento visual para as integrações e interações necessárias para os conceitos de Intelligent Enterprise, que já são realidade e só vão crescer e tomar mais corpo como opção de utilização nas aplicações. E entenda com isso que cada vez mais o S/4HANA fará sugestões e resolverá problemas comuns do dia a dia por meio de aplicativos e processos avançados de machine learning e inteligencia artificial.
E falando sobre Intelligent Enterprise, foi publicado um curso no OpenSap sobre UX, Intelligent Enterprise e Fiori 3. Corre lá que ainda dá para fazer (clique aqui para ver o curso). Como sempre no OpenSap, cursos de qualidade, gratuitos e com certificado.
Só de curiosidade e para citar, já existem diversas funcionalidades “inteligentes” com Machine Learning e Inteligencia Artificial a partir da versão S/4HANA 1905 (versão cloud), tais como manutenção preditiva, identificação de defeitos na qualidade, Machine Learning Service for Accruals Recommendation,… enfim, são muitas novas funcionalidades que tendem a operações cada vez mais autônomas.
Abaixo um slide da apresentação do roadmap do Fiori 3.

Fonte da Imagem: blog SAP Fiori Roadmap
O Fiori 3 busca uma maior consistência para experiência dos usuários entre todos os produtos SAP, e fica claro em todas as comunicações e referências que existe um foco maior, e louvável, de se equalizar as interfaces dos produtos com o objetivo de facilitar a utilização e reduzir os esforços de treinamento nas pontas, para os usuários. É mais ou menos a mesma estratégia que as fabricantes de avião fazem, tentando deixar o cockpit o mais similar possível entre todos os modelos de aeronaves, para diminuir os custos de treinamentos de pilotos. Na nossa realidade, troque “pilotos” por “usuários”.
Quanto aos objetos, já existem objetos SAPUI5 1.65 disponíveis na SAP Cloud Platform para os desenvolvedores.
Foi liberado um vídeo, do Teched de 2018, apresentando o racional do FIORI 3, justificativa e roadmap da solução. Sugiro assistir Fiori 3 in 20 minutes.
E se chegou até aqui, é porque está interessado, e sugiro consultar algumas outras referências na comunidade (em inglês):
Innovation for thought!
FM


Source: https://blogs.sap.com/2019/07/03/sap-fiori-3-agora-voce-vai-utilizar-muito-mais-o-fiori./

Fiori for SAP S/4HANA – Identifying the OData Services, CDS Views, and Authorizations of a SAP Fiori App

This blog post explains how to identify the underlying components of a Fiori app
From time to time, you may need to find out what OData Services, CDS Views and Authorizations are used by a specific SAP Fiori app.  For example, you may need this to:
  • Build your security profiles
  • Plan an extension
  • Troubleshoot an issue


From Fiori app to the underlying OData Services

There are 2 ways to confirm this:
  • Via the Fiori Apps Library
  • Via the app’s manifest.json file

Option 1 – Fiori Apps Library

In the Fiori Apps Library, find the Fiori app you are interested in.
For the specific Fiori app, in the Detail View go to the
Implementation Information tab > Configuration section >  see list of OData Services
Example:
Supply Chain Visualization
for Transportation Scheduler (Oil & Gas)

https://fioriappslibrary.hana.ondemand.com/sap/fix/externalViewer/#/detail/Apps(‘F2737’)/S13OP

If you want to see all the OData Services for all your Fiori apps, you can also view & download this using the List View
Just select the apps > select List View > use the Settings icon button to change the selection to include OData Services.

When you download you will see both the primary and any additional OData Services


Option 2 – Manifest.json

Get the SAPUI5 technical name from the Implementation Information > Configuration > SAPUI5 Application
Example: For Supply Chain Visualization, it is VISUAL_SCM_S1

 
In GUI transaction SE80, in the Repository Browser, select application type BSP Application and enter the technical name, and press Display. Expand the Page Fragments to find the manifest.json file and open it.  Look for the section “dataSources” and you will find the path to the OData Services

In this example the OData Services TSW_VISUAL_SHIPMENT_SRV and VBI_APPL_DEF2_SRV are shown, i.e. uri path “/sap/opu/odata/SAP/TSW_VISUAL_SHIPMENT_SRV” and “/sap/opu/odata/sap/VBI_APPL_DEF2_SRV” respectively.
TIP: For Fiori elements you can also identify the most important OData Entity Sets in the manifest.json – i.e. those main Entity Sets assigned to the Fiori elements pages.

From OData Services to CDS Views

There are different techniques depending on how the CDS Entities were exposed to the OData Service.  You can identify which technique via the naming convention used in the OData Service.
Exposing CDS Entities as OData Service

OData Service with naming convention <xxxxxx>_CDS

Remove the _CDS suffix and that is your CDS View name. Yes it’s that simple!
Example: (anything from KPI Workspace or search in Fiori Apps Library > Fiori apps for S/4HANA > All Apps > search on _CDS
181 Apps!

Supplier Payment Analysis(Open Payments) (S/4HANA)

for Accounts Payable Manager
https://fioriappslibrary.hana.ondemand.com/sap/fix/externalViewer/#/detail/Apps(‘F1750’)/S13OP
Implementation Information > Configuration >  see list of OData Services

OData Service =  C_APVENDOROPENITEMS_CDS

Therefore CDS view = C_APVENDOROPENITEMS
You can review the CDS Views using ABAP Development Tools in Eclipse. Within your ABAP Project for your system/client/user id, use the Open ABAP Development Object menu option to search for and open the matching CDS View Data Definition.

Why does this work? These CDS Views have been auto-generated using annotation @OData.Publish: true
ABAP Prog Model for Fiori help
https://help.sap.com/viewer/cc0c305d2fab47bd808adcad3ca7ee9d/201809.002/en-US/3b77569ca8ee4226bdab4fcebd6f6ea6.html

OData Service with naming convention <xxxxxx>_SRV

Remove the _SRV and that is your Gateway Project name.
TIP: There are some exceptions so if this does NOT find the Gateway Project name go to the any other naming convention option.

Open Gateway Project in transaction SEGW – or using ADT in Eclipse.


Within the Gateway Project, expand the Data Model.
Within the Data Model expand the Data Source References.
Within the Data Source References, expand the Exposures via SADL, then CDS Entity Exposures, then Entity Types.


Remove the suffix Type from the Entity Types and those are your CDS View names.
Example:
Entity Type name = C_VisualLocationsType
Therefore CDS View name = C_VisualLocations

Once you know the CDS View name you can view the matching data definition in ABAP Development Tools for Eclipse.

 
Why does this work? These CDS Views have been auto-generated using Referenced Data Source technique.
Reference ABAP Prog Model for Fiori help
https://help.sap.com/viewer/cc0c305d2fab47bd808adcad3ca7ee9d/201809.002/en-US/3b77569ca8ee4226bdab4fcebd6f6ea6.html

OData Service with naming convention CB_<xxxxxxxxx>

These are OData Services that support Fiori Search and are written with a special approach.

Go to transaction /IWFND/MAINT_SERVICE. Use the filter to search for the OData Service using the External name. You can use wildcards, e.g. cb_cost_c*

Once you find the service, select the row and then press the System Implementation button.

In the System Implementation you will find the ABAP Class for the Data Model

Drill down on the Data Provider Class to see the underlying ABAP Class coding.
Find the GET_ENTITYSET method

Drilldown on the GET_ENTITYSET method to review the ABAP code and determine how the data was retrieved. This may include CDS Views and BAPIs.  You may need to set a debug breakpoint.

Any other OData Service

Any other naming convention usually indicates it is a Mapped OData Service approach for SAP Gateway Projects.

Example:
Fiori app Periodic Meter Reading Overview for Meter Reading Specialist (Utilities)
https://fioriappslibrary.hana.ondemand.com/sap/fix/externalViewer/#/detail/Apps(‘F2186’)/S13OP

OData Service ISU_MR_PERDC_OVP

Go to /IWFND/MAINT_SERVICE, use the filter to find the OData Service.
Select the service and then press Service Implementation

In the Service Implementation details, find the Model Provider Class

Open the class and look for method IF_SADL_GW_MODEL_EXPOSURE_DATA~GET_MODEL_EXPOSURE. Note: You may need navigate to the super class.

Once you have found the method, review the code and search for entries with dataSource type=”CDS”.  The binding value contains the CDS View name. There may be several.
For example you can see the CDS view C_METERRDNGUNITSCHEDRECDOVW has been mapped.


You can also look for the line of code indicating the Gateway Service Project, in this case ISU_MR_PERDC_OVP.


Once you know the CDS View you can find it directly.

Why does this work?
Mapped OData Services use manually mapped references to CDS Views.


Becoming a SAP Fiori for SAP S/4HANA guru

Some words around… thanks  to my colleague Jocelyn Dart for drafting this blog post.
You’ll find much more on our SAP Fiori for SAP S/4HANA wiki
Brought to you by the S/4HANA RIG


Source: https://blogs.sap.com/2019/07/03/fiori-for-sap-s4hana-identifying-the-odata-services-cds-views-and-authorizations-of-a-sap-fiori-app/

Calling a BAPI in the SAP S/4HANA Cloud from a non-SAP system

Introduction

In the previous blog post of this series we saw how to call a whitelisted BAPI in the SAP S/4HANA Cloud using SAP Process Orchestration. Now we are going to take a look how we can do the same from a non-SAP application.

Calling a BAPI in the Cloud from non-SAP systems ( e.g. a JAVA program)

Non-SAP systems can make RFC-Calls to the S/4HANA Cloud as long as they adhere to the RFC standards. That is usually done by implementing the libraries which were published by SAP. There are numerous solutions available which implement the RFC protocol this way and are certified. These 3rd party products usually come along with a guide which explains how to integrate with SAP systems. For SAP On-Premise solutions it has been like this for many years. For the SAP S/4HANA Cloud it works as well (as we will see) but there are some official restrictions:
Please keep SAP Note 2447593 in mind which is saying that RFC should only be used to integrate S/4 HANA Cloud with SAP OnPremise-Solutions (and be it, that it is SAP PO). So whatever you do with non-SAP systems, RFC/BAPI and the SAP S/4HANA Cloud is at your own risk.

Preparation

What I used

  • A functional SAP Cloud Connector Instance + user with administrative privileges
  • An SAP S/4 HANA Public Cloud Tenant + user with administrative privileges
  • Eclipse
  • SAP JCO libraries

What I did

  • Download the JCO libraries
  • Import the JCO libraries into Eclipse
  • Set up the JCO Destination File
  • Test the connection and the BAPI call with the sample programs

Setting up Eclipse

One way of simulating a non-SAP System is making use of a SAP Connector, the JCO libraries. You can find them here: SAP Java Connector. In my example I set up an Eclipse Project and implemented a program that was based on the samples provided with the JCO library. I had to play around a little bit but in the end it worked.
Being not much of a Java guy, I was inspired by 2 Blogs from varun boyina which helped me to set up the example.
Initially I wanted to go via the good old RFC libraries which were used to be delivered with the SAP GUI and included such useful programs like startrfc.exe but that isn’t the case anymore. You can still download a NW RFC library if you want to (see here) but startrfc doesn’t work the way I thought it did anymore or maybe I’m mixing things up and don’t remember it properly. The last time I actually used startrfc was about 15 years ago. Programs change, memories fade…
Eclipse and the JCO worked fine for me and anybody who is more familiar with Eclipse and Java should get along easily.The project structure in Eclipse looks like this:


JCO Destination File

You can either put the destination details into the program or put an RFC destination file into the project. This file contains the information to establish a connection:
#for tests only !
#Tue May 15 16:51:44 CET 2019
jco.client.lang=EN
jco.client.client=100
jco.client.passwd= <Put the password of the S4HC API User of the CommScenario here>
jco.client.user=<Put the name of the S4HC API User of the CommScenario here>
jco.client.sysnr=00
jco.client.ashost=<Adress of the SCC, e.g. xxx.mo.sap.corp>
In the example the file is called “SCC_PRACTICE.jcoDestination”. You can see it in the project structure above. You need to put your own destination details for passwd, user and ashost.

Sample Program

With the program below I was able to read equipment data from the S/4 HANA Cloud. It is a very basic program and not dynamic at all. But it shows that actually not much is required to do the calls. If you want to get into the details I recommend that you read the documentation: SAP Java Connector (Standalone Version).
package jne;



import com.sap.conn.jco.AbapException;
// import com.sap.conn.jco.JCoContext;
 import com.sap.conn.jco.JCoDestination;
 import com.sap.conn.jco.JCoDestinationManager;
 import com.sap.conn.jco.JCoException;
// import com.sap.conn.jco.JCoField;
 import com.sap.conn.jco.JCoFunction;
// import com.sap.conn.jco.JCoFunctionTemplate;
 import com.sap.conn.jco.JCoStructure;
// import com.sap.conn.jco.JCoTable;
//  import com.sap.conn.jco.ext.DestinationDataProvider;

 /**
  * basic examples for Java to ABAP communication  
  */
 public class RFCBAPI
 {
//  static String SCC = "SCC_JNE";
  static String SCC = "SCC_PRACTICE";
  
               
     /**
      * This example demonstrates the destination concept introduced with JCO 3.
      * The application does not deal with single connections anymore. Instead
      * it works with logical destinations like ABAP_AS and ABAP_MS which separates
      * the application logic from technical configuration.     
      * @throws JCoException
      */
     public static void step1Connect() throws JCoException
     {
         JCoDestination destination = JCoDestinationManager.getDestination(SCC);
         System.out.println("Attributes:");
         System.out.println(destination.getAttributes());
         System.out.println();


     }
     
    
     public static void step5CallBAPI() throws JCoException
     {
         System.out.println("Initiating");
   JCoDestination destination = JCoDestinationManager.getDestination(SCC);
   System.out.println("Calling:");
   JCoFunction function = destination.getRepository().getFunction("BAPI_EQUI_GETDETAIL");
   if(function == null)
    throw new RuntimeException("BAPI_EQUI_GETDETAIL not found in SAP.");
    try
     {
      function.getImportParameterList().setValue("EQUIPMENT", "000000000010000000");
      function.execute(destination);
     }
    catch(AbapException e)
     {
     System.out.println("ABAP Exception"); 
     System.out.println(e.toString());
     }
    try
     {
     System.out.println("BAPI_EQUI_GETDETAIL finished:");
//     System.out.println(function.toXML());
      printStruct(function,"DATA_GENERAL_EXP");
//     printStruct(function,"DATA_SPECIFIC_EXP");
//     printStruct(function,"DATA_FLEET_EXP");
//     printStruct(function,"RETURN");
           }
    catch(Exception e)
     {
      e.printStackTrace();
     }
     }

     
     public static void step6PrintBAPI() throws JCoException
     {
         System.out.println("Initiating:");
   JCoDestination destination = JCoDestinationManager.getDestination(SCC);
   System.out.println("Calling:");
   JCoFunction function = destination.getRepository().getFunction("BAPI_EQUI_GETDETAIL");
   if(function == null)
    throw new RuntimeException("BAPI_EQUI_GETDETAIL not found in SAP.");
    try
     {
      function.getImportParameterList().setValue("EQUIPMENT", "000000000010000000");
//      function.getImportParameterList().setValue("REQUEST_INSTALLATION_DATA", "X");
      function.execute(destination);
     }
    catch(AbapException e)
     {
     System.out.println("ABAP Exception"); 
     System.out.println(e.toString());
     }
    try
     {
     System.out.println("BAPI_EQUI_GETDETAIL finished:");
     System.out.println(function.toXML());
//     System.out.println(function.getFunctionTemplate());
//      printStruct(function,"DATA_GENERAL_EXP");
//     printStruct(function,"DATA_SPECIFIC_EXP");
//     printStruct(function,"DATA_FLEET_EXP");
//     printStruct(function,"RETURN");
           }
    catch(Exception e)
     {
      e.printStackTrace();
     }
     }
     
     public static void printStruct(JCoFunction BAPI, String StrucName) {
      
      System.out.println("\n" + "Structure: " + StrucName);
      JCoStructure BAPIStruc = BAPI.getExportParameterList().getStructure(StrucName);
      for (int i = 0; i < BAPIStruc.getFieldCount(); i++)
         {
             System.out.println(i + ": " + BAPIStruc.getString(i));;
         } 
     }
     
     
     public static void main(String[] args) throws JCoException
     {
//   Set Destination  

//      step0DestinationFile();
         step1Connect();
//          step2ConnectUsingPool();
//         step3SimpleCall();
//         step4WorkWithTable();
//         step4SimpleStatefulCalls();
//            step5CallBAPI();
            step6PrintBAPI();
     }
 }

Conclusion

What I learned from this test case

With this test case I brushed up my Java a little bit. For somebody who has used the JCO libraries already in the OnPrem world there is nothing new. The implementation is the same, just the RFC Destination is pointing to the SAP Cloud Connector.

Your Feedback

Please let me know if the description was helpful and you were able to set up the same test case. Any feedback how to improve this blog post is welcomed! Please put it in the comment section.

What’s next

Next time I will show you how to call a BAPI on-premise from SAP Cloud Platform Integration. It’s also the preparation for the final test case in which I do a call from the Cloud and back. Check back soon!

Source: https://blogs.sap.com/2019/07/03/calling-a-bapi-in-the-sap-s4hana-cloud-from-a-non-sap-system/

S/4 Data Migration – How to use Data Migration Cockpit effectively – Tips & Tricks – Part 1 in the Series of 2 Parts


In S/4 data migrations, the data migration cockpit became an essential tool. With rapidly evolving changes in the S/4 world, SAP is coming up with new enhancements to the Data migration cockpit almost every week.
Let us look into a few tips and tricks today. Please note, this blog is for the team who is already familiar with data migration cockpit and know the basics of tcodes LTMC & LTMOM.
If you want to have a brief overview of the above tcodes, please let me know in the comments section, I’ll publish one.
Today, we will review the below points:
  1. How to move the Data migration cockpit project from system to system
  2. How to process the records with the same key again
  3. How to overcome the performance issues
Move Data migration project from system to system:
Either within the same environment (Development -> Quality -> Production) or to other project environments, we will have a need to move the existing data migration project. Especially, once we extend the existing objects and /or add new objects to the project, it is very essential to move the project to avoid rework.

There are 2 steps involved in this.
  1. When we extend the objects we change the structures, system creates workbench transport. Same goes with creating new objects and adding new source code creates a workbench transport as well. Move the workbench requests for structure changes and source code changes just like any workbench transport.

2. Export and Import the Data Migration Cockpit project. This step is very similar to old LSMW      days. LTMOM mapping and all related things get copied to a local file.To export, in the source system client -> Open LTMC –> Click on Export Content

Upload the file downloaded (from source system client), from local machine.

Tip: Make sure to ‘synchronize structures’ and ‘Generate runtime object’ the data objects in every client. This can be done from tcode – LTMOM. Open the project -> data object and execute the 2 steps. Generation of data objects should be done in every client in the system.


Process records with same key multiple times:
The full blown change functionality is not supported yet with standard data objects. We can enhance or create new data objects using LTMOM to support that (we can discuss it further in the coming blogs).
There will be situations we want to process the same record again but, data migration stops us with an error. This functionality is a good sanity check. However, if we need to process the same record again, we need to clear the old record from table DMC_FM_RESTART_K

There is a standard report from SAP supports the deletion of old records for the data migration object. Launch SE38 and execute report DMC_RESET_FM_RESTART_TABLE

Tip: If you are building the custom data objects, please make sure you build the similar functionality (not allowing duplicates until explicitly one tries it). This comes very handy while doing audit. Just letting the system update any and every record sabotages the purpose of these checks built in.
Performance issues:
There are many performance concerns in using data migration cockpit. A few tricks can help to improve the performance.
  • Memory Issues

If we get the memory errors like the one below, clearing the logs help.
No more memory available to add rows to an internal table.
Go to the tile ‘Application log – Delete Expired Log’ or tcode SLG2. Provide the relevant input and delete the logs which are not needed. If there is a log exist for the project, System tries to read through it and it hinders the performance. Clearing logs helps to resolve that issue.

Once we execute the deletion of expired logs, it generates a back ground program to delete the logs.


  • File size

While working with files, the default size limit for each uploaded XML file is 100MB, but it depends on parameter icm/HTTP/max_request_size_KB, which controls the size of the http request. You can increase the size limit for each uploaded XML file by changing the system parameter (icm/HTTP/max_request_size_KB).
However, it is very much possible that, even after increasing the file size parameters, the timeouts may happen. At that point, it is required to adjust the Timeout Options for ICM and Web Dispatcher accordingly to avoid timeouts during the file upload.
Please review the SAP Note – 2719524 for more information.
  • Cloning the data object

Working with staging tables can be one solution for file size issues. That is the main purpose of staging tables.
However, the processing time issue is the same. The processing times with data migration cockpit are slightly higher than old direct input methods supported by LSMW. There are various reasons for it. The solution working better at this point is, slicing the input file into multiple files and clone the data object to use multiple background processes with those small files.

This step needs to be balanced out always, with the number of background processes available and how many users consuming them at any given point.
 
In further blog posts let us discuss more tips and tricks of data migration cockpit. Please refer to the note 2537549 to learn, new happenings on Data Migration Cockpit.


Source: https://blogs.sap.com/2019/07/03/s4-data-migration-how-to-use-data-migration-cockpit-effectively-tips-tricks-part-1-in-the-series-of-2-parts/

quarta-feira, 3 de julho de 2019

SAPUI5 VS FIORI

Hi,
I struggled a lot to get difference between sapui5 and Fiori.  So In this Document i am going to write what I got in my research.
SAPUI5
UI5 is nothing but development tool kit for html 5. It contains lot of predefined JavaScript library to design new user interface.
UI5 is mainly developed for SAP mobility which means Fiori.
UI5 is a framework based on MVC pattern.By using this frame work developer can easily build web application.
Picture1.png
From above you can easily understand that It will run on any device.
UI5 is SAP own user interface to develop web application.
UI5 is now a days is getting popular to outside of SAP to build  NON-SAP application also.
UI5 uses web technologies like HTML, CSS and JavaScript.
SAPUI5 is technology whereas Fiori is a methodology.
SAPUI5 is Hybrid app (Because of HTML5).
SAPUI5 Apps runs on multiple platforms with full capability as like native apps such us SMP.
FIORI:
Fiori is a new user experience for SAP software . To overcome the complexity of SAP traditional GUI ,New one has been developed  which is Fiori.
Fiori focus mainly on mobility. Fiori uses SAPUI5 for frontend and it uses odata  to get back end data.
Fiori is a design paradigm – not a methodology.
The primary technology used for Fiori is SAPUI5.
Without knowing SAPUI5 knowledge fiori customization is difficult. Fiori contains all the business process in the form of Role based.Currently more than 1000 roles are created  based on business process.
One code line for all screen sizes.
SAP back end contain  Business logic and odata service.
SAP front end which means Net weaver Gateway server contains SAPUI5 control libraries and App specific Fiori UX add-Ons.
In SAP ECC 6 and Ehp7, we can create odata service by using SEGW Transaction.
Fiori used across solutions such as SAP S/4HANA
Fiori apps are Hybrid which means based on web technologies(SAPUI5) and will be connecting to SAP via SAP NW gateway .
Fiori is a package which has collection of sapui5 apps .Refer below link.
https://fioriappslibrary.hana.ondemand.com/sap/fix/externalViewer/
The below link will describe the fiori architecture overview and prerequisites
http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/e03be70d-68fb-3010-c6a0-ff56889c2c81?QuickLink=index&overridelayout=true&58652073478233
Note:
SAP UI5 is Mother for All Fiori Apps.
Fiori Apps are build with SAPUI5 which implements HTML Features.
SAP Web IDE is used  for the creation modification of SAPUI5 code. Unlike other tool , SAP Web IDE doesn’t require any installation.
With Regards,
Siva.


Source: https://blogs.sap.com/2015/07/15/sapui5-vs-fiori/

segunda-feira, 1 de julho de 2019

What is the difference between SAP Best Practices and an SAP Model Company?


Last updated: June 7 2019
SAP Best Practices and SAP Model Companies are used to accelerate customer’s SAP cloud and on-premise implementation projects. You can find lots of excellent content on the benefits and value of using them in SAP implementations. This blog looks at what they contain and describes the key differences between SAP Best Practices, SAP Model Companies and Rapid Deployment Solutions. It answers some of the questions often asked by customers. It also contains useful links to get the latest information.
SAP Best Practices
SAP Best Practices came first and have evolved and improved for many years. They provide baseline configuration, standard business processes and a library of detailed documentation. They focus on cross-industry scope for S/4HANA but also cover C/4HANA and other cloud solutions.
The same Best Practice content generally exists in S/4HANA cloud and S/4HANA on-premise. (There are a few exceptions). At the time of writing they cover 29 on-premise countries. There are over 200 scope items representing business processes or functions. Each scope item can be activated in a sandbox or development system and has a process diagram, detailed test script and configuration documentation.

SAP Best Practices are available free of charge and can be seen or downloaded at the Best Practices Explorer with your s-user: https://rapid.sap.com/bp/. You can also find SAP packages for integration, data migration and analytics topics. Some partner solution packages are also available.
SAP S/4HANA Best Practices have significantly improved since 1) they became the foundation for S/4HANA Public Cloud and 2) they are developed and tested at the same time as the software by the same team. This means different Best Practices work together seamlessly and continuously evolve based on feedback from cloud customers. S/4HANA Cloud Best Practices are updated every quarter and on-premise S/4HANA Best Practices are updated once a year.
They can be selectively activated into your on-premise sandbox or development system using a tool called SAP Solution Builder. You can choose which countries you want, what scope items you need and certain other input parameters. Public cloud customers get content activated by SAP as part of their deployment. Activation creates new configuration settings and does not change the standard configuration that is part of a normal on-premise installation. For example, they may create one company code and other selected organization units that can then be renamed.
Activation is usually a one-off process, however, after the initial activation, an experienced team can do more delta activation. For example, to add an additional country or extra scope items. There are also tools to generate sample master data.
Once activated, even inexperienced SAP users can run end-to-end integrated business processes immediately by simply following the test script documentation. The greatest acceleration can be achieved by activating the configuration content into a new development system at the start of a project creating transports as you go. Alternatively, if you are already underway, a sandbox can be a good reference for project team members.
With Best Practices available, why start with an empty system? Read on further to see how SAP consulting can activate Best Practices for you. Alternatively, get a hosted 30-day trial here http://www.sap.com/s4hana-trial.
SAP’s implementation methodology, SAP Activate, recommends the use of SAP Best Practices in a “solution-led” approach. It advocates executing Fit-to-Standard workshops (for cloud) or Fit-Gap workshops (for on-premise) instead of the traditional Blueprint workshops that were part of the old ASAP methodology. Starting from day one with the standard SAP solution allows you to keep to standard and minimize customizations.

Many on-premise customers use SAP Solution Manager for the application lifecycle management of their SAP solutions. All the SAP Best Practice business processes diagrams and accelerators can be imported into Solution Manager and changed to reflect your project design.
Cloud (or hybrid cloud / on-premise) customers can use the Cloud Application Lifecycle Management implementation portal instead of Solution Manager.


SAP Model Companies
SAP Best Practices provide excellent cross-industry baseline solutions. Private cloud, hosted or on-premise customers can go one step better. What if you need deeper industry or line of business functionality and processes? Or, what if you want to avoid having to learn how to activate Best Practices yourself?
SAP Model Companies build on top of parts or all of the S/4HANA Best Practice baseline content. They provide additional processes, solutions, configuration and scope items. This can include additional SAP applications e.g. Leonardo innovations, SAP Integrated Business Planning and SAP Business Planning and Consolidation. Or they provide configuration and scenarios for a particular industry. They are purchased from SAP and include an engineered service to activate the Model Company in your on-premise, hosted or cloud solution.

For more information see the Model company SAP.com page. Here is the current list of available Model Companies. Each one provides a choice of “scope options”. SAP upgrade the Model Company content after Best Practices content is upgraded.

Model Companies are rapidly deployed by SAP into a new sandbox using an “appliance”. With a cloud provider such as AWS or Azure, this can be done in 1 week. For on-premise, it can be done in to 2 to 4 weeks. They are normally used to build a sandbox system (rather than a development system). Like Best Practices, they include sample organization structures and master data.
The Multinational Corporations Model Company allows you to combine Best Practices for multiple countries into one instance. A service summary like the one below is available for all Model Companies.

Some of the industry and Line of Business Model Companies are available for just one or two reference countries and must be localized to a target country after they have been activated.
SAP Model companies can be used to jump-start a project that is SAP-led or being implemented by a partner. Furthermore, because they are all built on the same cross-industry Best Practice baseline, SAP can rapidly merge or assemble many of the offerings to order.
You can test drive a model company by purchasing a 30-day trial here.

Rapid Deployment Solutions
Before SAP Model Companies were released, SAP Rapid Deployment Solutions (RDSs) were available. Most RDSs have been replaced by broader industry or line of Business SAP Model Companies. A few RDSs remain for areas such as analytics and integration and are still available in the Best Practice Explorer.


I hope you found this blog informative.
Amin Hoque
Enterprise Architect at SAP Digital Business Services UK


Source: https://blogs.sap.com/2019/06/03/what-is-the-difference-between-sap-best-practices-and-sap-model-companies/?

How to decide between a Greenfield and Brownfield S/4HANA transition

For transitioning to S/4HANA there are two fundamental options. You could either implement S/4HANA from scratch and migrate your existing data in a greenfield approach, or alternatively you could transition your existing ECC to S/4HANA including all of its customizations and data in a brownfield approach.

To make this decision, in my experience, the following dimensions have to be evaluated:
Dimensions.jpg

Data Quality / Unicode / Archive

When transitioning to S/4HANA, data matters big time.

Unicode

To start with, S/4HANA does only support Unicode. If your ECC system was on multiple code pages (MDMP) a Unicode conversion would have to be included into the transition. Technically, the SAP S/4HANA transition tools (SUM DMO option) support this conversion, but more importantly, your business would have to provide the respective vocabularies, which could be integrated into a data migration approach.

Archive

While the reorganization and column store compression of an S/4HANA transition regularly shrinks your data footprint considerably, it remains important that you only take relevant data in-memory due to the huge price difference between memory and disk capacity. Therefore, you would either have to implement a data retention strategy upfront a technical transition to S/4HANA or integrate it into your data migration approach.

Data Quality

With S/4HANA, operational reporting could be run real-time on your transactional data without the need to load it into a data warehouse environment. However this implies, that there is no transformation step as it was in a traditional ETL approach any longer, so that the data quality has to be given in the system itself. To achieve this, there are two steps required.

Passive Data Governance

Either prior to your transition to S/4HANA or as part of the data migration, your data foundation has to be cleansed. Whichever you find easier or is more feasible will drive your decision.

Active Data Governance

Once cleansed, your data foundation has to be maintained clean, regardless a greenfield or brownfield approach.

Integration / Interfaces

In a real-time environment like S/4HANA, integration makes a bigger difference than ever, since real-time information on batched data has no benefit. Therefore any interface into S/4HANA or out of it would either have to be revisited prior to the transition or re-implemented with real-time in mind as part of the migration.

Versions / Patches

Simple Finance, on-premise edition 1503

Technically Simple Finance, on-premise edition 1503, is based on EhP 7 for ERP 6.0, which runs on SAP NetWeaver 7.40 and HANA as the database. Therefore a transition from an earlier release is very similar to a respective upgrade and a data migration less likely the preferred alternative.

S/4HANA, on-premise edition 1511

Technically S/4HANA, on-premise edition 1511, is based on S/4HANA core components that run on SAP NetWeaver 7.50 and SAP HANA as the database database. Therefore a lot of components have started to be changed and a transition would have more the character of a migration.

Modifications / Enhancements

Your modifications and enhancements would have to be checked for S/4HANA compliance. SAP provide a tool for this, that I described in my earlier blog: Make the S/4HANA Custom Code Analyser work for you and some of the corrective measures might be automatable, but there remains effort. Therefore, if you had a lot of custom code that is of no value any longer, a migration and S/4HANA compliant re-implementation of the still required enhancements might be an opportunity for further simplification.

Configuration / Features

Please be aware, that S/4HANA is work in progress and that not all the functionality that had been available in ECC 6.0 is available in S/4HANA, on-premise edition 1511 yet. Please check the User Assistance for SAP S/4HANA, on-premise edition 1511 for what functionality has already been made available. Also not all industry solutions and add-ons, whether from SAP or 3rd parties, are S/4HANA compliant yet. For SAP products the SAP HANA readiness can be checked in the PAM. For 3rd party software you would however contact the respective vendor. Missing functionality, a non S/4HANA compliant industry solution or add-on would of course prevent you from a transition whereas you might still be able migrate, if you could provide the respective functionality in another way.

User Experience / Mobility

The strategic S/4HANA user interface is Fiori, but in SAP S/4HANA, on-premise edition 1511 quite a few transactions are still rendered in SAPGUI for HTML leveraging Screen Personas. Therefore, regardless the approach, I would recommend that you make yourself familiar with those UI technologies and get the technical foundation for Fiori in place.

Summary

If you had a streamlined system in terms of code, data and integration or could get to one without too much pain, a brownfield transition to S/4HANA would be the recommended option. However, if you had a lot of technical debt in your system, a greenfield migration would be the more feasible option that would reward you with a clean and simplified result.


Source: https://blogs.sap.com/2016/04/22/how-to-decide-between-a-greenfield-and-brownfield-s4hana-transition/