In this article, we’ll take a look at 2 artificial intelligence tools for generating ABAP code.

  • SAP Joule
  • Github Copilot

SAP Joule

For this example, I’ve followed the tutorial provided by SAP.

We’re going to create a RAP application to manage a library.

1/ Via BTP ABAP Environment, access the Generate ABAP Repository Objects function.

2/ Access the generator to create RAP objects via AI: Odata UI Service Supported By AI

3/ Enter the Prompt that describes your need for business Object (here the Prompt provided for the creation of the Library BO).

4/ This will generate the necessary objects ( Database Table / CDS / Behaviors / Service Definition / Service Binding )

5/ Then bring us to the service binding level, where we can publish the application.

6/ Next, access the Fiori application preview.

Discussion:

This feature is one of 4 that SAP Joule offers:

SAP Joule is therefore also able to support you in your day-to-day development as if you were working in Peer Programming.

SAP Joule for ABAP is currently not available on S/4 Hana On Premise systems, but is planned for Q1 2025 on Cloud systems (Private / Public / BTP).

Finally, to access SAP Joule, the ABAP environment must be connected to the SAP AI Core service -> Costs

Github Copilot

To install and configure Github Copilot for Eclipse, go HERE.

Github Copilot is to be considered as a Pair Programmer that helps in writing code, resolving errors, explaining existing code, writing tests, etc…

Here are a few examples in ABAP.

First of all, check that ABAP is enabled in Copilot4Eclipse languages:

1/ Code writing help

Here, we’ve created an abap class and want to add a method that divides a number by 2 :

  • By entering the comment: *Create method to dive a number by 2

Github Copilot offers a code :

Which can be accepted by pressing the TAB key.

  • Then Github Copilot also suggests that I fill in the DEFINITION part of the class.

2/ Code explanation

You can then select a part of the code to request an explanation of these functions.

3/ Correcting errors

Here we see that Github Copilot explains and reports an error. We can now ask for the error to be corrected

Then copy and paste the new code into the class.

4/ Adding references

If the code to be analyzed calls methods from other classes, you can add these so that Github Copilot is aware of them.

5/ Generating test classes

In the same way as above, you can request the creation of test classes.

Here, after a little reworking of the proposal made by Github Copilot :

Discussion:

Copilot4Eclipse is not an official Eclipse extension ( Whereas VS Code has the official extension ), so there are still a few problems related to this extension

Sometimes we have to reference the class we want to analyze in the chat and specify in the request which part of the code we want to analyze rather than having the option to right-click -> Copilot4Eclipse -> Explain This as shown in the example.

Error:

No more errors:

  • A Github Copilot subscription is required.
  • Very good contextually, since you can specify all the files/classes it needs to analyze your code.

Conclusion

We’ve explored 2 AI solutions for ABAP development that integrate directly with IDEs, one from SAP and the other from Github.

But there are many other solutions to help you in your day-to-day development.