Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

HANA ABAP UpdateErrors

Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 7

SELECT

/*

[NAME]

- HANA_ABAP_UpdateErrors

[DESCRIPTION]

- Overview of current SAP ABAP update requests in error state

[SOURCE]

- SAP Note 1969700

[DETAILS AND RESTRICTIONS]

- Tables VBHDR / VBERROR 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 VBHDR / VBERROR 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:

SET SCHEMA SAP<sid>

[VALID FOR]

- Revisions: all
- Statistics server type: all
- Client application: ABAP

[SQL COMMAND VERSION]

- 2017/02/16: 1.0 (initial version)

[INVOLVED TABLES]

- VBERROR
- VBHDR

[INPUT PARAMETERS]

- BEGIN_TIME

Begin time

TO_TIMESTAMP('2014/06/05 14:05:00', 'YYYY/MM/DD HH24:MI:SS') --> Set begin time


to 5th of June 2014, 14:05
ADD_DAYS(CURRENT_TIMESTAMP, -2) --> Set begin time
to two days before current time

- END_TIME

End time
TO_TIMESTAMP('2014/06/08 14:05:00', 'YYYY/MM/DD HH24:MI:SS') --> Set end time to
8th of June 2014, 14:05
CURRENT_TIMESTAMP --> Set end time to
current time

- APP_SERVER

SAP application server

'sapabap01' --> Restrict output to application server sapabap01


'%' --> No restriction related to SAP application server

- MANDT

SAP ABAP client

'100' --> Only show work processes related to client 100


'%' --> No restriction related to SAP ABAP client

- WP_TYPE

SAP ABAP work process type (e.g. DIA, ENQ, BTC, UPD)

'DIA' --> Restrict output to dialog work processes


'%' --> No restriction related to work process type

- WP_ID

SAP ABAP work process ID

23 --> Show information for work process 23


-1 --> No restriction related to work process ID

- CPID

Client process ID (i.e. process ID of SAP ABAP work process)

1234 --> Show information for work process with client process ID
1234
-1 --> No restriction related to client process ID

- ACTION

SAP ABAP work process action

'SELECT' --> Restrict output to SELECT operations


'%' --> No restriction related to work process action

- TABLE_NAME

Accessed table name

'MARA' --> Restrict output to accesses to table MARA


'%' --> No restriction related to table name

- STATE

SAP ABAP work process state


'SYNC RFC' --> Restrict output to work processes in state SYNC RFC
'%' --> No process state restriction

- WAITING_FOR

Wait situation

'CMSEND%' --> Display only work processes waiting for CMSEND


'%' --> No restriction related to wait situation

- APP_USER

Application user

'SAPSYS' --> Application user 'SAPSYS'


'%' --> No application user restriction

- APP_SOURCE

Application source

'SAPL2' --> Application source 'SAPL2:437'


'SAPMSSY2%' --> Application sources starting with SAPMSSY2
'%' --> No application source restriction

- REQUEST_TYPE

Type of root request

'RFC%' --> Restrict results to RFC requests


'%' --> No restriction related to request type

- BATCH_JOB

Batch job name

'MYBATCH1' --> Only show information for batch job MYBATCH1


'%' --> No restriction related to batch job

- AGGREGATE_BY

Aggregation criteria (possible values can be found in comment)

'TIME' --> Aggregation by time


'HOST, PORT' --> Aggregation by host and port
'NONE' --> No aggregation

- TIME_AGGREGATE_BY

Aggregation criteria (possible values can be found in comment)

'HOUR' --> Aggregation by hour


'YYYY/WW' --> Aggregation by calendar week
'TS<seconds>' --> Time slice aggregation based on <seconds> seconds
'NONE' --> No aggregation

- ORDER_BY

Sort criteria (available values are provided in comment)


'SIZE' --> Sorting by size
'TABLE' --> Sorting by table name

[OUTPUT PARAMETERS]

- START_TIME: Start time of considered time interval


- SAMPLES: Number of samples
- APP_SERVER: Application server name
- MANDT: SAP ABAP client
- TYP: Work process type (e.g. DIA, BTC, UPD)
- WP_ID: Work process ID
- CPID: Client process ID (i.e. OS PID of work process)
- DB_ROWS: Database rows retrieved
- DB_TIME_MS: Database time spent (ms)
- ACTION: Action (e.g. SELECT, ENQUEUE, ROLL IN, INSERT, UPDATE)
- TABLE_NAME: Accessed table name (only one table displayed in case of joins)
- STATE: Work process state
- APP_USER: Application user
- APP_SOURCE: Application source (main ABAP module -> current ABAP module)
- REQUEST_TYPE: Root request type
- BATCH_JOB: Batch job name
- WAITING_FOR: Wait reason

[EXAMPLE OUTPUT]

-----------------------------------------------------------------------------------
-----------------------------------------------------------------------------------
-----------------------------------------------------------------------------------
----------------------------
|START_TIME |APP_SERVER |MANDT|TYP|WP_ID|CPID |DB_ROWS |DB_TIME_S |
ACTION |TABLE_NAME |STATE |APP_USER |APP_SOURCE
|BATCH_JOB |WAITING_FOR
|
-----------------------------------------------------------------------------------
-----------------------------------------------------------------------------------
-----------------------------------------------------------------------------------
----------------------------
|2017/02/15 12:01:00|saphana0_E9A_02| 103|DIA| 33| 20032| 0| 0.00|
SELECT |LQUA | |RUPUZIDAEK |SAPML03T -> SAPLL03A
| |
|
|2017/02/15 12:01:00|saphana0_E9A_02| 103|DIA| 34| 20033| 1227| 0.27|
| | |JOBRUN |SAPMSSY1 -> SAPLVEDA
| |
|
|2017/02/15 12:01:00|saphana0_E9A_02| 103|DIA| 66| 20066| 0| 0.00|
SELECT |COST | |PUZUTTIOBA |/GLB/RGTPTR_PROCESS_ORDER_VAR ->
SAPLKARS | |
|
|2017/02/15 12:01:00|saphana0_E9A_02| 103|DIA| 77| 28920| 361| 0.51|
| |SYNC RFC |BGVASILEVA |RVV50R10C -> SAPLATPC
| |CMSEND(SAP) / 13410508 / SYNC_CPIC /
141.122.207.43|
|2017/02/15 12:01:00|saphana0_E9A_02| 103|BTC| 113| 1876| 833| 0.88|
SELECT |VBFA | |JOBRUN |/EUR/ODECSR_COD_PROCESS ->
SAPLV05C |RU_R3E_CS_R_0065295_SDBLRU3AIMSP|
|
|2017/02/15 12:01:00|saphana0_E9A_02| 103|BTC| 117| 22492| 283| 0.18|
| | |JOBRUN |SAPMV45A -> SAPLV69A
|IT_R3E_CS_R_0060246_ORDERS_E |
|
|2017/02/15 12:01:00|saphana0_E9A_02| 103|BTC| 119| 11503| 0| 0.00|
| |ABAP WAIT|NBNRA |/GLB/RGTFCR_INVOICE_JOB
|5200637291201720170215120040 |CMRCV / 77113581 / SYNC_CPIC
|
|2017/02/15 12:01:00|saphana1_E9A_02| 103|DIA| 8| 5335| 384| 0.57|
SELECT |LIKP | |BGMIHAYLAL1 |SAPMSSY1 -> SAPLV61B
| |
|
|2017/02/15 12:01:00|saphana1_E9A_02| 103|DIA| 22| 30973| 481| 0.64|
SELECT |/GLB/RGTNOSHPORD| |BGMIHAYLAL1 |SAPMSSY1 -> SAPLV61B
| |
|
|2017/02/15 12:01:00|saphana1_E9A_02| 103|DIA| 37| 30642| 0| 0.00|
SELECT |TRFCQOUT | |PUMAIZNEBA |SAPMSSY1 -> SAPLORFC
| |
|
|2017/02/15 12:01:00|saphana1_E9A_02| 103|DIA| 51| 5380| 0| 0.00|
| | |OSS_481396 |SAPMSSY1 ->
CL_SERVER_INFO================CP | |
|
|2017/02/15 12:01:00|saphana1_E9A_02| 103|DIA| 60| 30643| 1197| 0.92|
SELECT |EKBE | |DESERWEFL |RM06EL00 -> SAPLME07
| |
|
-----------------------------------------------------------------------------------
-----------------------------------------------------------------------------------
-----------------------------------------------------------------------------------
----------------------------

*/

