jueves, 9 de agosto de 2012

SUP on AWS - From Blag's point of view

The other day I read My 1st Sybase Unwired Platform app on AWS from Tobias Hofmann which is both a friend and an SAP Mentor. Tobias doesn't seems to be much happy with SUP on Amazon...so of course...I needed to test it myself.

Using the documentation from the all time guru Juergen Schmerder called Get your own Sybase Unwired Platform server on Amazon Web Services I was able to download the SDK and create my AWS image...which, to be honest, got broke as I made some silly mistakes...but it just took me a couple of minutes to clean up the mess, and create a new image that worked like a charm...I had my own SUP server up and running.

After I installed the Android emulator, installing the Sybase Workflow application wasn't hard at all...I simply need to call it like this...

Installing Sybase Workflow
<path_to>\adb install <path_to>\SybaseDataProvider.apk

The first thing I noticed as I was doing my first example, was something that Tobias experienced himself...a DLL was missing or couldn't be read...


I was really puzzled by this...I even log into the Remote Desktop to copy the file and create the same structure on my laptop...didn't work...until I found a comment from Pasquale de Angelis that magically solved the problem.

Now...I wanted to make a nice example, because reading from the flight tables is too mainstream...so I decided to do something else.

I thought about RFC_ABAP_INSTALL_AND_RUN but...one of input parameters is table, with an structure and even then the preview worked fine I couldn't really find a way to make it work using Personalization Keys...so...of course I create my own ZRFC_ABAP_INSTALL_AND_RUN.

UPDATE: RFC_ABAP_INSTALL_AND_RUN is not released as stated in https://service.sap.com/sap/support/notes/514998 and shouldn't be used on a productive environment. This is just an example on a blog and should be taken as it is.



I basically got rid of the input table and put 8 parameters to hold the source code to be executed.



With the RFC Function Module ready, I could get into the SUP hard work...and BTW...for this to really work I needed to create an empty program called ZTEST on my ERP system.


I create an MBO related to my FM and 8 Personalization Keys, one for each parameter.


I associate the Personalization Keys with the arguments on the MBO.




Inside the screen, I create the parameters and code submission menu.


A simple association of Personalization Keys and Parameter Keys to do the trick.

After that...which really didn't took more than 5 minutes, I was ready for the final test...running a simple ABAP program on Android...

ABAP LOOP
REPORT ZTEST.
DATA: COUNTER TYPE I.
DO 10 TIMES.
COUNTER = COUNTER + 1.
WRITE:/ 'Counter value is:', COUNTER.
ENDDO.



It worked just fine! So...no test can be completed without a more complex example...

ABAP_SELECT
REPORT ZTEST.
DATA: T_SPFLI TYPE STANDARD TABLE OF SPFLI.
FIELD-SYMBOLS: <FS_SPFLI> LIKE LINE OF T_SPFLI.
SELECT * FROM SPFLI INTO TABLE T_SPFLI.
LOOP AT T_SPFLI ASSIGNING <FS_SPFLI>.
WRITE:/ <FS_SPFLI>-CARRID, <FS_SPFLI>-CONNID.
ENDLOOP.



Cool, huh? I didn't have any connection problems with AWS...the service was very stable and reliable...after all, I have an SAP HANA Server and an R Server sitting next to my new SUP server.

Greetings,

Blag.


No hay comentarios: