Skip to Content

Tasting the mix of Flex, PHP and SAP

After reading Matthias Zeller excelent blog [Engaging User Interfaces with Adobe Flex | Engaging User Interfaces with Adobe Flex] I start my Flex learning process…So yes…I have studied Flex for the last 10 days or less…Anyway…I have come to learn and really love Flex…It’s simple, nice and productive.

I download this awesome Module Flex Module for Apache and IIS in order to test my Flex experiments on my Apache Server.[

As I usually do when I first learn a new Scripting Language, I have developed a SE16 Emulator by using Flex, PHP and SAP…I know that you might be asking yourselfs…”Did Blag said PHP? Why?”…It’s fair simple…I can’t use WebServices on my laptop’s MiniSAP 4.6D so I needed a way to connect to SAP and pass the information to Flex.

What we need to do? We must create a Login Class…


We need an Index php page too…

index.php<br />

<textarea cols=”90″ rows=”20″><?php



$_SESSION[“Server”] = $_POST[“myServer”];

$_SESSION[“Sysnum”] = $_POST[“mySysnum”];

$_SESSION[“Client”] = $_POST[“myClient”];

$_SESSION[“User”] = $_POST[“myUser”];

$_SESSION[“Pass”] = $_POST[“myPassword”];

$Login = new Login();

$Log_Me =  $Login->Log_In($_SESSION[“Server”],$_SESSION[“Sysnum”],


$RFC_Me = $Login->RFC_Connection($Log_Me);



     $Return = “<connections><connection>







$_SESSION = array();


$Login = new Login();





</p><p>Now, we can build our UI in Flex.


browser.mxml<br />

<textarea cols=”90″ rows=”20″><?xml version=”1.0″ encoding=”utf-8″?>

<mx:Application xmlns:mx=”” xmlns=”*”


<mx:HTTPService id=”userRequest”


useProxy=”false” method=”POST”>

     <mx:request xmlns=””>





<mx:Panel x=”10″ y=”10″ title=”SE16 Emulator”

width=”775″ height=”400″ layout=”absolute”>

     <mx:Label x=”60″ y=”10″ text=”Table” />

     <mx:TextInput x=”110″ y=”10″ id=”myTable” text=””/>

     <mx:Button x=”280″ y=”10″ id=”ShowData” label=”Show Data”



     <mx:DataGrid id=”dgData” x=”20″ y=”40″ height=”300″ width=”710″



               <mx:DataGridColumn headerText=”{userRequest.lastResult.connections.     

               connection.value}” dataField=”data”/>







</p><p>In order for this to work, we need to create our last php page…

</p><p>SE16.phpP.S you can download the source code from my public box Blag’s Box .


You must be Logged on to comment or reply to a post.