Saturday, May 21

Adding custom T codes on SAP FIORI Launchpad

 

This article will walk you through the process of adding custom T codes on the FIORI Launchpad by extending SAP Menu option on the FIORI Launchpad.

There are 2 ways of doing this. First, you can create a target mapping in the FIORI Launchpad designer. The target mapping will be tagged to the custom t code that you want to launch on the click of a tile.

Another option is to extend the SAP Menu available on the FIORI Launchpad. We shall discuss this option in more detail below.

SAP Menu search allows to access FIORI applications and standard TCODES (SAP GUI and Web Dynpro ABAP applications).

On opening the TCODE, the respective SAP GUI and Web Dynpro ABAP application will open on FIORI Launchpad.

If we want to access custom TCODES in Fiori Launchpad, we need to follow below steps.

Steps1: Go to T code se43 and select S000 and click on edit

Step2: Click on Extend








Step3: Create a new extension



 

 

 

 

 

 






Step4: Add a node of your choice and enter the required tcodes



 




Step5: After adding save it

Steps 6: Clear cache from Report /UI2/EAM_BUIL_CACHE

Step 7: Now check your custom T code in SAP FIORI Menu



Thursday, March 26

Steps for making changes to existing custom UI5 App


If you want to make changes in an existing custom UI5 app which is deployed on ABAP repository, this blog will guide you through the steps.
First you need to download the app from ABAP repository
Then, import it in eclipse
Then, make changes in the app in eclipse as per business requirements
Then, deploy the app with the same technical name or a different technical name. Capture this deployment in a TR.
Download application source code from ABAP repository
For this, login to SAP system as shown below. Enter logon credentials at below screen.
You will be taken to SAP Easy Access screen as shown below













Enter tcode SE38 in the commmad line










On the following screen, run the program called /UI5/UI5_REPOSITORY_LOAD as shown below















Click on execute button. On the screen that follows, enter the technical name of the application you identified previously. See below. Select the Download radio button since you want to download the source code of this application and then import in eclipse.

Click on execute button, you will be asked to select a location on your local machine for saving the folder of source code of this application

Select a folder or create a new folder at a specific location of your choice. And click on OK button. Below popup will then display

On this popup, check the checkbox ‘Remember my decision’ and click on Allow. Then system will display the summary of the files which will be downloaded

Scroll towards the bottom and click on ‘Click here to download’ button

On the popup that appears, click on continue

On the popup that appears next, check the checkbox ‘Remember my decision’ and click on allow

Done. Your application source code is now downloaded in a local folder. See below message

Importing the downloaded App in Eclipse for making changes in source code
Now let us import this application source code in eclipse to make changes as per business requirements. Open Eclipse.

Go to File->Import…






































Select Existing project into Workspace option as shown below

On the subsequent screen in the wizard, browse and select the folder which was downloaded from SAP system and then click on next





































Click on Finish. This will create a project in project explorer view of Eclipse.


Sometimes, there are some junk characters which appear in the JS files or json files which are downloaded from ABAP repository and hence some errors will be displayed in the project, refer above picture. In order to resolve these, refer the same code file in SE80  tcode in the ABAP frontend server and make same changes or remove unnecessary characters from files while comparing the code with code available in ABAP repository.
In my case, these are the special characters appearing on the File

So now I am going to SE80 and opening the same file and going to line no .115 to see what is causing these special characters and is it ok to remove/comment this code or remove the special characters and do away with the error.

Here, we can see that the source code need not commented. It is required and so I will remove the special characters from Eclipse file and make it error free manually.

Cleaning done, this is how it looks like now and error free. So, now the project is error free and ready for making code changes for business requirements. Once you are done with the necessary changes to the application, its time to deploy the changed app on ABAP repository. Here, you can decide to overwrite the existing app source code on the server or you can create a brand new app for deploy the changed source code under it. Here I will deploy the code under new app.
Deploying the App to ABAP repository
Right click on the app and select team->Share






































Select SAPUI5 ABAP repository from below

Enter ABAP frontend system’s details to deploy the App on it

Enter logon credentials. Ensure that this user has developer key assigned and developer roles given to it and using this ID, you have already created at least one technical object in the system prior to using the ID for deployment of UI5 app fom eclipse.

On the next page, you have options. Options one is to select an existing App onto which the changed resources will be overwritten. Option two is to create a new App. This will create a BSP application and a ICF service for the App in the system.

Finally, you need to select the TR or create a new TR to capture these changes


Click on Finish.
Test the new App
Once the application is deployed, you need to test that. Right click on the project and select Run As->Run on ABAP server shown below

Verify the changes in the deployed App. With this you have successfully made changes to an existing custom UI5 app and deployed on ABAP frontend server. 

In case you face any issues while following these steps, post a comment below and I will be happy to assist you resolve the issues

Saturday, March 21

SAP FIORI security concepts


This article is about the activities that a FIORI developer/administrator would do in a FIORI implementation project. This will be more from the perspective of SAP FIORI security.
By the end of this article, you will know concept of authentication, authorization, FIORI in the context of SAP ECC and S/4 HANA systems, types of users involved in SAP FIORI implementation project.

What is the difference between authentication and authorization?
Authentication is to provide access to the system. The ability to login to the system using correct login credentials is called authentication. And authorization is the ability of the user to perform various transactions within the system after login. Using authorizations, granular control over the ability of a user performing various transaction within the system can be done. For example, some users may be authorized to create a sales order, modify it and display it. While some other group of user may have authorization to only display a sales order.

