5 Replies Latest reply: Aug 21, 2015 9:04 AM by Raimund St├╝cklschwaiger RSS

    MD_STOCK_REQUIREMENTS_LIST_API Query (Abfrage)

      Hello There,

       

      I want to create an image of the SAP transaction MD04 in order to let all lagging Items. For this I ask for each item from the function block and make MD_STOCK_REQUIREMENTS_LIST_API per item (about 20,000) a QVD file.

      The whole process takes about 9 hours. That's way too long for the requirements of the company. So I'm looking for a way to speed up the whole. Here is my script. I am grateful for any help.

       

      EDIT: The best solution would be a way to get the whole Content of MD_STOCK_REQUIREMENTS_LIST_API in one query. If anyone know such a way with Qlikview or SAP please let me know.

       

      // BAPI Connector

      CUSTOM CONNECT TO "Provider = QvSAPBAPIConnector.dll; ASHOST = xx.xx.xx.xx; SYSNR = XX; CLIENT = XX; XUserId = ABC; XPassword = DEF;";

       

      // Create QVD for each article

      Export:

      LOAD Material_MATNR

      FROM

      [C: \ Reports \ QVD gene \ residue list \ export.txt]

      (Txt, UTF8, embedded labels, delimiter is '', MSQ);

      For i = 1 to NoOfRows ('export')

      let v_Material = Field Value ('Material_MATNR', $ (i));

      $ (V_Material):

      LOAD *;

      SQL {

        "Function": "MD_STOCK_REQUIREMENTS_LIST_API"

        "Output": "MDPSX"

        "Parameter":

        [

          {"Direction", "out", "name": "E_CM61M", "optional": false},

          {"Direction": "in", "length": 18, "name": "MATNR", "optional": false, "type": "CHAR", "value": "$ (v_Material)"},

          {"Direction": "in", "length": 3, "name": "PLSCN", "optional": true, "type": "NUM", "value", "000"},

          {"Direction": "in", "length": 4, "name": "Drive", "optional": false, "type": "CHAR", "value", "1000"},

          {"Direction", "tables", "name": "MDPSX", "optional": true}

        ]

      };

      store [$ (v_Material)] into [residue list \ MDPSX ___ $ (v_Material) .qvd];

      drop table $ (v_Material);

      // *****

      next

       

      Translated with Google Translate - Qlik Community Administrative Team

       

       

      Hallo,

       

      Ich möchte ein Abbild der SAP Transaktion MD04 erstellen um alle rückständigen Artikel anzeigen zu lassen. dazu frage ich für jeden Artikel den Funktionsbaustein MD_STOCK_REQUIREMENTS_LIST_API ab und erstelle pro Artikel (ca. 20.000) eine QVD Datei.

      Das ganze dauert etwa 9 Stunden. Das ist viel zu lang für die Anforderungen der Firma. Ich such also einen Weg um das Ganze zu beschleunigen. Hier mein Skript. Ich bin für jede Hilfe dankbar.

       

      // BAPI Connector

      CUSTOM CONNECT TO "Provider=QvSAPBAPIConnector.dll;ASHOST=XX.XX.XX.XX;SYSNR=XX;CLIENT=XX;XUserId=ABC;XPassword=DEF;";

       

      // create QVD for each article

      Export:
      LOAD Material_MATNR
      FROM
      [C:\Reports\QVD-Gen\Rückstandsliste\Export.txt]
      (txt, utf8, embedded labels, delimiter is ' ', msq);

      for i = 1 to NoOfRows('Export')

      let v_Material = FieldValue('Material_MATNR',$(i));
      $(v_Material):
      LOAD *;
      SQL {
        "function":"MD_STOCK_REQUIREMENTS_LIST_API",
        "output":"MDPSX",
        "parameters":
        [
          { "direction":"out", "name":"E_CM61M", "optional":false },
          { "direction":"in", "length":18, "name":"MATNR", "optional":false, "type":"CHAR", "value":"$(v_Material)" },
          { "direction":"in", "length":3, "name":"PLSCN", "optional":true, "type":"NUM", "value":"000" },
          { "direction":"in", "length":4, "name":"WERKS", "optional":false, "type":"CHAR", "value":"1000" },
          { "direction":"tables", "name":"MDPSX", "optional":true }
        ]
      };

      store [$(v_Material)] into [Rückstandsliste\MDPSX___$(v_Material).qvd];
      drop table $(v_Material);
      //*****
      next