Loading...

Follow SAPYard on Feedspot

Continue with Google
Continue with Facebook
or

Valid

In the BOPF Introduction, we learnt the fundamentals of BOPF. Hope you know that BOPF stands for Business Object Processing Framework (Not BOPF grade – Broken Orange Pekoe Fannings). In the part 1 we took a deep overview of the BOPF concept with some practical hands on session. We created a custom BO with a Root node. Today, we will continue where we left. Apologies for publishing the part 2 so late. Some professional and person priorities took over part 2. Everything is settled now, and I can devote more time in doing what I love most. That is, sharing knowledge and learning.

In previous article we created Root node and explored the objects which are created by the framework. If we have root node, there has to be a child node as well. And when you have header and item, there has to be a way to link them or associate them. You guess it right. I am trying to take you to the Association Concept in BOPF.

Well association is a global concept. I highly recommend, you should take a look into the below association articles related to OData, CDS View and HANA.

Association and Navigation in OData Service

Associations in CDS Views – I

Associations in HANA – A Conceptual Approach

Association in BOPF

Coming back today’s article. Let’s get into the system and create an Item Node under Root node. Go to T-code BOBF. Right click on the root node and create Item Node similar to how we did it in our first post. Hope you remember, we must have a structure ready to create it otherwise we can also create it through forward navigation. Once done it will look as shown in the below screen shot.

Note: In our last blog, one of the readers asked what are the fields required to create the Persistent and Transient structures ? That completely depends on the business requirement. For example, in my case I have taken emp id and name in the root node and in the item node father name, mobile, city, state and country.

In real time scenario surely, this will not be the case. We will have structure with huge number of fields but to understand the technicality this example should be enough and will serve our purpose.

We will have Combined structure, Combined Table Type and Database Table generated for Item Node by the framework. That is the beauty of the framework.

In our Root Node generated table, as of now we don’t have any entries. Let’s insert an instance in BOPF style. Execute the Business object. We will enter BO test or go to T-code BOBT. Before entering any entry let us check if root node has any rows (table entries). For this go to Load Node Instances>By Query>Root – Select_All as shown below. Both the Queries SELECT_ALL and SELECT_BY_ELEMENTS are created by the framework itself. We can check it in the Node elements. Expand the Root Node and the Queries which will show both the queries once the Root node is created. However, we can create our own custom queries too.

If you have any entry in the DB table it will load the entries else it will show you a message as below as we don’t have any entries created yet.

Also Take Free Video Course on New ABAP 7.4+ Syntax & Features

Let us create an entry in the DB Table. Click Add Node Instance Button and enter the data for the fields and SAVE. We have taken only two fields in our case as EMPID and EMPNAME. The KEY, PARENT_KEY and ROOT_KEY gets auto generated every time we create any Node instance.

We can confirm our entry in the DB Table of the Root Node. Let’s repeat the SELECT_ALL query and this time we will find the entry we have created just now. Let us also create an entry in the ITEM Node for the header data.

Note: If you have observed the above image carefully, the parent key is empty when the root node instance is created. This is because there is no parent to the root node.

Now we have a Header data and its Item data created. Let’s suppose we want to load the node instance by the key field as in the BOPF world the key is given by the framework itself. So let’s copy the GUID key from the created node instance as shown below.

Now to load the node instance of the Root Node with its key we go to Load Node Instances>By Key and enter the key by pressing the create button from the dialog box as shown below. We can also load the item data from the Root Node instance just by double clicking the Item node.

Also Take Free Video Course on ADBC Programming in S/4HANA

Alternative Key in BOPF

Since the BO Object has only one record we found the key of the root node easily and got the required data but in the real time scenario we will have lakhs of instances and it is not possible to always go and copy the GUID key. So BOPF has the concept of alternative key which helps to load an instance by a reference number rather than using the actual key.

If you have observed while loading the node instance, we had only two options to load the node instance i.e. by query and by key (as shown in the above screenshot) because we have no alternative key created in the system. Let’s create our alternative key and fetch data with it.  

Below is the step to create alternative key :

The data required to create the alternative key are the data element of the field which we want as the alternative key, the table type of the field and the field name as the alternative key name. All the data can be seen in the below screen shot.