What is FIORI?
FIORI is the new user experience for SAP solutions like ECC, S/4 HANA, SAP suite solutions etc... With the coming of FIORI, the old UI technologies like Dynpro, BSP and dialog programming have become obsolete. The main selling factor is FIORI is that it enables users to access business data and transactions on mobile devices and with high availability and in a secure manner and in a role-based manner. Moreover, FIORI apps are simple and coherent in nature. The monolithic screens that we used to see in the tcodes like ME21, VA01, MM01 etc… have been broken down into smaller chinks UI controls allowing users to focus on the task to be performed on the screen. And with this, the UI screens are self-explanatory and hence the training costs involved reduces drastically. The default user experience for S/4 HANA is FIORI. FIORI apps also has offline capabilities.

SAP FIORI provides role based assess to SAP Apps. What does this mean? Which type of users are involved in SAP FIORI implementation project?
In FIORI implementation project, there are 5 type of users. First, the Business user. This is the user who uses the FIORI App and does his daily tasks of his job using FIORI apps. Second is the SAP FIORI Security consultant also called BASIS consultant. This user installs the system, applies upgrades to the system, applies SAP notes to the system. He creates users, roles and hence gives necessary authorizations to the end users. This person creates the PFCG roles and add FIORI catalogue and Groups, OData authorizations etc... to the role and assign this role to the business users. He might also create the FIORI launchpad designer to create Tiles, target mapping, catalogue, group. He also might create Semantic object and Launchpad role instance. The third person is the UI5 developer also called FIORI developer. This guy creates brand new UI5 applications for business user’s requirements. At times, he extends standard Fiori apps. In case of FIORI extensions, he refers the FIORI apps library and does the necessary extensions based on business requirements. He will create odata services and consume those on UI5 apps. He will work on eclipse or on Web IDE. He will sometimes work on FIORI launchpad designer. Fourth user in the implementation project is called key user. This user does  the UI adaptations as per business requirements. He creates KPI tiles, smart filter FIORI apps. The fifth user is the UX designer. He focuses on creating prototypes, he uses build.me to create prototype. He is bridge between the business user and the UI5 application developer. His focus is to ensure that business user is happy with the UI controls, the screen navigation, the no. of clicks the user has to do to complete his tasks on the App, the app’s responsiveness etc. He creates prototypes and demoes it to the business users, gets his consensus and then hands over the prototype code to the UI5 developer so that developer can import the prototype in actual UI5 app project and then build further on it, integrate actual odata services and build full-fledged app based on the prototype.

Sunday, December 23

RFC destination from gateway to ECC is showing error

1. Introduction
2. Error
3. Resolution of Error

Introduction
You are trying to call function module from oData service. The oData service is hosted on SAP net weaver gateway system and function module which is RFC enabled is hosted on SAP ECC system. To make this call you need to have a RFC destination created in Gateway system. This activity can be done in SM59 transaction. Once RFC destination is created, test it by clicking on connection test as shown below.

Click on Connection test on below RFC Connection.


Below error is displayed


Error
Error when opening an RFC connection (LB: Hostname or service of the message server

Under such circumstances, if you try to run oData service on browser, you get below error.
Error Text as shown on the front end i.e browser
Call of service <oData service URL> terminated because of an error. The following error text was processed in system MUP : Error when opening an RFC connection (LB: Hostname or service of the message server unknown DEST =ECC_TRUSTED MSHOST =171.31.243.33 R3NAME =MUP GROUP =MUP).The error occurred on the application server mutcdcnwhwcuv. The termination type was: RABAX_STATE.If the termination type is RABAX_STATE, you will find more information on the cause of termination in system MGP in transaction ST22. If the termination type is ABORT_MESSAGE_STATE, you will find more information on the cause of termination on the application server mstddcnwgwciv in transaction SM21. If the termination type is ERROR_MESSAGE_STATE, you can search for further information in the trace file for the work process in transaction ST11 on the application server mstddcnwgwciv. You may also need to analyze the trace files of other work processes. If you do not yet have a user ID, contact your system administrator.  

Resolution of Error

If the destination system is unavailable or not accessible over HTTP, this error occurs.

Saturday, December 22

Testing oData Service using External Test Clients like ARC and Postman


1. Introduction
2. Google's ARC client
3. Concept of oData Write Operations without CSRF token
4. Google's Postman.


Introduction
SAP provides a testing environment for oData services called ‘Gateway Client’ which is an inbuilt tool in SAP NetWeaver Gateway System. It is meant for testing GET, POST, PUT, and PATCH, MERGE, DELETE http methods.
During SAP implementation projects, oData services also gets consumed in non-SAP application clients for example consuming oData service on an Android based mobile app. In such scenarios, testing oData services using an external client like ARC or Postman becomes critical. In this blog, we will see how to test oData service using ARC client and Postman.

Google’s ARC Client
First you need to Install ARC on your google chrome browser. After installation, click on Apps.
You will be able to see all the Apps installed on your Chrome browser like below.
Click on ARC icon, below page will be displayed. Where you need to enter your oData service's URL and select the type of Request like GET, POST, PUT etc...
Then Click on Send button, that it, you are done. This is equivalent to oData read operation, If you are connected to network from where your SAP Netweaver gateway system is accessible, your read request will go all the way to Gateway and fetch necessary information and display in XML format in below manner.

Concept of oData Write Operations without CSRF token
You can also add headers to your HTTP request. For example, if you are doing a POST request (i.e. write operation for your oData), you need to send X-Requested-With header and its value to be set a 'X'. When such a header is sent for a oData write operation, ICF of your netweaver gateway system will not check for X-CSRF-Token. Other wise for any oData write operation, CSRF token is a must.

In addition to sending X-Requested-with header, you also need to sent ~Check-CSRF-Token parameter's value to 0 at the ICF service level of your oData service. You can do this in SICF transaction of your gateway system as shown below.