FBild08 cf e workstn
c write fuss
c exfmt kopf
c *in03 doweq *off
c
c/exec sql
c+ select artnummer, artbezeich, artminbest, artaktbest, artgruppe
c+ into :artbezeich, :artminbest, :artaktbest, :artgruppe
c+ from art080114
c+ where :artnummer = :artnummer
c/end-exec
c if SQLCOD = *Zero
c Seton 40
c write Kopf
c exfmt Rumpf
c if artaktbest <> 0
c eval NEUBESTAND = artaktbest + eingang
c exfmt rumpf2
c if *in07 = *on
c/Exec SQL
c+ update art080114
c+ set artaktbest = :NEUBESTAND
c+ where :artnummer = :artnummer
C/end-exec
c endif
c endif
c if *in10 = *on
c exsr zusatzinfo
c endif
c z-add 0 eingabe
c z-add 0 neubestand
************************************************** *********
c zusatzinfo begsr
c/Exec SQL
c+ select count(*)
c+ into :verschart
c+ from art080114
c+ where artgruppe = :artgruppe
c/end-exec
c/exec Sql
c+ select count(distinct artgruppe)
c+ into :anzahlgrp
c+ from art080114
c/end-exec
c/exec sql
c+ select avg(artaktbest)
c+ into :dbestand
c+ from art080114
c/end-exec
c/exec sql
c+ select artnummer, artaktbest-artminbest
c+ into :bartlager, :bdiff
c+ from art080114
c+ where artnummer = :artnummer
c/end-exec
c