SAP® Documentation

Single view

ABAPCLASS_LOCAL_FRIENDS - CLASS LOCAL FRIENDS

CPI1466 during Backup   PERFORM Short Reference  
This documentation is copyright by SAP AG.
SAP E-Book

CLASS - LOCAL FRIENDS

Syntax

CLASS class DEFINITION
            LOCAL FRIENDS class1 class2 ...
                          intf1  intf2  ...


Effect

This statement makes the local classes and interfaces class1 class2 ... and intf1 intf2 ... of a class poolfriends of its global class class. At least one class or one interface must be specified.

This statement does not introduce a declaration part. It must not be ended with an ENDCLASS statement.

Notes

  • Declaring local classes of a class pool as friends of the global class is necessary, in particular, for local test classes that test the private components of the global class.
  • This variant of the statement CLASS can also only be listed in the context described under CLASS.
  • If the local classes and interfaces class1 class2 ... and intf1 intf2 ... are to be able to access all components of the global class class in their declaration part, the statement must first be specified in the class pool. Here, the local classes and interfaces must first be registered using CLASS - or INTERFACE - DEFERRED.


Example

In the CL_DEMO_AMDP_MESH class, the cl_test_selects class from the test include in the include for class-relevant local definitions (CCDEF include) is declared as a local friend of the global class, so that its private methods can be tested.

CLASS cl_test_selects DEFINITION DEFERRED.
CLASS cl_demo_amdp_mesh DEFINITION LOCAL FRIENDS cl_test_selects.







RFUMSV00 - Advance Return for Tax on Sales/Purchases   CPI1466 during Backup  
This documentation is copyright by SAP AG.

Length: 2756 Date: 20191212 Time: 224926     sap01-206 ( 26 ms )

Our Service

Looking for Support? Questions?

The

Consolut

Callback-Service

Leave us your contact details and we will call you back. Panels marked with * are mandatory.