Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Reading status table and update the status to A

Hi,

We're having the issue that a job fails on Qlik side but is still running on SAP. Therefore the status of the job is wrong in SAP and we have to update the job by the connector interface in qlik or in SAP by /N/QTQVC/UPDATE

However I want to automate this - setting every (or a specific) "running" job to A by Qlik script.

I'm not really good into SAP but what I know so far:

- /N/QTQVC/UPDATE is not visible by BAPI

- /QTQVC/PROCESS_STATUS is visible by the BAPI connector and it's possible to create a new status entry by qv script (but not to update an existing one)

Any idea how to do this?

1 Solution

Accepted Solutions
Hakan_Ronningberg

Hi Andreas,

You can use the BAPI connector (BAPI /QTQVC/UPDATE_STATUS) in a loop. You have to supply the values for CONNECTOR, JOBDATE and JOBTIME (key values to the database record) as parameters in the script instead of the values below:

[/QTQVC/UPDATE_STATUS_E_JOBDATE]:

LOAD *;

SQL {

  "function":"\/QTQVC\/UPDATE_STATUS",

  "output":"E_JOBDATE",

  "parameters":

  [

    { "direction":"out", "length":8, "name":"E_JOBDATE", "optional":false, "type":"DATE", "value":"00000000" },

    { "direction":"out", "length":6, "name":"E_JOBTIME", "optional":false, "type":"TIME", "value":"000000" },

    { "direction":"in", "length":10, "name":"CONNECTOR", "optional":false, "type":"CHAR", "value":"QTQVCEXTR1" },

    { "direction":"in", "length":8, "name":"JOBDATE", "optional":true, "type":"DATE", "value":"20170629" },

    { "direction":"in", "length":1, "name":"JOBSTATUS", "optional":true, "type":"CHAR", "value":"A" },

    { "direction":"in", "length":6, "name":"JOBTIME", "optional":true, "type":"TIME", "value":"144144" },

    { "direction":"in", "length":1, "name":"MODE", "optional":false, "type":"CHAR", "value":"U" }

  ]

};

In the latest versions of the Extractor connector there is a functionality that set the JOBSTATUS to 'A' and cancels the corresponding SAP job when a timeout is reached. So maybe you can change the timeout values to make this happen automatically. Link to Extractor timeouts in the online help:

Timeouts ‒ Qlik Connectors

Regards,

Hakan

View solution in original post

2 Replies
Hakan_Ronningberg

Hi Andreas,

You can use the BAPI connector (BAPI /QTQVC/UPDATE_STATUS) in a loop. You have to supply the values for CONNECTOR, JOBDATE and JOBTIME (key values to the database record) as parameters in the script instead of the values below:

[/QTQVC/UPDATE_STATUS_E_JOBDATE]:

LOAD *;

SQL {

  "function":"\/QTQVC\/UPDATE_STATUS",

  "output":"E_JOBDATE",

  "parameters":

  [

    { "direction":"out", "length":8, "name":"E_JOBDATE", "optional":false, "type":"DATE", "value":"00000000" },

    { "direction":"out", "length":6, "name":"E_JOBTIME", "optional":false, "type":"TIME", "value":"000000" },

    { "direction":"in", "length":10, "name":"CONNECTOR", "optional":false, "type":"CHAR", "value":"QTQVCEXTR1" },

    { "direction":"in", "length":8, "name":"JOBDATE", "optional":true, "type":"DATE", "value":"20170629" },

    { "direction":"in", "length":1, "name":"JOBSTATUS", "optional":true, "type":"CHAR", "value":"A" },

    { "direction":"in", "length":6, "name":"JOBTIME", "optional":true, "type":"TIME", "value":"144144" },

    { "direction":"in", "length":1, "name":"MODE", "optional":false, "type":"CHAR", "value":"U" }

  ]

};

In the latest versions of the Extractor connector there is a functionality that set the JOBSTATUS to 'A' and cancels the corresponding SAP job when a timeout is reached. So maybe you can change the timeout values to make this happen automatically. Link to Extractor timeouts in the online help:

Timeouts ‒ Qlik Connectors

Regards,

Hakan

Anonymous
Not applicable
Author

Perfect, that's exactly what we were looking for!

Script is now working already