This is a test message to test the length of the message box.
Login
Photo by DeepMind on Unsplash

ABAP Developer still relevant

823

In this article we look at whether ChatGPT can already replace an ABAP developer or whether it can be used as a help in everyday life.

ChatGPT has been in the media for quite a while as it is a very advanced chatbot that follows chat history, generates helpful information and can even be used in development. He creates code on request and also controls code that is given to him.

 

Introduction

What actually is ChatGPT? The bot was developed by openAI, who also developed Dall-E 2, a bot that creates images and graphics. As the name ChatGPT already expresses, it is a chat AI whose goal is to support the user with their questions and problems using natural language. Above all, the bot should be used in the support area.

ChatGPT was trained with information from the Internet so that it can answer many questions from everyday life. In this article, we will primarily look at the ABAP development skills and what the bot can already do today. We ask ourselves whether the bot can already build complete applications in order to replace an ABAP developer and how error-prone the bot is.

 

Basics

So let's start with the basics and ask the bot if it's familiar with ABAP development.

 

The answer is correspondingly long, ChatGPT simulates a natural conversation and also returns corresponding information. Next he should do a simple SELECT over the company codes. However, we already provide the corresponding table. However, we no longer point out that we want the code to be in ABAP:

 

Again we get a corresponding answer with an explanation and a code snippet for the output of the data. Even the Hungarian notation is adhered to in the example and the statement is output as modern ABAP. However, a small error has already crept in, because the WERKS field does not belong to T001.

 

Advanced

In the next step we make a new request to the chatbot and would like to have our last request packaged in a Data Access Object (DAO). Again, we don't give any context and the bot takes our last request as a reference:

 

ChatGPT also gives a corresponding explanation and an example of how to use the code. Unfortunately, this is where the wrong key comes into play.

 

Accordingly, we want to make a change to the coding and let ChatGPT exchange the key.

 

As a last step, ChatGPT should add a method to read a table of entries via a range, which returns the following code.

CLASS lcl_dao DEFINITION.
  PUBLIC SECTION.
    CLASS-METHODS:
      get_t001_data IMPORTING
        r_bukrs TYPE t001-bukrs
      RETURNING
        VALUE(r_t001_data) TYPE t001,
      get_t001_range IMPORTING
        r_bukrs_low TYPE t001-bukrs
        r_bukrs_high TYPE t001-bukrs
      RETURNING
        VALUE(r_t001_range) TYPE TABLE OF t001.
ENDCLASS.

CLASS lcl_dao IMPLEMENTATION.
  METHOD get_t001_data.
    SELECT SINGLE * FROM t001
      INTO @DATA(lv_t001)
      WHERE bukrs = r_bukrs.
    r_t001_data = lv_t001.
  ENDMETHOD.

  METHOD get_t001_range.
    SELECT * FROM t001
      INTO TABLE @DATA(lt_t001)
      WHERE bukrs >= r_bukrs_low AND bukrs <= r_bukrs_high.
    r_t001_range = lt_t001.
  ENDMETHOD.
ENDCLASS.

 

The range is not built according to the usual SELECT-OPTION criteria, but you can transfer a range and get a meaningful delimitation on the data. However, the returning parameter will lead to an error in the compiler because the return type is not fully specified, the key is still missing.

 

Error

As the next question, let's commit buggy code and see if it can be fixed. The following sample code with an error in it:

TYPES:
  BEGIN OF ts_data,
    some_id TYPE char25,
    text TYPE string,
  END OF ts_data,
  tt_data TYPE STANDARD TABLE OF ts_data WITH EMPTY KEY.
    
LOOP AT lt_data INTO DATA(ls_data) WHERE.
ENDLOOP.

 

ChatGPT has the following answer to the problem:

 

The analysis is correct so far, the WHERE condition was started, but it is missing. The problem would also be recognized by the compiler and the coding could not be activated.

 

New ABAP

As a final step, let's see if the chatbot can help us find the right CDS views to use an API to the system. We want to receive the right data for the business partner and ask him about the released CDS views in this area:

 

Unfortunately we have made several different requests to the bot and as above have not received a suitable response. The system did not want to output the standard view "I_BusinessPartner".

 

Conclusion

The chatbot can do a lot and can help a developer in his daily work. However, you should not rely on the answers and adopt them unchecked. The chatbot still makes mistakes and the result should be professionally evaluated again. Likewise, he cannot develop complete applications without precise instructions.


Included topics:
New ABAPSAPChatGPT
Comments (0)



And further ...

Are you satisfied with the content of the article? We post new content in the ABAP area every Friday and irregularly in all other areas. Take a look at our tools and apps, we provide them free of charge.


ABAP - RETURN value

Category - ABAP

After all these years, the “real” return in ABAP has finally arrived. In this article we will show you how it works and what it can do.

02/13/2024

ABAP Deep Dive - FOR (Loops)

Category - ABAP

Let's take a closer look at the FOR loop. How does it work? What do I have to consider and what can I do with it?

04/14/2023

ABAP Deep Dive - Table access (internal)

Category - ABAP

In this article, let's take a look at table access to internal tables and how they replace READ TABLE.

02/03/2023

ABAP - FINAL

Category - ABAP

In this article, we'll take a look at the new FINAL language construct, how it works, and what you can do with it.

12/23/2022

ABAP Deep Dive - VALUE

Category - ABAP

In this article we want to look at the value statement again in all its forms and how you can use it in your daily work.

11/11/2022