Skip to content

ABAP Keyword Documentation →  ABAP - Dictionary →  Classic Objects in ABAP Dictionary →  Database Tables →  Semantic Attributes of Database Tables →  Table-Specific Semantic Attributes of Database Tables →  Foreign Key Dependencies →  Flagging of Obsolete Data in Check Tables 

Flagging of Deprecated Data in Check Tables

This example demonstrates how deprecated data is flagged in check tables.

Other versions: 7.31 | 7.40 | 7.54

Source Code

REPORT demo_dynpro_deprecation.

TABLES demo_depr_struc.

DATA depr_flag TYPE abap_bool VALUE 'X'.

START-OF-SELECTION.
  CALL SCREEN 100.

LOAD-OF-PROGRAM.
  depr_flag = cl_configuration_deprecation=>deprecation_is_active( ).

  DATA ls_target TYPE demo_depr_check.

  SELECT planetype
         FROM saplane
         ORDER BY planetype
         INTO TABLE @DATA(planetypes).

  DELETE FROM demo_depr_check.
  INSERT demo_depr_check FROM TABLE @( VALUE #(
      FOR wa IN planetypes INDEX INTO idx
      ( planetype = wa-planetype
        configurationdeprecationcode =
          COND #( WHEN idx <= 3 THEN 'W'
                  WHEN idx BETWEEN 4 AND 6 THEN 'E'
                  ELSE ' ' ) ) ) ).

MODULE pbo_100 OUTPUT.
  SET PF-STATUS 'STATUS_100'.

  cl_configuration_deprecation=>set_deprecation_active(
    i_respect_obsolete_values = depr_flag ).
ENDMODULE.

MODULE cancel INPUT.
  LEAVE PROGRAM.
ENDMODULE.

Description

This example uses the check table DEMO_DEPR_CHECK for the flagging of deprecated entries and the first three table entries are flagged as deprecated. The next three table entries are flagged as invalid.

This example makes it possible to define how deprecated data is checked. The checkbox Check deprecated data enables or disables checks on deprecated data and hence defines the input check and input help.

If checks on deprecated data are enabled, the following takes place:

  • A warning is displayed if one of the deprecated values is entered. If one of the invalid values is entered, an error message is displayed and the entered value is not accepted.
  • The input help displays valid values and deprecated values only and no invalid values.

If the checkbox Check deprecated data is not selected, there are no warnings or error messages and the input help displays all entries from the check table DEMO_DEPR_CHECK.