0% found this document useful (0 votes)
9 views5 pages

AMDP

The document defines a class 'z_amdp_oop_ns' in ABAP that implements a method 'get_flight_details' to retrieve flight information from a database using SQLScript. It includes a structure for flight details and a driver program that calls the method to display the results. The implementation is designed for HANA database procedures and utilizes a join between flight and carrier tables.

Uploaded by

me.thirumalai
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views5 pages

AMDP

The document defines a class 'z_amdp_oop_ns' in ABAP that implements a method 'get_flight_details' to retrieve flight information from a database using SQLScript. It includes a structure for flight details and a driver program that calls the method to display the results. The implementation is designed for HANA database procedures and utilizes a join between flight and carrier tables.

Uploaded by

me.thirumalai
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

CLASS z_amdp_oop_ns DEFINITION

PUBLIC

FINAL

CREATE PUBLIC .

PUBLIC SECTION.

INTERFACES if_amdp_marker_hdb.

TYPES : BEGIN OF ty_strct,

carrier_name(24) TYPE c,

connection_id TYPE num4,

planetype(10) TYPE c,

END OF ty_strct.

TYPES : it_strct TYPE STANDARD TABLE OF ty_strct WITH EMPTY KEY. "Table type

CLASS-METHODS : get_flight_details "Static method

IMPORTING VALUE(iv_client) TYPE mandt

EXPORTING VALUE(et_result) TYPE it_strct.

PROTECTED SECTION.

PRIVATE SECTION.

ENDCLASS.

CLASS z_amdp_oop_ns IMPLEMENTATION.

METHOD get_flight_details BY DATABASE PROCEDURE

FOR HDB
LANGUAGE SQLSCRIPT

OPTIONS READ-ONLY

USING sflight scarr.

et_result = select DISTINCT [Link] as carrier_name,

[Link] as connection_id,

[Link]

from sflight as sf INNER JOIN scarr as sc

on [Link] = [Link]

order by carrier_name, connection_id, [Link];

ENDMETHOD.

ENDCLASS.

Driver Program :-

*&---------------------------------------------------------------------*

*& Report z_amdp_oop_dp

*&---------------------------------------------------------------------*

*&

*&---------------------------------------------------------------------*

REPORT z_amdp_oop_dp.

z_amdp_oop_ns=>get_flight_details(

EXPORTING

iv_client = sy-mandt

IMPORTING

et_result = DATA(it_result)

).
cl_demo_output=>display_data( value = it_result ).

*cl_demo_output=>display( it_result ).
MOCK HON QUESTION SOLUTION (18/10/2024).

You might also like