0% found this document useful (0 votes)
3K views2 pages

Nested Case - CDS

This view combines data from three tables to display records that are blocked or have errors due to locking. It selects key fields like request number, dependent details, personnel number, quota details, status, amount, and error message. The records are grouped by report type such as "School Transport Blocked", "Loans Blocked", and "Air Ticket Blocked".

Uploaded by

topankajsharma
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3K views2 pages

Nested Case - CDS

This view combines data from three tables to display records that are blocked or have errors due to locking. It selects key fields like request number, dependent details, personnel number, quota details, status, amount, and error message. The records are grouped by report type such as "School Transport Blocked", "Loans Blocked", and "Air Ticket Blocked".

Uploaded by

topankajsharma
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

@AbapCatalog.

sqlViewName: 'ZHR_LOCK_DATA'
@AbapCatalog.compiler.CompareFilter: true
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'Unprocessed Records due to Locking'
define view Zcds_Lock_Data as

select from zhr_ess_sta_req


{
'School Transport Blocked' as Report_Type,
zreq_no as Request_Number,
zdep_id as Dependent_ID,
zdep_name as Dependent_Name,
pernr as Personnel_Number,
cast('' as abap.numc( 2 )) as Quota_Type,
cast(0 as abap.dec( 10, 5 )) as Quota_number,
zreq_stat as Request_Status,
cast(0 as abap.curr( 13, 2 )) as Amount,
case zpo_error
when '' then ( case zreq_stat
when 'AP' then 'Data Error'
else ''
end )
else zpo_error
end as Error

union

select from zhr_ess_req_stat


{
'Loans Blocked' as Report_Type,
zreq_no as Request_Number,
cast('' as abap.numc(2)) as Dependent_ID,
cast('' as abap.char(80)) as Dependent_Name,
pernr as Personnel_Number,
cast('' as abap.numc( 2 )) as Quota_Type,
cast(0 as abap.dec( 10, 5 )) as Quota_number,
zreq_stat as Request_Status,
zamount as Amount,
case zpo_error
when '' then ( case zreq_stat
when 'AP' then 'Data Error'
else ''
end )
else zpo_error
end as Error

union

select from zhr_ess_ata_itm


inner join zhr_ess_ata_hdr
on zhr_ess_ata_itm.zreq_no = zhr_ess_ata_hdr.zreq_no
{
'Air Ticket Blocked' as Report_Type,
zhr_ess_ata_itm.zreq_no as Request_Number,
cast('' as abap.numc( 2 )) as Dependent_ID,
cast('' as abap.char(80)) as Dependent_Name,
pernr as Personnel_Number,
ktart as Quota_Type,
zqt_no as Quota_number,
zhr_ess_ata_itm.zreq_stat as Request_Status,
zamount as Amount,
case zpo_error
when '' then ( case zhr_ess_ata_itm.zreq_stat
when 'AP' then 'Data Error'
else ''
end )
else zpo_error
end as Error

You might also like