What do you do when your InfoPackage selection parameters change over time, are dependent on third-party statuses, or are required for delta management? You have standard and non-standard data selection functionalities to deal with these scenarios. We walk you through the process for using them.
InfoPackages are DataSource-specific tools used to determine how, when, and which data to extract from a source system. You are probably familiar with the common InfoPackage selection parameters, but did you know that many standard and non-standard data selection functionalities are available to help you transform InfoPackages into powerful smart extraction tools?
This is helpful when your selection parameters change over time, are dependent of third-party statuses, or are required for delta management. To explore these functionalities with you, let’s use the standard R/3 DataSource 2LIS_11_VAITM (Sales Order Item Data) as an example.
I’ll start with the InfoPackage creation procedure. On the Administrator Workbench, you may select Modeling>InfoSources. Locate the DataSource 2LIS_11_VAITM, right-click on it, and select the Create InfoPackage option (Figure 1). After giving a description to the new InfoPackage (Figure 2), press the enter key to access the InfoPackage definition screens.

Figure 1
Right-click on the 2LIS_11_VAITM DataSource and select Create InfoPackage
The InfoPackage definition screens are organized under five tabs. For this exercise, you need to visit only the Data Selection tab.
The Data Selection tab is where you apply values as filters to fields configured as selection options within an extractor. This filtering is used to select specific datasets from a source system. The many reasons for using extraction selection parameters include parallel initializations, delta mechanisms, or performance issues.
On this tab, you may specify a range of values to an extractor field using both the From Value and To Value columns. If you specify a value in the From Value column and leave To Value empty, the system considers it a single selection.
To create multiple values or ranges for the same field, you may first select the required field and then click on the green plus-sign icon on the bottom left of the screen (Figure 3). A second selection line for this field is then created (Figure 4). You may repeat this procedure as much as you need to to combine different ranges or values.
The red minus-sign icon does the opposite: It removes extra selection lines. The Check button validates the values applied on the selection fields to avoid overlap, invalid date formats, or incorrect parameter sequence (“from” values lower than “to” values). Finally, the trash bin icon erases all values from the selection options.
To the right of the icons, you find the Use Conversion Routine indicator. With this indicator flagged, the values entered should follow external format standards. A good example could be leading zeros required for article number values. If the conversion routine indicator is not flagged, then the internal format is the one to be used.
Automation Functionalities
The functionalities presented up to now require manual intervention, but they can also be automated. Each selection row has columns named Type (Variable change to selection values with background processing) and Details for Type. These columns allow you to give decision power and flexibility to your InfoPackage instead of just fixing the values.

Figure 2
Enter a description for the new InfoPackage

Figure 3
Once you select a field, you can create multiple values or ranges, remove extra selection lines, or erase all values from the selection options using the three circled icons, respectively. The Check button validates the values. Note the Use Conversion Routine indicator to the right of the icons.
To automate your data-selection procedures, you may use one of the options available under the Type column. Table 1 provides a description and use for each.
Options 0 to 4 are SAP-delivered functions, and their descriptions correspond exactly to their actions. For example, option 0 (get yesterday) automatically sets yesterday’s date in a date-selection field. The same processing pattern happens with the other date options (1 to 4). For all cases, the date conversion is based on the system’s current date.
Option 5 (free temporal selection) allows you to periodically change the values applied to selection fields. A dialog box is available under the Detail for type button when this option is selected. This dialog box initially has four fields: From Value, To Value, Next Period from Value, and Period indicator. The From Value and To Value fields define the range of values to be used on the first run of a particular extractor. The Next Period from Value field determines from which value the range of values applied as selection during the second run should start. The period indicator defines if it is an ongoing procedure, based simply on the number of periods the InfoPackage is executing or if it should take time elements (i.e., period, year) into consideration. After all selections are made, a new field is also offered on the dialog box, allowing the user to define the number of repetitions until restarting from initial value.
SAP suggests two possible configuration scenarios on its documentation. Go to the SAP online help (help.sap.com) and search for the document “Variable Selection Change in Background Processing” in the SAP Library under Administrator Workbench.
Option 6 (ABAP routine) provides great versatility as it allows the use of ABAP coding to drive the selection values. The code is usually structured around the following ABAP parameters l_t_range, l_t_range-low, l_t_range-high, l_t_range-sign, and l_t_range-option. These ABAP parameters define value intervals on the fly to be used as selections. Low and high parameters identify from and to values. The parameter sign determines if from and to values should be included (I) or excluded from the value interval. The parameter option provides the logic to be applied to the specified values such as “equal to,” “not equal to,” and so on.

Figure 4
Clicking on the green plus-sign icon creates a second selection line for the field
Code |
Description |
Use |
0 |
Get yesterday |
Date-type characteristics only |
1 |
Get last week |
Date-type characteristics only |
2 |
Get last month |
Date-type characteristics only |
3 |
Get last quarter |
Date-type characteristics only |
4 |
Get last year |
Date-type characteristics only |
5 |
Free temporal selection |
Date-type characteristics excepted |
6 |
ABAP routine |
All characteristics |
7 |
OLAP variables |
All characteristics |
|
Table 1 |
Type column values
|
|
For example, say you would like to use this option to extract only the records created in the last five days, including today. Option 6 applied to the creation-date field could be structured as follows:
data: l_idx like sy-tabix.
read table l_t_range with key
fieldname = ‘ERDAT’.
l_idx = sy-tabix.
start = sy-datum - 7.
* Selecting the last 7 days
l_t_range-low = start.
l_t_range-high = sy-datum.
l_t_range-sign = ‘I’.
l_t_range-option = ‘EQ’.
append l_t_range.
p_subrc = 0.
Also, keep in mind that you may use other BW tables as part of your logic, including control, master data, or surrogate ID (SID) tables. This is useful in cases where records to be extracted are based only on BW occurrences instead of source-system content. For example, you might be interested in extracting the names (text) from only those employees with sales volumes registered in BW. An ABAP program could be created to first read the records stored on the employee SID table and then apply them as values to the corresponding InfoPackage selection field.
Option 7 (OLAP variables) leverages the available BW reporting variables as selection logic for InfoPackages. In this case, only variables that do not require manual input and are not replacement paths may be used. It is important to check consistency between the variable output and expected selection values. To do that, you may use the Check button on the dialog box accessed through Detail for type.
Christian Savelli
Chris Savelli, senior manager at COMERIT, has been dedicated to SAP BI and Analytics projects since 1998. He holds multiple SAP certifications covering HANA, BW and ECC applications and has expertise in managing all aspects of the information creation process, utilizing SAP BI technologies to satisfy strategic, analytical and reporting needs. Chris Savelli started his career at SAP and subsequently held senior level positions at consulting companies Deloitte and Accenture. His education background includes a bachelor of science degree in robotics and a master of science degree in engineering both from the University of Sao Paulo, as well as a post-graduate diploma in business administration from the University of California at Berkeley.
You may contact the author at csavelli@comerit.com.
If you have comments about this article or publication, or would like to submit an article idea, please contact the editor.