Script design notes - search query

Before importing a query into a Solution file in Winshuttle Designer, develop and run the query using Microsoft Excel and then further test with XML to ensure all expected results are found in the query.


Add each possible input search criteria (these can be optional depending on how the query is designed).

It’s recommended to use key/index fields and/or match Codes (Indexed and upper case version of the text field that SAP uses for search criteria).  All of these will help the query run faster. Match codes will be present in the same table as the text field in your SAP system if they are available.  When using a Match code a function should be added to the form in order to correct a user that enters in lower case or mix case. (See Form Design Notes for additional information.)

The following example shows 3 match code’s (MCOD1, 2 & 3). It is not always obvious which fields these are configured to search. After running the query and viewing the outputs, the following values were found: MCOD1 =NAME1, MCOD2=NAME2 and MCOD3=CITY.

In this case the MCOD1 and MCOD3 were used for Name 1 and City respectively. However, note that MCOD1 and MCOD3 were used for inputs and NAME1 and CITY were used for outputs.

You can add multiple ways of using the same field by using an OR setting in the Where Clause Builder in Query and choosing multiple operators. The Like operator allows the user to use wild cards and the = (Equal) operator allows the user to find exact items. Using the Like operator is recommended for names where things can be spelled several ways (e.g. Company, Co., CO, etc.) or the exact name is not known (e.g. name or description).


Select available outputs you want to show in the form to the user. It is usually more useful and user-friendly to display the actual field name (not the mcode) for the output.  Additionally, it can also be useful to select all fields you might wish to copy (also see Prepopulating fields).  This effectively allows one query to serve two functions, the search and the ability to retrieve all the data for the fields you wish to prepopulate.