Regenerate the business Object once done.

After the alternative key is created we can now see the 3rd option to fetch the data based on alternative key. In our case the Employee ID which we have created is 100. So, let us fetch the data using the alternative key 100 and we will be able to fetch the data.

This brings us to the end of the post which I planned as part 2. Hopefully you are clear about the Association and Alternative Key concept in BOPF. I know it is very basic, but we need to take baby steps. Let’s get comfortable with the ABCs of BOPF and then we can plunge deeper. In next article and in future series, we would gradually take advanced topic and also showcase real project scenarios.

Questions please.

Please feel free to comment below for any suggestions, input or queries.

If you want to have real time discussions and resolutions, do join our SAP Technical Telegram Group where we have more than 5100+ active SAP consultants from 6 Continents.

Please Note: You need to install Telegram App on your mobile first and then you can join the group using the above link.

Please SUBSCRIBE to SAPYard’s Youtube Channel for Free End to End SAP Video Course and Training.

Step by Step Tutorials on BOPF
  • Show original
  • .
  • Share
  • .
  • Favorite
  • .
  • Email
  • .
  • Add Tags 

As promised, I will continue publishing articles related to SAPUI5 which are a bit complex and you would not find tutorial documents on these advanced topic that easily.

In one of the articles I explained How to Get Weight from the Weigh Scale/Weigh Bridge Bluetooth Device using SAPUI5 Hybrid App? It was bluetooth device then and today it is Python. This can be treated as part 2 for the Weigh Scale/Bridge application development.

Also CheckFirst Program in ABAP HANA

Step1:- Create a SAPUI5 project in WebIDE Step2:- Create a button and input box on screen Step3:- Execute Python Service and get the Service URI

Execute the python service which hosts data from the comport and get its service URI from command line. In real time you can host data to intranet so that it can be accessible in all fiori apps.

Also ReadCreate your first OData Service

Step4:- Integrate this Service in SAPUI5 App and read the data

Also Read – Everything about CDS (Core Data Services)

Testing Time

Check, the request which brought data from python is available as shown below.

Once you have the service you can do whatever you need from the service. It’s your baby now.

I am sure, if you have not worked much in SAPUI5 development, you ought to have questions. And we do not charge consulting fee to answer your queries. Feel free to put your doubts and I make sure to answer them personally.

Questions please!!

If you want to have real time discussions and resolutions, do join our SAP Technical Telegram Group where we have more than 5100+ active SAP consultants from 6 Continents.

Please Note: You need to install Telegram App on your mobile first and then you can join the group using the above link.

Please SUBSCRIBE to SAPYard’s Youtube Channel for Free End to End SAP Video Course and Training.

Step by Step Tutorials on SAPUI5
  • Show original
  • .
  • Share
  • .
  • Favorite
  • .
  • Email
  • .
  • Add Tags 

SAPYard has been predominantly covering topics on SAP ABAP but that does not mean SAPYard cannot cover other topics of SAP. Yard is the space for every topic in SAP and therefore today, I am writing the first article on SAP XI/PI/PO. This is a very basic requirement but very often googled for. As a novice, I learnt PI certificate update process in a hard way, but others would not suffer. This article would act as a complete guide for PI 7.5 certificate update.

Let’s start.

Open XPI inspector in intended PI business system to update certificates

Provide URL in SSL URL https://certs1.ariba.com field as shown below.

Start the trace and stop.

Also Take:Free Video Course on New Features and Syntax in SAP ABAP 7.4

If you scroll down till the end, you will find some certificates with yellow/red color.

Click on the links and download the certificates. Once certificates are ready on your local machine (desktop or laptop), Go to SAP NetWeaver Administrator from Configuration and Monitoring.

Select Configuration tab and then Certificates & Keys link.

Search with TRUST* in Name will enable all certificates related to TRUSTEDCA’s.

Also Read:Difference between Open SQL and Native SQL

Then click on Import Entry and select certificates from presentation server (local desktop/laptop) and import the certificate here.

Once certificate is imported, select the certificate and go to Security (top left corner just below the Key Storage tab).

 Search with ARIBA and select that record and then click on Grant.

