Ansicht
Dokumentation

ABENENUM_USAGE_ABEXA - ENUM USAGE ABEXA

ABENENUM_USAGE_ABEXA - ENUM USAGE ABEXA

ABAP Short Reference   TXBHW - Original Tax Base Amount in Local Currency  
This documentation is copyright by SAP AG.
SAP E-Book

, Use

This example demonstrates the use of enumerated types.

Source Code

Execute

Description

The program calls the method SHOW of class CL_DEMO_WRAP_BROWSER. Two enumerated types are defined as follows in this class:

TYPES:
  BEGIN OF ENUM size STRUCTURE sz,
    s, m, l, xl,
  END OF ENUM size STRUCTURE sz.
TYPES:
  BEGIN OF ENUM format STRUCTURE fmt,
    l, p,
  END OF ENUM format STRUCTURE fmt.

The use of enumerated structures means that the same name l can occur twice. The method SHOW wraps the method SHOW_HTML of the class CL_ABAP_BROWSER:

The input parameters size and format format of the method have the identically named enumerated types and can only contain their enumerated values. These are mapped to the corresponding constants of class CL_ABAP_BROWSER. These constants are to be regarded as a workaround for real enumerated types, which did not exist when CL_ABAP_BROWSER was developed.

Enumerated values can be entered for the size and format when the program is executed. The internal transfer to the program takes place by deserializing the character-like values to the local enumerated variables size and format. The exception for invalid values is caught internally, whereby the enumerated variables are initialized, which corresponds to the values of the enumerated constants sz-s and fmt-l.






TXBHW - Original Tax Base Amount in Local Currency   BAL_S_LOG - Application Log: Log header data  
This documentation is copyright by SAP AG.

Length: 1998 Date: 20240425 Time: 111005     sap01-206 ( 38 ms )