Dont know where to put the event !
Thanks !, but the problem is there is no widget:
Here ist the definition of the browsing procedure wich becomes no focus :
/*%%TYPE=ClassDefinition, VERSION=A, PROGRAM=ClEdit.w */
/* Class: CBrwAA (CBrowse) */
/*%%UserComment */
/*%%SystemDefine */
{hglobal.i}
&Scoped-Define SelfClass CBrwAA
&Scoped-Define ParentClass CBrowse
def input param Zeitraum_von as date no-undo.
def input param Zeitraum_bis as date no-undo.
def input param Buchungsart as int no-undo.
/*%%UserDefine */
&GLOBAL-DEFINE xlWindows 2
DEFINE VARIABLE chExcelApplication AS COM-HANDLE NO-UNDO.
DEFINE STREAM RPT.
/*
** VON HIER
** .... */
&SCOPED-DEFINE BrowserBreite 90
&SCOPED-DEFINE Titel Buchungsjournal
&SCOPED-DEFINE Tabelle mytable
&SCOPED-DEFINE VERBOTEN UPD,DEL,CRE
def temp-table mytable
field buchung as char
field Lieferant as int format "->>9"
field Datum as date
field AuftrNr as character
field Posnr as integer
field BelegNr as character
field Glas as int format "->>9"
field Durchm as int format "->>9"
field ET as char format "x(3)"
field Farbe as char format "x(3)"
field Sphaere as dec format "->,>9.99"
field Torus as dec format "->,>9.99"
field Addition as dec format "->,>9.99"
field Richtung as char format "x(2)"
field Stueck as int format "->>9"
field artikel_nr as char format "x(30)".
def new shared var sh_cArtikel like mytable.artikel_nr.
if Buchungsart = 1 then do :
FOR each lajo
where (lajo.dat >= zeitraum_von)
and (lajo.dat <= zeitraum_bis)
and (lajo.art = "Z")
NO-LOCK,
xartikel where xartikel.artikel_nr = lajo.artnr NO-LOCK,
lieferer where (lieferer.k-nr = int(substring(xartikel.artikel_nr ,1,2))) NO-LOCK.
create mytable.
mytable.buchung = lajo.art.
mytable.Lieferant = lieferer.k-nr.
mytable.artikel_nr = lajo.artnr.
mytable.Datum = lajo.dat.
mytable.AuftrNr = lajo.belegnr.
mytable.Glas = xartikel.glas.
mytable.Durchm = xartikel.durchm.
mytable.Et = xartikel.ets.
mytable.Farbe = xartikel.farbe.
mytable.Sphaere = xartikel.spha.
mytable.Torus = xartikel.tor.
mytable.Addition = xartikel.addition.
mytable.Richtung = xartikel.richtg.
mytable.stueck = lajo.mng.
end.
end.
if Buchungsart = 2 then do :
FOR each lajo
where (lajo.dat >= zeitraum_von)
and (lajo.dat <= zeitraum_bis) NO-LOCK,
each xaufpos
where (xaufpos.aarnr = int(lajo.belegnr))
and (xaufpos.posnr = int(lajo.belegpos))NO-LOCK,
first lieferer where (lieferer.k-nr = int(substring(xaufpos.artikel_nr ,1,2))) NO-LOCK.
if available xaufpos then do:
create mytable.
mytable.buchung = lajo.art.
mytable.Lieferant = lieferer.k-nr.
mytable.artikel_nr = xaufpos.artikel_nr.
mytable.PosNr = xaufpos.posnr.
mytable.Datum = lajo.dat.
mytable.AuftrNr = lajo.belegnr.
mytable.Glas = xaufpos.glas.
mytable.Durchm = xaufpos.durchm.
mytable.Et = xaufpos.ets.
mytable.Farbe = xaufpos.farbe.
mytable.Sphaere = xaufpos.spha.
mytable.Torus = xaufpos.tor.
mytable.Addition = xaufpos.addition.
mytable.Richtung = xaufpos.richtg.
mytable.Stueck = lajo.mng.
end.
end.
end.
&Scoped-Define DialogFile dialog/lajo
/* ASSIGN Firma - Feldliste */
{AddField.i BelegNr char }
{AddField.i lieferant int}
{AddField.i Glas int }
{AddField.i Durchm int }
{AddField.i ET char }
{AddField.i Farbe char }
{AddField.i Sphaere dec }
{AddField.i Torus dec }
{AddField.i Addition dec }
{AddField.i Richtung char }
{AddField.i Stueck int }
{AddTo2.i Query " FOR each mytable " "Buchungsjounal"}
{addtomnu.i Bearbeiten "Excel-Export" " Excel"}
/* ....
** Bis Hier
*/
/* ENDE */
/*%%SystemAreaData */
&IF LOOKUP( "DATA", "{&AREA}") NE 0 OR "{&AREA}" EQ "" &THEN
{{&ParentClass}.i &Area=Data}
/*%%UserAreaData */
/*%%SystemAreaMethod */
&ENDIF
&IF LOOKUP( "METHOD", "{&AREA}") NE 0 OR "{&AREA}" EQ "" &THEN
/*%%UserAreaMethod */
/*%%SystemCleanup */
{{&ParentClass}.i &Area=Method}
&ENDIF
/*%%UserCleanup */
/*EOF*/
procedure excel :
/* ----------------------------------Schreibt CSV Datei und öffnet CSV in Excel------------------ */
def input param phParent as handle no-undo.
def input param prRecID as recid no-undo.
def input param psEditMode as char no-undo.
if available mytable then do:
OUTPUT TO c:\Bujo.txt.
FOR EACH mytable NO-LOCK:
EXPORT DELIMITER '~t'
mytable.BelegNr
mytable.lieferant
mytable.Glas
mytable.Durchm
mytable.ET
mytable.Farbe
mytable.Sphaere
mytable.Torus
mytable.Addition
mytable.Richtung
mytable.Stueck .
END. /* end of for each mytable... */
OUTPUT CLOSE.
CREATE "Excel.Application" chExcelApplication NO-ERROR.
IF ERROR-STATUS:ERROR THEN RETURN no-apply.
chExcelApplication

isplayAlerts = FALSE.
chExcelApplication

isplayAlerts = FALSE.
chExcelApplication:Interactive = FALSE.
chExcelApplication:Visible = TRUE.
chExcelApplication:Workbooks:OpenText("c:\Bujo.txt",{&xlWindows},,,, TRUE).
chExcelApplication

isplayAlerts = TRUE.
chExcelApplication:Interactive = TRUE.
RELEASE OBJECT chExcelApplication NO-ERROR.
chExcelApplication = ? NO-ERROR.
end. /* if available mytable */
else do:
message " Es sind keine Export-Daten vorhanden ! "
view-as alert-box.
end.
end procedure.
Make
Can you help me again