Select the entry and go to Permissions per Domain tab.

Then click on Grant New Permissions tab.

Also Read:Open SQL, CDS or AMDP, which Code to Data Technique to use?

Do the same process for all certificates. Now all certificates are imported successfully into the intended business system.

Now restart all channels from Monitoring.

Go to advanced search.

Restart all channels which appear here and you are done. Your certificates are successfully loaded and you are good to perform your business processes.

This is my first article at SAPYard. So, your feedback would help me improve. Please provide your genuine comments. Also suggest what topics do you want me to cover in the area of SAP PI.

Suggestions please.

We have a very active Telegram (App) SAP Technical Group with more than 5000+ SAP Technical Practitioners from 6 Continents of the SAP World. Please join it using below link.
Telegram SAP Technical Discuss Group. You need to install the Telegram App first on your mobile device. Once you have it on your mobile, you can join the group and also access it from the Web on your computer and laptop.

Please SUBSCRIBE to SAPYard’s Youtube Channel for Free End to End SAP Video Course and Training.

Check HANA-ABAP Tutorials
  • Show original
  • .
  • Share
  • .
  • Favorite
  • .
  • Email
  • .
  • Add Tags 

At SAPYard my fellow author Sagar is targetting the advanced topics in SAPUI5 while I and others help the beginners in SAPUI5 to catch up with different topics in UI development. Resource model is in my plate in this article. Resource model is used for internationalization in Fiori and UI applications. Resource model is also known as i18n model.

Wondering what 18 means?

18 stands for number of alphabets between I & N in InternationalizatioN. Did you just count the alphabets? Did anyone tell you this before?

We use internationalization and localization in our SAPUI5 application for replacing the hard coded text from the application. It is one of the best practices of SAP to use i18n for hard coded texts.  Generally, we use Resource Model for defining it, since it is one-time binding. 

Use Case

We are going to display a table where the column heading texts will be translatable according to our i18n model.

Also Read: End to End ABAP on HANA Tutorials

Steps:
  1. Create a new folder i18n and file inside the folder
  2. Configure in manifest.json
  3. Add the translatable texts in i18n files
  4. Do the binding in view.xml
  5. Execute the application
Step – 1: Create a new folder i18n and file inside the folder as shown below.
Step – 2: Configure in manifest.json.

In our manifest.json we have to configure the above created i18n file under models area within SAPUI5 section as shown below.

Note: I have done the configuration directly in code editor. If you use descriptor editor then automatically the code will generated .

Also Check: How to Consume Custom OData in SAPUI5 Application

Step-3: Add the translatable texts in i18n files.

I am going to provide texts for 3 different language files.

For English(default) – i18n.properties
For Tamil – i18n_ta. Properties
For German – i18n_de. Properties

Note: The above Tamil and German texts has been translated using Google translate. What would we do if Google becomes a paid service or shuts down one day.

Also Read: SAP Fiori Tutorial. Part II. End to End Implementation of Fiori App

Step-4: Do the binding in view.xml as shown below.
Step-5: Execute the application

Note: From the above image we could see, by default it displays English language text.

If we want to display the text in Tamil language, then append the text ‘&sap-ui-language=ta’ at the end of URL.

Now execute the application to see the output in another language.

If we need the text in German language, do the same as shown below (‘&sap-ui-language=de’) and execute the application.

Do we need to change the language at the URL every time?

A big NO..

In real time if you are logging into a Fiori or UI application, it will open the Fiori Launchpad page where you have to enter your credentials as shown below.

From the above image you can see the option Language where you can select your language there so that the corresponding i18n file for the selected language will be called and displays the texts.

As easy as that. Right?

In one of our US project with German roll out, the Fiori App was opening in only German by default. Even for our US client. That was a tricky situation. Check this article to know about this interesting issue and resolution. How to change non-English Default Language in Fiori Launch Pad?

Internationalization is one such topic which does not get it due. Just like some of the world famous under-rated players. This article is a tribute to i18n.

Comments please!!

In case, you face any issue, please write your questions in the comment section. We reply to each and every comment.

