高手们,如何用dephi调用RFC? 如何用dephi连接SAP调用RFC?具体要怎么调用?是否要用到什么SDK? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 汗foxyy8888和vividw~~~~~RFC,都木有听说过?严重怀疑你俩是不是多年的网虫~~ 先要安裝2個控件,RFCGFunctions & RFCLoginControlunit logon1;interfaceusesWindows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,ExtCtrls, OleCtrls, StdCtrls, SAPFunctionsOCX_TLB, Grids;typeTForm1 = class(TForm) SAPFunctions1: TSAPFunctions; Button1: TButton; Grid: TStringGrid; procedure Button1Click(Sender: TObject);private{ Private-Deklarationen }public{ Public-Deklarationen }end;varForm1 : TForm1 ;Table,Funct : VARIANT ;implementation{$R *.DFM}procedure TForm1.Button1Click(Sender: TObject);var txt : string ; r : integer ;begin (* define function *) Funct := SAPFunctions1.add('RFC_READ_TABLE'); (* tell the function what table should be read *) Funct.exports('QUERY_TABLE').value := 'CSKT'; (* call the function *) if not Funct.call then (* on error show message *) showMessage(Funct.exception) else begin (* select table with the data's *) Table := Funct.tables.item('DATA'); (* addjust the StringGrid *) grid.rowCount := Table.rowcount + 1; grid.cells[0,0] := 'Client'; grid.cells[1,0] := 'Kostenstelle'; grid.cells[2,0] := 'Bezeichnung'; for r := 1 to grid.rowCount -1 do begin (* select first dataset *) txt := Table.value(r,1); (* Because the RCF-function returns only one *) (* string whitch contains all data's, the *) (* string must be cut to different parts *) grid.cells[0,r] := copy(txt,0,3); (* Client *) grid.cells[1,r] := copy(txt,9,10); (* CostCent-number *) grid.cells[2,r] := copy(txt,27,20); (* CostCent-description*) end; grid.visible := True; end;end;end. 如何在 TWebBrowser 中模拟点击超链接 a请教高手,ctivex如何取滚动条位置 这是什么原因造成的? 关于Delphi对象和构造器的问题 在DELPHI调用存储过程的问题? delphi 7 的报表 有谁知道,qq聊天的面板是怎么做的? 跟Sql数据库有关的饿问题! 弱弱的一个问题,delphi下用什么报表呢?fast report ,水晶,请问能否用b/s下的报表,如润乾,如意. 缷载程序是怎么做的? 2006的最后一天.这年过的如何?你最想说的一句话是什么? 各位大师,谁命令行程序的编写例子给提供两个。小弟感激不尽。
RFC,都木有听说过?严重怀疑你俩是不是多年的网虫~~
TForm1 = class(TForm)
SAPFunctions1: TSAPFunctions;
Button1: TButton;
Grid: TStringGrid;
procedure Button1Click(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;var
Form1 : TForm1 ;
Table,Funct : VARIANT ;implementation
{$R *.DFM}procedure TForm1.Button1Click(Sender: TObject);
var txt : string ;
r : integer ;
begin (* define function *)
Funct := SAPFunctions1.add('RFC_READ_TABLE'); (* tell the function what table should be read *)
Funct.exports('QUERY_TABLE').value := 'CSKT'; (* call the function *)
if not Funct.call then (* on error show message *)
showMessage(Funct.exception) else begin (* select table with the data's *)
Table := Funct.tables.item('DATA'); (* addjust the StringGrid *)
grid.rowCount := Table.rowcount + 1;
grid.cells[0,0] := 'Client';
grid.cells[1,0] := 'Kostenstelle';
grid.cells[2,0] := 'Bezeichnung';
for r := 1 to grid.rowCount -1 do begin (* select first dataset *)
txt := Table.value(r,1); (* Because the RCF-function returns only one *)
(* string whitch contains all data's, the *)
(* string must be cut to different parts *)
grid.cells[0,r] := copy(txt,0,3); (* Client *)
grid.cells[1,r] := copy(txt,9,10); (* CostCent-number *)
grid.cells[2,r] := copy(txt,27,20); (* CostCent-description*)
end;
grid.visible := True;
end;
end;
end.