Buenos días JC
La consulta quedó de la siguiente manera
SELECT T0.NumAtCard, t0.docdate, t0.cardcode, t0.cardname, T0.SlpCode,T1.SlpName,
case
when T0.groupnum='-1' then 'F.Contado'
else 'F.Crédito' END as 'Tipo Venta',
(select doctotal from oinv where docnum = t0.docnum)as 'Total',
(select doctotal from oinv where docnum = t0.docnum and T0.groupnum='-1')as 'Total Contado',
(select doctotal from oinv where docnum = t0.docnum and T0.groupnum <>'-1') as 'Total Crédito'
FROM OINV T0 INNER JOIN OSLP T1 ON T0.SlpCode = T1.SlpCode
UNION ALL
SELECT T0.NumAtCard, t0.docdate, t0.cardcode, t0.cardname, T0.SlpCode,T1.SlpName,
case
when T0.groupnum='-1' then 'Contado'
else 'N / Crédito' END as 'Tipo Venta',
(select doctotal from ORIN where docnum = t0.docnum)as 'Total',
(select doctotal from ORIN where docnum = t0.docnum and T0.groupnum='-1')as 'Total Contado',
(select doctotal from ORIN where docnum = t0.docnum and T0.groupnum <>'-1') as 'Total Crédito'
FROM ORIN T0 INNER JOIN OSLP T1 ON T0.SlpCode = T1.SlpCode
where T0.DocDate >=[%0] and T0.DocDate <=[%1]
ORDER BY T0.DocDate
pero al pasarlo al Generador de Consulta del SAP, no me funciona.
Tengo la Versión de SAP 9 PL 7