@EndUserText.label: 'table function for CDS Meta Data'
define table function ZT_CA_CDS_METADATA
returns
{
Client : mandt;
SqlviewName : objectname;
CDSView : ddlname;
CDSViewDesc : abap.char(60);
FieldName : fieldname;
Position : tabfdpos;
DataElement : rollname;
DataType : datatype_d;
Length : ddleng;
Decimals : decimals;
}
implemented by method
ZCL_CDS_META=>GET_CDS_META
class zcl_cds_meta definition
public
final
create public .
public section.
interfaces: if_amdp_marker_hdb.
class-methods: GET_CDS_META for table function ZT_CA_CDS_METADATA.
protected section.
private section.
endclass.
class zcl_cds_meta implementation.
method GET_CDS_META by database function
for hdb
language sqlscript
options read-only
using RSODPABAPCDSVIEW DD25T DD03L.
i_sqlview = SELECT
'000' as CLIENT,
RSODPABAPCDSVIEW.SQLVIEWNAME,
RSODPABAPCDSVIEW.DDLNAME,
DD25T.DDTEXT
FROM RSODPABAPCDSVIEW
INNER JOIN DD25T AS DD25T
ON DD25T.VIEWNAME= RSODPABAPCDSVIEW.SQLVIEWNAME;
return select
sqlview.client,
sqlview.SqlviewName,
sqlview.DdlName as CdsView ,
sqlview.ddtext as CdsViewDesc,
DD03L.Fieldname,
DD03L.Position,
DD03L.rollname as DataElement,
DD03L.Datatype,
DD03L.leng as Length,
DD03L.Decimals
from :i_sqlview as sqlview
left outer join DD03L as DD03L
on DD03L.tabname = sqlview.sqlviewName;
endmethod.
endclass.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
3 | |
3 | |
2 | |
2 | |
2 | |
2 | |
2 | |
2 | |
2 | |
2 |