1 Reply Latest reply: May 18, 2017 10:58 AM by Coskun Istanbulluoglu RSS

    SAP Connector BAPI: Return multiple tables from one statement.

    Viktor Kreschenski

      Hello Community,

      I try to create a SAP BAPI Connection and read from one function multiple tables at the same time. In QlikView Help I found:

      "Some Functions return more than one table, but QlikView can only handle one for each statement. Select the output table you want and then click Add call to script."

       

      I tried to solve this problem with a loop where I call the same function multiple times each with different output.

      The problem is that for each output the tables has slightly different combination of return value. The reason is that the function should be called only once.


      Is there another way to solve it or some kind of workaround? Thanks in advance.

      Here is some reduced script (the syntax is not quite right but you get the idea):

       

      Do while run = 1

       

      [/FUNCTION/]:

      LOAD *;

      SQL {

        "function":"\/FUNCTION/",

        "output":"TABLE_NAME1",

       

       

        "parameters":

        [

          { "direction":"out", "name":"TABLE_NAME1", "optional":false },

          { "direction":"out", "name":"TABLE_NAME2", "optional":false },

          { "direction":"out", "name":"TABLE_NAME3", "optional":false },

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

        ]

      };

       

       

      sleep 100;

       

       

      [/FUNCTION/]:

      LOAD *;

      SQL {

        "function":"\/FUNCTION/",

        "output":"TABLE_NAME2",

       

       

        "parameters":

        [

          { "direction":"out", "name":"TABLE_NAME1", "optional":false },

          { "direction":"out", "name":"TABLE_NAME2", "optional":false },

          { "direction":"out", "name":"TABLE_NAME3", "optional":false },

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

        ]

      };

      let pass = pass + 1;

      LOOP;