Application Development Blog Posts
Learn and share on deeper, cross technology development topics such as integration and connectivity, automation, cloud extensibility, developing at scale, and security.
cancel
Showing results for 
Search instead for 
Did you mean: 
rosenberg_eitan
Active Contributor
Hi all,
Deep structures are those structures that contain at least one deep component.
In this blog entry and the following ones I will try to demonstrate usage scenario that will use
deep structure, class, program and smart form .
Our data will be based on tables:
SCARR
Airline
SPFLI
Flight
SFLIGHT
Flight schedule (with flight date)
STICKET
Flight Ticket

I am going to use a class to hold those structure type.
The reason behind this decision will be demonstrated.
The  class: Y_R_EITAN_TEST_31_02_CL
The class is used as a types container . we will give the class more roles on in the next blog entry.
At this point I am exposing just part of the public section:
Things to note:
  • tp_airport_x is used twice in tp_spfli_1 (I do not know if this is posible using SE11 ) .
  • I always define a new type and include something the reason "is being a boy scout" be prepared for changes .
  • Table Type is our deep one  tp_scarr_1_tab contains lower table type tp_spfli_1_tab that contains..... down to tp_sbook_1_tab .
  • r_carrid r_connid and r_fldate are range type tables just like SELECT-OPTIONS:  those will be used later on in the next blog entry.
  • tp_flat_1 demonstrate "combining tables"  note the use of "RENAMING WITH SUFFIX" addition there and in other places.
    The thing that interesting here is that we can combine different structures that contain the same field names. And they are all living happily ....(This is not our main subject here but I thought why not....) . This is a life saver when it comes to smart form .

And this is source:

*"* public components of class Y_R_EITAN_TEST_31_02_CL
*"* do not include other source files here!!!
  PUBLIC SECTION.

    TYPES:
      BEGIN OF tp_airport_x  .
    TYPES: name        TYPE sairport-name ,
           time_zone   TYPE sairport-time_zone .
    TYPES: END OF tp_airport_x .

    TYPES:
      BEGIN OF tp_sbook_1 .
            INCLUDE TYPE sbook AS sbook RENAMING WITH SUFFIX _sbook .
    TYPES: END OF tp_sbook_1 .
    TYPES:
      tp_sbook_1_tab TYPE STANDARD TABLE OF tp_sbook_1 WITH NON-UNIQUE DEFAULT KEY .
    TYPES:
      BEGIN OF tp_sflight_1 .
            INCLUDE TYPE sflight AS sflight RENAMING WITH SUFFIX _sflight .
    TYPES: it_sbook_1 TYPE tp_sbook_1_tab .
    TYPES: END OF tp_sflight_1 .
    TYPES:
      tp_sflight_1_tab TYPE STANDARD TABLE OF tp_sflight_1 WITH NON-UNIQUE DEFAULT KEY .
    TYPES:
      BEGIN OF tp_spfli_1 .
            INCLUDE TYPE spfli AS spfli RENAMING WITH SUFFIX _spfli .
            INCLUDE TYPE tp_airport_x AS fr_airport RENAMING WITH SUFFIX _fr .
            INCLUDE TYPE tp_airport_x AS to_airport RENAMING WITH SUFFIX _to .
    TYPES: it_sflight_1 TYPE tp_sflight_1_tab .
    TYPES: END OF tp_spfli_1 .
    TYPES:
      tp_spfli_1_tab TYPE STANDARD TABLE OF tp_spfli_1 WITH NON-UNIQUE DEFAULT KEY .


    TYPES:
  BEGIN OF tp_scarr_x.
    TYPES: carrid   TYPE scarr-carrid ,
           carrname TYPE scarr-carrname ,
           currcode TYPE scarr-currcode .
    TYPES: END OF tp_scarr_x .

    TYPES:
      BEGIN OF tp_scarr_1.
            INCLUDE TYPE tp_scarr_x AS scarr RENAMING WITH SUFFIX _scarr .
    TYPES: it_spfli_1 TYPE tp_spfli_1_tab .
    TYPES: END OF tp_scarr_1 .
    TYPES:
      tp_scarr_1_tab TYPE STANDARD TABLE OF tp_scarr_1 WITH NON-UNIQUE DEFAULT KEY .

    TYPES:
      BEGIN OF tp_flat_1 .
            INCLUDE TYPE tp_scarr_x AS scarr RENAMING WITH SUFFIX _scarr .
            INCLUDE TYPE spfli      AS spfli   RENAMING WITH SUFFIX _spfli .
            INCLUDE TYPE sflight    AS sflight RENAMING WITH SUFFIX _sflight .
    TYPES: END OF tp_flat_1 .
    TYPES:
      tp_flat_1_tab TYPE STANDARD TABLE OF tp_flat_1 .

    TYPES:
      r_carrid TYPE RANGE OF sflight-carrid .
    TYPES:
      r_connid TYPE RANGE OF sflight-connid .
    TYPES:
      r_fldate TYPE RANGE OF sflight-fldate .
 

This is all for now until next time .
Regards.
8 Comments