select count(1) from sapabap1.kna1 where updat = '00000000' union all
select count(1) from sapabap1.kna1 where updat != '00000000' union all
select count(1) from sapabap1.kna1 where updat is null;

select count(1) from sapabap1.Bkpf where aedat = '00000000' and mandt = '800' union all
select count(1) from sapabap1.Bkpf where aedat != '00000000' and mandt = '800';


		select top 20 "$rowid$" as rowids,
       		mandt, bukrs, belnr, gjahr, blart, bldat, budat, monat, cpudt, cputm, 
			case aedat when '00000000' then null else to_date(aedat) end as aedat, upddt,
       		(to_date(cpudt)||' '||to_time(cputm)) as cpudt_cputm
    	from sapabap1.Bkpf
    	where "$rowid$" > '2702057' and mandt = '800'
    	order by "$rowid$";
    	
    	select top 20 "$rowid$" as rowids,
       		mandt, bukrs, belnr, gjahr, blart, bldat, budat, monat, cpudt, cputm, 
			case aedat when '00000000' then null else to_date(aedat) end as aedat, upddt,
       		(to_date(cpudt)||' '||to_time(cputm)) as cpudt_cputm
    	from sapabap1.Bkpf
    	where "$rowid$" > '2702306' and mandt = '800'
    	order by "$rowid$";
    	
    	select top 20 "$rowid$" as rowids,
       		mandt, bukrs, belnr, gjahr, blart, bldat, budat, monat, cpudt, cputm, 
			case aedat when '00000000' then null else to_date(aedat) end as aedat, upddt,
       		(to_date(cpudt)||' '||to_time(cputm)) as cpudt_cputm
    	from sapabap1.Bkpf
    	where "$rowid$" > '2702607' and mandt = '800'
    	order by "$rowid$";
    	
    	
    	select top 20 "$rowid$" as rowids,
       		mandt, bukrs, belnr, gjahr, blart, bldat, budat, monat, cpudt, cputm, upddt
			,aedat
       		,(cpudt||cputm) as cpudt_cputm
    	from sapabap1.Bkpf
    	where "$rowid$" > '2702607' and mandt = '800'
    	order by "$rowid$";
    	
    	
    	
    	
 
 
 
 
select top 20 "$rowid$" as rowids,
vbeln, mandt, erdat, wadat_ist, ctlpc, kunnr, aedat,lfuhr,
case wadat_ist when '00000000' then null else (to_date(wadat_ist)||' '||to_time(lfuhr)) end as wadat_ist2lfuhr
from sapabap1.likp
where "$rowid$" > '10' AND MANDT = '800'
order by "$rowid$"


select * from sapabap1.kna1 where mandt = '800' limit 10
