Transferring data packets with BWQuery class English

From Theobald Software

Jump to: navigation, search

German Version: Datenpakete mit der BWQuery-Klasse


When extracting BW queries with a huge amount of data it might be useful not to extract the whole result set at once (see also Transferring data packets with ReadTable class ).

The code sample below shows how to use the property 'PackageSize' and the event 'OnIncomingPackage'. The sample is shortened and is based on Executing BW Queries .

Set the PackageSize property to a reasonable value (e.g. 1000) and process each package within the IncomingPackage event. Before calling Execute() the event handler must be set correctly to trigger the event.


Attention! Packaging is limited to 1.000.000 rows due to SAP


C#

private void Go_Click(object sender, System.EventArgs e)
{
    // Open R3Connection and create BWQuery object
 
    query.PackageSize = 1000;
    query.IncomingPackage += new BWCube.OnIncomingPackage(query_IncomingPackage);
 
    query.Execute();
}
 
void query_IncomingPackage(BWCube Sender, MDXExecuter mdxexecuter, DataTable PackageResult)
{
    MessageBox.Show("A new data package has arrived");
    this.dataGrid1.DataSource = PackageResult;
}
DeutschEnglish
Personal tools
Navigation
XtractQL Provider
Xtract RS