pysaprfc-users Mailing List for Python SAP rfc module
Brought to you by:
klvon
You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(2) |
Sep
|
Oct
|
Nov
|
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(4) |
Sep
|
Oct
|
Nov
|
Dec
|
From: vivek k. g. <gup...@re...> - 2006-08-09 08:13:43
|
Thanks again for the help. In my case I think that going with the option 2 = will be the only option I will have. Also, do I need SAPGUI for my SAP clie= nt script to run properly? I will be presenting this demo app on this comin= g friday to the client. I have to add some GUI for the app, which I will be= doing in wxPython. I will inform you the outcome of the demo. I hope that = I will be able to work in Python again ;) . Thanks again for your timely h= elp and suggestions.=0A=0AThanks and regards,=0AVivek Kumar=0A=0AKlavdij Vo= ncina wrote:=0A> Hello,=0A>=0A> AFAIK you don't need SAPGUI installed for t= he RFC server to work - only librfc32.dll.=0A> And for invoking the server = app you have two options (either one should be configured via sm59):=0A> 1.= SAP system starts your app when needed and stops it after execution. In th= is case your app has to be installed either on application server (the host= machine of SAP system), frontend (local computer from which the function w= as called, has to have SAP GUI installed and running) or from explicit host= . The later is probably the only option in your scenario as you don't have = SAP GUI installed and probably don't have access to SAP host. Unfortunately= starting server app on explicit host requires rsh (remote shell) which is = not available on stock Windows. I believe there are some implementations of= rsh for Windows (both commercial and shareware), but I'd advise against it= as rsh presents possible security threat.=0A> 2. Run app as "registered se= rver". In this case app must be started in advance with certain command lin= e parameters. This are -a<program name> -g<hostname or IP of SAP server> -x= <gateway>. <gateway> is either sapgwXX or 33XX, where XX is system number. = <program name> is a short text of your choice, something like my_computer.= my_server. The same name has to be entered in SM59 in order to register you= r app with SAP. You can then invoke your function(s) from any computer conn= ected to SAP.=0A> Apart from that you don't need further settings.=0A>=0A> = Best regards,=0A> Klavdij=0A> =0A |
From: vivek k. g. <gup...@re...> - 2006-08-07 09:26:07
|
Thanks for helping me out. There are some more things where I am a little b= it confused. I will be grateful if you can help me out in that. There are s= ome points where I fell I need some more help.=0A=0A1. On my machine if I a= m not having SAP GUI installed then also is it possible to connect to SAP a= nd act as a RFC Server ?=0A2. Do I need some other information (e.g. some i= ni file, some parameters to be passed to RFC Server) for server to work?=0A= 3. Do I need to run my python RFC Server exe file in advance so that SAP RF= C client can use it? Or the SAP RFC client will invoke my app automatically= ?=0A=0AI have also gone through the help available on net for setting up a = SM59 RFC connection, from pysaprfc site and other sites also. In my case as= I don't have SAPGUI on my machine then most probably on SAP SM59 it needs = to be registered as __explicit host__ . Please correct me if I am going wro= ng here. And AFAIK in general to work as a server the application need to b= e already running and listening to incoming connections or the client shoul= d know the path from which the server application has to be started. So, I = just want to know whether is it necessary to have SAP GUI installed and con= figured on my machine before it can host the RFC Server application? Actual= ly I just want to prepare myself before negotiating with this proposed clie= nt.=0A=0AThanks and Regards,=0AVivek Kumar=0A=0AKlavdij Voncina wrote:=0A> = You definitely need access to a SAP system to test your application. The li= brfc32.dll alone is not enough. In order to call a function defined in SAP = you need at least connection settings (IP or name of the host, and system n= umber) plus username, password and client number. In the simplest and most = often case the connection string is something like 'ASHOST =3D <ip or hostn= ame of SAP system> SYSNR=3D<system number> CLIENT=3D<client> USER=3D<userna= me> PASSWD=3D<password>'.=0A> In case of a server function (as in your exam= ple) the connection should be defined from SAP system using transaction sm5= 9 as described in SAP documentation.=0A> If I understand your situation cor= rectly your client gave you librfc32.dll but you don't have access to their= system. In that case you should negociate access to their test or dev syst= em in order to be able to test your app. The example you sent should work i= f SAP system is accessible and configured properly (sm59).=0A>=0A> Best reg= ards,=0A> Klavdij=0A>=0A>=0A>=0A> =0A>> Dear All, Recently I am given= a task to try interfacing with SAP R/3=0A>> using RFC. The task is as foll= owing..I have to write an app which should be=0A>> able to call a simple fu= nction in SAP and show the output on screen. Also=0A>> the SAP should be ab= le to call a simple function in this app.As I have no=0A>> previous experie= nce of SAP I was very nervous. I googled for the options=0A>> available for= interfacing and found pySAP, .net connector and JCo while=0A>> searching f= or interfaces. In my organization as most of the work is on=0A>> windows pl= atform so noboy here uses any open source languages. I have some=0A>> prior= experience of Python and I thought it will be a good chance to push=0A>> i= t in my organization. I somehow managed to convince my pm that this job=0A>= > can be done in python. Now let me tell you what softwares I have availabl= e=0A>> at my hand..OS : Windows XPPython : version 2.4.3ctypes : version=0A= >> 1.0.0pysaprfc : version 1.0.0mxdatetime : version 2.0.3We don\'t have a= =0A>> license for SAP but I somehow managed to get librfc32.dll from the cl= ient=0A>> (possibly, if this test app is through :) ) the version for= =0A>> librfc32.dll is 4640.5.378.3114. I created two simple scripts after r= eading=0A>> the documentation. Here is the code for the simple server=0A>> = function..------------------------------------------import pysapimport=0A>>= sysclass SAP_RFC_SRV(pysap.RFC_SERV_FUNC): =0A>> _name_=3D\'ZTE= ST_ABC\' =0A>> _importing_=3D[(\'Strdata\',\'C\',10)]  = ;=0A>> _exporting_=3D[(\'Msg_reached\',\'C\',1)] def=0A>= > run(self,handle): print \'Message Fro= m=0A>> Sap : \',self[\'Strdata\'] =0A>> = self[\'Msg_reached\']=3D\'1\'srv=3Dpysap.RfcServerEx()try: =0A>>= srv.register_func(SAP_RFC_SRV) srv.main_loop(sys.argv)except= =0A>> pysap.SapRfcError,E: print \'Error returned while trying = to=0A>> register sap rfc server...\',E raw_input(\'Press any ke= y to=0A>> exit...\') sys.exit(1)----------------------------- I= even=0A>> created an exe from the script using the py2exe after reading a = previous=0A>> post on mailing list dated 2005-08-31. But still when I run t= his exe I=0A>> still get this \'connection failed\' message.Is it neccessar= y to have a=0A>> running SAP server to run this server app or is there some= thing I am=0A>> missing? Also, do I have to create some ini file for this s= erver to work?=0A>> Please help me as this is my only chance to get some wo= rk in Python after=0A>> more then 2 years :( and I definitely don\'t want t= o miss it.THX and=0A>> Regards,Vivek Kumar=0A>> =0A>=0A> --------------= -----------------------------------------------------------=0A> Take Survey= s. Earn Cash. Influence the Future of IT=0A> Join SourceForge.net's Techsay= panel and you'll get the chance to share your=0A> opinions on IT & busines= s topics through brief surveys -- and earn cash=0A> http://www.techsay.com/= default.php?page=3Djoin.php&p=3Dsourceforge&CID=3DDEVDEV=0A> ______________= _________________________________=0A> Pysaprfc-users mailing list=0A> Pysap= rfc...@li...=0A> https://lists.sourceforge.net/lists/lis= tinfo/pysaprfc-users=0A>=0A>=0A>=0A> =0A=0A=0A |
From: Klavdij V. <von...@si...> - 2006-08-06 14:57:05
|
You definitely need access to a SAP system to test your application. The librfc32.dll alone is not enough. In order to call a function defined in SAP you need at least connection settings (IP or name of the host, and system number) plus username, password and client number. In the simplest and most often case the connection string is something like 'ASHOST = <ip or hostname of SAP system> SYSNR=<system number> CLIENT=<client> USER=<username> PASSWD=<password>'. In case of a server function (as in your example) the connection should be defined from SAP system using transaction sm59 as described in SAP documentation. If I understand your situation correctly your client gave you librfc32.dll but you don't have access to their system. In that case you should negociate access to their test or dev system in order to be able to test your app. The example you sent should work if SAP system is accessible and configured properly (sm59). Best regards, Klavdij > Dear All, Recently I am given a task to try interfacing with SAP R/3 > using RFC. The task is as following..I have to write an app which should be > able to call a simple function in SAP and show the output on screen. Also > the SAP should be able to call a simple function in this app.As I have no > previous experience of SAP I was very nervous. I googled for the options > available for interfacing and found pySAP, .net connector and JCo while > searching for interfaces. In my organization as most of the work is on > windows platform so noboy here uses any open source languages. I have some > prior experience of Python and I thought it will be a good chance to push > it in my organization. I somehow managed to convince my pm that this job > can be done in python. Now let me tell you what softwares I have available > at my hand..OS : Windows XPPython : version 2.4.3ctypes : version > 1.0.0pysaprfc : version 1.0.0mxdatetime : version 2.0.3We don\'t have a > license for SAP but I somehow managed to get librfc32.dll from the client > (possibly, if this test app is through :) ) the version for > librfc32.dll is 4640.5.378.3114. I created two simple scripts after reading > the documentation. Here is the code for the simple server > function..------------------------------------------import pysapimport > sysclass SAP_RFC_SRV(pysap.RFC_SERV_FUNC): > _name_=\'ZTEST_ABC\' > _importing_=[(\'Strdata\',\'C\',10)] > _exporting_=[(\'Msg_reached\',\'C\',1)] def > run(self,handle): print \'Message From > Sap : \',self[\'Strdata\'] > self[\'Msg_reached\']=\'1\'srv=pysap.RfcServerEx()try: > srv.register_func(SAP_RFC_SRV) srv.main_loop(sys.argv)except > pysap.SapRfcError,E: print \'Error returned while trying to > register sap rfc server...\',E raw_input(\'Press any key to > exit...\') sys.exit(1)----------------------------- I even > created an exe from the script using the py2exe after reading a previous > post on mailing list dated 2005-08-31. But still when I run this exe I > still get this \'connection failed\' message.Is it neccessary to have a > running SAP server to run this server app or is there something I am > missing? Also, do I have to create some ini file for this server to work? > Please help me as this is my only chance to get some work in Python after > more then 2 years :( and I definitely don\'t want to miss it.THX and > Regards,Vivek Kumar |
From: vivek k. g. <gup...@re...> - 2006-08-05 12:23:40
|
Dear All, Recently I am given a task to try interfacing with SAP R/3 using RFC. The task is as following..I have to write an app which should be able to call a simple function in SAP and show the output on screen. Also the SAP should be able to call a simple function in this app.As I have no previous experience of SAP I was very nervous. I googled for the options available for interfacing and found pySAP, .net connector and JCo while searching for interfaces. In my organization as most of the work is on windows platform so noboy here uses any open source languages. I have some prior experience of Python and I thought it will be a good chance to push it in my organization. I somehow managed to convince my pm that this job can be done in python. Now let me tell you what softwares I have available at my hand..OS : Windows XPPython : version 2.4.3ctypes : version 1.0.0pysaprfc : version 1.0.0mxdatetime : version 2.0.3We don\'t have a license for SAP but I somehow managed to get librfc32.dll from the client (possibly, if this test app is through :) ) the version for librfc32.dll is 4640.5.378.3114. I created two simple scripts after reading the documentation. Here is the code for the simple server function..------------------------------------------import pysapimport sysclass SAP_RFC_SRV(pysap.RFC_SERV_FUNC): _name_=\'ZTEST_ABC\' _importing_=[(\'Strdata\',\'C\',10)] _exporting_=[(\'Msg_reached\',\'C\',1)] def run(self,handle): print \'Message From Sap : \',self[\'Strdata\'] self[\'Msg_reached\']=\'1\'srv=pysap.RfcServerEx()try: srv.register_func(SAP_RFC_SRV) srv.main_loop(sys.argv)except pysap.SapRfcError,E: print \'Error returned while trying to register sap rfc server...\',E raw_input(\'Press any key to exit...\') sys.exit(1)-----------------------------I even created an exe from the script using the py2exe after reading a previous post on mailing list dated 2005-08-31. But still when I run this exe I still get this \'connection failed\' message.Is it neccessary to have a running SAP server to run this server app or is there something I am missing? Also, do I have to create some ini file for this server to work? Please help me as this is my only chance to get some work in Python after more then 2 years :( and I definitely don\'t want to miss it.THX and Regards,Vivek Kumar |
From: Klavdij V. <von...@si...> - 2005-08-31 18:46:28
|
You have to register the module with r/3 using transaction sm59. Please, check SAP help but basically there are two options - starting program from either backend or frontend (or registered server machine via rsh), or registernig already running process. If you go for second option you have to pass certain arguments when starting program, usually those are -a<prog_name> -g<gateway> -x<gw_port> where prog_name is program id from sm59, gateway is a name or ip of sap gateway server and gw_port is the port gateway is runing on. When using first option and running on Windows you have to produce an .exe using py2exe or similar tool, on Unix/Linux making script executable using chmod is enough. HTH, Klavdij > The following Module should run out of the box. But it says "exception > 'connection failed'". I have o clue whats going on. Can pls somebody give > me a hint how the module has to be started > > #!/usr/bin/env python > # -*- coding: latin_1 -*- > > import pysap > class MyFunc(pysap.RFC_SERV_FUNC): > _name_='Z_MY_FUNC' > _importing_=[('IN_VALUE','I')] > _exporting_=[('OUT_VALUE','I')] > > def run(self,handle): > self['OUT_VALUE']=2*self['IN_VALUE'] > > import sys > srv=pysap.RfcServerEx() > try: > srv.register_func(MyFunc) > srv.main_loop(sys.argv) > except pysap.SapRfcError, msg: > > print "exception %s " % (msg) > > sys.exit(1) > > > > ------------------------------------------------------- > SF.Net email is Sponsored by the Better Software Conference & EXPO > September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices > Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA > Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf > _______________________________________________ > Pysaprfc-users mailing list > Pys...@li... > https://lists.sourceforge.net/lists/listinfo/pysaprfc-users |
From: Michael B. <mic...@we...> - 2005-08-31 07:40:35
|
The following Module should run out of the box. But it says "exception 'connection failed'". I have o clue whats going on. Can pls somebody give me a hint how the module has to be started #!/usr/bin/env python # -*- coding: latin_1 -*- import pysap class MyFunc(pysap.RFC_SERV_FUNC): _name_='Z_MY_FUNC' _importing_=[('IN_VALUE','I')] _exporting_=[('OUT_VALUE','I')] def run(self,handle): self['OUT_VALUE']=2*self['IN_VALUE'] import sys srv=pysap.RfcServerEx() try: srv.register_func(MyFunc) srv.main_loop(sys.argv) except pysap.SapRfcError, msg: print "exception %s " % (msg) sys.exit(1) |