 
/*------------------------------------------------------------------------
   File        : Artst
   Purpose     : 
   Syntax      : 
   Description : 
   Author(s)   : walter.riechsteiner
   Created     : Wed Sep 01 11:50:40 CEST 2021
   Notes       : 
 ----------------------------------------------------------------------*/

USING Progress.Lang.*.

BLOCK-LEVEL ON ERROR UNDO, THROW.

CLASS classes.Artst:
    DEFINE PUBLIC PROPERTY  Firma           AS  CHARACTER   NO-UNDO
        GET.
        SET.

    DEFINE PUBLIC PROPERTY  Artnr           AS  INTEGER     NO-UNDO
        GET.
        SET.

    DEFINE PUBLIC PROPERTY  Inhalt          AS  INTEGER     NO-UNDO
        GET.
        SET.

    DEFINE PUBLIC PROPERTY  Jahr            AS  INTEGER     NO-UNDO
        GET.
        SET.

    DEFINE PUBLIC PROPERTY  Suchbe          AS  CHARACTER   NO-UNDO
        GET.
        SET.

    DEFINE PUBLIC PROPERTY  Bez             AS  CHARACTER   NO-UNDO
        GET.
        SET.

    DEFINE PUBLIC PROPERTY  Bez1            AS  CHARACTER   NO-UNDO
        GET.
        SET.

    DEFINE PUBLIC PROPERTY  Bez2            AS  CHARACTER   NO-UNDO
        GET.
        SET.

    DEFINE PUBLIC PROPERTY  GGeb_Cd         AS  CHARACTER   NO-UNDO
        GET.
        SET.
    DEFINE PUBLIC PROPERTY  GGeb_Cd_KBez    AS  CHARACTER   NO-UNDO
        GET.
        SET.
    DEFINE PUBLIC PROPERTY  GGeb_Cd_Bez     AS  CHARACTER   NO-UNDO
        GET.
        SET.
    DEFINE PUBLIC PROPERTY  GGeb_Cd_Inhalt  AS  INTEGER     NO-UNDO
        GET.
        SET.

    DEFINE PUBLIC PROPERTY  VGeb_Cd         AS  CHARACTER   NO-UNDO
        GET.
        SET.
    DEFINE PUBLIC PROPERTY  VGeb_Cd_KBez    AS  CHARACTER   NO-UNDO
        GET.
        SET.
    DEFINE PUBLIC PROPERTY  VGeb_Cd_Bez     AS  CHARACTER   NO-UNDO
        GET.
        SET.
    DEFINE PUBLIC PROPERTY  VGeb_Cd_Inhalt  AS  INTEGER     NO-UNDO
        GET.
        SET.

    DEFINE PUBLIC PROPERTY  KGeb_Cd         AS  CHARACTER   NO-UNDO
        GET.
        SET.
    DEFINE PUBLIC PROPERTY  KGeb_Cd_KBez    AS  CHARACTER   NO-UNDO
        GET.
        SET.
    DEFINE PUBLIC PROPERTY  KGeb_Cd_Bez     AS  CHARACTER   NO-UNDO
        GET.
        SET.
    DEFINE PUBLIC PROPERTY  KGeb_Cd_Inhalt  AS  INTEGER     NO-UNDO
        GET.
        SET.
        
    DEFINE PUBLIC PROPERTY  Wg_Grp          AS  INTEGER     NO-UNDO
        GET.
        SET.
    DEFINE PUBLIC PROPERTY  Wg_Grp_Bez1     AS  CHARACTER   NO-UNDO
        GET.
        SET.
    DEFINE PUBLIC PROPERTY  Wg_Grp_Bez2     AS  CHARACTER   NO-UNDO
        GET.
        SET.
    DEFINE PUBLIC PROPERTY  Wg_Grp_Bez      AS  CHARACTER   NO-UNDO
        GET.
        SET.
        
    DEFINE PUBLIC PROPERTY  Prod_Grp        AS  INTEGER     NO-UNDO
        GET.
        SET.
    DEFINE PUBLIC PROPERTY  Prod_Grp_Bez1   AS  CHARACTER   NO-UNDO
        GET.
        SET.
    DEFINE PUBLIC PROPERTY  Prod_Grp_Bez2   AS  CHARACTER   NO-UNDO
        GET.
        SET.
    DEFINE PUBLIC PROPERTY  Prod_Grp_Bez    AS  CHARACTER   NO-UNDO
        GET.
        SET.
        
    DEFINE PUBLIC PROPERTY  Art_Grp         AS  INTEGER     NO-UNDO
        GET.
        SET.
    DEFINE PUBLIC PROPERTY  Art_Grp_Bez1    AS  CHARACTER   NO-UNDO
        GET.
        SET.
    DEFINE PUBLIC PROPERTY  Art_Grp_Bez2    AS  CHARACTER   NO-UNDO
        GET.
        SET.
    DEFINE PUBLIC PROPERTY  Art_Grp_Bez     AS  CHARACTER   NO-UNDO
        GET.
        SET.

    DEFINE PUBLIC PROPERTY  Rab_Grp         AS  INTEGER     NO-UNDO
        GET.
        SET.
    DEFINE PUBLIC PROPERTY  Rab_Grp_Bez1    AS  CHARACTER   NO-UNDO
        GET.
        SET.
    DEFINE PUBLIC PROPERTY  Rab_Grp_Bez2    AS  CHARACTER   NO-UNDO
        GET.
        SET.
    DEFINE PUBLIC PROPERTY  Rab_Grp_Bez     AS  CHARACTER   NO-UNDO
        GET.
        SET.

    DEFINE PUBLIC PROPERTY  Bonus_Grp       AS  INTEGER     NO-UNDO
        GET.
        SET.
    DEFINE PUBLIC PROPERTY  Bonus_Grp_Bez1  AS  CHARACTER   NO-UNDO
        GET.
        SET.
    DEFINE PUBLIC PROPERTY  Bonus_Grp_Bez2 AS  CHARACTER   NO-UNDO
        GET.
        SET.
    DEFINE PUBLIC PROPERTY  Bonus_Grp_Bez   AS  CHARACTER   NO-UNDO
        GET.
        SET.

    DEFINE PUBLIC PROPERTY  Reg_Grp         AS  INTEGER     NO-UNDO
        GET.
        SET.
    DEFINE PUBLIC PROPERTY  Reg_Grp_Bez1    AS  CHARACTER   NO-UNDO
        GET.
        SET.
    DEFINE PUBLIC PROPERTY  Reg_Grp_Bez2    AS  CHARACTER   NO-UNDO
        GET.
        SET.
    DEFINE PUBLIC PROPERTY  Reg_Grp_Bez     AS  CHARACTER   NO-UNDO
        GET.
        SET.

    DEFINE PUBLIC PROPERTY  Farbe           AS  INTEGER     NO-UNDO
        GET.
        SET.
    DEFINE PUBLIC PROPERTY  Farbe_Bez1      AS  CHARACTER   NO-UNDO
        GET.
        SET.
    DEFINE PUBLIC PROPERTY  Farbe_Bez2      AS  CHARACTER   NO-UNDO
        GET.
        SET.
    DEFINE PUBLIC PROPERTY  Farbe_Bez       AS  CHARACTER   NO-UNDO
        GET.
        SET.

    DEFINE PUBLIC PROPERTY  Traub_Grp       AS  INTEGER     NO-UNDO
        GET.
        SET.
    DEFINE PUBLIC PROPERTY  Traub_Grp_Bez1  AS  CHARACTER   NO-UNDO
        GET.
        SET.
    DEFINE PUBLIC PROPERTY  Traub_Grp_Bez2  AS  CHARACTER   NO-UNDO
        GET.
        SET.
    DEFINE PUBLIC PROPERTY  Traub_Grp_Bez   AS  CHARACTER   NO-UNDO
        GET.
        SET.

    DEFINE PUBLIC PROPERTY  Style           AS  INTEGER     NO-UNDO
        GET.
        SET.
    DEFINE PUBLIC PROPERTY  Style_Bez1      AS  CHARACTER   NO-UNDO
        GET.
        SET.
    DEFINE PUBLIC PROPERTY  Style_Bez2      AS  CHARACTER   NO-UNDO
        GET.
        SET.
    DEFINE PUBLIC PROPERTY  Style_Bez       AS  CHARACTER   NO-UNDO
        GET.
        SET.

    DEFINE PUBLIC PROPERTY  Herst           AS  INTEGER     NO-UNDO
        GET.
        SET.
    DEFINE PUBLIC PROPERTY  Herst_Bez       AS  CHARACTER   NO-UNDO
        GET.
        SET.
    DEFINE PUBLIC PROPERTY  Herst_GLN       AS  CHARACTER   NO-UNDO
        GET.
        SET.
        

    DEFINE PUBLIC PROPERTY  Leih_Art        AS  LOGICAL     NO-UNDO
        GET.
        SET.

    DEFINE PUBLIC PROPERTY  Lager           AS  LOGICAL     NO-UNDO
        GET.
        SET.

    DEFINE PUBLIC PROPERTY  Sk_Ber          AS  LOGICAL     NO-UNDO
        GET.
        SET.

    DEFINE PUBLIC PROPERTY  MWSt            AS  INTEGER     NO-UNDO
        GET.
        SET.

    DEFINE PUBLIC PROPERTY  Konto           AS  CHARACTER   NO-UNDO
        GET.
        SET.

    DEFINE PUBLIC PROPERTY  Gewicht         AS  DECIMAL     NO-UNDO
        GET.
        SET.

    DEFINE PUBLIC PROPERTY  Alk_Gehalt      AS  DECIMAL     NO-UNDO
        GET.
        SET.

    DEFINE PUBLIC PROPERTY  Herk_Lkz        AS  CHARACTER   NO-UNDO
        GET.
        SET.

    DEFINE PUBLIC PROPERTY  Strichcode      AS  CHARACTER   NO-UNDO
        GET.
        SET.

    DEFINE PUBLIC PROPERTY  Bestand         AS  INTEGER     NO-UNDO
        GET.
        SET.

    DEFINE PUBLIC PROPERTY  Reserviert      AS  INTEGER     NO-UNDO
        GET.
        SET.

    DEFINE PUBLIC PROPERTY  Bestellt        AS  INTEGER     NO-UNDO
        GET.
        SET.

    DEFINE PUBLIC PROPERTY  Mind_Bestand    AS  INTEGER     NO-UNDO
        GET.
        SET.

    DEFINE PUBLIC PROPERTY  LEP             AS  DECIMAL     NO-UNDO
        GET.
        SET.

    DEFINE PUBLIC PROPERTY  DEP             AS  DECIMAL     NO-UNDO
        GET.
        SET.

    DEFINE PUBLIC PROPERTY  Letzt_Eing      AS  DATE        NO-UNDO
        GET.
        SET.

    DEFINE PUBLIC PROPERTY  Letzt_Ausg      AS  DATE        NO-UNDO
        GET.
        SET.

    DEFINE PUBLIC PROPERTY  Edat            AS  DATE        NO-UNDO
        GET.
        SET.

    DEFINE PUBLIC PROPERTY  Esbkb           AS  CHARACTER   NO-UNDO
        GET.
        SET.

    DEFINE PUBLIC PROPERTY  Mdat            AS  DATE        NO-UNDO
        GET.
        SET.

    DEFINE PUBLIC PROPERTY  Msbkb           AS  CHARACTER   NO-UNDO
        GET.
        SET.

    DEFINE PUBLIC PROPERTY  Aktiv           AS  LOGICAL     NO-UNDO
        GET.
        SET.

    DEFINE PUBLIC PROPERTY  Netto           AS  LOGICAL     NO-UNDO
        GET.
        SET.

    DEFINE PUBLIC PROPERTY  MutFlag         AS  LOGICAL     NO-UNDO
        GET.
        SET.

    DEFINE PUBLIC PROPERTY  Ausverk         AS  INTEGER     NO-UNDO
        GET.
        SET.

    DEFINE PUBLIC PROPERTY  Res_i1          AS  INTEGER     NO-UNDO
        GET.
        SET.

    DEFINE PUBLIC PROPERTY  WHK_Code        AS  CHARACTER   NO-UNDO
        GET.
        SET.

    DEFINE PUBLIC PROPERTY  Res_c2          AS  CHARACTER   NO-UNDO
        GET.
        SET.

    DEFINE PUBLIC PROPERTY  Res_c1          AS  CHARACTER   NO-UNDO
        GET.
        SET.

    DEFINE PUBLIC PROPERTY  Soll_Bestand    AS  INTEGER     NO-UNDO
        GET.
        SET.

    DEFINE PUBLIC PROPERTY  Min_Marge       AS  DECIMAL     NO-UNDO
        GET.
        SET.

    DEFINE PUBLIC PROPERTY  Listen_EP       AS  DECIMAL     NO-UNDO
        GET.
        SET.

    DEFINE PUBLIC PROPERTY  Preisliste      AS  LOGICAL     NO-UNDO
        GET.
        SET.

    DEFINE PUBLIC PROPERTY  EAV_Code        AS  CHARACTER   NO-UNDO
        GET.
        SET.

    DEFINE PUBLIC PROPERTY  EShop           AS  LOGICAL     NO-UNDO
        GET.
        SET.

    DEFINE PUBLIC PROPERTY  EShop_2         AS  LOGICAL     NO-UNDO
        GET.
        SET.

    DEFINE PUBLIC PROPERTY  FremdNr         AS  CHARACTER   NO-UNDO
        GET.
        SET.

    DEFINE PUBLIC PROPERTY  ArtikelBild     AS  CHARACTER   NO-UNDO
        GET.
        SET.

    DEFINE PUBLIC PROPERTY  EP-Intern       AS  DECIMAL     NO-UNDO
        GET.
        SET.

    DEFINE PUBLIC PROPERTY  lLotnr          AS  LOGICAL     NO-UNDO
        GET.
        SET.

    DEFINE PUBLIC PROPERTY  lVerfall        AS  LOGICAL     NO-UNDO
        GET.
        SET.

    DEFINE PUBLIC PROPERTY  Mind_MHD        AS  INTEGER     NO-UNDO
        GET.
        SET.

    DEFINE PUBLIC PROPERTY S_Bez1           AS CHARACTER    NO-UNDO
        GET.
        SET.
    DEFINE PUBLIC PROPERTY S_Bez2           AS CHARACTER    NO-UNDO
        GET.
        SET.
        
    DEFINE PUBLIC PROPERTY Lagerort         AS CHARACTER    NO-UNDO 
        GET.
        SET.
    
    DEFINE PUBLIC PROPERTY Strichcode_GGeb  AS CHARACTER    NO-UNDO
        GET.
        SET.
    DEFINE PUBLIC PROPERTY Strichcode_VGeb  AS CHARACTER    NO-UNDO
        GET.
        SET.
    DEFINE PUBLIC PROPERTY Strichcode_KGeb  AS CHARACTER    NO-UNDO
        GET.
        SET.

    DEFINE PUBLIC PROPERTY lOk              AS LOGICAL      NO-UNDO
        GET.
        SET.
    DEFINE PUBLIC PROPERTY cErrorMessage    AS CHARACTER    NO-UNDO
        GET.
        SET.
        
    /*------------------------------------------------------------------------------
     Purpose:
     Notes:
    ------------------------------------------------------------------------------*/

    CONSTRUCTOR PUBLIC Artst (  ):
        SUPER ().
        
    END CONSTRUCTOR.

    /*------------------------------------------------------------------------------
     Purpose:
     Notes: Initial Construktor Address
    ------------------------------------------------------------------------------*/

    CONSTRUCTOR PUBLIC Artst ( cFirma AS CHARACTER, iArtnr AS INTEGER, iInhalt AS INTEGER, iJahr AS INTEGER   ):
        SUPER ().
        
        ASSIGN  
            THIS-OBJECT:Firma  = cFirma
            THIS-OBJECT:Artnr  = iArtnr
            THIS-OBJECT:Inhalt = iInhalt
            THIS-OBJECT:Jahr   = iJahr.  

        getArtikel().
        
    END CONSTRUCTOR.

    /*------------------------------------------------------------------------------
     Purpose:
     Notes: Initial Construktor Address
    ------------------------------------------------------------------------------*/

    CONSTRUCTOR PUBLIC Artst ( cFirma AS CHARACTER, iArtnr AS INTEGER, iInhalt AS INTEGER, iJahr AS INTEGER, iLager AS INTEGER ):
        SUPER ().
        
        ASSIGN  
            THIS-OBJECT:Firma  = cFirma
            THIS-OBJECT:Artnr  = iArtnr
            THIS-OBJECT:Inhalt = iInhalt
            THIS-OBJECT:Jahr   = iJahr .
            
        getArtikelLager( INPUT iLager ).
        
    END CONSTRUCTOR.

    /*------------------------------------------------------------------------------
     Purpose:
     Notes:
    ------------------------------------------------------------------------------*/

    METHOD PUBLIC LOGICAL getArtikel(  ):
        
        DEFINE VARIABLE cString AS CHARACTER NO-UNDO.
        
        DEFINE BUFFER bArtst FOR Artst.

        FIND bArtst NO-LOCK 
            WHERE bArtst.Firma  = THIS-OBJECT:Firma
            AND   bArtst.Artnr  = THIS-OBJECT:Artnr
            AND   bArtst.Inhalt = THIS-OBJECT:Inhalt
            AND   bArtst.Jahr   = THIS-OBJECT:Jahr NO-ERROR.
        IF NOT AVAILABLE bArtst THEN 
        DO:
            lOk           = FALSE.
            cErrorMessage = 'NOT FOUND'.
            RETURN FALSE.
        END.
        
        ASSIGN
            Suchbe       = bArtst.Suchbe
            Bez          = bArtst.Bez
            KGeb_Cd      = bArtst.KGeb_Cd
            GGeb_Cd      = bArtst.GGeb_Cd
            VGeb_Cd      = bArtst.VGeb_Cd
            Wg_Grp       = bArtst.Wg_Grp
            Prod_Grp     = bArtst.Prod_Grp
            Art_Grp      = bArtst.Art_Grp
            Rab_Grp      = bArtst.Rab_Grp
            Bonus_Grp    = bArtst.Bonus_Grp
            Reg_Grp      = bArtst.Reg_Grp
            Farbe        = bArtst.Farbe
            Traub_Grp    = bArtst.Traub_Grp
            Leih_Art     = bArtst.Leih_Art
            Lager        = bArtst.Lager
            Sk_Ber       = bArtst.Sk_Ber
            MWSt         = bArtst.MWSt
            Konto        = bArtst.Konto
            Gewicht      = bArtst.Gewicht
            Alk_Gehalt   = bArtst.Alk_Gehalt
            Herk_Lkz     = bArtst.Herk_Lkz
            Strichcode   = bArtst.Strichcode
            Bestand      = bArtst.Bestand
            Reserviert   = bArtst.Reserviert
            Bestellt     = bArtst.Bestellt
            Mind_Bestand = bArtst.Mind_Bestand
            LEP          = bArtst.LEP
            DEP          = bArtst.DEP
            Letzt_Eing   = bArtst.Letzt_Eing
            Letzt_Ausg   = bArtst.Letzt_Ausg
            Edat         = bArtst.Edat
            Esbkb        = bArtst.Esbkb
            Mdat         = bArtst.Mdat
            Msbkb        = bArtst.Msbkb
            Aktiv        = bArtst.Aktiv
            Netto        = bArtst.Netto
            MutFlag      = bArtst.MutFlag
            Ausverk      = bArtst.Ausverk
            Style        = bArtst.Style
            Res_i1       = bArtst.Res_i1
            WHK_Code     = bArtst.WHK_Code
            Res_c2       = bArtst.Res_c2
            Res_c1       = bArtst.Res_c1
            Soll_Bestand = bArtst.Soll_Bestand
            Min_Marge    = bArtst.Min_Marge
            Listen_EP    = bArtst.Listen_EP
            Herst        = bArtst.Herst
            Preisliste   = bArtst.Preisliste
            EAV_Code     = bArtst.EAV_Code
            EShop        = bArtst.EShop
            FremdNr      = bArtst.FremdNr
            ArtikelBild  = bArtst.ArtikelBild
            EP-Intern    = bArtst.EP-Intern
            EShop_2      = bArtst.EShop_2
            lLotnr       = bArtst.lLotnr
            lVerfall     = bArtst.lVerfall
            Mind_MHD     = bArtst.Mind_MHD.
            
        FIND FIRST Artbez NO-LOCK
            WHERE Artbez.Firma  = bArtst.Firma
            AND   Artbez.Artnr  = bArtst.Artnr
            AND   Artbez.Inhalt = bArtst.Inhalt
            AND   Artbez.Jahr   = bArtst.Jahr NO-ERROR.
        IF AVAILABLE Artbez THEN 
        DO:
            ASSIGN 
                Bez1 = Artbez.Bez1
                Bez2 = Artbez.Bez2.
        END.

        FIND KGebinde NO-LOCK 
            WHERE KGebinde.Firma  = Firma
            AND   KGebinde.Geb_Cd = KGeb_Cd NO-ERROR.
        IF AVAILABLE KGebinde THEN 
        DO:
            ASSIGN 
                KGeb_Cd_KBez   = KGebinde.KBez
                KGeb_Cd_Bez    = KGebinde.Bez
                KGeb_Cd_Inhalt = KGebinde.Inhalt.
        END.
        FIND VGebinde NO-LOCK 
            WHERE VGebinde.Firma  = Firma
            AND   VGebinde.Geb_Cd = VGeb_Cd NO-ERROR.
        IF AVAILABLE VGebinde THEN 
        DO:
            ASSIGN 
                VGeb_Cd_KBez   = VGebinde.KBez
                VGeb_Cd_Bez    = VGebinde.Bez
                VGeb_Cd_Inhalt = VGebinde.Inhalt.
        END.
        FIND GGebinde NO-LOCK 
            WHERE GGebinde.Firma  = Firma
            AND   GGebinde.Geb_Cd = GGeb_Cd NO-ERROR.
        IF AVAILABLE GGebinde THEN 
        DO:
            ASSIGN 
                GGeb_Cd_KBez   = GGebinde.KBez
                GGeb_Cd_Bez    = GGebinde.Bez
                GGeb_Cd_Inhalt = GGebinde.Inhalt.
        END.
        
        FIND WarenGrp NO-LOCK 
            WHERE WarenGrp.Firma  = Firma
            AND   WarenGrp.Wgr    = Wg_Grp NO-ERROR.
        IF AVAILABLE WarenGrp THEN 
        DO:
            ASSIGN  
                Wg_Grp_Bez1 = WarenGrp.Bez1
                Wg_Grp_Bez2 = WarenGrp.Bez2
                Wg_Grp_Bez  = WarenGrp.BezL.
        END.
        
        FIND ProdGrp NO-LOCK 
            WHERE ProdGrp.Firma  = Firma
            AND   ProdGrp.Wgr    = Prod_Grp NO-ERROR.
        IF AVAILABLE ProdGrp THEN 
        DO:
            ASSIGN 
                Prod_Grp_Bez1 = ProdGrp.Bez1
                Prod_Grp_Bez2 = ProdGrp.Bez2
                Prod_Grp_Bez  = ProdGrp.BezL.
        END.
        
        FIND ArtikGrp NO-LOCK 
            WHERE ArtikGrp.Firma  = Firma
            AND   ArtikGrp.Wgr    = Art_Grp NO-ERROR.
        IF AVAILABLE ArtikGrp THEN 
        DO:
            ASSIGN 
                Art_Grp_Bez1 = ArtikGrp.Bez1
                Art_Grp_Bez2 = ArtikGrp.Bez2
                Art_Grp_Bez  = ArtikGrp.BezL.
        END.
        
        cString = getTabelBezCodeI( 1, 'ARABGRP' , Rab_Grp ).   /*  Sprcd, RecArt, CodeI */
        IF cString <> '' THEN 
            ASSIGN
                Rab_Grp_Bez1 = ENTRY(1, cString, CHR(01))
                Rab_Grp_Bez2 = ENTRY(2, cString, CHR(01))
                Rab_Grp_Bez  = ENTRY(3, cString, CHR(01)).
                
        cString = getTabelBezCodeI( 1, 'ABONUS'  , Bonus_Grp ).
        IF cString <> '' THEN 
            ASSIGN 
                Bonus_Grp_Bez1 = ENTRY(1, cString, CHR(01))
                Bonus_Grp_Bez2 = ENTRY(2, cString, CHR(01))
                Bonus_Grp_Bez  = ENTRY(3, cString, CHR(01)).

         
        cString = getTabelBezCodeI( 1, 'REGION'  , Reg_Grp   ).
        IF cString <> '' THEN 
            ASSIGN 
                Reg_Grp_Bez1 = ENTRY(1, cString, CHR(01))
                Reg_Grp_Bez2 = ENTRY(2, cString, CHR(01))
                Reg_Grp_Bez  = ENTRY(3, cString, CHR(01)).

        cString = getTabelBezCodeI( 1, 'FARB'    , Farbe     ).
        IF cString <> '' THEN 
            ASSIGN 
                Farbe_Bez1 = ENTRY(1, cString, CHR(01))
                Farbe_Bez2 = ENTRY(2, cString, CHR(01))
                Farbe_Bez  = ENTRY(3, cString, CHR(01)).

        cString = getTabelBezCodeI( 1, 'TRAUB'   , Traub_Grp ).
        IF cString <> '' THEN 
            ASSIGN 
                Traub_Grp_Bez1 = ENTRY(1, cString, CHR(01))
                Traub_Grp_Bez2 = ENTRY(2, cString, CHR(01))
                Traub_Grp_Bez  = ENTRY(3, cString, CHR(01)).
                
        cString = getTabelBezCodeI( 1, 'STYLE'   , Style     ).
        IF cString <> '' THEN 
            ASSIGN 
                Style_Bez1 = ENTRY(1, cString, CHR(01))
                Style_Bez2 = ENTRY(2, cString, CHR(01))
                Style_Bez  = ENTRY(3, cString, CHR(01)).

        cString = getTabelBezCodeI( 1, 'HERST'   , Herst     ).
        IF cString <> '' THEN 
            ASSIGN 
                Herst_Bez = ENTRY(1, cString, CHR(01))
                Herst_GLN = ENTRY(2, cString, CHR(01)).
        
        lOK = TRUE.
        cErrorMessage = ''.

    END METHOD.    

    /*------------------------------------------------------------------------------
     Purpose:
     Notes:
    ------------------------------------------------------------------------------*/

    METHOD PUBLIC LOGICAL getArtikelLager( INPUT iLager AS INTEGER  ):
        
        getArtikel().
        
        IF iLager <> 99 THEN 
        DO:
        
            FIND FIRST ArtLager NO-LOCK 
                WHERE ArtLager.Firma  = Firma
                AND   ArtLager.Artnr  = Artnr
                AND   ArtLager.Inhalt = Inhalt
                AND   ArtLager.Jahr   = Jahr
                AND   ArtLager.Lager  = iLager NO-ERROR.
            IF AVAILABLE ArtLager THEN 
            DO:
                ASSIGN
                    Bestand  = ArtLager.Bestand
                    LagerOrt = ArtLager.Ort.
            END.
        END.
        
        FIND FIRST ArtLief NO-LOCK 
            WHERE ArtLief.Firma  = Firma
            AND   ArtLief.Artnr  = Artnr
            AND   ArtLief.Inhalt = Inhalt
            AND   ArtLief.Jahr   = Jahr
            AND   ArtLief.Haupt  = TRUE NO-ERROR.
        IF NOT AVAILABLE ArtLief THEN 
        DO:
            FIND FIRST ArtLief NO-LOCK 
                WHERE ArtLief.Firma  = Firma
                AND   ArtLief.Artnr  = Artnr
                AND   ArtLief.Inhalt = Inhalt
                AND   ArtLief.Jahr   = Jahr NO-ERROR.
        END.
        IF AVAILABLE ArtLief THEN 
        DO:
            ASSIGN
                S_Bez1          = ArtLief.S_Bez1
                S_Bez2          = ArtLief.S_Bez2
                Strichcode_GGeb = ArtLief.Strichcode_GGeb
                Strichcode_VGeb = ArtLief.Strichcode_VGeb
                Strichcode_KGeb = ArtLief.Strichcode_KGeb.
        END.
        
        IF S_Bez1 = '' THEN 
            ASSIGN 
                S_Bez1 = Bez1
                S_Bez2 = Bez2.
        
        RETURN TRUE.

    END METHOD.

    /*------------------------------------------------------------------------------*/
    /* Purpose:                                                                     */
    /* Notes:                                                                       */
    /*------------------------------------------------------------------------------*/

    METHOD PUBLIC CHARACTER getTabelBezCodeI( iSprcd AS INTEGER, cRecArt AS CHARACTER, iCodeI AS INTEGER ):
        
        DEFINE VARIABLE cResult AS CHARACTER NO-UNDO.
        
        DEFINE BUFFER bTabel FOR Tabel.

        FIND bTabel NO-LOCK USE-INDEX Tabel-k2
            WHERE bTabel.Firma  = Firma
            AND   bTabel.RecArt = cRecArt
            AND   bTabel.CodeI  = iCodeI
            AND   bTabel.CodeC  = ''
            AND   bTabel.Sprcd  = iSprcd NO-ERROR.
           
        cResult = (IF AVAILABLE bTabel THEN SUBSTITUTE('&1&4&2&4&3', bTabel.Bez1, bTabel.Bez2, bTabel.BezL, CHR(01) ) ELSE '' ).
        RETURN cResult.

    END METHOD.
    
        
    
    DESTRUCTOR PUBLIC Artst ():
        
    END DESTRUCTOR.

END CLASS.