cancel
Showing results for 
Search instead for 
Did you mean: 

APPROVAL PROCESS REPORT

Juan-Mari
Explorer
0 Kudos
210

Is there a query that can give the results in the report for Approval Stages, approval templates and approver. Customer has 95 approval and needs a report to check and then request changes. SAP B1 on HANA. 

Would really appreciate any help. 

Accepted Solutions (0)

Answers (1)

Answers (1)

MD1
Active Contributor

Hi,

please try this query report

sELECT
T0."DraftEntry" as "Draft No",
T0."CreateDate" As "Request Date",
T0."CreateTime" as "Request Time",
t2."Name" As "Approval For",
T3."U_NAME" as "Request From",
t6."Comments" as "Remarks",
T4."U_NAME" as "Approver Name",
T1."UpdateDate" As "Approved Date",
T1."UpdateTime" as "Approved Time",
CASE WHEN T6."WddStatus" = 'W' 
THEN 'Pending' WHEN T6."WddStatus" = 'Y' 
THEN 'Approved' WHEN T6."WddStatus" = 'N' 
THEN 'Reject' WHEN T6."WddStatus" = 'C' 
THEN 'Pending' 
ELSE '-' 
END AS "Decision",
---T0."IsDraft" ,   
DAYS_BETWEEN (T1."UpdateDate",
CURRENT_DATE) AS "Days from Approved Date" 
fROM OWDD T0 
INNER JOIN WDD1 T1 ON T0."WddCode" = T1."WddCode" 
left outer join odrf t6 on t0."DraftEntry" = t6."DocEntry" 
and T6."ObjType" = T6."ObjType" 
left outer JOIN OWTM T2 ON T0."WtmCode" = T2."WtmCode" 
left outer JOIN OUSR T3 ON T0."OwnerID" = T3."USERID" 
left outer JOIN OUSR T4 ON T1."UserID" = T4."USERID" 
left outer JOIN OUDP T5 ON T3."Department" = T5."Code" 
Where (T0."IsDraft"='Y') 
and T6."DocStatus" ='O' 
and T6."WddStatus" not in ('C','N') 
 
union all sELECT
T0."DraftEntry" as "Draft No",
T0."CreateDate" As "Request Date",
T0."CreateTime" as "Request Time",
t2."Name" As "Approval For",
T3."U_NAME" as "Request From",
t6."Comments" as "Remarks",
T4."U_NAME" as "Approver Name",
T1."UpdateDate" As "Approved Date",
T1."UpdateTime" as "Approved Time",
CASE WHEN T6."WddStatus" = 'W' 
THEN 'Pending' WHEN T6."WddStatus" = 'Y' 
THEN 'Approved' WHEN T6."WddStatus" = 'N' 
THEN 'Reject' WHEN T6."WddStatus" = 'C' 
THEN 'Pending' 
ELSE '-' 
END AS "Decision",
DAYS_BETWEEN (T1."UpdateDate",
CURRENT_DATE) AS "Days from Approved Date" 
fROM OWDD T0 
INNER JOIN WDD1 T1 ON T0."WddCode" = T1."WddCode" 
left outer join odrf t6 on t0."DraftEntry" = t6."DocEntry" 
and T6."ObjType" = T6."ObjType" 
left outer JOIN OWTM T2 ON T0."WtmCode" = T2."WtmCode" 
left outer JOIN OUSR T3 ON T0."OwnerID" = T3."USERID" 
Left outer JOIN OUSR T4 ON T1."UserID" = T4."USERID" 
left outer JOIN OUDP T5 ON T3."Department" = T5."Code" 
Where T6."WddStatus" ='C' 
and T6."DocStatus" ='O' 
 
 
order by "Request Date"