ArtikelDetails.p 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. { SUPER/funktionen.i }
  2. DEF VAR cString AS CHAR NO-UNDO.
  3. DEF TEMP-TABLE tArtst LIKE Artst
  4. FIELD cBez1 AS CHAR
  5. FIELD cBez2 AS CHAR
  6. FIELD cKGeb AS CHAR
  7. FIELD cVGeb AS CHAR
  8. FIELD cGGeb AS CHAR
  9. FIELD cWgr AS CHAR
  10. FIELD cPgr AS CHAR
  11. FIELD cAgr AS CHAR
  12. FIELD cRabGrp AS CHAR
  13. FIELD cBonGrp AS CHAR
  14. FIELD cFarbe AS CHAR
  15. FIELD cTraube AS CHAR
  16. FIELD cRegion AS CHAR
  17. FIELD cLand AS CHAR
  18. FIELD cHerst AS CHAR
  19. FIELD cStyle AS CHAR
  20. FIELD lBez2 AS LOG
  21. FIELD iKnr AS INT
  22. FIELD cLief AS CHAR
  23. FIELD cSeineNr AS CHAR
  24. FIELD cStrKGeb AS CHAR
  25. FIELD cStrVGeb AS CHAR
  26. FIELD cStrGGeb AS CHAR
  27. .
  28. cString = SUBSTITUTE('&1&4&2&4&3', 'wari', 'saab009', '1000', CHR(01) ).
  29. RUN ANMELDUNG ( cString ).
  30. FOR EACH Artst NO-LOCK
  31. WHERE Artst.Firma = '1000'
  32. AND Artst.Aktiv = TRUE:
  33. CREATE tArtst.
  34. BUFFER-COPY Artst TO tArtst.
  35. FIND FIRST ArtBez OF Artst NO-LOCK.
  36. ASSIGN tArtst.cBez1 = ArtBez.Bez1
  37. tArtst.cBez2 = Artbez.Bez2
  38. tArtst.lBez2 = Artbez.Bez2_Druck.
  39. tArtst.cKGeb = DYNAMIC-FUNCTION('getKGebindeKBez':U, tArtst.KGeb_Cd ) NO-ERROR.
  40. tArtst.cVGeb = DYNAMIC-FUNCTION('getVGebindeKBez':U, tArtst.VGeb_Cd ) NO-ERROR.
  41. tArtst.cGGeb = DYNAMIC-FUNCTION('getGGebindeKBez':U, tArtst.GGeb_Cd ) NO-ERROR.
  42. tArtst.cWgr = DYNAMIC-FUNCTION('getWarenGrp':U , tArtst.Wg_Grp) NO-ERROR.
  43. tArtst.cPgr = DYNAMIC-FUNCTION('getProdukteGrp':U, tArtst.Wg_Grp, tArtst.Prod_Grp) NO-ERROR.
  44. tArtst.cAgr = DYNAMIC-FUNCTION('getArtikelGrp':U , tArtst.Wg_Grp, tArtst.Prod_Grp, tArtst.Art_Grp) NO-ERROR.
  45. tArtst.cLand = DYNAMIC-FUNCTION('getLand':U , tArtst.Herk_Lkz ) NO-ERROR.
  46. RUN FIND_RABATTGRP ( tArtst.Rab_Grp, OUTPUT cString ).
  47. tArtst.cRabGrp = ENTRY(2, cString, CHR(01)).
  48. RUN FIND_BONUSGRUPPE ( tArtst.Bonus_Grp, OUTPUT cString ).
  49. tArtst.cBonGrp = ENTRY(2, cString, CHR(01)).
  50. RUN FIND_FARBE ( tArtst.Farbe, OUTPUT cString ).
  51. tArtst.cFarbe = ENTRY(2, cString, CHR(01)).
  52. RUN FIND_TRAUBE ( tArtst.Traub_Grp, OUTPUT cString ).
  53. tArtst.cTraube = ENTRY(2, cString, CHR(01)).
  54. RUN FIND_REGION ( tArtst.Reg_Grp, OUTPUT cString ).
  55. tArtst.cRegion = ENTRY(2, cString, CHR(01)).
  56. RUN FIND_REGION ( tArtst.Reg_Grp, OUTPUT cString ).
  57. tArtst.cRegion = ENTRY(2, cString, CHR(01)).
  58. RUN FIND_HERSTELLER ( tArtst.Herst, OUTPUT cString ).
  59. tArtst.cRegion = ENTRY(2, cString, CHR(01)).
  60. RUN FIND_STYLE ( tArtst.Style, OUTPUT cString ).
  61. tArtst.cStyle = ENTRY(2, cString, CHR(01)).
  62. FIND FIRST ArtLief NO-LOCK
  63. WHERE ArtLief.Firma = tArtst.Firma
  64. AND ArtLief.Artnr = tArtst.Artnr
  65. AND ArtLief.Inhalt = tArtst.Inhalt
  66. AND ArtLief.Jahr = tArtst.Jahr
  67. AND ArtLief.Haupt = TRUE NO-ERROR.
  68. IF NOT AVAILABLE ArtLief THEN DO:
  69. FIND FIRST ArtLief NO-LOCK
  70. WHERE ArtLief.Firma = tArtst.Firma
  71. AND ArtLief.Artnr = tArtst.Artnr
  72. AND ArtLief.Inhalt = tArtst.Inhalt
  73. AND ArtLief.Jahr = tArtst.Jahr NO-ERROR.
  74. END.
  75. IF AVAILABLE ArtLief THEN DO:
  76. FIND Adresse NO-LOCK
  77. WHERE Adresse.Firma = '1000'
  78. AND Adresse.Knr = ArtLief.Knr NO-ERROR.
  79. ASSIGN tArtst.iKnr = ArtLief.Knr
  80. tArtst.cLief = (IF AVAILABLE Adresse THEN Adresse.Anzeig_Br ELSE '??????????')
  81. tArtst.cSeineNr = ArtLief.S_Artnr
  82. tArtst.cStrKGeb = ArtLief.Strichcode_KGeb
  83. tArtst.cStrVGeb = ArtLief.Strichcode_VGeb
  84. tArtst.cStrGGeb = ArtLief.Strichcode_GGeb.
  85. END.
  86. END.
  87. OUTPUT TO 'C:\Entwicklung\Temp\Artikeldetail.csv' NO-MAP NO-CONVERT.
  88. PUT CONTROL 'Artnr;Inhalt;Jahr;Suchbe;Bez1;Bez2;KGeb;KGebinde;VGeb;VGebinde;GGeb;GGebinde;Wg;Warengruppe;ProdGrp;Produktegruppe;ArtGrp;Artikelgruppe;'
  89. 'Mwst;Status;Netto;Lager;Preisliste;Alk-%;Gewicht;Strichcode;Listen_EP;EP-Intern;eShop;Bez-2?;Bestand;'
  90. 'RabGrp;Rabattgruppe;BonusGrp;Bonusgruppe;Farbe;Farbe;TraubGrp;Traubensorte;RegGrp;Region;Herk;Herkunftsland;Herest;Hersteller;Style;Style;'
  91. 'KNr;Lieferant;Seine Artnr;StrCode KGeb;StrCode VGeb;StrCode GGeb' CHR(10).
  92. FOR EACH tArtst:
  93. EXPORT DELIMITER ';'
  94. tArtst.Artnr
  95. tArtst.Inhalt
  96. tArtst.Jahr
  97. tArtst.Suchbe
  98. tArtst.cBez1
  99. tArtst.cBez2
  100. tArtst.KGeb_Cd
  101. tArtst.cKGeb
  102. tArtst.VGeb_Cd
  103. tArtst.cVGeb
  104. tArtst.GGeb_Cd
  105. tArtst.cGGeb
  106. tArtst.Wg_Grp
  107. tArtst.cWgr
  108. tArtst.Prod_Grp
  109. tArtst.cPgr
  110. tArtst.Art_Grp
  111. tARtst.cAgr
  112. tArtst.Mwst
  113. tArtst.Ausverk
  114. tArtst.Netto
  115. tArtst.Lager
  116. tArtst.Preisliste
  117. tArtst.Alk_Gehalt
  118. tARtst.Gewicht
  119. tArtst.Strichcode
  120. tArtst.Listen_EP
  121. tArtst.EP-Intern
  122. tARtst.eShop
  123. tArtst.lBez2
  124. tArtst.Bestand
  125. tArtst.Rab_Grp
  126. tArtst.cRabGrp
  127. tArtst.Bonus_Grp
  128. tArtst.cBonGrp
  129. tArtst.Farbe
  130. tArtst.cFarbe
  131. tArtst.Traub_Grp
  132. tArtst.cTraube
  133. tArtst.Reg_Grp
  134. tArtst.cRegion
  135. tArtst.Herk_Lkz
  136. tArtst.cLand
  137. tArtst.Herst
  138. tArtst.cHerst
  139. tArtst.Style
  140. tArtst.cStyle
  141. tArtst.iKnr
  142. tArtst.cLief
  143. tArtst.cSeineNr
  144. tArtst.cStrKGeb
  145. tArtst.cStrVGeb
  146. tArtst.cStrGGeb
  147. .
  148. END.
  149. OUTPUT CLOSE.