If you want to have real time discussions and resolutions, do join our SAP Technical Telegram Group where we have more than 5100+ active SAP consultants from 6 Continents.

Please Note: You need to install Telegram App on your mobile first and then you can join the group using the above link.

Please SUBSCRIBE to SAPYard’s Youtube Channel for Free End to End SAP Video Course and Training.

Step by Step Tutorials on SAPUI5
  • Show original
  • .
  • Share
  • .
  • Favorite
  • .
  • Email
  • .
  • Add Tags 

The more you work on any technology, the more the client gets comfortable and more complex and real life requirements come up. Same happened with us in our project. We have used SAPUI5 to the fullest and now, the client wanted a voice recognizing application. Technology is really for the lazy ones. Now folks do not want to type. They want to talk and complete the operations.

If you are a beginner, my articles might be a bouncer for you. Do not duck. Face it with grit. If you want to be a real SAPUI5 developer, accept these challenging requirements and learn.

Did you check my previous article SAPUI5 – Offline Application in 8 Steps

Here we present a sample app to demonstrate the voice recognition. You can provide hands free operations. Example user can say “Save” instead of clicking a button and you can form save operation.

Step1:- Initialize and Settings for Indian English

Initialize the voice recognition variable and its settings to recognize in English India (You can set your preferences)

<code>if('webkitSpeechRecognition' in window){
            this.recognition = new webkitSpeechRecognition() ;
        }else{
            this.recognition = new SpeechRecognition();
        }
    this.recognition.continuous = true;
    this.recognition.interimResults = false;
    this.recognition.lang = 'en-IN';</code>

Also CheckAn ABAPer’s First SAPUI5 App in SAP WebIDE

Step2:- Initialize Result Function

Initialize the result function which provides the user speech values

<code>this.recognition.onresult = function(event) {
            var vFinal = "";
            for (var i = event.resultIndex; i &lt; event.results.length; ++i) {
                if (event.results[i].isFinal) {
                    vFinal = event.results[i][0].transcript;
                }
            }
            if (vFinal != "") {
                sap.m.MessageToast.show(vFinal);
            }
        };</code>
Step3:- Start the voice recognition
<code>this.recognition.start();</code>

And you are done. Simple right? Below is a sample application for your rescue. Copy and run it in your system.

If you are curious, how it would work, just upload this VoiceRecognition App on your machine and experience it first hand.

I know these are advanced topic and you surely would have doubts. Feel free to write your questions in the comments section. I reply to each and every query.

Just Ask!!

If you want to have real time discussions and resolutions, do join our SAP Technical Telegram Group where we have more than 5000+ active SAP consultants from 6 Continents.

Please Note: You need to install Telegram App on your mobile first and then you can join the group using the above link.

Please SUBSCRIBE to SAPYard’s Youtube Channel for Free End to End SAP Video Course and Training.

Step by Step Tutorials on SAPUI5
  • Show original
  • .
  • Share
  • .
  • Favorite
  • .
  • Email
  • .
  • Add Tags 
SAPYard by Bohra Mohammed - 1w ago

Formatter functions are used for formatting the data being rendered on various UI controls on the UI screen. For example, the data being fetched from backend via a Odata Model returns flag indicators like 0,1,2 etc. And you want to display a meaningful text to the end user corresponding to the flag. In this case, formatter function will be invoked and it will format the flag to a meaningful text shown to the end user.

We also have a separate article on List Control Using Formatter in SAPUI5.

In this tutorial, we will work through an example of formatter function. We will create a JSON Model and Bind one of its properties which contains codes/flag values to a Text Field on the UI and then we will define a formatter function and attach that function to the Text Field on the UI. Within the definition of formatter function, we will write logic to return corresponding meaningful text for a given input flag/code.

Also Read: End to End ABAP on HANA Tutorials

1. Create JSON Model
var oModel = new sap.ui.model.json.JSONModel();
oModel.setData({code:"1"});
sap.ui.getCore().setModel(oModel); 
2. Create Text View in the View file
var oTextView = new sap.ui.commons.TextView("textView", {
    // bind text property of textview to code property of model
    text: "{/code}",
    <strong>formatter: '.formatter.statusText'</strong> 
});
3. Create Formatter.js file

