An AMDP class is a global class in the class library that contains one or more of the following tag interfaces:
- IF_AMDP_MARKER_HDB for the SAP HANA database
The names of the interfaces all start with IF_AMDP_MARKER and a suffix indicates the database system for which the ABAP Managed Database Procedures can be implemented in AMDP methods of the class.
An AMDP class can contain both regular methods and AMDP methods. It can contain one or more AMDP methods for each database system specified by a tag interface.
CLASS zcl_test_extractor_amdp DEFINITION
PUBLIC
FINAL
CREATE PUBLIC.
PUBLIC SECTION.
INTERFACES if_amdp_marker_hdb .
BEGIN OF ty_attributes,
object_id TYPE crmt_object_id_db
,guid TYPE crmt_object_guid
,process_type TYPE crmt_process_type_db
,P_DESCRIPTION TYPE crmt_description
,process_desc type crmt_description
END OF ty_attributes.
TYPES:
tt_attributes TYPE STANDARD TABLE OF ty_attributes,
CLASS-METHODS get_result
IMPORTING
VALUE(iv_clnt) TYPE mandt
VALUE(ip_filters) TYPE string
EXPORTING
VALUE(et_attribute_details) TYPE tt_attributes
RAISING
cx_amdp_error.
ENDCLASS.
METHOD get_result
BY DATABASE PROCEDURE
FOR HDB
LANGUAGE SQLSCRIPT
OPTIONS READ-ONLY
USING crmd_orderadm_h crmc_proc_type crmc_proc_type_t
lt_result =
SELECT DISTINCT
oh.object_id AS object_id
,oh.process_type AS process_type
,pd.P_DESCRIPTION as P_DESCRIPTION
,oh.created_at AS created_at
,oh.created_by AS created_by
FROM crmd_orderadm_h
AS oh
JOIN crmc_proc_type
AS pt ON pt.process_type = oh.process_type and pt.client = IV_CLNT
JOIN crmc_proc_type_t
AS pd ON pd.process_type = pt.process_type AND pd.langu = 'E'
WHERE oh.object_type = 'BUS2000126' AND oh.process_type = 'ZBKG' and
oh.client = IV_CLNT
ORDER BY oh.object_id;
et_attribute_details = APPLY_FILTER( :lt_result, :ip_filters );
ENDMETHOD.
lt_ebeln = SELECT i.ebeln
FROM bkpf as h
INNER JOIN bseg as i
on i.bukrs = h.bukrs AND
i.belnr = h.belnr AND
i.gjahr = h.gjahr
UNION ALL SELECT ebeln from:lt_ebeln;
lt_details =
*Cost Center Items
SELECT DISTINCT
base_cc.gl_account as gl_account,
base_cc.ryear as ryear,
cc_hyp.zz_hpp_project as hp_proj_id,
from :lt_cc as base_cc
left outer join :lt_cc_hyp as cc_hyp
on base_cc.kostl = cc_hyp.kostl
*WBS Items
union all
select distinct
base_wbs.gl_account as gl_account,
base_wbs.ryear as ryear,
wbs_hyp.zz_hpp_project as hp_proj_id,
from :lt_wbs as base_wbs
left outer join :lt_wbs_hyp as wbs_hyp
on base_wbs.projk = wbs_hyp.pspnr ;
LEFT OUTER JOIN tj02t AS ct ON ct.istat = cs.stat
AND ct.spras = 'E' AND ct.txt04 IN ('CANC','DEF')
et_details =
select
base.gl_account as gl_account,
'' as activity, case
when base.period = '001' then 'Jul'
when base.period = '002' then 'Aug'
when base.period = '003' then 'Sep'
when base.period = '004' then 'Oct'
when base.period = '005' then 'Nov'
when base.period = '006' then 'Dec'
when base.period = '007' then 'Jan'
when base.period = '008' then 'Feb'
when base.period = '009' then 'Mar'
when base.period = '010' then 'Apr'
when base.period = '011' then 'May'
when base.period = '012' then 'Jun'
else 'NA'
end as period,
'' as scenario,
base.year as year,
SUM ( base.hsl ) as hsl
from :lt_details as base
group by gl_account, zzlocbrd, hp_proj_id, prctr, year, period;
lt_sum = SELECT DISTINCT
oh.object_id as object_id ,
sum( pi.net_value ) as total_value
FROM crmd_orderadm_h AS oh
inner JOIN crmd_orderadm_i AS oi ON oi.header = oh.guid
JOIN crmd_pricing_i AS pi ON pi.guid = oi.guid
LEFT OUTER JOIN tj02t AS ct ON ct.istat = cs.stat AND ct.spras = 'E' AND ct.txt04 IN ('CANC','DEF')
inner JOIN :et_attribute_details as base
on oh.object_id = base.object_id
AND ct.txt30 IS NULL
GROUP BY oh.object_id , pi.net_value ;
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
37 | |
10 | |
5 | |
4 | |
4 | |
4 | |
3 | |
3 | |
3 | |
2 |