Tag Archive | php


Recently as I’ve dug more and more into HANA (how could I not with Tom and Rich publishing so many cool things?) I found that I could take many of my existing demos from PHP and MySQL and port them to HANA. The pain though has always been migrating DB content so I decided to make a simple little tool to make life easier.

It was during the SAP InnoJam event in Madrid that I sat down and coded something that I was able to test with Rich’s help, HOWEVER this is not something SAP supports or even validates or approves this is just me and my own HANA Cloud instance having some fun and deciding to share!

GitHub - Move to HANA

GitHub – Move to HANA

I call it Move to HANA and you can find the code on GitHub. It’s fairly simple and I used JQuery Mobile (don’t hate me SAP UI5 lovers) to put it together, just upload it to your PHP server and run it.

The idea behind it, is to give a simple migration tool that will help generate the HANA specific SQL to get your same tables and fields generated and your data uploaded via the HANA Studio. Right now it’s setup for MySQL but is easily expanded for any DB you are working on; oh and of course it’s not 100% yet it’s only got a handful of the different field types but hey – it’s GitHub go ahead and make some changes!

As for execution – again very simple.

Database selection

Database selection


Once your select your database then you will need to log into the database to select which “database” you want to migrate.

Login into your database

Login into your database


Then select your “database” at which point the script will generate the 3 step process for data migration.

Simple 3 Steps

Simple 3 Steps


Step 1, will provide your the “copy and paste” script you need to enter into your HANA Studio.

HANA SQL to generate SCHEMA

HANA SQL to generate SCHEMA

Step 2, will provide the command line code for MySQL to generate the CSV files you can then upload via the HANA Studio

Command Line for MySQL Dumps

Command Line for MySQL Dumps

Step 3, will provide the SQL command to ensure the proper permissions for the newly generated SCHEMA


SCHEMA permissions

SCHEMA permissions

I’ve used the script a dozen times already to get sample data and other MySQL data moved into HANA to allow myself more and more opportunities to try my hand at HANA coding and it’s worked quite well. If you give a try feedback would be great and if you find new data types or if you want to try a different database than MySQL by all means have at it!!


** SAP does not support nor endorse this tool and there is no support other than the very little free time that I personally have to answer comments. **


The SAP Developer’s Guide to PHP Originally uploaded by Craig Cmehil.

The book is old however it still pertains to the topic and based on the fact that I’ve received more comments (last one this morning) to the original thread and the reposted one than anything else I thought it might be best to remind everyone there’s a book available to help you as well.

In addition to the book you can find a ton of resources over on the SAP Developer Network in the PHP forum and the Scripting Languages wiki.

If you still need help be sure to hollar!

To order just go check the website, SAP PRESS or Amazon.

New SAP PHP framework?

What’s this? Seems that some folks over in the SAP Developer Network (SDN) are working on a new framework for SAP and PHP, the SAP Network Wiki is a being developed as complete transaction based framework around the SAP transactions.

As you may see…My main goal is to develop an SAP PHP based Framework, name it SAPHP, or something else. Of course, a lot of work must be done and a lot of things must be improved…For example:

  • SE11 –> Be able to create Tables, Domains, Data Elements. 
  • SE10 –> Be able to create new Transport Orders.
  • SE38 –> Be able to create programs and save them on SAP.
  • ST22 –> Be able to read the Short Dump information.

Something to take a peek at and maybe keep one eye on for awhile to see where it goes…

Connect PHP to SAP

In the current issue of the International PHP Magazine their is a very nice tutorial done how connecting PHP with SAP, those who attending the Las Vegas SAP TechEd might have seen this tutorial for those who missed it there I highly recommend checking out the current issue and take a look.

It combines the basics of PHP and AJAX with the power of an SAP backend, the beauty of the tutorial is the ease of use and the hint of what is possible with the versitility of PHP and the flexibility of SAP.

Why should I use PHP with my SAP landscape?

I get this question a lot, and in fact since SDN is becoming more noticeable in the outside world and the fact that we have a growing and strong community and a decent size library of information, the question seems to be popping up more and more of late.

Why should I use PHP in my SAP landscape?

Well the bottom line is this, and I know that if someone really wants to make me look bad they’ll post this way out of context, “You should not use PHP in your SAP Landscape”, now the rest of it for those of you interested in the whole story. You should not use PHP in your SAP Landscape if you don’t already have it. No one, myself nor SAP is actually telling you to run out and learn everything you can about PHP. What is being said is simply this, “if you have PHP already in your landscape you don’t need to run out and learn something else”.

A lot of times someone will hear that they are installing SAP so they do a search and find all this information related to ABAP, Java, .NET so on and so forth so they think that all that work they’ve already done in PHP for their internal applications will have to be redone, removed or replaced. This is simply not the case, and that is the message I’ve been trying hard to get across. If you have PHP knowledge in house already and add SAP to the mix then you can still leverage that PHP knowledge and do not need to retrain all your developers in something other than the basics of how a SAP system works.

In fact with the release of NW04s the support for Web services is tremendous and therefore might make life even a little easier for your developers.

OK this was a lot shorter than I was thinking but I don’t want to confuse the bottom line message with clutter.

So I’m a PHP developer and my company runs SAP now what?

So you’re a PHP developer and your company is running SAP, the problem though is you have no clue about SAP or what it does – you are curious though. The following are a few tips on making the cross over from building web applications to building SAP based web applications using PHP.

I won’t pretend to be an expert on how things work in the corporate/enterprise world nor will I even attempt at telling you how to do something inside your company. What I intend to do is is give you some tips/suggestions on approaching your SAP administrative team and ABAP developers in order to get you started.

Ok so let’s get some basics out of the way and then move into some possible secanrio’s on getting started. Read More…