2,679
社区成员
发帖
与我相关
我的任务
分享
procedure TfrmRFCB.btnReadTextClick(Sender: TObject);
begin
(* parameter "true" : SilentLogOn *)
if Connection.LogOn(0,true) <> true then
raise Exception.Create('Error logon!');
try
try
Animate1.Active := true;
(* assign the existing connection to the *)
(* component SAPFunctions1 *)
SAPFunctions2.Connection := Connection;
//調用Read_Text函數
Funct := SAPFunctions2.add('Read_Text');
Funct.exports('LANGUAGE').value := '1'; //文本語言:ZH,ZF
Funct.exports('ID').value := 'F01'; //標識: 項目文本F01
Funct.exports('OBJECT').value := 'EKKO';//文本對象:EKPO項目文本
//Funct.exports('CLIENT').value := '208';//
//關鍵標識號,表頭則為憑証號, 行項目文本則為(單號+項目碼)
Funct.exports('NAME').value := Trim(edtCode.Text); //+POItems.Value(1,'PO_ITEM');
if not Funct.call then
showMessage(Funct.exception)
else
begin
POTEXTITEM := funct.tables.item('LINES');
Memo2.Lines.Add(POTEXTITEM.Value(1,'TDLINE'));
end;
except on E: Exception do
raise Exception.Create(E.Message);
end;
finally
Animate1.Active := false;
end;
end;