SAP R/3 and Python ?

Joerg Wegener joerg.wegener at sap.com
Fri Jun 23 10:39:13 EDT 2000


Hi,


"Aahz Maruch" <aahz at netcom.com> wrote in message
news:8ivqtr$oo8$1 at nntp9.atl.mindspring.net...
> In article <3953212C.84E3127F at lemburg.com>,
> M.-A. Lemburg <mal at lemburg.com> wrote:
> >
> >does anyone have an idea of how to interface to SAP R/3 from Python ?
> >
> >If there are no such Python interfaces, how much effort would it take
> >to add orders from a web system into an R/3 system ?
> >
> >[I know, my ignorance shines through here: I've never used R/3, but a
> >customer has confronted me with that need.]
>
> Disclaimer: I know little about R/3, too.
>
> IIRC, R/3 uses a database backend.  At worst, it should be possible for
> you to dump data directly into R/3 as long as you're careful to follow
> the virtual schema.

By all means, do NOT attempt this! SAP introduced an additional layer of
indirection between its applications and the database. The logical structure
is stored an the ABAP Dictionary, a data dictionary. Applications access the
database using the definitions found there.

BUT: There is NO 1:1-mapping from the ABAP Dictionary to the actual tables!
The R/3 Database Server performs various optimizations. The reason is that
R/3 is independent of the underlying RDBMS, therefore the database server
encapsulates the application layer from the database. Example: if your ABAP
table has 140 attributes, but the database only allows 128 attributes per
table, the database server will create two tables and distribute the
attributes. In other words, the physical implementation of the tables
depends upon the vendor and version of:
- the operating system
- the database system
used in the individual R/3 installation.

Another good reason not to access the database tables directly: by doing so,
you bypass the business logic in the application layer, and you could well
leave the database in an inconsistent state.

I think the best way to access R/3 is via a protocol called RFC (Remote
Function Call) or via BAPIs (Business APIs). IIRC there is something called
RFC-SDK which allows to write or generate code (I'm not sure here) which
gives access to RFCs via DDE/OLE. Use this in combination with WIN32-Python.
The downside is that you need much more knowledge about R/3 functions, but
this is the best and most reliable way.

Hope this helps

Joerg


> --
>                       --- Aahz (Copyright 2000 by aahz at netcom.com)
>
> Androgynous poly kinky vanilla queer het    <*>
http://www.rahul.net/aahz/
> Hugs and backrubs -- I break Rule 6
>
> Why don't they make poppasmarts or didjeridon'ts?  --Aahz





More information about the Python-list mailing list