implementation{$R *.dfm}procedure TForm1.Button1Click(Sender: TObject);
  var
    Table,Connection,Funct : variant;
    r:integer;
begin
   Connection:=SAPLogoncontrol1.NewConnection;
   Connection.user:='likb';
   Connection.System:='999';
   Connection.Client:='999';
   Connection.ApplicationServer:='192.168.0.10';
   Connection.SystemNumber:='01';
   Connection.Password:='likb147';
   Connection.Language:='ZH';
   SAPLogonControl1.Enabled:= false;
   if Connection.LogOn(0,true) then
   begin
     SAPFunctions1.Connection:=Connection;
     SAPFunctions1.RemoveAll;
     Funct:=SAPFunctions1.Add('ZBOGS');
     Funct.exports('P_JS').value:=3;     if not Funct.call then
       showmessage(funct.exception) //问题就是在这里出现!
       else
       begin
//       Table:=nil;
       Table:=Funct.tables.item('IT_ZBOGS');
       with ADOQuery1 do
       begin
         close;
         sql.Clear;
         sql.Add('insert into ttest(a,b) values(:a,:b)');
         parameters.parambyname('a').value:=Table.value(1,2);
         parameters.parambyname('b').value:=Table.value(1,5);
         execSQL;
       end;
       end;
     end;
end;end.