SAP Screen Personas III – Scripting

Share on Facebook17Share on LinkedIn53Tweet about this on TwitterShare on Google+0
Please Share!!

Welcome to the third edition of SAP Screen Personas series. In the first blog, we introduced the SAP Screen Personas and in the second blog, we saw how can we manipulate the screen layout and screen enhancements with SAP Screen Personas. In this blog, we will introduce and try to understand the Scripting in SAP Screen Personas.

If you are like me, you would be already impressed with SAP Screen Personas (referred as Personas hereafter) but Scripting tool is the most powerful tool in Personas’ arsenal. As evident, Scripting allows a developer to write scripts (programs) which can then be used to automate several steps leading to maximum productivity. Let’s see how we can add “scripts” in Personas:

In order to add the scripts, you need to go into the flavor and click on the scripting tool.

Scripting in Personas

It will open a scripting window at the bottom of the screen. Now it is disconnected from the flavor navigation but still part of the flavor. This means you can navigate to other transaction which makes scripting a very powerful tool.

Recording in Personas

For writing a script, you can write it from scratch or can use various tools at your disposal which can accelerate the coding process. One of them is the Recording Tool. The concept is similar to macro recording in the excel – so after pressing “Start Recording”, Personas will capture each click on the screen along with the element where the action was performed and put it in the script in the sequential fashion – until you press stop recording.

Here we will take a very simple example. In this example, we are automating a simple step. In the SAP initial screen, we will provide a user with an option to go to the Technical Setting of a database table. If you break down the steps

  • Enter transaction SE11.
  • Enter the table name.
  • Click on Display button.
  • Click on Technical Setting.

If suppose a user’s job is to just enter the Database table name and record Size Category of the table then we are saving a lot of time for that user. First, he can reach the desired information in a single click and he does not even have to remember the transaction. If applied correctly for a client, this could mean an increase in productivity. Below is a script which was recorded doing exactly the same thing.

Scripting code

If you notice here, recording stores the MARA as hard coded value. If we want to allow a user to enter the table name, we can easily create a dashboard for the user in the SAP initial screen, by adding a label, a text field and a script button.

Flavor Editing in Personas

You can extrapolate this design to achieve a dashboard transaction, designed for a specific role (knock knock Fiori Launchpad) and the user does not have to remember any transaction. In order to capture the user entry, we can define a variable and use the inspector tool to click on the text field and use the text entered there as input. Below is the same script modified to take the user input.

Now, since this blog is meant to be an ABAPer’s take on Personas, let me add my perspective. I have done java scripts in my college days – which was in my past life and I was still able to read and fairly understand the code. Recording tool does provide me quite a code and I need to tweak things in the code. Obviously, you need to learn a little more about scripting to trap the errors and perform more functions in the scripts but it can be easily done. If you compare the ABAP and Personas Script’s commands you will find that it is evident that Personas has no connection with the database. It is recording the input and performing actions on the top of the SAP GUI so you need to be careful about the performance (I will cover this in the next blog).

For example – the variable table is specific text entered in a particular screen element. It is not something which you can find without having that text element present on the screen. Each and every element on the screen has a name. A table control has a name and a row and column to identify the cells.  It will not be as coding in the ABAP but it is high time to come out of the comfort zone.

In the script, all the logical statements for example – IF and Loops are acceptable but since it is just the front end, you cannot write select statements – Or can you? If you want to know, tune into the next installment.

As usual, please let us know whether you liked this one or not. Post feedback and questions and share it with your friends if you find this helpful. Please also mention any Personas related topic in which you are interested or let me know how can I make it better in next installments.

Some Popular Tutorials in SAPYard

1. ABAP for SAP HANA Tutorials
2. ABAP Web Dynpro Tutorials
3. GOS Tutorial
4. OOPs ABAP Tutorial
5. HANA Tutorial
6. SAP Netweaver and OData Tutorial
7. SAP Adobe Form Tutorial
8. SAP Fiori Tutorial
9. SAPUI5 Tutorial
10. SAP Screen Personas Tutorials

 

Share on Facebook17Share on LinkedIn53Tweet about this on TwitterShare on Google+0
Please Share!!

About the Author

Bhavesh K Ratnam
Bhavesh K Ratnam
Qualification: B.Tech, M.Tech from IIT Kharagpur, India. SAP ABAP Experience since 2006. Find more about him on LinkedIn.

5 Comments on "SAP Screen Personas III – Scripting"

  1. Hi Bhav – Waiting for your next post on Scripting. Just came to know from one of my current client’s SCM Team member that they have been trying to implement Personas for ME23N screen for the last 2 years. But they are planning to abandon it as the scripting and other Personas customization has slowed down the ME23N screen.

    They were being helped by SAP for some months and she claims that the openSAP training on Personas is the knowledge taken from my current client’s ME23N experience.

    The Personas implementation was completely being done by the functional and business analyst. So they might have missed some points to consider for performance while implementing Scripts as they were not from ABAP background.

    Waiting for your next posts on Performance related topic on Personas.

    Regards,
    Raju

    • Hello Raju
      Thanks for the kind words. If people do not understand how Personas work then it may give them woes. I will explain the issues and benefits related to Personas speed in my next blog.

  2. brilliant way of teaching, Seriously no match, even a layman can understand your blogs and start working on SAP.

    awesome..

    • Thanks Ahmed. True, Bhavesh is an exceptional ABAPer with even better writing and explaining skill. I am sure all following his post in Personas would be project ready by the time he completes the series.

      Please stay tuned and spread the words. 🙂

      Regards,
      Team SAPYard.

Leave a Reply to Raju Cancel reply

Your email address will not be published.


*