Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Delphi7 and Sql statment

Former Member
0 Likes
643

hi al Friends this is my first post, my question is simple:

How to do a select similar to:

SELECT BUKRS KUNNR BELNR GJAHR BUZEI WRBTR WAERS

INTO-CORRESPONDING FIELDS OF TABLE TBSID

FROM BSID

WHERE: KUNNR IN S_KUNNR,

BUKRS = P_BUKRS,

i am work with ActiveXcomponent, and have this code:

procedure TForm1.SAPLogonControl1Click(Sender: TObject);

begin

Connection := SAPLogoncontrol1.newConnection;

(* In some GUI-versions the username *)

(* must be written in uppercase !!! *)

Connection.User := AnsiUpperCase('XXXXX'); //Ok

Connection.System := 'XXX'; //Ok

Connection.Client := '400'; //Ok

Connection.ApplicationServer := '192.168.1.71'; //

Connection.SystemNumber := '44'; //Ok

Connection.Password := 'xXxXxXxX'; //Ok

Connection.Language := 'EN' ; //Ok

Connection.SAPRouter :='/H/188.122.133.22/H/'; //Ok

SAPLogonControl1.Enabled := false;

if Connection.LogOn(0,true) = true then

(* parameter "true" : SilentLogOn *)

begin

ShowMessage('Logon O.K.');

Button1.Enabled:= true;

end

else

begin

ShowMessage('Error on logon :-(((');

SAPLogonControl1.Enabled:=true;

end;

end;

my connection work: say me: ShowMessage('Logon O.K.');

my question is wich is the next step for execute a normal Sql statment?

i am interested in get all the (journalentries) accounting registers (accounting policy)

thanks

3 REPLIES 3
Read only

Former Member
0 Likes
559

i get part of the answer on /server irc.freenode.org on the cahnnel #sap by E0x i need use RFC_READ_TABLE

now i get the information of the table 'CSKT' with this code:

Funct.exports('QUERY_TABLE').value := 'CSKT';

i get 70 records the value of the first record is:

'200S1000000000111099991231Administracion Administracion ADMINISTRACION'

now i am working in this 2 things (same as the topic)

1) How to Exceute a SQLstatment or similar by sample:

get all records from 'CSKT' table but only the Depths: 'Administracion' hot do this?

2) how to get/extract all the table names of SAP? 'CSKT', 'AGKO', 'ANAT'

SAP_TABLES

any advice?

thanks

Read only

0 Likes
559

1. Call the "RFC_READ_TABLE" with OPTIONS to select specific rows that meet certain criteria.

2. Query table "DD02L" for list of tables in SAP.

Read only

Former Member
0 Likes
559

i have a problem:

How to Clear RFC Tables when using RFC_READ_TABLE in a loop

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.Cell[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 the problem is 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;

and not work.

Thanks