Escolar Documentos
Profissional Documentos
Cultura Documentos
Using the Scripting features we can easily automate the SAP Transactional activities like
Sales order Creation, User Creation, Vendor Master Creation, Automate HR activities like
Info type creation, Display... Etc.
In the following examples we can see how effectively we can utilize the scripting features in
Screen Personas.
Examples:
In the following example we can see how effectively we can change the user password (in
SU01 Transaction) and display the user details from SU01 transaction using Screen
Personas.
In general following are the actual steps involved in the backend system to change the user
password using SU01
1. Login to the SAP backend system using valid use rid and password
2. By default SMEN page will be displayed
3. Type the SU01 Transaction
4. Enter the user id
5. Click Change password
Similar to the above case to view the user details, we have the following list of the steps to
be performed in the system.
1. Login to the SAP backend system using valid use rid and password
2. By default SMEN page will be displayed
3. Type the SU01 Transaction
4. Enter the user id
5. Click display icon to view the user details.
By using the Personas we can reduce the number of steps involved to change the password
and to view the user details. In this example copying the values of First Name and Full
Name of an employee are explained using Personas. Similar to the copying of naming fields
we can add more fields on the screen.
Just like a Web Portal, a custom overview page designed for the SAP screen personas. In
that Overview page we can add different buttons like Calling Transaction button, Script
button and a button to trigger another web page... etc.
In our example we can add two script button one button to change the password of the
user and the second button to view the user details directly from the Personas overview
page.
View User: Script Button: To view the first name and Full name of the user id which is
mentioned in the Input field (as highlighted in the below screenshot)
Change Password: Script Button: To change the password of the user id which is
mentioned in the Input field.
FirstName & Input Field: Custom Label and Input Field created to view the employee first
name which is copied from SU01 Transaction.
FullName & Input Field: Custom Label and Input Field created to view the employee Full
name which is copied from SU01 Transaction.
As highlighted in the below screenshot, Label maintained with empty text on the personas
page to view in case of any error during the execution of the script.
To view the user details in SAP R/3 system SU01 Transaction will be used as shown in the
following screenshot.
In Personas page without navigating to the target page we can get the user details on the
same page with the help of Personas Script Actions. Also user no need to remember the
transaction code.
If the user entered the wrong information corresponding error message will get displayed in
the Personas overview page.
For Example
In case if the user maintained the empty value (or) wrong user id in the Input field.
To view the script recording for the View user Button, just enter into the edit mode of the
Flavor and double click on the View User Script button.
The following script actions used on the Screen Personas page on the click event of the View
User button to fetch the user Details.
Explanation for the each steps mentioned in the script recording:
Step 1, 2 and 3 – Just to clear the screen fields. Label for the error display, first Name and
Full Name.
To get the relevant id of the screen field just enter into the edit mode and select the
Properties as shown in the following screenshot.
These are all the actual id referenced in our Personas scripting actions.
As shown in the following screenshot, just select the Enter Value in the list of actions and
leave the Input field as Blank. By this way we are maintaining the Empty value for the other
fields also in the step 2 and step 3.
Step 4 – copy the user id from the screen Personas overview page which was entered in the
Input field.
Step 6 – paste the values on the User Input field SU01 Transaction; we have already copied
the value in the local variable called as “user”
Step 9 –
If
(ses[0]/wnd[0]/usrUSRAREA/tabstripTABSTRIP1/tabpageMAINAREASAPLSUID_MAINTENAN
CE1900/frameAUTOTEXT001/txtSUID_ST_NODE_PERSON_NAMENAME_FIRST)
Control Exist
Checking the If condition is there any control Exist in the target screen with the mentioned
control id.
If there is any control exist with the above mentioned field name then in the,
Step 10 and 11 – copying the text value from the SU01 Target screen and store in the local
variable as firstname and fullname.
Step 12 and 13 – click the Push button twice to navigate back from the Su01 transaction to
Personas overview page
Step 14 and 15 – Paste the values on the Personas Overview page screen field such as
firstname and fullname.
During the execution of the script in the Step 7 (Push button action) in case of any error
happens, which will be displayed in the status bar.