Thursday 7 September 2017

ABAP Continuous Integration – the backend

Short read


In this blog the creation of an Odata Service is shown which can be used to get the unit test data of an ABAP Netweaver system.

To get the information whether all tests of a package are valid or not the ABAP class cl_aunit_adt_res_test_runs is used. The code to extract the package status is available on github: https://github.com/andau/zabap_ci and can be imported with abapGit.

Also the code for the endpoint is available on github, see https://github.com/andau/zabap_ci_ep. But as this is a standard Gateway service which generated a bunch of code the best way to create the gateway service is certainly the tool SEGW (see a step by step explanation for an ABAP 7.5 system below).

In any case the target of this blog is to get a running Odata-Service http://YOUR_SERVER:PORT/sap/opu/odata/SAP/ZABAP_CI_EP_SRV/AbapCiSummarySet(‘ZABAP_CI’) where ‘ZABAP_CI’ is the package name for that the unit test data should be retrieved.

Long read


Odata Service created with the SAP Gateway Service Builder

To create an Odata service the first step is to create a package. See below some sample values – but feel free to use your own coding conventions.

SAP ABAP Certifications, SAP ABAP Tutorials and Materials, SAP ABAP System, SAP ABAP Development

The central element of the Odata service is the Data model. For this Odata service a structure is used: zst_abap_ci_summary.tabl.xml

SAP ABAP Certifications, SAP ABAP Tutorials and Materials, SAP ABAP System, SAP ABAP Development

In ABAP 7.5 the activation (or registration) of a service is literally one click. Under Service Maintenance you can use the Register button to make your service public available.

SAP ABAP Certifications, SAP ABAP Tutorials and Materials, SAP ABAP System, SAP ABAP Development

To test if the service is up and running the transaction

SAP ABAP Certifications, SAP ABAP Tutorials and Materials, SAP ABAP System, SAP ABAP Development

After finishing the above steps and ensuring that the service is up the service can be used to provide the unit test status of a package to external systems.

No comments:

Post a Comment