As explained in QueryProvider: Seemantic Grouping, the DTP only can create packages when semantic grouping is used. The following simple example explains some details like when the query can be split into sub-queries(pack level 3) and what it exactly means. See also Example II.
Example where the query result can be retrieved in packages(pack level 3)
The query is very simple and only contains some basic key figures and one formula with the name 'Formula 1'. In this case, the formula is not mapped with a field of the target which means that the semantic group can be used to split the extraction into several disjunct queries.
The DTP uses package size 2(the simple sample query only delivers 10 records). The pack level 5 is the one of the (entire)query, however, since we skipped the formula, the correct level of this DTP is actually 3. This will be checked again during the runtime(see below) and then corrected to 3.
When we run the query in 'Simulation Mode', we can see that packages were created:
When we check the data of the first package, we can see that it only contains records where plant = P01:
The second package contains only plants of P02 and the third one two other plants. So, the packages contain only data with disjunct values of the Infoobject STPE Plant.
As explained in Helpful Breakpoints, there are some methods were you can check what exactly the system is doing regarding the handling of data packages. We run the DTP again in Simulation Mode and set a breakpoint in method IF_RSDRV_VPROV_INT_QUERY~READ of CL_RSR_QPROV_QUERY :
We can see that the pack level is 3 which mans that the query can be split into subqueries. The variable L_PART_CHANM contains the characteristic which we used in the DTP for semantic grouping. A bit later the method get_dat_flat is called which executes the query with the addtional filter of the semantic group in the internal table P_THX_SLICER. In the first call the 'slicer' contains the restriction Plant=P01(see above).
The first package with 4 data records is transferred. Later, at the technical level of the DTP packet assembler, it is checked whether the package already contains more records as defined as package size. If yes, the package is loaded into the target provider.
Then the system continues with running the next sub-query and fills again the internal table p_t_data of the DTP packet assembler.
Example where the query result can't be retrieved in packages(pack level 5)
We take the same query as above but now assign the formula to a key figure of the target cube. Since this formula with a boolean operator, the pack level is now 5 and packaging on query level isn't possible any longer:
The DTP is the same as above:
In the simulation mode we see again the same packages, however, the internal processing is now different:
We use the same breackpoints as above and take a closer look at the processing of the packages:
The pack level is now 5 which means that all the data is fetched in one go from the QueryProvider and stored in an internal table.
We can see that now the 'slicer' is empty and that all 10 records are transferred from the QueryProvider to the DTP.
Afterwards, in the DTP packet assembler, the data is retrieved in packages from the internal table p_t_data and loaded into the target provider. The packages again only contain records according the definition of the semantic grouping.
First package contains 4 records: