Early Access: The content on this website is provided for informational purposes only in connection with pre-General Availability Qlik Products.
All content is subject to change and is provided without warranty.
Skip to main content Skip to complementary content

BW process chain status and QlikView tasks

It can be a problem to know when a BW process chain has finished loading data and QlikView can start loading its part. Below is an example of how you can use the BAPI Connector to check the status of a Process chain and start the QlikView load when ready.

BW process chain overview

Process chains are a robust graphical scheduling and monitoring tool to maintain automation, visualization and monitoring of tasks/processes. Typically this is used to update DSOs and InfoCubes.

The connector transports include a Report program named /QTQVC/PROCESS_STATUS.

Two variants of the program should be created for each process chain, to be used in the beginning and at the end of setting the status of the process. The QlikView script has to be updated with a loop to be able to check the status and finally change the status.

Variant 1 of the Report program sets the indicator to ”N” = Not Ready

and

Variant 2 sets the indicator to ”R” = Ready. When calling the report program the status is stored in our table /QTQVC/Status.

In the QlikView script we utilize the BAPI Connector to check when there is an ”R” in the table, then proceed with normal load, and finally set the status to ”F” = Finish when the load is completed. The BAPI Connector calls a function module named /QTQVC/PROCESS_STATUS, which in turn calls the report program /QTQVC/PROCESS_STATUS.

Illustration of process chain where indicator is first set to N Not Ready by the QlikView script and then set to R Ready by another variant of the script

Setup in QlikView

You need to schedule the QlikView task to start when the Process chains normally end.

Script example

Add a loop in the beginning of the script, using the BAPI Connector to check the Status of the Process chain.

The script will leave the loop when status changes to “R” (Ready) and continue with the normal load of BW data.

When that is finished it should set the status to “F” (Finished) to avoid the same data being loaded twice.

CUSTOM CONNECT TO "Provider=QvSAPBAPIConnector.dll;ASHOST=xxx.xxx.xxx.xxx;SYSNR=10;CLIENT=800;XUserId=QCWJORBOPLTA;XPassword=OUZKbYRNJbaATYMX;";
set Status1='N';
do while Status1 <> 'R'
//CHECK STATUS
Out:
LOAD *;
SQL {
"function":"\/QTQVC\/PROCESS_STATUS",
"output":"STATUS_OUT",
"parameters":
[
{ "direction":"out", "length":1, "name":"STATUS_OUT", "optional":false, "type":"CHAR", "value":" " },
{ "direction":"in", "length":10, "name":"CONNECTOR", "optional":false, "type":"CHAR", "value":"PRCHAIN_02" },
{ "direction":"in", "length":1, "name":"MODE", "optional":false, "type":"CHAR", "value":"C" },
{ "direction":"in", "length":1, "name":"STATUS_IN", "optional":true, "type":"CHAR", "value":" " },
{ "direction":"in", "length":40, "name":"TASK_ID", "optional":false, "type":"CHAR", "value":"DATA_01" }
]
};
Let Status1=peek('STATUS_OUT' ,-1,'Out');
exit do when Status1='R';
trace 'Waiting for BW process to finalize';
sleep 10000;
loop
//****************************************************************************
//Load Data
CUSTOM CONNECT TO "Provider=QvSAPEXTRConnector.dll;ASHOST=xxx.xxx.xxx.xxx;SYSNR=10;CLIENT=800;XUserId=MXMDKRBOPDAB;XPassword=cHNLSYRNJbaATYcc;";
 
 
[80COMP_CODET]:
LOAD
[COMP_CODE],
[LANGU],
[TXTMD];
SQL EXTRACTOR 80COMP_CODET
UPDMODE F // full extractor
EXTRLANGUAGE E
LOGSYS QTQVCEXTR1
WHERE
LANGU I EQ E
;
//STORE * FROM [80COMP_CODET] INTO FULL_80COMP_CODET.QVD;
//DROP TABLE [80COMP_CODET];
 
//****************************************************************************
 
CUSTOM CONNECT TO "Provider=QvSAPBAPIConnector.dll;ASHOST=xxx.xxx.xxx.xxx;SYSNR=10;CLIENT=800;XUserId=QCWJORBOPLTA;XPassword=OUZKbYRNJbaATYMX;";
//UPDATE STATUS
drop table Out;
Out:
LOAD *;
SQL {
"function":"\/QTQVC\/PROCESS_STATUS",
"output":"STATUS_OUT",
"parameters":
[
{ "direction":"out", "length":1, "name":"STATUS_OUT", "optional":false, "type":"CHAR", "value":" " },
{ "direction":"in", "length":10, "name":"CONNECTOR", "optional":false, "type":"CHAR", "value":"PRCHAIN_02" },
{ "direction":"in", "length":1, "name":"MODE", "optional":false, "type":"CHAR", "value":"U" },
{ "direction":"in", "length":1, "name":"STATUS_IN", "optional":true, "type":"CHAR", "value":"F" },
{ "direction":"in", "length":40, "name":"TASK_ID", "optional":false, "type":"CHAR", "value":"DATA_01" }
]
};
//****************************************************************************

Setup in SAP BW system

You need to be skilled in creating Report variants and maintaining Process chains to do the following tasks.

Do the following:

  1. Create two variants (N and R) of the program /QTQVC/PROCESS_STATUS, for each process chain.

Setup status illustration depicting TASK ID as Masterdata_01

  1. In the process chain, add this ABAP program with variant at the start and at the end of the chain. The Task ID has to be unique for each process chain.

    Process chain illustration with MasterData_02 script leading to PROCESS_NOT_READY leading to execution of info package leading to PROCESS_READY

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – let us know how we can improve!