BAPI / RFC with Delphi(系列之四)--TSAPFunctions使用(有登录对话框的delphi源代码)
来源:互联网 发布:巨星知我心 编辑:程序博客网 时间:2024/05/05 14:14
1、新建一个Form,并在form上添加下列控件
Component function SAPFunctions1 SAP ActiveX-component to connect RFC/BAPI Grid Stringgrid to show the data's in the form Button1 Button to start the procedure
2、源代码如下(使用RFC_READ_TABLE函数读取成本中心)
unit logon1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,ExtCtrls, OleCtrls, StdCtrls, SAPFunctionsOCX_TLB, Grids;
type
TForm1 = class(TForm)
SAPFunctions1: TSAPFunctions;
Button1: TButton;
Grid: TStringGrid;
procedure Button1Click(Sender: TObject);
private
{ }
public
{ }
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] := 'Cost Number';
grid.cells[2,0] := 'CostCenter Description';
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.
- BAPI / RFC with Delphi(系列之四)--TSAPFunctions使用(有登录对话框的delphi源代码)
- BAPI / RFC with Delphi(系列之四)--TSAPFunctions使用(有登录对话框的delphi源代码)
- BAPI / RFC with Delphi(系列之六)--TSAPFunctions使用BAPI创建PO(有登录对话框的delphi源代码)
- BAPI / RFC with Delphi(系列之六)--TSAPFunctions使用BAPI创建PO(有登录对话框的delphi源代码)
- BAPI / RFC with Delphi(系列之五)--TSAPFunctions和TSAPLogoncontrol使用(无登录对话框Delphi源代码)
- BAPI / RFC with Delphi(系列之五)--TSAPFunctions和TSAPLogoncontrol使用(无登录对话框Delphi源代码)
- BAPI / RFC with Delphi(系列之二)--TSAPLogonControl使用(有对话框的登录sap的delphi源代码)
- BAPI / RFC with Delphi(系列之二)--TSAPLogonControl使用(有对话框的登录sap的delphi源代码)
- BAPI / RFC with Delphi(系列之三)--TSAPLogonControl使用(无对话框的登录sap的delphi源代码)
- BAPI / RFC with Delphi(系列之三)--TSAPLogonControl使用(无对话框的登录sap的delphi源代码)
- BAPI / RFC with Delphi(系列之七)--TBAPIControl使用BUS1001显示物料(Delphi源代码)
- BAPI / RFC with Delphi(系列之八)--TBAPIControl使用BUS2012建立PO(Delphi源代码)
- BAPI / RFC with Delphi(系列之八)--TBAPIControl使用BUS2012建立PO(Delphi源代码)
- BAPI / RFC with Delphi(系列之七)--TBAPIControl使用BUS1001显示物料(Delphi源代码)
- BAPI / RFC with Delphi(系列之一)--安装部件
- BAPI / RFC with Delphi(系列之一)--安装部件
- Delphi登录功能的源代码
- delphi with do 的使用
- 软件文档
- Google 的秘密- PageRank 彻底解说 zz
- SRM340
- Apache Axis v1.1命令行工具参考3
- 如何用VS2005制作Web安装程序
- BAPI / RFC with Delphi(系列之四)--TSAPFunctions使用(有登录对话框的delphi源代码)
- 在ASP.NET下实现数字和字符相混合的验证码
- JBoss4 应用服务器Web开发人员参考手册(3):context.xml
- 在 Windows Mobile 使用 WS-Attachment 传输二进制数据
- Unicode简介
- C#中获取的SQL日期精度丢失毫秒的处理--SQL日期格式转换
- 她建议你....
- 挂号控件 未完成版
- setdwcache