Skip to Content
Author's profile photo Alvaro Tejada Galindo

Build a Mobile App with PowerBuilder (or at least try it…)

Disclaimer: This blog is just a test. An attempt to build something that doesn’t represent SAP or Sybase in any way.

While I was on SAP TechEd Las Vegas, someone asked me if he could use PowerBuilder to build Mobile Applications…at that time I sincerely replied him that I didn’t had idea, but I was going to work on it as soon as I had some time. This blog is a product of that…

I first start doing some research on the web, and I found that Pocket PowerBuilder was used for this purpose, but now it’s discontinued. So I kept looking…

Then I found Appeon Mobile for PowerBuilder, but it’s a not free product and I didn’t really want to make any marketing pitch, so I choose to do something else…

PowerBuilder now provides .NET Web Forms Applications which basically turns our application on a ASP.NET webpage, that could be rendered on a mobile device, so that’s the approach I chose for this blog.

Before we start, let’s make clear that I’m not a Web Developer nor a PowerBuilder developer so my experience in both is kinda limited.

When I first start doing my testing, I really had a lot of troubles and headaches, so here’s what I did so you don’t need to suffer the same way I did…

Web_PB_HANA_01.png

If is not already activated, we need to activate some services, so let’s go to Control Panel –> All Control Panel Items –> Programs and Features and then Turn Windows features on or off.

Web_PB_HANA_02.png

From the Application Development Features choose .NET Extensibility, ASP, ASP.NET, ISAPI Extensions and ISAPI Filters.

Then go to Run –> inetmgr and do the following.

Web_PB_HANA_03.png

Double click on ISAP and CGI Restrictions and allow everything.

Web_PB_HANA_04.png

Now, we’re ready to move to PowerBuilder. For this, we will need a connection to an SAP HANA system. If you don’t know how to do this, please refer to my blog PowerBuilder – The new kid on Developer Center’s block.

Create a new application and choose .NET Web Forms Application. The application is going to be called web_pb_hana.

Web_PB_HANA_05.png

Choose Grid and then SQL Select.

Web_PB_HANA_06.png

Web_PB_HANA_07.png

On the screen, simply choose CARRID and then Design –> Disctinct.

Web_PB_HANA_08.png

Call this one dg_carrid.

Next, create a another one but this time choose External and call the parameter Carrid.

Web_PB_HANA_09.png

On the screen we need to tell that the DataWindows is going to be dg_carrid (so it knows from where to fetch the data) and also specify carrid as both Display and Data Columns. One important thing is to check the options Always Show Arrow, Vertical Scroll Bar and AutoRetrieve.

Web_PB_HANA_10.png

Call this one ff_params.

Next, create one last DataWindow, Grid again and SQL Select again.

Select MANDT, CARRID, CONNID, COUNTRYFR and COUNTRYTO.

Choose Design –> Retrieval Arguments (This is very important as it will allows us to pass the values of the Drop Down control to our report). Name it Carrid.

Web_PB_HANA_11.png

Web_PB_HANA_12.png

In the Where tab fill in the parameter and the argument. Call this one dg_report.

Now, we can go and create a Window.

Web_PB_HANA_13.png

On the Layout we might to simply drag and drop the dd_report and the ff_params.

Web_PB_HANA_14.png

Call this dg_window. The button will be called btnreport.


Now that we’re ready with our Layout, we need to go back to our Database Painter and copy the Preview generated by the SAP HANA connection.

Web_PB_HANA_15.png

Double click on the application icon and copy the following code (the first part is done by pasting the Preview the copied before).

Web_PB_HANA_15_1.png

Now, double click on dg_window and then double click on btnreport.

Web_PB_HANA_16.png

Go back to the dg_window layout and right click to choose Script.

Web_PB_HANA_17.png

We now can run it and it will of course open a browser.

Web_PB_HANA_18.png

Web_PB_HANA_19.png

Next job, is to open it on an emulator, so let’s grab the Android Emulator and instead of passing the localhost address, use 10.0.2.2/web_bp_hana.

Web_PB_HANA_20.png

For some reason…it will ask as to open a new window.

Web_PB_HANA_21.png

Web_PB_HANA_22.png

Actually…this doesn’t work…when you choose the Carrid and press the Show Report button, you will see some loading, but then nothing…I guess it has to do with the rendering as we’re passing an ASP.NET page.

Web_PB_HANA_23.png

Anyway…I tried with the BlackBerry emulator and it was even worse…it didn’t even wanted to connect to the main page…so…I think to myself…ASP.NET? Windows Phone should work fine…

For the Windows Phone, you can keep passing localhost, which is a good thing.

Web_PB_HANA_24.png

As you can see…it really looks small…but at least it works…

Web_PB_HANA_25.png

Web_PB_HANA_26.png

As I already said…I’m not a Web Developer…so I don’t know if this can be fixed on the generated ASP.NET page or not…so I simply went back to PowerBuilder and make everything bigger…Font 24 was my key….

Web_PB_HANA_27.png

So…at least it looks a little bit more descent…

Anyway…here you have an application build on PowerBuilder that run on a Windows Phone and read data from SAP HANA


Assigned Tags

      19 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Former Member
      Former Member

      Great blog Alvaro! I interest in PB but waiting for next version!

      Author's profile photo Alvaro Tejada Galindo
      Alvaro Tejada Galindo
      Blog Post Author

      Me too man...me too 🙂

      Greetings,

      Blag.

      Author's profile photo Witalij Rudnicki
      Witalij Rudnicki

      Hi Blag. There is nothing more interesting as reading try/fail/success blogs with new things! Kudos!

      Would be great to get some more comments from core PB developers as well.

      Author's profile photo Alvaro Tejada Galindo
      Alvaro Tejada Galindo
      Blog Post Author

      Vitaliy:

      Thanks for the comment 🙂 For sure it would be great...I actually don't see many PB people here, which is sad...we should have more blogs and experiments around PB...some people ask..."Isn't PB dead?" I'm sure it's not...it's just need more people to show what can be achieved and why it's more alive than ever 😉

      Greetings,

      Blag.

      Author's profile photo Former Member
      Former Member

      I'm trying to do very similar things to you using PB and HANA with JDBC.  I noticed in your connection string "...amazonaws.com:30015...".  Where is the 30015 from?  Is that something unique to the AWS connection?

      I am so far unable to connect via jdbc to HANA running on AWS.

      Thanks

      Author's profile photo Witalij Rudnicki
      Witalij Rudnicki

      3XX15 is HANA db's port to for calls. XX is the HANA db instance number, in the Blag's case it was system 00, but you need to use your HANA instance number.

      Author's profile photo Alvaro Tejada Galindo
      Alvaro Tejada Galindo
      Blog Post Author

      Matt:

      Vitaliy is right. You need to pass the full address to make it work. Have you also assigned the JDBC library in PowerBuilder? http://scn.sap.com/community/developer-center/hana/blog/2012/08/24/powerbuilder--the-next-kid-on-developer-centers-block

      Greetings,

      Blag.

      Author's profile photo Former Member
      Former Member

      The only way I could get past the error was to modify the classpath to include the full folder/filename ie, "C:\Program Files\SAP\hdbclient\ngdbc.jar".  Putting "C:\Program Files\SAP\hdbclient" in PB did not work when I attempted a connection.

      I'm still getting errors with the connection even with the full path.  The message is "No Suitable driver found for jdbc:sap//xxxxxx.compute-1.amazonaws.com:30015"  I'm trying to find something else I can test JDBC connections other than PowerBuilder.

      Author's profile photo Alvaro Tejada Galindo
      Alvaro Tejada Galindo
      Blog Post Author

      Matt:

      That's weird...I have neved specified the full path...anyway...can you validate that you're using the right version of the SAP HANA Client? 32bits vs. 64 bits. In my case I used the 64bits one.

      I had similar problems when I was writing my blog on SAP HANA and .NET

      Greetings,

      Blag.

      Author's profile photo Former Member
      Former Member

      I made sure I used the 64 bit driver in my CLASSPATH designation but it still doesn't work.  Is there some way to tell if I'm running 64 bit java (if that even matters)?

      I'm dead in the water if I can't connect PowerBuilder to my HANA AWS instance.

      Matt

      Author's profile photo Alvaro Tejada Galindo
      Alvaro Tejada Galindo
      Blog Post Author

      Matt:

      Well...when I go to CDM and type "java -version' I got the following:

      java version "1.7.0_07"

      Java(TM) SE Runtime Environment (build 1.7.0_07-b10)

      Java HotSpot(TM) 64-Bit Server VM (build 23.3-b01, mixed mode)

      Not sure if it has something to do or not...like I told you...I only pass C:\Program Files\sap\hdbclient as the Java Classpath, the driver com.sap.db,jdbc.Driver as the Driver Name and my AWS SAP HANA path as the URL and that's it...I have never had a problem with it...

      This is the document that I read when I first was trying to connect PB with SAP HANA

      http://www.scribd.com/doc/96729799/35/Integration-of-the-JDBC-Driver hopefully it might help...

      Greetings,

      Blag,

      Author's profile photo Former Member
      Former Member

      FYI: The PowerBuilder Webforms feature - that this article was based on - has been discontinued as of PB 12.5.2!

      Author's profile photo Former Member
      Former Member

      Great info! thanks Alvaro!

      Author's profile photo Former Member
      Former Member

      I'd like to know if it is possible to develop android application with powerbuilder.

      Author's profile photo Alvaro Tejada Galindo
      Alvaro Tejada Galindo
      Blog Post Author

      I'm not a PowerBuilder expert...so I really don't know...I assume you can as PB runs on .NET and with xamarin you can create Android apps...it would be just a matter of trying yourself 🙂 and sharing your results of course 😉

      Greetings,

      Blag.

      Development Culture.

      Author's profile photo Former Member
      Former Member

      Yes I can develop application to .NET and run it on IIS, but it is better if it is android native application. That's why I ask it.

      Author's profile photo Former Member
      Former Member

      Hi Dev;

      A1: Just PB Classic or PB.Net ......  NO

      A2: Using Appeon that installs into the PB Classic IDE .... YES    😉

      Appeon Mobile - Appeon - PowerBuilder Tools, Native Mobile & Web Development platform, Professional Service

      HTH

      Regards ... Chris

      Author's profile photo Former Member
      Former Member

      Thank's I'll try it and say here my advanced

      Author's profile photo Agustin Adolfo Calderon Coronado
      Agustin Adolfo Calderon Coronado

      Could you post a version of this for Appeon Mobile