Please, Don’t Call Them RESTful

At the beginning of 2000, Douglas Crockford claimed that JavaScript was the World’s most misunderstood programming language. The reason for this misunderstanding was mainly due to bad naming, design errors, non-strict standard, etc. So, the misunderstanding was almost natural.

Last year I tweeted something similar about the REST architectural paradigm. https://goo.gl/KQJqmB #DataIntegration #ML

ABAP and Swagger/OpenAPI

Swagger

Swagger is a set of tools for creating, generating, documenting, and testing RESTful services.
It is centered around a specification file(https://swagger.io/specification/), which contains the description of the REST services, much like a SOAP WSDL or OData metadata file.

There are many powerful tools in the Swagger family, which all are open source:

* Editor
* UI
* Inspector

These tools are free and works in the browser. SAP also use Swagger as part of API management.

ABAP

A while ago I started building a tool for integrating ABAP and Swagger using an inside-out approach.

Lets jump right into it and see how it works, suppose I want to expose the methods of the following class as REST services: CLASS zcl_todo DEFINITION PUBLIC CREATE PUBLIC. PUBLIC SECTION. METHODS create IMPORTING is_data TYPE ztodo_data RETURNING VALUE(rs_key) TYPE ztodo_key . METHODS delete IMPORTING is_key TYPE ztodo_key . METHODS list RETURNING VALUE(rt_list) TYPE ztodo_tt . METHODS update IMPORTING iv_guid TYPE ztodo_key-guid is_data TYPE ztodo_data . ENDCLASS. CLASS ZCL_TODO IMPLEMENTATION. METHOD create. DATA: ls_todo TYPE ztodo. TRY. rs_key-guid = cl_system_uuid=>if_system_uuid_static~create_uuid_c22( ). CATCH cx_uuid_error. ASSERT 0 = 1. ENDTRY. MOVE-CORRESPONDING rs_key TO ls_todo. MOVE-CORRESPONDING is_data TO ls_todo. INSERT ztodo FROM ls_todo. ASSERT sy-subrc = 0. ENDMETHOD. METHOD delete. DELETE FROM ztodo WHERE guid = is_key-guid. ASSERT sy-subrc = 0. ENDMETHOD. METHOD list. SELECT * FROM ztodo INTO TABLE rt_list. “#EC CI_NOWHERE ENDMETHOD. METHOD update. DATA: ls_todo TYPE ztodo. ls_todo-guid = iv_guid. MOVE-CORRESPONDING is_data TO ls_todo. UPDATE ztodo FROM ls_todo. ASSERT sy-subrc = 0. ENDMETHOD. ENDCLASS.

Interface ZIF_SWAG_HANDLER must be implemented, and metadata added for the methods to be exposed, METHOD zif_swag_handler~meta. FIELD-SYMBOLS: LIKE LINE OF rt_meta. APPEND INITIAL LINE TO rt_meta ASSIGNING . -summary = ‘List’(001). -url-regex = ’/list$’. -method = zcl_swag=>c_method-get. -handler = ‘LIST’. APPEND INITIAL LINE TO rt_meta ASSIGNING . -summary = ‘Create’(002). -url-regex = ’/create$’. -method = zcl_swag=>c_method-post. -handler = ‘CREATE’. APPEND INITIAL LINE TO rt_meta ASSIGNING . -summary = ‘Delete’(003). -url-regex = ’/delete$’. -method = zcl_swag=>c_method-post. -handler = ‘DELETE’. APPEND INITIAL LINE TO rt_meta ASSIGNING . -summary = ‘Update’(004). -url-regex = ’/update/(w+)$’. APPEND ‘IV_GUID’ TO -url-group_names. -method = zcl_swag=>c_method-post. -handler = ‘UPDATE’. ENDMETHOD.

Add the handler to a custom SICF node, and thats about it! ABAP-Swagger will automatically generate a spec from the method definitions, and it is possible to use the Swagger UI to test the services. ABAP-Swagger is open source and works from 702 and up.

The full example can be found at https://github.com/larshp/todo_logic

Find more Open Source ABAP projects on dotabap.org

ABAP is like the sun, it will keep shining for a million years http://bit.ly/2F0KrFM #SAP #SAPCloud #AI

Thoughts on what’s next for the SAP Community

I originally posted this content on my own blog* over here: Thoughts on what’s next for the SAP community. I’ve since been encouraged, not least by folks managing this community like Jerry Janda, to post that content here too.

Too much? Never! As you wrote: “[W]ithout content, there is no community.” I’d love to see this blog on #SAPCommunity too. Your perspective on the video is a great read.

— Jerry Janda (Work) (@workjerryjanda) February 4, 2018

I don’t usually cross-post, but this is perhaps important enough to make an exception. So here is the post, in its brief entirety.

Thoughts on what’s next for the SAP Community

This evening I watched a short video, What’s Next for SAP Community?, with Björn Goerke, Chief Technology Officer and President of SAP Cloud Platform, and Thomas Grassl, Head of Developer Relations, laying out the vision for the SAP Community. Here are some brief Friday night thoughts.

I have been involved in building and helping the SAP community (small ‘c’) grow for a long time, from mailing lists in the 1990’s, through co-creating the original SAP Developer Network and seeing the changes through the SAP Community Network to become simply the SAP Community (see The SAP developer community 10 years ago, a post from 2005).

It’s been great to see Developer Relations and the SAP Community moving under the wing of the office of the CTO, and with the backing of CEO Bill McDermott, there’s certainly more than enough torque and momentum upon which to build.

The chassis has undergone some significant welding in recent years, but the current remodelling, while still needing some love and attention, is so much better for content creators. And without content, there is no community. I’m hopeful that the chassis and bodywork will go from strength to strength, especially with the recently announced 2018 redesigns, and we see the rebirth of interconnectivity.

What struck me most about listening to Björn and Thomas on the video just now was my perception of the sense of community being the strong, implicit anchor for the message and the vision. So I decided to transcribe the video, to perform a simple text analysis.

The transcription is here, and we can see from some simple textalyser analysis that the perception wasn’t too far off – the top five places for word frequencies in the entire piece are (with occurrences in brackets):

1: “our” (12)
2: “community” (10)
3: “sap” (6)
4: “how”, “new”, “customers” (5)
5: “need”, “think”, “help”, “content” (4)

Now it’s a short dialogue so perhaps this analysis needs to be taken with a pinch of salt, but it certainly occurs to me that the core message, and the core task, is getting people and knowledge connected.

We can do that, can’t we?

* yes, blog. Short for weblog. Often an entire website section (like this one), with a multitude of articles. Not an individual article or post. A blog is a collection of posts. Not a single post. Got that, community? http://bit.ly/2EYZTSz #SAP #SAPCloud #AI