Create formatter.js file in your WebContent/model folder. Write below code in it. We are letting the application know what to return when 0, 1 or 2 is received.

sap.ui.define([], function () {
 "use strict";
 return {
 statusText: function (sStatus) {
 switch (sStatus) {
 case "0":
 return 'New';
 case "1":
 return 'In Progress';
 case "2":
 return 'Completed';
 default:
 return sStatus;
 }
 }
 };
});

Also Check: How to Consume Custom OData in SAPUI5 Application

4. Refer formatter.js file in View’s Controller
Define
sap.ui.define([
 "sap/ui/core/mvc/Controller",
 "sap/ui/model/json/JSONModel"<strong>,
 "sap/ui/demo/wt/model/formatter"</strong>
], function (Controller, JSONModel, <strong>formatter</strong>) {
 "use strict";
 return Controller.extend("org.test.controller.Sample", {
 <strong>formatter: formatter,</strong>
Output

With this coding done, below output will be displayed on the screen.

When ‘code’ property value is 0, output will be ‘New’ as per formatter function definition in step 3 above.

When ‘code’ property value is 1, output will be ‘In Progress’ as per formatter function definition

When ‘code’ property value is 2, output will be ‘Completed’ as per formatter function definition

This is a simple demonstration of formatter function in SAPUI5. If you have a very complex formatting to be done, the steps remain the same. Formatters are very useful in numerous real project scenarios like controlling the color of output or visibility of an element and many more.

In case, you face any issue, please write your questions in the comment section. We reply to each and every comment.

If you want to have real time discussions and resolutions, do join our SAP Technical Telegram Group where we have more than 5000+ active SAP consultants from 6 Continents.

Please Note: You need to install Telegram App on your mobile first and then you can join the group using the above link.

Please SUBSCRIBE to SAPYard’s Youtube Channel for Free End to End SAP Video Course and Training.

Step by Step Tutorials on SAPUI5

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

Let me make a confession. SAPYard is for beginners but the topics which I have covered so far or would cover in future are for advanced UI5 developers. You need to have worked in some SAPUI5 projects to assimilate it. Or else, it might be all bouncers and you would have to duck through the articles. This is not to dissuade you but to give you a realistic picture of project requirements. What you learn in online/offline/class room training is not always what the clients demand in real projects. Very often than not, there is a huge gap between what we are trained for and what work we get in projects.

Coming back to yet another advanced topic. How to Build Offline SAPUI5 Applications?

Poor Internet Connectivity has direct correlation with the scope for Offline Applications. But sometimes Offline Application may be a business decision too and not just connectivity adversity.

Pre requirements:- Knowledge of creating Hybrid Applications and Simple CRUD batch operations using Odata Model

Also Cordova should be installed in your system.

Step1:- Open cmd prompt
Step2:- Create Offline Project of Cordova

Step3:- Add the platform
Step4: Add the SQL Lite Plugin

Also Read:End to End ABAP on HANA Tutorials

Step5:- Add the Network information plugin
<code>cordova plugin add cordova-plugin-network-information</code>
Step6:- Create a call back Function to perform Sync when device is online
<code>document.addEventListener("online", yourCallbackFunction, false);</code>
Step7:- Check for Online or Offline Status

navigator.connection.type if its not none then device is online. This is where the yourCallbackFunction can perform batch operation. Before any crud check if device is online else store in the Database of SQL

<code>var db = window.sqlitePlugin.openDatabase({    name: 'my.db',    location: 'default',  });

//Offline scenario example where crud is insert operation and no internet
if (navigator.connection.type == "none"){

db.transaction(function(tx) {    tx.executeSql('CREATE TABLE IF NOT EXISTS DemoOffline (id, value)');    tx.executeSql('INSERT INTO  DemoOffline  VALUES (?,?)', ['100', 101]);  }, 
function(error) {    console.log('Transaction ERROR: ' + error.message);  },
function() {    console.log('Populated database OK');  });

}else{//Perform usual oModel.create("/Entity,oentity,{success:function(){},error:function(){}}");}</code>

Also Read:Bluetooth Device using SAPUI5 Hybrid App?

Step7:- Batch Operation once Online

Once device is online as per step6 you need to perform batch operation

<code>yourCallbackFunction: function(){
var array = [];
  db.transaction(function(tx) {
    tx.executeSql('SELECT * FROM DemoOffline', [], function(tx, rs) {
     //rs.rows.item push it into an array
    }, function(tx, error) {
      console.log('SELECT error: ' + error.message);
    });
  });
if(array.length>0){
//Create the batch operation
//Call the oModel.submitChanges();
}
}</code>
Step8:- Build an APK file using the below final command

That’s all you need. It might look simple, but you need to sweat a little more for your first offline app. Please feel free to write your questions, feedback in the comment section below. We reply to each and every feedback.

If you want to have real time discussions and resolutions, do join our SAP Technical Telegram Group where we have more than 5000+ active SAP consultants from 6 Continents.

Please Note: You need to install Telegram App on your mobile first and then you can join the group using the above link.

Please SUBSCRIBE to SAPYard’s Youtube Channel for Free End to End SAP Video Course and Training.

Step by Step Tutorials on SAPUI5
  • Show original
  • .
  • Share
  • .
  • Favorite
  • .
  • Email
  • .
  • Add Tags 

You might have a decade of SAP experience but when you get opportunity to work in a new technology, you become a fresher in that project. Same happened to me. When my manager asked me to work in SAP ISU Project, I was a beginner in the SAP ISU Retail area. The process, the tables, the function modules, everything was new for me. Therefore I thought it would be a good idea to document whatever small or big I learn, so that it can be a ready reference for the beginners in that area.

With that thoughts, here we come with our third article on SAP ISU. In the first, we learned about Bankruptcy Overview and Write-Off Process. In the second article we went through Installation, Meter Reading, Bill Order, Billing, Invoice and Invoice Printing Process Overview.

What happens after the Invoice is generated? You guessed it right. The customer does the payment. What if you want to mock the Payment Lot process for testing? Yes, in today’s tutorial we would check all the steps to create a payment against the invoice document. There might be other better ways, but today we would demonstrate one simple process which even the technical consultant can perform.

IS-U means Industry-Specific Solutions for Utilities Industry. Or more commonly IS-U means Industry Solutions-Utilities.

Go to t-code FP05 (Process Payment Lot)

Give the Lot number as per naming convention

Hit Create Hit New Items

Also ReadMy First SAP ABAP Program in S/4HANA

Save, Come back and hit the Close button Click Yes Come back and hit Post button There are three options. We have chosen the 2nd option (Background – Start Immediate)

Check, the job gets scheduled immediately.

Also Watch : Free Video Course on Debugging for Functional Consultants

Validate the Payment in FPL9 (Account Display)

Go to t-code FPL9, give your account number and hit enter. Check the Payment line is created and the Clearing Document Number is generated. For our example, the clearing document number starts with 092006*. Please note this one clearing document can be for multiple Invoice Line items based on Main and Sub (shown in table DFKKOP below).

Que: In which table can we find the Clearing Document Number?
Ans: DFKKKO and DFKKOP

Also CheckMy First OData Service in SAP

You can see the Clearing Document in table DFKKOP.

Check for one Clearing Document there can be multiple Invoicing Document in column DFKKOP-OPBEL.

The Clearing Document Number details can be found Header table DFKKKO

If you have worked on any SAP ISU Project, then you must be smiling at this article. We understand, it is a cake walk for you. But our target audiences are beginners in SAP ISU. So, we do not shy away from providing every minute detail we learn while working in any new area.

If you also have something to share, please feel free to send a word document to mail@sapyard.com or mailsapyard@gmail.com. We will publish it in your name. Nothing is small. Any tips, tricks or tweaks which you found interesting can be a life saver for someone in a project. So, please share.

We have a very active Telegram (App) SAP Technical Group with more than 5000+ SAP Technical Practitioners from 6 Continents of the SAP World. Please join it using below link.
Telegram SAP Technical Discuss Group. You need to install the Telegram App first on your mobile device. Once you have it on your mobile, you can join the group and also access it from the Web on your computer and laptop.

SAP IS-U Process Overview
  • 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