@ClientDependent: false
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'Static'
define table function ZG_CDS_TF_TEXT
returns {
objnr :J_OBJNR;
status_profile :j_stsma;
system_status :string40;
user_status :string40;
}
implemented by method zg_cl_st_text=>get_status_text;
CLASS zg_cl_st_text DEFINITION
PUBLIC
FINAL
CREATE PUBLIC .
PUBLIC SECTION.
INTERFACES: if_amdp_marker_hdb.
TYPES:
BEGIN OF ty_status,
objnr TYPE j_objnr,
status_profile TYPE j_stsma,
system_status TYPE char40,
user_status TYPE char40,
END OF ty_status.
TYPES:
tt_status TYPE STANDARD TABLE OF ty_status.
DATA : gt_status TYPE STANDARD TABLE OF ty_status.
CLASS-METHODS get_status_text FOR TABLE FUNCTION ZG_CDS_TF_TEXT.
PROTECTED SECTION.
PRIVATE SECTION.
ENDCLASS.
CLASS zg_cl_st_text IMPLEMENTATION.
METHOD get_status_text BY DATABASE FUNCTION
FOR HDB
LANGUAGE SQLSCRIPT
OPTIONS READ-ONLY
USING jest jsto tj30t tj02t.
gt_status = SELECT DISTINCT a.objnr,
b.stsma as status_profile,
d.txt04 as system_status,
c.txt04 as user_status
from JEST as a
inner join jsto as b on b.objnr = a.objnr
left outer join tj30t as c on c.estat = a.stat and
c.stsma = b.stsma and
c.spras = 'E'
left outer join tj02t as d on d.istat = a.stat and
d.spras = 'E'
where a.inact <> 'X';
RETURN SELECT objnr,
status_profile,
STRING_AGG( system_status, ',' ORDER BY system_status) as system_status,
STRING_AGG( user_status, ',' ORDER BY user_status) as user_status
FROM :gt_status
GROUP BY objnr, status_profile;
ENDMETHOD.
ENDCLASS.
@AbapCatalog.sqlViewName: 'YGF_SQL_STAT'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'CDS View for Status Text'
@ClientDependent: true
define view YGF_DDL_STAT as select from ygf_ddl_stat_tf as a {
key a.objnr,
a.status_profile,
a.system_status,
a.user_status
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
2 | |
2 | |
2 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |