Categories Uncategorized Tasting the mix of PHP and SAP February 17, 2006 | 79 Views | Alvaro Tejada Galindo more by this author Retagging required alvaro tejadagalindo3beyond sapemerging technologiesscripting languages share share tweet share Follow Alert Moderator To report this post you need to login first. 26 Replies 26 Comments You must be Logged on to comment or reply to a post. Marilyn Pratt February 17, 2006 at 8:14 am Hi Alvaro,Thanks for breathing life back into this subject. Back when we set up the PHP forum last year we were interested to see what lively conversations would evolve. The likes of Jason Simnmons, Craig Cmehil, John Astill, Gregor Wolf, Anton Wenzelhuemer and others kept conversation flowing for a while there, but without more interaction from the community the subject got real quiet.Thanks for bringing it back to life with your PHP forum posts and this weblog! Marilyn like (0) Alvaro Tejada Galindo Post authorFebruary 17, 2006 at 8:30 am Thanks for your kind words Marilyn. And special thanks to Craig, who offer me trust and friedship. I’m sure that with the help of Craig, John and Jason we can make the PHP-SAP community user grow on every day. Greetings, Blag. like (0) Former Member February 23, 2006 at 3:17 am Estoy bastante interesado en el tema de conectar php y sap, pero tengo un gran problema, desde la empresa en la que trabajo todas las conexiones requieren la cadena SAProuter y claro esto no lo cotempla aún el RFC. Mi pregunta es si hay algún sap de prueba que pueda instalar y hacer mis pequeños pinos o si sabes conectar php y sap habiendo una cadena Saprouter por el medio. Muchas gracias por todo y mut interesante este artículo. like (0) Alvaro Tejada Galindo Post authorFebruary 23, 2006 at 4:53 am Hola: Bueno, lo que puedes hacer es conseguir el minisap, instalar el apache, el php y el saprfc. Es lo que yo hice en mi casa, para poder escribir este weblog. What is MiniSap? —————————————————- Hi: Well, what you can do is get the MiniSap, install the apache web server, php and the saprfc.That’s what i do in my house in orden to write this weblog. What is MiniSap? Greetings, Blag. like (0) Craig Cmehil February 23, 2006 at 5:05 am English only please! like (0) Alvaro Tejada Galindo Post authorFebruary 23, 2006 at 5:09 am Ok Chief, i got the message…But you can notice that i answer in both languages…But, you’re right…Only english starting right now -;) Greetings, Blag. like (0) Former Member February 23, 2006 at 5:29 am Esto es lo que buscaba el minisap. Muchas gracias;Ya tenia instalado el apache, el php y el saprfc. He estado investigando más y hay unos atributos para la conexión pero no consigo que fuincione. Ahora pruebo con el minisap. Muchas gracias por todo. like (0) February 28, 2006 at 12:11 am Just installed Apache and PHP a few weeks ago; now I can put it to use. I hate Java, too; all those tedious little bits and beans that have to be identified, arranged and assembled just in order to “get the job done”… bah. like (0) Craig Cmehil February 28, 2006 at 12:55 am Don’t forget to check out the PHP forum here: https://forums.sdn.sap.com/forum.jspa?forumID=124&start=0 as well as all the other PHP blogs: https://forums.sdn.sap.com/thread.jspa?threadID=38415&tstart=0 like (0) Hans-Joerg Alles February 28, 2006 at 1:00 am Hello, isn’t it necessary to encrypt the submitted password ? Is saprfc_open able to handle an encrypted password ? Hans like (0) Alvaro Tejada Galindo Post authorFebruary 28, 2006 at 3:38 am Remember that this is just a test app. I made it in order to show some of the PHP/SAP functionallity. You must encrypt the send data and decrypt the recieved data, i don’t think that saprfc_open handle it. But as my blog says, this is not intended to be use on a productive system, so i just want to add some basic functionallity…If you want extra stuff, you can coded yourself -;) Or you can check the forums -:) Greetings, Blag. like (0) Hans-Joerg Alles March 3, 2006 at 5:06 am Hello,but that’s exactly the problem, why we only have examples and no productive usable solutions. Until now, i didn’t find any code to catch the login data and decrypt it. Hans like (0) Alvaro Tejada Galindo Post authorMarch 3, 2006 at 5:37 am Well…we only have test app and productive usability for a couple of reasons…First, most of the RFC are not release for customer use (Ask SAP why), and second because SAPRFC is still under development (At least i think it is). The main porpuse of my blogs is to show what you can do, and what you’re going to able to do in the future. Anyway…i think that Craig or Marilyn can give you better answers. Greetings, Blag. like (0) Former Member March 7, 2006 at 8:29 pm Well done. Been keeping one eye on the PHP/SAP front…I agree it is much easier to use. PHP definitely have it’s own niche area. For the issue of security you can implement SSL which, if I remember correctly in my old webmaster days, it decrypes every thing so you dont have to worry about clear text for the id and password being passed via the web. like (0) Craig Cmehil March 7, 2006 at 11:12 pm I think the reason we have only examples is because many people haven’t taken PHP/SAP to the next level, or in my case weren’t allowed to blog about everything. SAPRFC, is as “Blag” states under development but only because PHP is under development so you can really use it in a productive environment if you want, or using PHP together with Web Services. Bottom line is that you can use it in a productive environment together with SSL for login encryption or even SSO and with real productive solutions. I’ll see if I might be able track down some higher end solutions to share here on SDN. Craig like (0) Former Member April 3, 2006 at 10:02 pm In the SAP_Connection.php you miss a Kind regards, Ronald. like (0) Former Member April 3, 2006 at 10:10 pm In the SAP_Connection.php you miss a php definitiion at line 5. Kind regards, Ronald. like (0) Alvaro Tejada Galindo Post authorApril 4, 2006 at 5:45 am My mistake -:) Now it’s fixed…Thank Ronald. Greetings, Blag. like (0) Former Member October 13, 2009 at 8:53 am Hola Alvaro, Te Quiero hacer una consulta referente a una conexion de SAP con PHP, yo estoy haciendo mi aplicacion BSP, luego esta pagina sera colgada en internet, pero esta pagina esta hecha en php, quiero saber si existe una conexion PHP con SAP, ademas para poder enviarle los datos de user y pass(de sap dado que te los pide la aplicacion bsp cuando corre) para entrar al BSP. porfavor quisiera que me ayudes con este tema. si tuvieras un ejemplito seria chevere. like (0) Former Member November 16, 2010 at 6:32 am Hi there, Probably nobody will answer to this, but… I’d like to have a shot. I’m working in a very very very big company and bureaucracy is making anything impossible. The fact, is that I have SAP in my computer installed and it works pretty good, the problem is that I dont have the server address and the other parameters I need in order to connect to SAP through SAP-RFC via PHP. Is there any way to find out the characteristics of a connection that already happens in my computer? Thank you very much in advance. Greetings. like (0) Alvaro Tejada Galindo Post authorNovember 16, 2010 at 6:45 am Of course this is alive…a little bit old but I’m still here -;)If you have SAP on your computer…and you have SAPGui…then you have all the information you need…just go to your SAPGui, select the system you used to log-in and press “Change Item”…there you’re going to see the Application Server, System Number and System ID.If you have any further questions please let me know. Greetings,Blag. like (0) Former Member November 16, 2010 at 7:04 am Hey Mr Tejada, thank you for the fast answer hehe. It seems we could speak in spanish but let’s not make a language mess here. Well, next problem, I’m just a poor spanish guy working in germany, and all the ******* software is -of course- in german. And SAP is not the exception. I can not find the “Change Item” I guess is the button under the “Log on” button (or however it’s written in English), but it looks more like an “add system” button. There is on the left of Systems another thing like “connections”, but then again, no info is available. I guess these people are hiding as much as they can. Once I’m logged onto the system ,is it possible to get the data I need? I’m just a php developer, and this stuff of SAP is being a pain in the *** hehe. By the way, I’m pretty sure you know it, but it is not a good practice to write plain HTML code through PHP =) Thank you very much! y un saludo! like (0) Alvaro Tejada Galindo Post authorNovember 16, 2010 at 7:24 am Yes, I speak Spanish…but here we have to use only English…and please don’t use curse words…it’s completely forbidden here…I don’t know if there’s a way to get that info from SAP, but you should try looking for a file called SAPLogon.ini or something like that…it should contain the information.Or maybe you can download and install the NetWeaver Community Edition…it’s under Downloads…that’s why I use at home for all my personal projects…About passing plain HTML to PHP…I know that, but I’m just lazy -;) Greetings,Blag. like (0) Former Member November 16, 2010 at 7:32 am Perfect! I found the file .ini and it seems there’s all I need. It’s a bit strange that the server is not and IP or something like this, but just IDS_LAN. Anyway, I’m going to try. Hey, and I’m sorry for the rude words =) Thank you very much! Spanish regards from Germany.Bor like (0) Former Member November 16, 2010 at 8:05 am Hi there again, I tried to get as many data as possible from the .ini file you told me. There are several Items, so I looked for the one with the name of server I wanna connect, in my case: Item2… so going up and down I got these values: [Router],[Router2],[RouterChoice],[Server],[Database],[System],[Description],[Address],[MSSysName], [MSSrvName],[SessManKey],[SncName],[SncChoice], [CodepageIndex],[Origin],[MSSrvPort],[LowSpeedConnection],[Utf8Off]. Many of them are just empty or equal to 0. Ok, so we get back to the php file and try to fill the login array. This is my guess: $LOGIN = array ( “ASHOST” => [Server], “SYSNR” => [System], “CLIENT” => “001”, “USER” => “blablabla”, “PASSWD” => “1234”, “GWHOST” =>[Address], “GWSERV” =>””, “MSHOST” =>””, “R3NAME” =>””, “GROUP” =>””, “LANG” =>”EN”, //”TRACE” =>”” ); But it doesnt work. It gives me the following: ############ Warning: RFC Error Info : Group : 101 Key : RFC_ERROR_PROGRAM Message : Open file ‘C:\WINNT\sapmsg.ini’ failed in C:\xammpOLD\htdocs\SAPphpO\index.php on line 25Failed to connect to the SAP serverRFC Error Info : Key : RFC_IO5 Status : CODE=CM_PRODUCT_SPECIFIC_ERROR STATUS=??? DATA=??? ID=??? Message : Open file ‘C:\WINNT\sapmsg.ini’ failed Internal: IO HANDLE=20 DRV=EXT LINE=589 CODE=5 ########### I checked for the file sapmsg.ini and it does not exist. Could you give me a hand? =) Thanks a lot in advance, at least now I see it tries to connect. Greetings. like (0) Alvaro Tejada Galindo Post authorNovember 16, 2010 at 8:10 am I would need to check my NSP when I get home to analyze the ini file…will reply you tonight or tomorrow…but better send me an email…you can find it on my business card. Greetings,Blag. like (0) Leave a Reply Cancel replyYou must be logged in to post a comment.