select count(1) from sapabap1.vbak where mandt = '800' and audat = '20201212';


select audat, count(1) from sapabap1.vbak where audat >= '20201207' and audat <= '20201215' group by audat order by audat desc limit 100;

select "$rowid$" from sapabap1.vbak where mandt = '800' and vbeln = '0010078342';



select top 20 "$rowid$" as rowids,
	a.vbeln, a.mandt, a.vbtyp, a.audat, a.waerk, a.kalsm, a.ctlpc, a.kunnr, a.bukrs_vf, a.bstnk, 
	a.bname, a.telf1, a.netwr, a.vkbur, a.knumv, a.vkorg, a.vtweg, a.kkber, a.auart, a.aedat, b.pernr, 
	a.erdat, a.erzet, a.spart
from ${hana_user}.vbak a 
left join (
	
) b on a.vbeln = b.vbeln
where "$rowid$" &gt; #{rowids} and a.mandt = '800'
order by "$rowid$"



select q.vbeln,r.pernr from ${hana_user}.vbap q 
	left  join (
		select vbeln,posnr,pernr from ${hana_user}.vbpa where mandt = '800' and pernr != '00000000' group by vbeln,posnr,pernr
	) r on q.vbeln = r.vbeln and q.posnr = r.posnr 
where q.mandt = '800' and r.pernr is not null and a.vbeln = '111'
group by q.vbeln,r.pernr
	
	