cancel
Showing results for 
Search instead for 
Did you mean: 

Query for Draft Reports

shikin
Participant
0 Kudos

Dear all,

can someone help me to alter this code because if I using Union then the golden arrow won't appear:

SELECT t0.docentry as 'Draft Number', T0.[DocNum], T0.[DocDate], T0.Comments as Remark, T0.U_confirmed, t1.Price<br>FROM ODRF T0  <br>INNER JOIN DRF1 T1 ON T0.[DocEntry] = T1.[DocEntry] <br>WHERE T0.[ObjType] =59 and DocStatus='O' and T0.U_confirmed='No'<br>union all<br>SELECT t0.docentry as 'Draft Number', T1.[DocNum], T0.[DocDate], T1.Comments as Remark, T1.U_confirmed, t0.Price<br>FROM DRF1 T0  <br>INNER JOIN ODRF T1 ON T0.[DocEntry] = T1.[DocEntry] <br>WHERE T0.[ObjType] =59 and DocStatus='O' and T1.U_confirmed='Yes' and t0.Price=0

Accepted Solutions (1)

Accepted Solutions (1)

SonTran
Active Contributor
0 Kudos

Hi,

Try this

SELECT t0.docentry as 'Draft Number', T0.[DocNum], T0.[DocDate], T0.Comments as Remark, T0.U_confirmed, t1.Price
FROM ODRF T0
INNER JOIN DRF1 T1 ON T0.[DocEntry] = T1.[DocEntry]
WHERE T0.[ObjType] =59 and DocStatus='O' and
(T0.U_confirmed='No' or (T0.U_confirmed='Yes' and t1.Price=0))

Hope this helps,

Son Tran

shikin
Participant
0 Kudos

Hi sontran

this is what I am looking for! Thank you so much!

Answers (2)

Answers (2)

jitin_chawla
Advisor
Advisor
0 Kudos

Hi,

Did you use the query above? Did it help?

Check this:

SELECT t0.docentry as 'Draft Number', T0.[DocNum], T0.[DocDate], T0.Comments as Remark, 
CASE 
 WHEN T0.U_Confirmed = 'Yes' and T1.Price = 0 THEN 'YES' 
 WHEN T0.U_Confirmed = 'No' and T1.Price >= 0 THEN 'NO'
 END AS 'Confirmed',
t1.Price
FROM ODRF T0  
INNER JOIN DRF1 T1 ON T0.[DocEntry] = T1.[DocEntry] 
WHERE T0.[ObjType] =59 and DocStatus='O' 
shikin
Participant
0 Kudos

Dear jitin.chawla

the results should be like the one in my union :

Just that if im using union, the golden arrow won't show

jitin_chawla
Advisor
Advisor
0 Kudos

Hi,

The Union All will remove the navigation arrow. You can check the earlier discussion on it in following thread:

https://answers.sap.com/questions/8626781/how-do-i-enable-the-%27gold-arrow%27-drill-down-on-a-s.htm...

If, however, your fields are same for both queries and its just the UDF (U_Confirmed) which is different and you want to merge the result, check below if it helps:

SELECT t0.docentry as 'Draft Number', T0.[DocNum], T0.[DocDate], T0.Comments as Remark, 
CASE 
 WHEN T0.U_Confirmed = 'Yes' THEN 'YES' 
 WHEN T0.U_Confirmed = 'No' THEN 'NO'
 END AS 'Confirmed',
t1.Price
FROM ODRF T0  
INNER JOIN DRF1 T1 ON T0.[DocEntry] = T1.[DocEntry] 
WHERE T0.[ObjType] =59 and DocStatus='O' 

KR,

Jitin

shikin
Participant
0 Kudos

Hi jitin.chawla

actually I to create new alerts and the results should be like this : if t0.u_confimed ='Yes' but t1.price=0 then it will trigger an alerts. if t0.u_confirmed = 'No' also triggered an alerts. I want this both condition in one alerts and the results should be like this :

but when i union it, the golden arrow won't appeared. Please help!