We have added search box. Key in SAP issue keyword to search
TopBottom

Announcement: wanna exchange links? contact me at sapchatroom@gmail.com.

[sap-dev] Clear RFC Tables when using RFC READ TABLE in a loop with Delphi

Posted by Admin at
Share this post:
Ma.gnolia DiggIt! Del.icio.us Yahoo Furl Technorati Reddit

Posted by miguelenriquez
on May 24 at 6:19 PM
hi all i read this question:

http://sap.ittoolbox.com/groups/technical-functional/sap-dev/clear-rfc-tables-when-using-rfc_read_table-in-a-loop-2614239

but not answer for me.

my question is:

i have a problem:

How to Clear RFC Tables when using RFC_READ_TABLE in a loop

i use the ActiveX Sap components.

FunctDetail : VARIANT ;
SAPFunctions2: TSAPFunctions;

SapFunctions2.Connection:=Connection;
SapFunctions2.Removeall;
FunctDetail := SAPFunctions2.add('RFC_READ_TABLE');

var
i:integer

for i:=0 to 50 do
begin
FunctDetail.exports('QUERY_TABLE').value := 'LFA1';
FunctDetail.Tables.Item('FIELDS').AppendRow.Value( 'FIELDNAME'):='LIFNR';
FunctDetail.Tables.Item('FIELDS').AppendRow.Value( 'FIELDNAME'):='NAME1';
FunctDetail.Tables.Item( 'OPTIONS' ).AppendRow.Value( 'TEXT' ) := 'LIFNR = '''+Ng1.Cellhttp://wc1LIFNR,Ng1.RowCount-1.asstring+'''';
end;
my problem is how to clear the Table Items, the first time work, but in the next loop (when i=1) say a error. SYSTEM_FAILURE and then other error: "No connection to SAP System Available"


i think, for fix the problem, each time clear the Table.Items (or reuse the items) i try for delte the items:

FunctDetail.Tables.Item(1).Delete;

or

FunctDetail.Tables.Item(1).Remove;
also i try:

FunctDetail.Parameter[ 'OPTIONS' ].Value := 'LIFNR = '''+Ng1.Cell[wc1LIFNR,Ng1.RowCount-1].asstring+'''';

but get these error:

"Method 'Parameter' not supported by automation object"

and not work.

Thanks
__.____._
Copyright © 2011 Toolbox.com and message author.

Toolbox.com 4343 N. Scottsdale Road Suite 280, Scottsdale, AZ 85251
View this online
  
_.____.__

0 comments:

Post a Comment

T r a n s l a t e to your language