Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Global script for showing SAPui5 table in Screen Personas

Hi all,

This is a short one, but i believe it might come in handy for many people.

Following several excellent blogs on how to copy data from tables in SAP Screen Personas and showing it in SAPUI5 . However the blogs i’ve seen so far have hardcoded the bindingproperties and the headers of the columns.

This little Script can be stored centrally in the personas resource repository and executed on every table to generate a SAPUI5 table version of the data.

Look at this wiki that will show you how to load scripts from the resource repository.

Add a Html Viewer to your flavor and next add a script.

This little snippet shows you how to use the script:

session.utils.include("000C2975DCD41ED782D4F32BBDE300C6", false);

var selectedTable = session.findById("wnd[0]/usr/cntlGRID1/shellcont/shell/shellcont[1]/shell");
var tableHTML1 = getTable(selectedTable);
session.findById("wnd[0]/usr/htmlViewerPersonas_148971033247974").content = tableHTML1;

Let’s go through it:

First you load the script stored centrally. Then you get the ID of the table control,

Declare a new variable (tableHTML1), this variable will contain the htmlcode for your html viewer returned from the getTable function from the global script.

Set the content of your HTML viewer to the variable you just created and you are done. Easy right

Remember that the values i use in the above snippet is for my own flavor, you need to replace the id of the table and the htmlviewer.

You can download the script from here

This post first appeared on Web Service Testing A Blackjack GUI And API, please read the originial post: here

Share the post

Global script for showing SAPui5 table in Screen Personas


Subscribe to Web Service Testing A Blackjack Gui And Api

Get updates delivered right to your inbox!

Thank you for your subscription