ich habe folgendes Problem:
Um auf RFCs von SAP zuzugreifen, verwende ich die OCX des SapGui.
Über das Werkzeug "Import Type Libary" habe ich die SAPFunctionsOCX_5_0_TLB erzeugt. Um die Tabelle zu übergeben, muss ich eine Funktion "Exports" aufrufen.
Code: Alles auswählen
procedure TForm1.Button1Click(Sender: TObject);
var txt : string ;
r : integer ;
Table, Funct : variant;
begin
{ Funktion definieren }
Funct:=Ifunction(AxcSAPFunctions1.OleServer.add('RFC_READ_TABLE'));
{ Der Funktion übergeben, welche Tabelle gelesen werden soll }
Funct.Exports('QUERY_TABLE').value := 'CSKT'; // <------------------------------- hier!
{ Funktion ausführen }
if not Funct.call then
{ Bei Fehler Meldung anzeigen }
showMessage(Funct.exception)
else begin
{ Tabelle mit den Daten selektieren }
Table := Funct.tables.item('DATA');
...
Beim Import der OCX hat der Assistent die Funktion in "Export_" umbenannt.
Code: Alles auswählen
Unit SAPFunctionsOCX_5_0_TLB;
// Imported SAPFunctionsOCX on 19.02.2019 22:23:33 from F:\ZugriffAufSAP\Bibliotheken\Ansi\system32\wdtfuncs.ocx
{$mode delphi}{$H+}
interface
// Warning: renamed coclass 'Function' to 'Function_'
// Warning: renamed coclass 'Exports' to 'Exports_'
// Warning: renamed property 'Type' in IStructure to 'Type_'
// Warning: renamed property 'Function' in IStructure to 'Function_'
// Warning: renamed property 'Exports' in IFunction to 'Exports_' // <----------------- hier sagt er das auch
// Warning: renamed property 'Type' in IParameter to 'Type_'
// Warning: renamed property 'Function' in IParameter to 'Function_'
Uses
Windows,ActiveX,Classes,Variants,ActiveXContainer;
Const
...
// IFunction :
IFunction = dispinterface
['{695B9700-2F2C-11CF-9AE5-0800096E19F4}']
// Call : Call the function in R/3 return whether successfull
function Call:WordBool;dispid 6;
// CallIndirect : Call a function module in R/3 indirectly; use the transactional RFC interface.
// Importing parameters are not supported. If an error occurs, the RFC client program has to
// reconnect to R/3 later and repeat this RFC call with the specific TransID.
function CallIndirect(tranID:WideString):WordBool;dispid 11;
// Exports : Export parameter collection - Returns whole collection, or single item (if parameter not empty)
property Exports_:IDispatch readonly dispid 9; // <---------------------- und hier macht er das auch
// Imports : like Exports: item is empty, string or number. For whole collection or single Parameter object
property Imports:IDispatch readonly dispid 10;
...
Code: Alles auswählen
Funct.Exports_('QUERY_TABLE').value := 'CSKT';
Eine Änderung auf
Code: Alles auswählen
property Exports_:IDispatch readonly dispid 9 name 'Exports';
Meine Frage: Wie bekomme ich das hin, dass ich diese Funktion trotzdem aufrufen kann?
Vielen Dank schon im Voraus!