Now accepting guest editorial from SAP, Oracle, Workday and ServiceNow practitioners.Pitch a guide
The Sign-Off Table

Lesson 2 of 6

Explaining code

8 min

Listen to this lesson

0:00 / 14:41

Most ABAP work starts with reading code someone else wrote. After a system conversion, that's thousands of objects. At Contoso, about 7,500 custom objects came across from ECC, many with no documentation and some whose authors left years ago. Explain is the Joule capability built for this moment.

What Explain covers

SAP's help page says Explain gives detailed explanations of selected development objects or lines of source code, with special support for ABAP classes, ABAP programs, CDS artifacts and ATC findings (simplification items only). Two limits matter in practice: you can explain one object at a time, because multiple object selection isn't supported, and quick replies aren't enabled for every object type.

  • Starting points: the Project Explorer, the source code editor, the Joule chat view, and views such as Outline, Relation Explorer or Search.
  • Selected code: select lines in the editor to explain just that block, such as one nested loop.
  • Guided conversation: you can ask for a short or detailed explanation, with or without examples, or ask questions such as "Are there nested loops in the selected function module?"
  • Context awareness: if Explain doesn't know which object you mean, it asks and offers a list through quick replies.
  • Used objects: the explanation shows the object it used and any other resources it drew on. Check that list; it tells you what Joule actually looked at.
Explain gives you a hypothesis about the code; you confirm it against the code and the business before you rely on it.
The Sign-Off Table · thesignofftable.com/academy/sap-aid-201

Explain in the Custom Code Migration app

SAP also offers Explain inside the Custom Code Migration app (or Analyze Custom Code, depending on role) in the ABAP environment, for ECC-to-S/4HANA work. Code Explain there needs a communication arrangement for scenario SAP_COM_0464 (RFC to the system being analyzed) and one for SAP_COM_0B22, plus SAP Notes 3785952 (first) and 3755890. ATC Explain explains simplification-item findings and shows its references on a separate tab. Contoso used the readiness checks during its conversion; Explain is most useful now for the converted objects that still carry findings.

How to check an explanation

Language models write fluent text whether or not it's right. SAP's own recommendations page says generative AI results can't be guaranteed and that the models behind J4D can change at any time. So treat every explanation as a claim to verify. A good habit is to check four things, in this order:

  1. Does it name the right inputs and outputs?Yes → continue · No → the explanation is about a different code path; re-select
  2. Do the tables and APIs it mentions appear in the code?Yes → continue · No → it is filling gaps from general knowledge; distrust the rest
  3. Does the business rule it describes match the process owner's view?Yes → continue · No → raise it; either the code or the explanation is wrong
  4. Would you sign your name to it in the object documentation?Yes → record it · No → read the code yourself before changing anything
Four questions turn an AI explanation into knowledge you can rely on.
The Sign-Off Table · thesignofftable.com/academy/sap-aid-201

What would you do?

Kenji's developer runs Explain on <code>ZCL_CMC_CORE_DEPOSIT</code>. The explanation says the class calculates the core deposit per unit from the agreement and "excludes closed agreements using status CLOSED". The developer can't find any status filter in the method. What should she do?

A worked example: a classic report

A Contoso developer has to change a classic report in ZCMC_SD that prints open core returns per fleet customer. She selects the report in the Project Explorer and starts Explain with a prompt: "Explain this report in a few sentences: inputs, tables read, and output." The answer names the selection screen parameters, three tables and a list output. She then selects the nested loop that builds the totals and asks: "Are there nested loops in the selected code, and what do they cost on large data?" Explain points out a SELECT inside a loop over all agreements. That matches a priority 2 performance finding ATC already raised on a related class. She records the confirmed summary as a comment block, adds the performance issue to the change scope, and only then starts editing.

Notice the pattern: a broad question first, then narrow questions on selected lines, each checked against the code, ATC results or the process owner. That's how Explain saves time without becoming a source of new errors.

Key points
  • Explain supports classes, programs, CDS artifacts and simplification-item ATC findings, one object at a time.
  • Start it from the Project Explorer, the editor, the Joule chat or views such as Outline.
  • Check the "used objects" list to see what Joule actually read.
  • Verify inputs, tables, the business rule and your own confidence before relying on an explanation.
  • Record confirmed explanations so the team doesn't regenerate them.

Check your understanding · not graded

Lesson check

  1. 1. Which ATC findings does Explain support, according to SAP?

  2. 2. What does SAP say about selecting several objects for Explain?

  3. 3. Explain claims a method reads table ZCMC_CORE_AGI, but the code never mentions it. What does that suggest?