Skip to Content

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 SMP 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 SMP 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…

WorkflowClient_Error.png

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.

ZRFC_ABAP_INSTALL_AND_RUN_001.png

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

ZRFC_ABAP_INSTALL_AND_RUN_002.png

ZRFC_ABAP_INSTALL_AND_RUN_003.png

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

AWS_SUP_ABAP_CODE_000.png

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

AWS_SUP_ABAP_CODE_001.png

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

AWS_SUP_ABAP_CODE_002.png

AWS_SUP_ABAP_CODE_003.png

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

AWS_SUP_ABAP_CODE_004.png

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.

AWS_SUP_ABAP_003.png

AWS_SUP_ABAP_004.png

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.

AWS_SUP_ABAP_001.png

AWS_SUP_ABAP_002.png

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 SMP server.

To report this post you need to login first.

5 Comments

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

    1. Alvaro Tejada Galindo Post author

      Thomas:  I’m aware of it, but I wanted to show a nice example of what can be done with SUP on AWS. I however, will add that restriction on my blog.  Greetings,  Blag.

      (0) 
    2. Ethan Jewett

      Since one of the “solutions” in the note is “Implement a customer-specific function module and adapt the programs used to this function module”, I think Blag is just following the recommendation that SAP provides by using ZRFC… 😉

      (0) 
      1. Thomas Jung

        I disagree.  Remote code execution is something that should only be done very rarely and with extreme caution. Although the note may say “Implement a customer-specific function module and adapt the programs used to this function module” it isn’t making a recommendation that this is something that is good to do. I would hope that any customer making a customer-specific version of this function module is carefully considering its usage and how to control/restrict it. 

        However the case here is different.  Blag is an SAP employee and is using this function module (or a copy of it) as the basis of his example.  One could easily assume that examples and demos from SAP employees represent best practice or recommended approaches. That should not be the case in regards to the example given here.

        (0) 
        1. Ethan Jewett

          I agree, and I’m really just pulling your leg 🙂 My point was that its probably worse to have this sort of recommendation in the official note (especially as currently written) than in a blog that is pretty clearly off-the-cuff.

          Ideally stuff like this shouldn’t show up in either venue, but IMO the note should read a lot more like your comment here and a lot less like it currently does. As it stands, the note is badly done. If the note doesn’t explain why you shouldn’t use the function module (like you do here), then many people who read it will assume it is OK to follow the note’s suggestion to replicate the behavior in a customer function module.

          (0) 

Leave a Reply