Skip to Content
Author's profile photo Tobias Hofmann

Run the SUP 101 example in your AWS SUP instance

You have SUP running on AWS, now what? The easiest way is to run HWC apps, but what about native apps? SAP provides example apps here on SCN, called SUP101. But how can you run these using your SUP instance?

The SUP101 files you can download (MBO, native, HWC code) are based on the SUP documentation. I will use as the target platform Android, so the SUP guide to follow is the one for the Android scenario. The complete example code for all platforms is available here on SCN.

Using the SUP101 example can be as easy as download, unzip, import, deploy, run. In my case I use a local SUP SDK and a SUP instance on AWS, connected via VPN. Because of this I’m using custom connection profiles for SUP and the sample DB in my SDK. I’m also using my own Eclipse for Android development and did not install ADT into SUP SDK. In case you are using a similar setup, the blog outlines how to adjust the SUP101 example.

Configure MBO

Download and import the MBO project into SUP SDK. The MBO used in the SUP101 example is using the sample DB. The connection parameters of the MBO are defined in the attribute list: Data Source. Normally you do not have to changes these parameters for two simple reasons:

  1. The default name of the data source is My Sample Database. When you are using this data source for the SUP Sample DB connection you are good
  2. When you deploy the MBO you define the server mapping for the connection. Even when your data source to sampledb differs you can just deploy it to get the MBO working.

On the other hand, when you have a custom SUP connection (AWS IP or VPN) it is a good idea to adjust the MBO connection also so you can modify the MBO later. Adjust the connection settings to use your SUP server.

/wp-content/uploads/2012/08/sup101aws1_130043.jpg

Click o Change Connection Profile and select the data source you created for your SUP instance.

/wp-content/uploads/2012/08/sup101aws2_130044.jpg

The wizard takes care of the rest, including mapping of the operations.

/wp-content/uploads/2012/08/sup101aws3_130045.jpg

Do this for both MBOs included in the SUP101 example project. Just a reminder: the SUP server must be online and reachable for this kind of operation:

/wp-content/uploads/2012/08/sup101aws4_130046.jpg

That’s it. The SUP 101 MBO is now using your SUP server. When you deploy you have to map the local MBO connection to the sampledb connection created on the server:

/wp-content/uploads/2012/08/sup101aws5_130047.jpg

Native Android app

Download the example SUP101 Android code from SCN. Import the SUP101 example for Android in your Eclipse that you normally use to develop Android apps (read: ADT, AVD already installed, configured and known to work). The online documentation for SUP states that you can install the Android SDK into SUP SDK, but when you are used to use your normal Eclipse installation for Android development you should use that SDK.

Unzip the project and import it into Eclipse. After importing the project this is how your Eclipse should show it:

/wp-content/uploads/2012/08/sup101aws6_130049.jpg

Adjust the build path of the project:

/wp-content/uploads/2012/08/sup101aws7_130048.jpg

In the native app you’ll have to adjust the connection parameters:

  • Package: com.sybase.sup.samples.objectapi
  • Class: SUP101SampleActivity.java

Change the SUP connection parameters:

private static String USERNAME = "user";
private static String PASSWORD = "pass";
private static String HOST = "IP of SUP";
private static int PORT = 5001;

Now you can run the app in the simulator.

/wp-content/uploads/2012/08/sup101aws8_130050.jpg

Detail screen:

/wp-content/uploads/2012/08/sup101aws9_130051.jpg

Changing the data:

/wp-content/uploads/2012/08/sup101aws10_130052.jpg

Check that the change is applied on the server. Use SUP SDK to examine the content of the db table customer:

/wp-content/uploads/2012/08/sup101aws11_130053.jpg

You have now a running SUP101 example project on your SUP AWS instance!

Assigned Tags

      6 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Jorge Cepeda Mallett
      Jorge Cepeda Mallett

      Tobias,

      We downloaded the SUP101 and imported into SUP environment in cloudshare but we got the following error.

      Creating connectiosn to My Sample Database has encountered a problem

      Error JZ006... Connection refused connect

      regards

      Author's profile photo Tobias Hofmann
      Tobias Hofmann
      Blog Post Author

      Jorge,

      looks like the sample db is down. Get in contact with the people responsible for the cloudshare SUP trial. The above blog is about SUP on AWS.

      Author's profile photo Former Member
      Former Member

      Hello,

      I am new in SAP Please help me to create new customer.

      Author's profile photo Former Member
      Former Member

      Hello Tobias,

      I came across your sample code and was trying the same at my end. I followed all your steps and while executing it, I landing with the below mentioned error. Could you please look into it and provide guidance?

      Author's profile photo Tobias Hofmann
      Tobias Hofmann
      Blog Post Author

      The error message suggest that some Sybase Java classes are missing. Did you imported the sample app successfully?

      Author's profile photo Former Member
      Former Member

      Hello Tobias,

      Yes, I imported the Sample app successfully by following all steps mentioned by you in this forum.