START_TIME,
LPAD(NUM, 7) COUNT,
APP_SERVER,
LPAD(MANDT, 5) MANDT,
APP_USER,
REPORT_NAME,
TRANSACTION_NAME
FROM
( SELECT
CASE
WHEN BI.AGGREGATE_BY = 'NONE' OR INSTR(BI.AGGREGATE_BY, 'TIME') != 0 THEN
CASE
WHEN BI.TIME_AGGREGATE_BY LIKE 'TS%' THEN
TO_VARCHAR(ADD_SECONDS(TO_TIMESTAMP('2014/01/01 00:00:00', 'YYYY/MM/DD
HH24:MI:SS'), FLOOR(SECONDS_BETWEEN(TO_TIMESTAMP('2014/01/01 00:00:00',
'YYYY/MM/DD HH24:MI:SS'), TO_TIMESTAMP(H.VBDATE, 'YYYYMMDDHH24MISS')) /
SUBSTR(BI.TIME_AGGREGATE_BY, 3)) * SUBSTR(BI.TIME_AGGREGATE_BY, 3)), 'YYYY/MM/DD
HH24:MI:SS')
ELSE TO_VARCHAR(TO_TIMESTAMP(H.VBDATE, 'YYYYMMDDHH24MISS'),
BI.TIME_AGGREGATE_BY)
END
ELSE 'any'
END START_TIME,
CASE WHEN BI.AGGREGATE_BY = 'NONE' OR INSTR(BI.AGGREGATE_BY, 'MANDT') !=
0 THEN H.VBMANDT ELSE MAP(BI.MANDT, '%', 'any', BI.MANDT)
END MANDT,
CASE WHEN BI.AGGREGATE_BY = 'NONE' OR INSTR(BI.AGGREGATE_BY, 'APP_USER') !=
0 THEN H.VBUSR ELSE MAP(BI.APP_USER, '%', 'any', BI.APP_USER)
END APP_USER,
CASE WHEN BI.AGGREGATE_BY = 'NONE' OR INSTR(BI.AGGREGATE_BY, 'SERVER') !=
0 THEN H.VBNAME ELSE MAP(BI.APP_SERVER, '%', 'any', BI.APP_SERVER)
END APP_SERVER,
CASE WHEN BI.AGGREGATE_BY = 'NONE' OR INSTR(BI.AGGREGATE_BY, 'REPORT') !=
0 THEN H.VBREPORT ELSE MAP(BI.REPORT_NAME, '%', 'any', BI.REPORT_NAME)
END REPORT_NAME,
CASE WHEN BI.AGGREGATE_BY = 'NONE' OR INSTR(BI.AGGREGATE_BY, 'TRANSACTION') !=
0 THEN H.VBTCODE ELSE MAP(BI.TRANSACTION_NAME, '%', 'any', BI.TRANSACTION_NAME)
END TRANSACTION_NAME,
COUNT(*) NUM,
BI.ORDER_BY
FROM
( SELECT
BEGIN_TIME,
END_TIME,
MANDT,
APP_USER,
REPORT_NAME,
TRANSACTION_NAME,
APP_SERVER,
AGGREGATE_BY,
MAP(TIME_AGGREGATE_BY,
'NONE', 'YYYY/MM/DD HH24:MI:SS',
'HOUR', 'YYYY/MM/DD HH24',
'DAY', 'YYYY/MM/DD (DY)',
'HOUR_OF_DAY', 'HH24',
TIME_AGGREGATE_BY ) TIME_AGGREGATE_BY,
ORDER_BY
FROM
( SELECT /* Modification section */
TO_TIMESTAMP('1000/07/11 06:15:00', 'YYYY/MM/DD HH24:MI:SS') BEGIN_TIME,
TO_TIMESTAMP('9999/07/11 06:18:00', 'YYYY/MM/DD HH24:MI:SS') END_TIME,
'%' MANDT,
'%' APP_USER,
'%' REPORT_NAME,
'%' TRANSACTION_NAME,
'%' APP_SERVER,
'TIME' AGGREGATE_BY, /* TIME, SERVER, MANDT, APP_USER, REPORT,
TRANSACTION or comma separated combinations, NONE for no aggregation */
'DAY' TIME_AGGREGATE_BY, /* HOUR, DAY, HOUR_OF_DAY or database time
pattern, TS<seconds> for time slice, NONE for no aggregation */
'TIME' ORDER_BY /* TIME, COUNT */
FROM
DUMMY
)
) BI,
VBHDR H,
VBERROR E
WHERE
TO_TIMESTAMP(H.VBDATE, 'YYYYMMDDHH24MISS') BETWEEN BI.BEGIN_TIME AND
BI.END_TIME AND
H.VBMANDT LIKE BI.MANDT AND
H.VBUSR LIKE BI.APP_USER AND
H.VBREPORT LIKE BI.REPORT_NAME AND
H.VBTCODE LIKE BI.TRANSACTION_NAME AND
H.VBNAME LIKE BI.APP_SERVER AND
H.VBKEY = E.VBKEY
GROUP BY
CASE
WHEN BI.AGGREGATE_BY = 'NONE' OR INSTR(BI.AGGREGATE_BY, 'TIME') != 0 THEN
CASE
WHEN BI.TIME_AGGREGATE_BY LIKE 'TS%' THEN
TO_VARCHAR(ADD_SECONDS(TO_TIMESTAMP('2014/01/01 00:00:00', 'YYYY/MM/DD
HH24:MI:SS'), FLOOR(SECONDS_BETWEEN(TO_TIMESTAMP('2014/01/01 00:00:00',
'YYYY/MM/DD HH24:MI:SS'), TO_TIMESTAMP(H.VBDATE, 'YYYYMMDDHH24MISS')) /
SUBSTR(BI.TIME_AGGREGATE_BY, 3)) * SUBSTR(BI.TIME_AGGREGATE_BY, 3)), 'YYYY/MM/DD
HH24:MI:SS')
ELSE TO_VARCHAR(TO_TIMESTAMP(H.VBDATE, 'YYYYMMDDHH24MISS'),
BI.TIME_AGGREGATE_BY)
END
ELSE 'any'
END,
CASE WHEN BI.AGGREGATE_BY = 'NONE' OR INSTR(BI.AGGREGATE_BY, 'MANDT') !=
0 THEN H.VBMANDT ELSE MAP(BI.MANDT, '%', 'any', BI.MANDT)
END,
CASE WHEN BI.AGGREGATE_BY = 'NONE' OR INSTR(BI.AGGREGATE_BY, 'APP_USER') !=
0 THEN H.VBUSR ELSE MAP(BI.APP_USER, '%', 'any', BI.APP_USER)
END,
CASE WHEN BI.AGGREGATE_BY = 'NONE' OR INSTR(BI.AGGREGATE_BY, 'SERVER') !=
0 THEN H.VBNAME ELSE MAP(BI.APP_SERVER, '%', 'any', BI.APP_SERVER)
END,
CASE WHEN BI.AGGREGATE_BY = 'NONE' OR INSTR(BI.AGGREGATE_BY, 'REPORT') !=
0 THEN H.VBREPORT ELSE MAP(BI.REPORT_NAME, '%', 'any', BI.REPORT_NAME)
END,
CASE WHEN BI.AGGREGATE_BY = 'NONE' OR INSTR(BI.AGGREGATE_BY, 'TRANSACTION') !=
0 THEN H.VBTCODE ELSE MAP(BI.TRANSACTION_NAME, '%', 'any', BI.TRANSACTION_NAME)
END,
BI.ORDER_BY
)
ORDER BY
MAP(ORDER_BY, 'TIME', START_TIME) DESC,
MAP(ORDER_BY, 'COUNT', NUM) DESC

You might also like