Señores buenas tardes soy nuevo en la parte de presupuestos de SAP y en nuestra empresa utilizamos Normas de reparto y centros de costo ya tengo el query con lo presupuestado pero no se de donde sacar lo REAL o ejecutado , mi presupuesto es solamente de gastos este es mi query .
elect t3.AcctCode as Cuenta,T1.Name as NombreCuenta , T0.Name as Escenario
,t4.OcrCode as [Cod Norma Rep]
,t4.OcrName as [Nom Norma Rep]
, CASE t3.Line_ID
WHEN 0 THEN 'Enero'
WHEN 1 THEN 'Febrero'
WHEN 2 THEN 'Marzo'
WHEN 3 THEN 'Abril'
WHEN 4 THEN 'Mayo'
WHEN 5 THEN 'Junio'
WHEN 6 THEN 'Julio'
WHEN 7 THEN 'Agosto'
WHEN 8 THEN 'Septiembre'
WHEN 9 THEN 'Octubre'
WHEN 10 THEN 'Noviembre'
WHEN 11 THEN 'Diciembre'
ELSE 'N/A'
END
'Mes'
,t3.DebLTotal as [Presupuesto Mes Quetzalez] ,t3.DebSTotal as [Presupuesto Mes Dolares],t3.MonthPrcnt as '%'
,t2.DebLTotal as [Presupuesto General Quetzalez]
,t2.DebSTotal as [Presupuesto General Dolares]
,t2.[AcctCode]
, SUM(-t3.DebLTotal + t3.CredLTotal) as DiferenciaPresupuestoMes
from OBGS T0
left join OBGS T1 on T0.BaseId = T1.AbsId
left join OBGT T2 on T0.AbsId = T2.Instance
inner join OPRC t5 on t2.acctcode =t5.cctypecode --CENTRO DE COSTO
inner join BGT1 t3 on t3.BudgId=t0.AbsId --DETALLE PRESUPUESTO
inner join OOCR t4 on t5.prccode =t4.OcrCode--NORMAS DE REPARTO
where t0.Name='50123 RM-Limpieza de vidrios Mod. 1' and t4.OcrCode='50102'
group by t3.AcctCode ,T1.Name , T0.Name
,t4.OcrCode
,t4.OcrName,t3.Line_ID
,t3.DebLTotal ,t3.DebSTotal ,t3.MonthPrcnt
,t2.DebLTotal
,t2.DebSTotal
,t2.[AcctCode]