Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Anyone ever integrated VFP frontend with SAP

Status
Not open for further replies.

EzLogic

Programmer
Aug 21, 2001
1,230
0
0
US
I am interested in knowing if anyone had a chance in the VFP community to connect VFP front end client to SAP backend databases.

I read/heard that SAP data structures are difficult and they are not similar to VFP tables nor SQL Tables.

I am interested in learning how to access data in SAP thru VFP.

I am using VFP 9.0


Ali Koumaiha
Wireless Toyz
Farmington Hills, Michigan
 
Ali,
The link here below probably will help you in more knowing about the structure of SAP DBs
I had the opportunity to face the problem of "asking" SAP about data (i.e. no need of “sending” data to it), and didn't come out of the problem. The final solution I had to accept, was to ask the SAP programmer to provide TXT or CSV files, which are daily programmatically updated, and then work on them. Also XML caused me troubles.
Hope this help and is not confusing you.
Regards.
 
You can download tables from SAP using BAPI or RFC functions anf then work on the downloaded data. The code below will present you with the form for logging on to SAP and will download all the Company codes defined using the standard SAP BAPI function "BAPI_COMPANYCODE_GETLIST".
You will need to have SAP GUI front end installed on your machine.

Code:
xsystem='00'         &&System ID 
xuser='USERNAME'     &&SAP User name 
xclient='00'         &&SAP Client
xpassword='password' &&Password 

**All the ablove values may be left blank

objBapiControl =CREATEOBJECT("SAP.Functions")
objconnection=objBapiControl.connection

objconnection.ApplicationServer = '10.10.10.10'  &&SAP System IP address
objconnection.System=xsystem
objconnection.Client=xclient
objconnection.User=xuser
objconnection.Password=xpassword
objconnection.Language='E'
objconnection.tracelevel=6

retcd=objconnection.Logon(0,.f.)

IF retcd = .f.
   return
ENDIF

objcompanycodes=objBapiControl.add("BAPI_COMPANYCODE_GETLIST")
objcompanycodes.call

objtable=objcompanycodes.tables("COMPANYCODE_LIST")

create table ('d:\temp\co_code') ;   &&Change as required
     (CName C(10), CDesc C(100))

FOR i = 1 TO objtable.rowcount
   APPEND BLANK
   replace cname WITH objtable.cell(i,1)
   replace cdesc WITH objtable.cell(i,2)
endfor

objconnection.logoff

BROWSE

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top