Step 4: Give a name and description
Step 5: Choose the Transport Request and Click Next
@EndUserText.label: 'table_function_description'
define table function table_function_name
returns {
client_element_name : abap.clnt;
element_name : element_type;
}implemented by method class_name=>method_name;
Step 8: Go back to the Project Explorer Source Code Library -> Classes
Step 9: Right-click and create a New ABAP Class
@EndUserText.label: 'Table function demo'
define table function Z_TABLE_FUNCTION_DEMO
returns {
client : abap.clnt;
empid : abap.numc(10);
qualification : abap.char(50);
}
implemented by method z_amdp_cl_tf=>get_data;
CLASS z_amdp_cl_tf DEFINITION
PUBLIC
FINAL
CREATE PUBLIC .
PUBLIC SECTION.
INTERFACES if_amdp_marker_hdb.
CLASS-METHODS get_data FOR TABLE FUNCTION z_table_function_demo.
PROTECTED SECTION.
PRIVATE SECTION.
ENDCLASS.
CLASS z_amdp_cl_tf IMPLEMENTATION.
METHOD get_data BY DATABASE FUNCTION FOR HDB
LANGUAGE SQLSCRIPT
OPTIONS READ-ONLY
USING zgandetails.
RETURN
SELECT client,empid,STRING_AGG(qualification,',') as qualification
from zgandetails
GROUP BY client,empid;
ENDMETHOD.
ENDCLASS.
@AbapCatalog.sqlViewName: 'Z_TB_VIEW'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'Table function View'
define view z_table_function_view as select from Z_TABLE_FUNCTION_DEMO {
empid,
qualification
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
8 | |
5 | |
5 | |
4 | |
4 | |
4 | |
4 | |
4 | |
3 | |
3 |