HANA ABAP InstalledComponents
HANA ABAP InstalledComponents
HANA ABAP InstalledComponents
/*
[NAME]
- HANA_ABAP_InstalledComponents
[DESCRIPTION]
[SOURCE]
- Tables CVERS, PAT03, PRDVERS and STACKHDR only available in SAP ABAP environments
- You have to be connected to the SAP<sid> schema otherwise the following error is
issued:
[259]: invalid table name: Could not find table/view PRDVERS in schema
- If access to ABAP objects is possible but you cannot log on as ABAP user, you can
switch the default schema before executing the command:
[VALID FOR]
- Revisions: all
- Client application: ABAP
[INVOLVED TABLES]
- CVERS
- PAT03
- PRDVERS
- STACKHDR
[INPUT PARAMETERS]
- NAME
Component version
- DESCRIPTION
Component description
- SKIP_PREVIOUS_RELEASES
- EXCLUDE_SUB_COMPONENTS
[OUTPUT PARAMETERS]
NAME,
VERSION,
SP,
DESCRIPTION,
INSTALL_TIME
[EXAMPLE OUTPUT]
-----------------------------------------------------------------------------------
--------------------------------------------------
|NAME |VERSION |SP |DESCRIPTION
|INSTALL_TIME |
-----------------------------------------------------------------------------------
--------------------------------------------------
|EHP3 FOR SAP SCM 7.0 |EHP3 FOR SAP SCM 7.0|22 (03/2021) |EHP3 FOR SAP
SCM 7.0 |2021/10/24 00:03:36|
|SAP GRC ACCESS CONTROL |11 |27 (11/2020) |SAP ACCESS
CONTROL 10.1 |2021/10/24 00:03:36|
|SAP GRC PROCESS CONTROL |11 |27 (11/2020) |SAP PROCESS
CONTROL 10.1 |2021/10/24 00:03:36|
|SAP LANDSCAPE MGMT ENTERPRISES|1.0 |04 (09/2012) |SAP NW
LANDSC VIRT MGT ENT 1.0 |2018/10/20 17:43:36|
|SAP NETWEAVER |7.4 |25 (12/2020) |SAP
NETWEAVER 7.4 |2021/10/24 00:03:36|
|SAP SCM |7.0 |23 (01/2021) |SAP SCM 7.0
|2021/10/24 00:03:36|
|SAP TDMS 4.0 |SAP TDMS 4.0 |SPS 20 (02/2021) |SAP TDMS 4.0
|2021/10/24 00:03:36|
|SLT |2.0 |SP20 (02/2021) SP|SAP LT
REPLICATION SERVER 2.0 |2021/10/24 00:03:36|
| | | |
| |
|BI_CONT |747 |0034 |BI_CONT 747:
Support Package 0034 |2021/10/24 00:03:26|
|DMIS |2011_1_731 |0021 |DMIS
2011_1_731: SP 0021 |2022/03/12 20:15:11|
|DMIS_CNT |2011_1_731 |0021 |DMIS_CNT
2011_1_731: SP 0021 |2022/03/12 20:15:12|
|EA-IPPE |400 |0033 |SP 33 for
EA-IPPE 4.00 |2021/10/24 00:03:15|
|GRCFND_A |V1100 |0027 |GRCFND_A
V1100: SP 0027 |2021/03/13 20:52:47|
|GRCPINW |V1100_731 |0028 |GRCPINW
V1100_731: SP 0028 |2021/03/13 20:52:48|
...
-----------------------------------------------------------------------------------
--------------------------------------------------
*/
BASIS_INFO AS
( SELECT /* Modification section */
'%' NAME,
'%' VERSION,
'%' DESCRIPTION,
'X' SKIP_PREVIOUS_RELEASES,
'X' EXCLUDE_SUB_COMPONENTS
FROM
DUMMY
)
SELECT
NAME,
VERSION,
SP,
DESCRIPTION,
INSTALL_TIME
FROM
( SELECT
LINE_NO LINE_NO,
NAME,
VERSION,
SP,
DESCRIPTION,
INSTALL_TIME
FROM
( SELECT
ROW_NUMBER () OVER (ORDER BY P.NAME, P. VERSION) LINE_NO,
ROW_NUMBER () OVER (PARTITION BY P.NAME ORDER BY S.INST_DATE || S.INST_TIME
DESC) LINE_NO_2,
P.NAME NAME,
P.VERSION VERSION,
IFNULL(S.DESCRIPT, '') SP,
P.DESCRIPT DESCRIPTION,
TO_VARCHAR(TO_TIMESTAMP(S.INST_DATE || S.INST_TIME, 'YYYYMMDDHH24MISS'),
'YYYY/MM/DD HH24:MI:SS') INSTALL_TIME,
BI.SKIP_PREVIOUS_RELEASES
FROM
BASIS_INFO BI,
PRDVERS P LEFT OUTER JOIN
STACKHEADR S ON
S.PROD_ID = P.ID
WHERE
P.NAME LIKE BI.NAME AND
P.VERSION LIKE BI.VERSION AND
P.DESCRIPT LIKE BI.DESCRIPTION AND
P.INSTSTATUS = '+'
)
WHERE
( SKIP_PREVIOUS_RELEASES = ' ' OR LINE_NO_2 = 1 )
UNION ALL
SELECT 999, '', '', '', '', '' FROM DUMMY
UNION ALL
SELECT
2000 + LINE_NO LINE_NO,
NAME,
VERSION,
SP,
DESCRIPTION,
INSTALL_TIME
FROM
( SELECT
ROW_NUMBER () OVER (ORDER BY C.COMPONENT, C.RELEASE) LINE_NO,
ROW_NUMBER () OVER (PARTITION BY C.COMPONENT ORDER BY P.IMPLE_DATE ||
P.IMPLE_TIME || P.DELIV_DATE || P.DELIV_TIME DESC) LINE_NO_2,
C.COMPONENT NAME,
C.RELEASE VERSION,
MAP(IFNULL(P.TO_REL, ''), '', IFNULL(C.EXTRELEASE, ''), IFNULL(P.TO_REL, ''))
SP,
P.SHORT_TEXT DESCRIPTION,
TO_VARCHAR(TO_TIMESTAMP(P.IMPLE_DATE || P.IMPLE_TIME, 'YYYYMMDDHH24MISS'),
'YYYY/MM/DD HH24:MI:SS') INSTALL_TIME,
BI.SKIP_PREVIOUS_RELEASES
FROM
BASIS_INFO BI,
CVERS C LEFT OUTER JOIN
( SELECT ADDON_ID COMP, ADDON_REL RELEASE, SHORT_TEXT, IMPLE_DATE,
IMPLE_TIME, DELIV_DATE, DELIV_TIME, TO_REL FROM PAT03 UNION ALL
SELECT COMPONENT COMP, COMP_REL RELEASE, SHORT_TEXT, IMPLE_DATE,
IMPLE_TIME, DELIV_DATE, DELIV_TIME, TO_REL FROM PAT03
) P ON
C.COMPONENT = P.COMP AND C.RELEASE = P.RELEASE
WHERE
C.COMPONENT LIKE BI.NAME AND
C.RELEASE LIKE BI.VERSION AND
P.SHORT_TEXT LIKE BI.DESCRIPTION AND
( BI.EXCLUDE_SUB_COMPONENTS = ' ' OR UPPER(SUBSTR(P.SHORT_TEXT, 1, 10)) NOT
IN ('SUB COMPON', 'SUBCOMPONE') )
)
WHERE
( SKIP_PREVIOUS_RELEASES = ' ' OR LINE_NO_2 = 1 )
)
ORDER BY
LINE_NO