SAP EML DISPLAY DERIVED TYPE ABEXA



Get Example source ABAP code based on a different SAP table
  


VX_EXA_ONLY

Display BDEF Derived Type Components
This example allows multiple BDEF derived type components and their availability in variables typed with TYPE TABLE FOR ... and TYPE STRUCTURE FOR ... to be explored.
The program makes use of three different RAP scenarios:
RAP external numbering (non-draft, non-late numbering)
Late numbering
Draft
The example is based on dummy BDEFs and behavior pools (ABP) that just serve the purpose of including many specifications to display a variety of BDEF derived type components in the output: ScenarioData modelBDEFABP
RAP external numberingRoot entity: DEMO_MANAGED_ROOT_TEST lbr lbr Child entity: DEMO_MANAGED_CHILD_TEST DEMO_MANAGED_ROOT_TEST BP_DEMO_MANAGED_ROOT_TEST
Late numberingRoot entity: DEMO_MANAGED_ROOT_TEST_LN lbr lbr Child entity: DEMO_MANAGED_CHILD_TEST_LN DEMO_MANAGED_ROOT_TEST_LN BP_DEMO_MANAGED_ROOT_TEST_LN
DraftRoot entity: DEMO_MANAGED_ROOT_TEST_DT lbr lbr Child entity: DEMO_MANAGED_CHILD_TEST_DT DEMO_MANAGED_ROOT_TEST_DT BP_DEMO_MANAGED_ROOT_TEST_DT
ABAP_NOTE
Since variables cannot be declared with many of the BDEF derived types outside of the implementation class (for example, in a program), the global class contains variables that are typed with the various BDEF derived types and methods (get_comp and get_comp_table) that get the components.
The availability of components varies depending on the specification in the BDEF, for example, %is_draft is only available for draft scenarios. %pid is only available for late numbering scenarios.
For example, in case of TYPE TABLE FOR INSTANCE FEATURES RESULTS , which is similar for several other types that require a certain specification in the BDEF, only those elements that are specified with features : instance are available as components.

ABAP_SOURCE_CODE
ABAP_EXEC

ABAP_DESCRIPTION
The program allows a BDEF derived type to be chosen, either TYPE TABLE FOR ... or TYPE STRUCTURE FOR ..., and a RAP scenario (external numbering, late numbering and draft) to be selected. The output shows an initial internal table. The table's column names represent the BDEF derived type components that are available in the chosen BDEF derived type. In many cases, multiple component groups are available in BDEF derived types, for example, %tky is often available if %key is available. These component groups are additionally displayed. Note that this example displays components and component groups on a high level. The availability of components and component groups depends on the specifications in the BDEF. Make sure to check the F2 help for your variables typed with BDEF derived types to get the full overview.