Dear Experts,
Good day!
Kindly help me upon my query. I am having a hard time in grouping that will generate a collapsing or expanding result.
Here's my query.
SELECT
T4.Code,
T0.DocDate as 'Date',
T0.DocNum,
T2.DocNum as 'AR Doc.#',
T0.CardCode as BPCode,
T3.CardName as BPName,
T3.Address,
T0.CounterRef as 'Ref',
T0.TransId As 'Transaction No.',
T3.LicTradNum as TIN,
T1.Debit
FROM dbo.ORCT AS T0
LEFT join JDT1 T1 ON T0.DocNum = T1.BaseRef
LEFT JOIN OINV t2 ON t0.DocNum = t2.ReceiptNum
LEFT JOIN OCRD T3 ON T0.CardCode = T3.CardCode
LEFT JOIN OFPR T4 ON T0.FinncPriod = T4.AbsEntry
Inner JOIN OACT T5 on T1.Account = T5.AcctCode
where T1.Account='_SYS00000000301' and t4.Code=[%]
The result goes like this.
I red boxed the document number that I wanted to have a collapsing or expanding result. The purpose of wanting the collapsing table is for excel transfer that will only return one value for DEBIT.
Sample for collapsing and expanding result in which SAP generates from the incoming payments.
Thank you so much in advance.
-JZA