With GuiXT you can offer the user all the fields and functions relevant to a particular process on a single screen, thus enabling him to work efficiently: he does not need any further navigation steps and does not have to find his way around complex screens.
As an example, we
implement the simplified creation of a malfunction report in Plant
Maintenance (transaction IW21): |
GuiXT screen for fast entry of a malfunction report for equipment |
Procedure
Part 1
We offer the fast entry mode as a pushbutton in the initial screen of
transaction IW21:
From fast entry, the user can switch back to the SAP standard:
GuiXT Script:
if
Q[Transaction=IW21]
// Remove standard
button
del
P[Notification]
// here then the fast entry
with
// iw21_simple_on.txt
Set
V[iw21_simple]
"X"
Return
// iw21_simple_off.txt
Set
V[iw21_simple]
""
Return
Part 2 (UI of fast entry)
We implement
the required input fields with GuiXT:
// Group boxes around everything
Box
(1,3)
(18,100)
// Equipment
InputField
(2,6)
"Equipment"
(2,32)
size=18
_
name="iw21_equnr"
-required
searchHelp="EQUIR"
// Equipment text
Text
(2,54)
"&V[iw21_eqktx]"
// Set default, current date
and time
if
not
V[iw21_ausvn]
Set
V[iw21_ausvn]
"&V[today_user]"
Set
V[iw21_auztv]
"&V[today_h:00]"
endif
// build up time dropdown
00:00;00:15; ...
if
not
text[iw21_time_dropdown]
include
"build_iw21_time_dropdown.txt"
endif
Text
(14,6)
"Priority"
-label
size=18
DropDownList
(14,24)
"iw21_priority_dropdown"
width=20
refer="V[iw21_priok]"
-noSort
Comments:
The length
specification size=18
of the equipment number can be obtained via F1 -> Technical
information -> Data element
In the same
way choose F1 -> Technical information to display the name of the search
help:
"EQUI" is a collective search help (transaction SE11). For fast entry,
instead of the collective search help, we have only selected the most
suitable "EQUIR" and specified
searchHelp="EQUIR":
DropDownList is used to enter the priority and times
The long text entry is done via TextBox
Part 3 (Function "Check")
When the user presses "Enter" or the "Check" pushbutton, the system first performs a number of plausibility checks, for example, whether a short text has been entered. Further checks are carried out by running through the IW21 transaction with the entered values on a trial basis; instead of saving the entries, the system returns to the fast entry screen. Since the same procedure is needed for "Save", we use the same InputScript for "Check" and "Save" and select the mode "Check" or "Save" by means of a parameter (InputScript for this in part 4):
On Enter process="iw21_simple_save.txt
Part 4 ("Save" function)
With "Save" we start the same InputScript as with "Check". In the IW21 scripting we then press F11 at the end. The input data is reset and we return to the fast entry screen.
//
-----------------------------------------------------
// IW21 Fast malfunction entry
(check/save)
// File "iw21_simple_save.txt"
//
-----------------------------------------------------
Parameter
MODE // C=Check S=Save// Plausibility checks
// Equipment specified?
// Short text specified?
// Date
specified?
//
Date format correct?
// -------------------------
// Create notification
via IW21
// -------------------------
Set
F[Notification type] "M2"Screen
SAPLIQS0.7200Screen
SAPLIQS0.7200Enter "=10\TAB02" // Termine+Priorität
// Set priority
// Change priority -> popup "Specify new dates?"
Screen
SAPLIQS0.7200// now we are back on IW21 start
For the sake of completeness here is the include script to build the time selection:
// Build long text with times (per quarter of an hour) for dropdown
Set
V[k] 0label
next_hourSet
V[hh]
&V[k]
+ 100
Set
V[hh]
"&V[hh](2-3)"
Set
V[time]
"&V[hh]:00"
copytext
fromString="time"
toText="iw21_time_dropdown"
-appendLine
Set
V[time]
"&V[hh]:15"
copytext
fromString="time"
toText="iw21_time_dropdown"
-appendLine
Set
V[time]
"&V[hh]:30"
copytext
fromString="time"
toText="iw21_time_dropdown"
-appendLine
Set
V[time]
"&V[hh]:45"
copytext
fromString="time"
toText="iw21_time_dropdown"
-appendLine
if
V[k<24]
goto
next_hour
endif