Skip to Content

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.[
| http://labs.adobe.com/wiki/index.php/Flex_Module_for_Apache_and_IIS]

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…

Login_Class.php

We need an Index php page too…

index.php<br />

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

session_start();

include(“Login_Class.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”],

             $_SESSION[“Client”],$_SESSION[“User”],$_SESSION[“Pass”]);

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

if(isset($RFC_Me))

{

     $Return = “<connections><connection>

                  <value>Connected</value>

                  </connection></connections>”;

     print($Return);

}

else

{

$_SESSION = array();

session_destroy();

$Login = new Login();

$Login->Login_Page();

}

?>

</textarea>

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

</p><p>index.mxml

browser.mxml<br />

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

<mx:Application xmlns:mx=”http://www.adobe.com/2006/mxml” xmlns=”*”

layout=”horizontal”>

<mx:HTTPService id=”userRequest”

url=”http://localhost/SinglePath_Stuff/PHP_FLEX_SAP/SE16/SE16.php

useProxy=”false” method=”POST”>

     <mx:request xmlns=””>

          <myTable>{myTable.text}</myTable>

     </mx:request>

</mx:HTTPService>

<mx:Form>

<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”

     click=”userRequest.send()”/>

          

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

     dataProvider=”{userRequest.lastResult.tables.table}”>

          <mx:columns>

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

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

          </mx:columns>

     </mx:DataGrid>     

</mx:Panel>

</mx:Form>

</mx:Application>

</textarea>

</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 .

 

To report this post you need to login first.

11 Comments

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

  1. Dushyant Shetty
    Nice, my curiosity on Scripting and Flex continues to increase !
    Quite an impressive motivator for us “Don’t know where to start” types…

    Regards,

    Dushyant

    (0) 
  2. Former Member
    Well Done.
    I like the new possibilities that Flex offers and I want to test and experiment with flex myself.
    How can I get a test version, ’cause I acctually dont know where to start. Do I need to use the Java Stack of SAP or can I do it with the ABAP Stack?
    (0) 
  3. Matthias Zeller
    Hello Alvaro,
    I am impressed. All this in just a couple of days. Good work. Exciting to see all the various Flex projects going on in the SAP eco-system.

    Cheers,

    Matthias

    (0) 
    1. Alvaro Tejada Galindo Post author
      Thanks a lot Matthias -:) I came to learn and love Flex in a short time…Of course…I’m just beginning…There’s a lot to learn an a lot of Flex, PHP and SAP integrations to do -;)

      Greetings,

      Blag.

      (0) 
  4. Former Member
    Hi Blag,

    Nice one. Just thinking maybe you can try use states in Flex. Create a state for login and after login, create another state and show the datagrid. I dont know what the returned result are. Maybe you can use datafield in the each data column to map your returned data. I will download your source code and play around it.

    Just one question, I am using MacBook, so dont know if I can try to get a trial version of SAP to do the test.

    Michael

    (0) 

Leave a Reply