You are on page 1of 3

WEEK 2 UNIT 3

BUILDING A SIMPLE SCRIPT


Part 1:
To begin, please complete the purchase order quick lookup scenario demonstrated in the video.

Part 2:
In addition to this scenario, we would like to create a new script to do the following:

1. Allow the selection of a vendor


2. Then go straight to displaying the specified master record when the Display Vendor button is
pressed
3. Then select a certain tab in the vendor master.

Let’s get started.

1) Delete the “Display Vendor” transaction button and then create a similar script button with a “Display
Vendor” label. Use the “Large blue button” quick style to get the proper formatting.

2) Now add a Text Field (One-line) on top of this new script button, above the button text.

3) Add a new script, called Vendor_display and record the following steps:

a. Enter transaction code BP into the command field and press the green Enter button next to it

b. Press the Open BP (Shift+F5) button and enter a vendor number, for example
17100001
c. Hit the Enter key (or click the green check button)
d. Select the “Financial Services BP” value in the “Display in BP role” dropdown
e. To ensure that the “Address” tab is always shown when the vendor is displayed, click on this
tab. If this tab was already selected, you must first select another tab and then select the
“Address” tab again, since the recording will only capture changes. In this case, manually
remove the script lines selecting another tab to avoid unnecessary actions in your script.

4) Stop recording. If you want, you can remove the setFocus() actions from this script. In this scenario,
they are not needed and only create clutter. They will not cause any problems if they stay in the script,
however.

Now you have the vendor number hard coded in the script, which needs to be replaced with the
vendor number entered in the Dashboard.

5) Go back to your Dashboard flavor using F3 or the back button.

6) Move the cursor to the beginning of your script. Use the Inspector in the scripting window to select
your new input field for vendor number. Refer to this field’s “text” property to define a variable called
“vendor”. Use this new variable instead of the hard coded vendor number in your script to select the
correct vendor.

7) Save the script and exit the script editor.

8) Bind the new script to the script button and test your script. You can use various vendor numbers, for
example from 17100001 through 17100007 or USSU-VSF01 through USSU-VSF08.
OpenSAP – Introduction to SAP Screen Personas

Figure 1 – Dashboard view including the new script

Copyright/Trademark
OpenSAP – Introduction to SAP Screen Personas

Part 3:
You can also create a new flavor for the BP transaction, and simplify the look of the vendor display by:
a. Hiding unnecessary elements like the “Worklist / Find” pane on the left, both toolbars, and the
menu. Do not hide the “Back” button, which should be moved from the standard toolbar to
allow navigating back to the Dashboard
b. Moving the main tab strip all the way to the left edge of the screen (use the “Left in” position of
the flavor bar’s Home tab)

NOTE: Pay particular attention to selecting the correct control. This screen includes a lot of complex
controls that are embedded into others, including the ones we are interested in. Repeated clicking into
a control will allow selection of the correct object. On the contrary, the Esc key will move outwards so it
will select the parent container of a control. Set this new flavor as your default for transaction BP,
using the flavor bar.

Figure 2 – Simplified view of the BP transaction

Copyright/Trademark

You might also like