For certain tasks it is useful to
let the user enter additional data on a popup screen. GuiXT does not
provide its own popups, but we can use one of the standard SAP popup
screens.
Solution
In the InputScript we set a status variable and call up the
"Help settings" popup. Example
// indicate: scheduling popup active SetV[me21n_scheduling_popup]"X" Enter "?HF1C"
In the GuiXT script for the help settings popup, we query
the transaction and the status variable, and then include another
script with a suitable name. Example:
In this included script we remove all existing elements,
set our own title and a suitable window size, remove the
standard functions and add our own elements. Example:
/ remove existing elements
del
S[USR_VALS]
-withBox
// own
title Title"Delivery Schedule Assistant" // suitable
window size WindowSize(20,80) // remove
standard functiona delP[/0] delP[/12] On"Enter"Fcode="?" On"/1"Fcode="?" On"/4"Fcode="?"
// add own
functions Pushbutton(toolbar)"Copy delivery schedule"process="me21n_add_schedule.txt"
Pushbutton(toolbar)"@02\QCancel@""/12""F12"
// add own
elements such as
InputFeild, Table,... ....
In the GuiXT script of the underlying screen we reset the popup
indicator if no popup is shown. Example:
Please note the the script for the
underlying screen is also processed when a popup screen is shown, and
Q[InactiveScreen]is
fulfilled in this situation.
Example
In the purchase order transaction ME21N we add a pushbutton column
which allows the user to create schedule lines automatically, each with
quantity and delivery date.
Video
GuiXT Script, main screen "saplmegui.e0014.txt"
// deactivate scheduling popup indicator ifnot
Q[InactiveScreen] ClearV[me21n_scheduling_popup] endif // item
table on screen? then add a pushbutton column ifT[SAPLMEGUI_TC_1211] Column"DS"table=T[SAPLMEGUI_TC_1211]position=2size=3 -pushButton _ label="@6Q\QDelivery
schedule assistant@" _ process="me21n_show_scheduling_popup.txt" endif
InputScript "me21n_show_scheduling_popup.txt"
// show any errors
ProcessingOption
returnOnError="off" // enter on main screen
Enter
Screen
SAPLMEGUI.0014
// save relevant cell values for display in popup
Set
V[me21n_ematn]
"&cell[SAPLMEGUI_TC_1211,MEPO1211-EMATN,&V[_tabrow]]"
Set
V[me21n_txz01]
"&cell[SAPLMEGUI_TC_1211,MEPO1211-TXZ01,&V[_tabrow]]"
Set
V[me21n_menge]
"&cell[SAPLMEGUI_TC_1211,MEPO1211-MENGE,&V[_tabrow]]"
Set
V[me21n_eeind]
"&cell[SAPLMEGUI_TC_1211,MEPO1211-EEIND,&V[_tabrow]]"
Set
V[me21n_elpei]
"&cell[SAPLMEGUI_TC_1211,MEPO1211-ELPEI,&V[_tabrow]]"
// save the selected row number
Set
V[me21n_itemrow]
"&V[_tabrow]"
// any order item data missing?
if
not
V[me21n_ematn]
or
not
V[me21n_menge]
or
not
V[me21n_eeind]
Message
"E: Please enter material, quantity and delivery date"
-statusline
Enter
Leave
endif
//quantity 1 ?
if
V[me21n_menge=1]
Message
"E: No scheduling for quantity 1"
-statusline
Enter
Leave
endif
// other date formats (week/month) ?
if
V[me21n_elpei=W]
or
V[me21n_elpei=M]
Message
"E: Automatic scheduling not supported for week or month format"
-statusline
Enter
Leave
endif
// create table variable
CreateTable
V[me21ndis]
date quantity
// reset table display status
Clear
V[me21ndis.stat.*]
//reset quantity
Clear
V[me21n_distribute_each]
// indicate: scheduling popup active
Set
V[me21n_scheduling_popup]
"X"
// use the SAP help options popup
Enter
"?HF1C"
GuiXT Script for the SAP help settings popup
"saplsr13.e0102.txt"
if
Q[Transaction=ME21N]
and
V[me21n_scheduling_popup=X] include
"me21n_scheduling_popup.txt"
endif
// next working day SetV[factory_calendar]"01" Call"DATE_CONVERT_TO_FACTORYDATE"_ export.DATE="date" _ export.FACTORY_CALENDAR_ID="factory_calendar" _ import.DATE="date2"
// leave
popup Enter /12 // any
scheduling? else no action ifnot
V[me21ndis.date.1] Leave endif Screen SAPLMEGUI.0014 // we open the delivery scheduling with a double click on the quantity
field SetCursor
cell[SAPLMEGUI_TC_1211,MEPO1211-MENGE,&V[me21n_itemrow]] Enter /2
Set
cell[SAPLMEGUI_TC_1320,MEPO1320-EEIND,&V[relrow]]"&V[me21ndis.date.&V[absrow]]" Set
cell[SAPLMEGUI_TC_1320,MEPO1320-MENGE,&V[relrow]]"&V[me21ndis.quantity.&V[absrow]]" SetV[absrow]&V[absrow] + 1