Einzelnen Beitrag anzeigen

Pfaffe

Registriert seit: 29. Jan 2009
294 Beiträge
 
Delphi 12 Athens
 
#9

AW: SAP BAPI_MATERIAL_GETLIST Übergabe des Filters

  Alt 11. Dez 2021, 21:58
So funktioniert es bei mir:
Delphi-Quellcode:
var
  i, y: integer;
  txt: String;
  Funct, mat, tab: OleVariant;
begin
   Funct:= SAPFunctions1.Add('BAPI_MATERIAL_GETLIST');
   // Funct.exports('MAXROWS').value:= 100;
   mat:= Funct.tables.item('MATNRSELECTION');
   mat.Rows.Add;
   mat.value(1, 'SIGN'):= 'I'; // I, E
   mat.value(1, 'OPTION'):= 'BT'; // (EQ,NE,GT,GE,LE,LT,BT,NB,CP,NP)
   mat.value(1, 'MATNR_LOW'):= '000000000000107117'; // 18 Zeichen
   mat.value(1, 'MATNR_HIGH'):= '000000000000107120';
   if not Funct.call then
      showMessage(Funct.exception)
   else
      begin
         // Ausgabe Material
         tab:= Funct.tables.item('MATNRLIST');
      for i:= 1 to tab.rowcount do
        for y:= 1 to 6 do // Warum max. 6?
          begin
            txt:= tab.value(i, y);
            mmo1.Lines.Add(txt);
            end;

         // Ausgabe Fehler
         tab:= Funct.tables.item('RETURN');
      for i:= 1 to tab.rowcount do
        for y:= 1 to 12 do
          begin
            txt:= tab.value(i, y);
            mmo1.Lines.Add(txt);
          end;
      end;
end;
  Mit Zitat antworten Zitat