Purpose Reading SAP searchhelp values for populating dropdown lists |
Solution
Example
For each field, the value list can be read from the respective SAP search help:
The name of the searchhelp can be found in the SAP data dictionary (transaction SE11):
You can test the searchhelp in SE11:
We read these values via the function "/guixt/read_searchhelp_values": Set V[searchhelp] "H_TVAU" CreateTable V[dropdowntable] value text Call "/guixt/read_searchhelp_values" cache="session" _ export.searchhelp="searchhelp" _ import.values="dropdowntable" To facilitate reuse of the dropdown lists in other screens while keeping the scripts simple, we implement a separate "process" script for each dropdown list: GuiXT Script // get dropdown value lists process read_dropdown_vrkme V[dropdown_vrkme] process read_dropdown_augru V[dropdown_augru] process read_dropdown_konda V[dropdown_konda] process read_dropdown_vkbur V[dropdown_vkbur] "1710" "10" "00"
// Sales unit Text (16,45) "Sales unit" size=20 -label DropDownList (16,66) table=V[dropdown_vrkme] refer="V[vrkme]" width=40 -showkeys
// Order reason Text (17,45) "Order reason" size=20 -label DropDownList (17,66) table=V[dropdown_augru] refer="V[augru]" width=40
// Price group Text (18,45) "Customer price group" size=20 -label DropDownList (18,66) table=V[dropdown_konda] refer="V[konda]" width=40
// Sales office Text (19,45) "Sales office" size=20 -label DropDownList (19,66) table=V[dropdown_vkbur] refer="V[vkbur]" width=40
InputScript "process_read_dropdown_vrkme.txt" // read searchhelp for sales unit Parameter dropdowntable Set V[searchhelp] "H_T006" Set V[columns] "msehi,msehl" CreateTable V[dropdowntable] value text Call "/guixt/read_searchhelp_values" cache="session" _ export.searchhelp="searchhelp" _ export.columns="columns" _ import.values="dropdowntable" Return InputScript "process_read_dropdown_augru.txt" // read searchhelp for order reason Parameter dropdowntable Set V[searchhelp] "H_TVAU" CreateTable V[dropdowntable] value text Call "/guixt/read_searchhelp_values" cache="session" _ export.searchhelp="searchhelp" _ import.values="dropdowntable" Return InputScript "process_read_dropdown_vkonda.txt" // read searchhelp for customer price group Parameter dropdowntable Set V[searchhelp] "H_T188" CreateTable V[dropdowntable] value text Call "/guixt/read_searchhelp_values" cache="session" _ export.searchhelp="searchhelp" _ import.values="dropdowntable" Return InputScript "process_read_dropdown_vkbur.txt" // read searchhelp for sales office Parameter dropdowntable Parameter vkorg Parameter vtweg Parameter spart
Set V[searchhelp] "H_TVKBZ" Set V[columns] "vkbur,bezei"
// add selections CreateStructure V[seloptrow] shlpfield sign option low high CreateTable V[selopt] include=V[seloptrow]
if V[vkorg] Set V[seloptrow.shlpfield] "VKORG" Set V[seloptrow.sign] "I" Set V[seloptrow.option] "EQ" Set V[seloptrow.low] "&V[vkorg]" AppendRow V[seloptrow] table=V[selopt] endif
if V[vtweg] Set V[seloptrow.shlpfield] "VTWEG" Set V[seloptrow.sign] "I" Set V[seloptrow.option] "EQ" Set V[seloptrow.low] "&V[vtweg]" AppendRow V[seloptrow] table=V[selopt] endif
if V[spart] Set V[seloptrow.shlpfield] "SPART" Set V[seloptrow.sign] "I" Set V[seloptrow.option] "EQ" Set V[seloptrow.low] "&V[spart]" AppendRow V[seloptrow] table=V[selopt] endif
CreateTable V[dropdowntable] value text
Call "/guixt/read_searchhelp_values" cache="session" _ export.searchhelp="searchhelp" _ export.columns="columns" _ export.selopt="selopt" _ import.values="dropdowntable"
Return
|
Components InputAssistant |