Applies to:
- Winshuttle Foundation
4-2. Use Query to populate lists from SAP
Back to
Steps in this phase
In the previous phase, we populated several drop-down fields using static lists in SharePoint. But in some cases, you may need to populate drop-down lists from SAP.
There are two basic options to get drop-down lists or lookups from SAP into the form:
- Bring the values from SAP into SharePoint using the Winshuttle Query product.
- Use a live-lookup into SAP.
The first option is recommended for values that do not change very often in SAP. You can get better performance by loading those values from SharePoint lists, and then refreshing the SharePoint lists from SAP at pre-defined intervals.
In this section we're going to use the first option. First, we will download the list of countries and regions from SAP, and then use Winshuttle Query to create a new Query using tables.
For this step we will begin by downloading the list of countries and regions from SAP.
- Open Winshuttle Query.
- Click Create Query.
- Create the Query with the properties as shown below, and then click OK.
Based on prior information, we know that the list of countries and regions are contained in the table T0005T and T005U.
- Use the Search function to add the following tables to the Query Builder:
- T005T
- T005U
- We will make the Language the only Selection field, and we set the condition to retrieve only records in the English language. The output fields are Country Code, Country Name, Region Code, and Region Description.
Note that Language is being used as an input field. The other fields are output fields.
- Run a quick preview in the Query Builder to make sure that we have the correct data.
- Next, we go into the Query Mapper and select SharePoint List as the output destination.
- Provide username/password credentials to create the SharePoint list.
- Run the Query. (You should receive a success message.)
Changing the SharePoint List default item limit
SharePoint lists are limited to displaying 50 items by default, but this can be changed, and in many cases you may need to change it to accommodate large lists of data.
- On your SharePoint Site, click the List tab, and then click Modify View.
- Next to Item Limit, set the number of items to display to 2000.
Downloading Terms of Payment (list) from SAP
The next list we need to download from SAP to SharePoint is the list of payment terms. In Winshuttle Query’s query builder area, there is an option to search tables by field name or field description. We will search the Terms of Payment field in the SAP data dictionary, and we see from the search results that the table we need is T052U.
- We do not know what table the Terms of Payment is stored in, so we're going to use the Search feature in Winshuttle Query to search for the field "Terms of Payment" in the SAP Dictionary.
- Next, we find the closest item and then select it.
- Next, select the input field (Language Key) and everything else remains output fields.
- Then we create and export to a new SharePoint List, shown below.