All topics
ABAPBeginner

Modularization

Learn how to structure ABAP code using FORM routines, function modules, methods, includes, classes and reusable service design.

Overview

Learn how to structure ABAP code using FORM routines, function modules, methods, includes, classes and reusable service design.

Lessons in this topic

Interview questions covered

  • Report crashes because a FORM reads an uninitialised global variable. How do you prevent it?
  • How do you design a service layer for a large ABAP application?
  • Difference between FORM and METHOD in ABAP.
  • When would you use INCLUDE programs?
  • What is the cost of many small function-module calls in a loop?
  • How do you evolve a legacy function group into a service class without breaking callers?
  • What is a Function Module and when is it required?
  • Customer validation exists separately in three reports and one OData service. How do you move it into a class-based design?
  • A customer validation rule was written as a local class in one report. Now two other programs need it. What do you do?
  • The same delivery-block rule is coded separately in a report, a user exit and an OData service, and they now give different results. How do you fix this?
  • Users get a success message after saving a sales-related custom document, but the record is sometimes missing in the database. What could be wrong with the update logic?
  • A pricing routine uses several global variables and CHANGING parameters, and nobody knows which values it changes. How do you clean up its interface?
  • A delivery user exit in MV50AFZ1 contains several FORM routines sharing global variables, and a change caused wrong values in another FORM. How do you work safely here?
  • You need logic that a report uses, that an external system calls via RFC, and that runs in the update task. Would you use a FORM, a method or a function module?
  • A 6,000-line SD report with everything in START-OF-SELECTION is hard to change. How do you restructure it into maintainable modules?
  • A custom RFC-enabled function module is called by several external systems. What must you consider when changing it?
  • A pricing rule was copied into five reports. A defect was fixed in one of them, and the others still produce wrong prices. How do you prevent this happening again?
  • Where would you put business logic that must be reused by a report, a Fiori app and a BAPI?
  • When should you use a subroutine (FORM), a function module, and a method?

Related topics

Interview questions on this topic