Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Function Group - local class not visible inside of E01 or F01, but is visible inside of TOP include.

bill_immer
Explorer
0 Kudos
835

I have a function group with system generated includes LZ...TOP, and LZ....F01. I created a new include called LZ---E01 to put local classes but when I do that, they are not visible inside the function - I get the "is unknown" error.

If I put the class in LZ....F01 it is also "unknown".

If I put the class in the LZ....TOP it works, but I get a warning... "There should only be definitions in the TOP include".

I do see the new include is added to the "SAPLZ..." function pool and the includes and the "SAPLZ..." are activated.

It only sees classes in the TOP however...

1 ACCEPTED SOLUTION

Sandra_Rossi
Active Contributor
751

Here is how it should be done for includes of local classes in function groups.

You must define 2 include programs and the naming convention should be:

  • LZ...D01: definition part of local classes (its INCLUDE statement is defined in the LZ...TOP include)
  • LZ...P01: implementation part of local classes (its INCLUDE statement is defined in the SAPLZ... include)

LZ...E01 is reserved to the event blocks.

Source: ABAP documentation - FUNCTION-POOL

2 REPLIES 2

FredericGirod
Active Contributor
0 Kudos
751

Why didn't use global class ? (following Clean Code Abap you should use global class)

Did you try to put the definition in top and the implementation if you F01 include ?

Sandra_Rossi
Active Contributor
752

Here is how it should be done for includes of local classes in function groups.

You must define 2 include programs and the naming convention should be:

  • LZ...D01: definition part of local classes (its INCLUDE statement is defined in the LZ...TOP include)
  • LZ...P01: implementation part of local classes (its INCLUDE statement is defined in the SAPLZ... include)

LZ...E01 is reserved to the event blocks.

Source: ABAP documentation - FUNCTION-POOL