Skip to Content
Author's profile photo Lars Hvam

Call HANA Orion API from ABAP

Some months ago Thomas Jung introduced the REST API for the SAP HANA Repository. I’ve implemented a client in ABAP that uses the REST API, it includes a simple GUI that lets you edit files on the HANA server.

/wp-content/uploads/2015/04/editor_687390.png

Clicking save will call the API and the code is saved on HANA.

/wp-content/uploads/2015/04/web_687391.png

I’ll not recommend using the ABAP editor for XSJS development, as it is just a simple text editor that doesn’t know about javascript.

The following example shows how a file can be created from ABAP using the API,

DATA(lo_factory) = NEW zcl_orion_factory( iv_url      = p_url

                                          iv_user     = p_user

                                          iv_password = p_passw ).

DATA(lo_file) = lo_factory->file( ).

lo_file->file_create( iv_path = ‘foobar/’

                      iv_name = ‘asdf.txt’ ) ##NO_TEXT.

lo_file->file_update( iv_path = ‘foobar/asdf.txt’

                      iv_data = ‘Hello’ ) ##NO_TEXT.

The code doesn’t work with HCP, I haven’t had any luck getting past the SAML authentication from ABAP.

larshp/abapOrion · GitHub

Assigned Tags

      Be the first to leave a comment
      You must be Logged on to comment or reply to a post.