d-artpreis.w 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582
  1. &ANALYZE-SUSPEND _VERSION-NUMBER AB_v10r12 GUI ADM2
  2. &ANALYZE-RESUME
  3. /* Connected Databases
  4. anadat PROGRESS
  5. */
  6. &Scoped-define WINDOW-NAME CURRENT-WINDOW
  7. {adecomm/appserv.i}
  8. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _DEFINITIONS dTables
  9. /*------------------------------------------------------------------------
  10. File:
  11. Description: from DATA.W - Template For SmartData objects in the ADM
  12. Input Parameters:
  13. <none>
  14. Output Parameters:
  15. <none>
  16. Modified: February 24, 1999
  17. ------------------------------------------------------------------------*/
  18. /* This .W file was created with the Progress AppBuilder. */
  19. /*----------------------------------------------------------------------*/
  20. /* Create an unnamed pool to store all the widgets created
  21. by this procedure. This is a good default which assures
  22. that this procedure's triggers and internal procedures
  23. will execute in this procedure's storage, and that proper
  24. cleanup will occur on deletion of the procedure. */
  25. CREATE WIDGET-POOL.
  26. /* *************************** Definitions ************************** */
  27. /* Parameters Definitions --- */
  28. /* Local Variable Definitions --- */
  29. DEF VAR lInaktiv AS LOG NO-UNDO.
  30. &SCOPED-DEFINE Tabelle ArtPreis
  31. &SCOPED-DEFINE TabWhere /* USE-INDEX Benutzer-k1 ~
  32. WHERE {&Tabelle}.Benutzer = tRowObject.Benutzer
  33. */
  34. { incl/datdefinition.i }
  35. /* _UIB-CODE-BLOCK-END */
  36. &ANALYZE-RESUME
  37. &ANALYZE-SUSPEND _UIB-PREPROCESSOR-BLOCK
  38. /* ******************** Preprocessor Definitions ******************** */
  39. &Global-define DATA-LOGIC-PROCEDURE .p
  40. &Scoped-define PROCEDURE-TYPE SmartDataObject
  41. &Scoped-define DB-AWARE yes
  42. &Scoped-define ADM-SUPPORTED-LINKS Data-Source,Data-Target,Navigation-Target,Update-Target,Commit-Target,Filter-Target
  43. /* Db-Required definitions. */
  44. &IF DEFINED(DB-REQUIRED) = 0 &THEN
  45. &GLOBAL-DEFINE DB-REQUIRED TRUE
  46. &ENDIF
  47. &GLOBAL-DEFINE DB-REQUIRED-START &IF {&DB-REQUIRED} &THEN
  48. &GLOBAL-DEFINE DB-REQUIRED-END &ENDIF
  49. &Scoped-define QUERY-NAME Query-Main
  50. /* Internal Tables (found by Frame, Query & Browse Queries) */
  51. &Scoped-define INTERNAL-TABLES ArtPreis Tabel
  52. /* Definitions for QUERY Query-Main */
  53. &Scoped-Define ENABLED-FIELDS Firma Artnr Inhalt Jahr Preis_Grp Ab_Datum Aktion AktName VK_Netto~
  54. VK_Brutto Marge Aktiv Preisgruppe ArtID MinMarge
  55. &Scoped-define ENABLED-FIELDS-IN-ArtPreis Firma Artnr Inhalt Jahr Preis_Grp ~
  56. Ab_Datum Aktion AktName VK_Netto VK_Brutto Marge Aktiv
  57. &Scoped-Define DATA-FIELDS Firma Artnr Inhalt Jahr Preis_Grp Ab_Datum Aktion AktName VK_Netto~
  58. VK_Brutto Marge Aktiv Preisgruppe ArtID MinMarge
  59. &Scoped-define DATA-FIELDS-IN-ArtPreis Firma Artnr Inhalt Jahr Preis_Grp ~
  60. Ab_Datum Aktion AktName VK_Netto VK_Brutto Marge Aktiv
  61. &Scoped-Define MANDATORY-FIELDS Firma
  62. &Scoped-Define APPLICATION-SERVICE
  63. &Scoped-Define ASSIGN-LIST
  64. &Scoped-Define DATA-FIELD-DEFS "d-artpreis.i"
  65. &Scoped-Define DATA-TABLE-NO-UNDO NO-UNDO
  66. &Scoped-define QUERY-STRING-Query-Main FOR EACH ArtPreis NO-LOCK, ~
  67. EACH Tabel WHERE TRUE /* Join to ArtPreis incomplete */ NO-LOCK INDEXED-REPOSITION
  68. {&DB-REQUIRED-START}
  69. &Scoped-define OPEN-QUERY-Query-Main OPEN QUERY Query-Main FOR EACH ArtPreis NO-LOCK, ~
  70. EACH Tabel WHERE TRUE /* Join to ArtPreis incomplete */ NO-LOCK INDEXED-REPOSITION.
  71. {&DB-REQUIRED-END}
  72. &Scoped-define TABLES-IN-QUERY-Query-Main ArtPreis Tabel
  73. &Scoped-define FIRST-TABLE-IN-QUERY-Query-Main ArtPreis
  74. &Scoped-define SECOND-TABLE-IN-QUERY-Query-Main Tabel
  75. /* Custom List Definitions */
  76. /* List-1,List-2,List-3,List-4,List-5,List-6 */
  77. /* _UIB-PREPROCESSOR-BLOCK-END */
  78. &ANALYZE-RESUME
  79. /* ************************ Function Prototypes ********************** */
  80. {&DB-REQUIRED-START}
  81. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION-FORWARD getQueryBuffer dTables _DB-REQUIRED
  82. FUNCTION getQueryBuffer RETURNS HANDLE
  83. ( /* parameter-definitions */ ) FORWARD.
  84. /* _UIB-CODE-BLOCK-END */
  85. &ANALYZE-RESUME
  86. {&DB-REQUIRED-END}
  87. {&DB-REQUIRED-START}
  88. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION-FORWARD openQuery dTables _DB-REQUIRED
  89. FUNCTION openQuery RETURNS LOGICAL
  90. ( /* parameter-definitions */ ) FORWARD.
  91. /* _UIB-CODE-BLOCK-END */
  92. &ANALYZE-RESUME
  93. {&DB-REQUIRED-END}
  94. /* *********************** Control Definitions ********************** */
  95. {&DB-REQUIRED-START}
  96. /* Query definitions */
  97. &ANALYZE-SUSPEND
  98. DEFINE QUERY Query-Main FOR
  99. ArtPreis,
  100. Tabel SCROLLING.
  101. &ANALYZE-RESUME
  102. {&DB-REQUIRED-END}
  103. /* ************************ Frame Definitions *********************** */
  104. /* *********************** Procedure Settings ************************ */
  105. &ANALYZE-SUSPEND _PROCEDURE-SETTINGS
  106. /* Settings for THIS-PROCEDURE
  107. Type: SmartDataObject
  108. Allow: Query
  109. Frames: 0
  110. Add Fields to: Neither
  111. Other Settings: PERSISTENT-ONLY COMPILE APPSERVER DB-AWARE
  112. */
  113. /* This procedure should always be RUN PERSISTENT. Report the error, */
  114. /* then cleanup and return. */
  115. IF NOT THIS-PROCEDURE:PERSISTENT THEN DO:
  116. MESSAGE "{&FILE-NAME} should only be RUN PERSISTENT.":U
  117. VIEW-AS ALERT-BOX ERROR BUTTONS OK.
  118. RETURN.
  119. END.
  120. &ANALYZE-RESUME _END-PROCEDURE-SETTINGS
  121. /* ************************* Create Window ************************** */
  122. &ANALYZE-SUSPEND _CREATE-WINDOW
  123. /* DESIGN Window definition (used by the UIB)
  124. CREATE WINDOW dTables ASSIGN
  125. HEIGHT = 1.67
  126. WIDTH = 58.2.
  127. /* END WINDOW DEFINITION */
  128. */
  129. &ANALYZE-RESUME
  130. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _INCLUDED-LIB dTables
  131. /* ************************* Included-Libraries *********************** */
  132. {src/adm2/data.i}
  133. /* _UIB-CODE-BLOCK-END */
  134. &ANALYZE-RESUME
  135. /* *********** Runtime Attributes and AppBuilder Settings *********** */
  136. &ANALYZE-SUSPEND _RUN-TIME-ATTRIBUTES
  137. /* SETTINGS FOR WINDOW dTables
  138. VISIBLE,,RUN-PERSISTENT */
  139. /* _RUN-TIME-ATTRIBUTES-END */
  140. &ANALYZE-RESUME
  141. /* Setting information for Queries and Browse Widgets fields */
  142. &ANALYZE-SUSPEND _QUERY-BLOCK QUERY Query-Main
  143. /* Query rebuild information for SmartDataObject Query-Main
  144. _TblList = "AnaDat.ArtPreis,AnaDat.Tabel WHERE AnaDat.ArtPreis ..."
  145. _Options = "NO-LOCK INDEXED-REPOSITION"
  146. _FldNameList[1] > AnaDat.ArtPreis.Firma
  147. "Firma" "Firma" ? ? "character" ? ? ? ? ? ? yes ? yes 8 yes ?
  148. _FldNameList[2] > AnaDat.ArtPreis.Artnr
  149. "Artnr" "Artnr" ? ? "integer" ? ? ? ? ? ? yes ? no 7.2 yes ?
  150. _FldNameList[3] > AnaDat.ArtPreis.Inhalt
  151. "Inhalt" "Inhalt" ? ? "integer" ? ? ? ? ? ? yes ? no 5.2 yes ?
  152. _FldNameList[4] > AnaDat.ArtPreis.Jahr
  153. "Jahr" "Jahr" ? ? "integer" ? ? ? ? ? ? yes ? no 4.8 yes ?
  154. _FldNameList[5] > AnaDat.ArtPreis.Preis_Grp
  155. "Preis_Grp" "Preis_Grp" ? ? "integer" ? ? ? ? ? ? yes ? no 9.2 yes ?
  156. _FldNameList[6] > AnaDat.ArtPreis.Ab_Datum
  157. "Ab_Datum" "Ab_Datum" ? ? "date" ? ? ? ? ? ? yes ? no 10.8 yes ?
  158. _FldNameList[7] > AnaDat.ArtPreis.Aktion
  159. "Aktion" "Aktion" ? ? "logical" ? ? ? ? ? ? yes ? no 6 yes ?
  160. _FldNameList[8] > AnaDat.ArtPreis.AktName
  161. "AktName" "AktName" ? ? "character" ? ? ? ? ? ? yes ? no 20 yes ?
  162. _FldNameList[9] > AnaDat.ArtPreis.VK_Netto
  163. "VK_Netto" "VK_Netto" ? ? "decimal" ? ? ? ? ? ? yes ? no 12.2 yes ?
  164. _FldNameList[10] > AnaDat.ArtPreis.VK_Brutto
  165. "VK_Brutto" "VK_Brutto" ? ? "decimal" ? ? ? ? ? ? yes ? no 12.2 yes ?
  166. _FldNameList[11] > AnaDat.ArtPreis.Marge
  167. "Marge" "Marge" ? ? "decimal" ? ? ? ? ? ? yes ? no 9.2 yes ?
  168. _FldNameList[12] > AnaDat.ArtPreis.Aktiv
  169. "Aktiv" "Aktiv" ? ? "logical" ? ? ? ? ? ? yes ? no 4.8 yes ?
  170. _FldNameList[13] > "_<CALC>"
  171. "DYNAMIC-FUNCTION('getPreisGrp':U, RowObject.Preis_Grp)" "Preisgruppe" "Preisgruppe" "x(20)" "character" ? ? ? ? ? ? yes ? no 20 no ?
  172. _FldNameList[14] > "_<CALC>"
  173. "RECID (Artpreis)" "ArtID" "ArtPreisRecid" "->,>>>,>>9" "Integer" ? ? ? ? ? ? yes ? no 10.2 no ?
  174. _FldNameList[15] > "_<CALC>"
  175. "DYNAMIC-FUNCTION('getMinMarge':U, RowObject.Artnr, RowObject.Inhalt, RowObject.Jahr)" "MinMarge" "Min. Marge" "->>,>>9.999" "Decimal" ? ? ? ? ? ? yes ? no 11.4 no ?
  176. _Design-Parent is WINDOW dTables @ ( 1.14 , 2.6 )
  177. */ /* QUERY Query-Main */
  178. &ANALYZE-RESUME
  179. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _MAIN-BLOCK dTables
  180. /* *************************** Main Block *************************** */
  181. { incl/datmainblock.i }
  182. fOpen = FALSE.
  183. SUBSCRIBE TO 'OPENPREIS' ANYWHERE.
  184. &IF DEFINED(UIB_IS_RUNNING) <> 0 &THEN
  185. RUN initializeObject.
  186. &ENDIF
  187. /* _UIB-CODE-BLOCK-END */
  188. &ANALYZE-RESUME
  189. /* ********************** Internal Procedures *********************** */
  190. {&DB-REQUIRED-START}
  191. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE DATA.CALCULATE dTables DATA.CALCULATE _DB-REQUIRED
  192. PROCEDURE DATA.CALCULATE :
  193. /*------------------------------------------------------------------------------
  194. Purpose: Calculate all the Calculated Expressions found in the
  195. SmartDataObject.
  196. Parameters: <none>
  197. ------------------------------------------------------------------------------*/
  198. ASSIGN
  199. rowObject.ArtID = (RECID (Artpreis))
  200. rowObject.MinMarge = (DYNAMIC-FUNCTION('getMinMarge':U, RowObject.Artnr, RowObject.Inhalt, RowObject.Jahr))
  201. rowObject.Preisgruppe = (DYNAMIC-FUNCTION('getPreisGrp':U, RowObject.Preis_Grp))
  202. .
  203. END PROCEDURE.
  204. /* _UIB-CODE-BLOCK-END */
  205. &ANALYZE-RESUME
  206. {&DB-REQUIRED-END}
  207. {&DB-REQUIRED-START}
  208. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE dataAvailable dTables _DB-REQUIRED
  209. PROCEDURE dataAvailable :
  210. /*------------------------------------------------------------------------------
  211. Purpose: Super Override
  212. Parameters:
  213. Notes:
  214. ------------------------------------------------------------------------------*/
  215. { incl/datdataavailable.i }
  216. END PROCEDURE.
  217. /* _UIB-CODE-BLOCK-END */
  218. &ANALYZE-RESUME
  219. {&DB-REQUIRED-END}
  220. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE disable_UI dTables _DEFAULT-DISABLE
  221. PROCEDURE disable_UI :
  222. /*------------------------------------------------------------------------------
  223. Purpose: DISABLE the User Interface
  224. Parameters: <none>
  225. Notes: Here we clean-up the user-interface by deleting
  226. dynamic widgets we have created and/or hide
  227. frames. This procedure is usually called when
  228. we are ready to "clean-up" after running.
  229. ------------------------------------------------------------------------------*/
  230. /* Hide all frames. */
  231. IF THIS-PROCEDURE:PERSISTENT THEN DELETE PROCEDURE THIS-PROCEDURE.
  232. END PROCEDURE.
  233. /* _UIB-CODE-BLOCK-END */
  234. &ANALYZE-RESUME
  235. {&DB-REQUIRED-START}
  236. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE INAKTIVIEREN dTables _DB-REQUIRED
  237. PROCEDURE INAKTIVIEREN :
  238. /*------------------------------------------------------------------------------
  239. Purpose:
  240. Parameters: <none>
  241. Notes:
  242. ------------------------------------------------------------------------------*/
  243. RETURN 'LOESCHEN'.
  244. /*
  245. { incl/datinaktivieren.i }
  246. */
  247. END PROCEDURE.
  248. /* _UIB-CODE-BLOCK-END */
  249. &ANALYZE-RESUME
  250. {&DB-REQUIRED-END}
  251. {&DB-REQUIRED-START}
  252. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE initializeObject dTables _DB-REQUIRED
  253. PROCEDURE initializeObject :
  254. /*------------------------------------------------------------------------------
  255. Purpose: Super Override
  256. Parameters:
  257. Notes:
  258. ------------------------------------------------------------------------------*/
  259. cSort = 'Preis_Grp'.
  260. fDesc = FALSE.
  261. DYNAMIC-FUNCTION('getArtPreisSort':U, INPUT-OUTPUT cSort, INPUT-OUTPUT fDesc ).
  262. { incl/datinitialize.i }
  263. END PROCEDURE.
  264. /* _UIB-CODE-BLOCK-END */
  265. &ANALYZE-RESUME
  266. {&DB-REQUIRED-END}
  267. {&DB-REQUIRED-START}
  268. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE OPENPREIS dTables _DB-REQUIRED
  269. PROCEDURE OPENPREIS :
  270. /*------------------------------------------------------------------------------
  271. Purpose:
  272. Parameters: <none>
  273. Notes:
  274. ------------------------------------------------------------------------------*/
  275. RUN REPOS_TABELLE.
  276. END PROCEDURE.
  277. /* _UIB-CODE-BLOCK-END */
  278. &ANALYZE-RESUME
  279. {&DB-REQUIRED-END}
  280. {&DB-REQUIRED-START}
  281. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE REAKTIVIEREN dTables _DB-REQUIRED
  282. PROCEDURE REAKTIVIEREN :
  283. /*------------------------------------------------------------------------------
  284. Purpose:
  285. Parameters: <none>
  286. Notes:
  287. ------------------------------------------------------------------------------*/
  288. { incl/datreaktivieren.i }
  289. END PROCEDURE.
  290. /* _UIB-CODE-BLOCK-END */
  291. &ANALYZE-RESUME
  292. {&DB-REQUIRED-END}
  293. {&DB-REQUIRED-START}
  294. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE REPOS_TABELLE dTables _DB-REQUIRED
  295. PROCEDURE REPOS_TABELLE :
  296. /*------------------------------------------------------------------------------
  297. Purpose:
  298. Parameters: <none>
  299. Notes:
  300. ------------------------------------------------------------------------------*/
  301. { incl/datrepos.i }
  302. END PROCEDURE.
  303. /* _UIB-CODE-BLOCK-END */
  304. &ANALYZE-RESUME
  305. {&DB-REQUIRED-END}
  306. {&DB-REQUIRED-START}
  307. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE SET_FILTER dTables _DB-REQUIRED
  308. PROCEDURE SET_FILTER :
  309. /*------------------------------------------------------------------------------
  310. Purpose:
  311. Parameters: <none>
  312. Notes:
  313. ------------------------------------------------------------------------------*/
  314. { incl/datsetfilter.i }
  315. END PROCEDURE.
  316. /* _UIB-CODE-BLOCK-END */
  317. &ANALYZE-RESUME
  318. {&DB-REQUIRED-END}
  319. {&DB-REQUIRED-START}
  320. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE SET_OPENFLAG dTables _DB-REQUIRED
  321. PROCEDURE SET_OPENFLAG :
  322. /*------------------------------------------------------------------------------
  323. Purpose:
  324. Parameters: <none>
  325. Notes:
  326. ------------------------------------------------------------------------------*/
  327. { incl/datsetopenflag.i }
  328. END PROCEDURE.
  329. /* _UIB-CODE-BLOCK-END */
  330. &ANALYZE-RESUME
  331. {&DB-REQUIRED-END}
  332. {&DB-REQUIRED-START}
  333. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE SET_SORT dTables _DB-REQUIRED
  334. PROCEDURE SET_SORT :
  335. /*------------------------------------------------------------------------------
  336. Purpose:
  337. Parameters: <none>
  338. Notes:
  339. ------------------------------------------------------------------------------*/
  340. { incl/datsetsort.i }
  341. DYNAMIC-FUNCTION('setArtPreisSort':U, cSort, fDesc ) NO-ERROR.
  342. END PROCEDURE.
  343. /* _UIB-CODE-BLOCK-END */
  344. &ANALYZE-RESUME
  345. {&DB-REQUIRED-END}
  346. /* ************************ Function Implementations ***************** */
  347. {&DB-REQUIRED-START}
  348. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION getQueryBuffer dTables _DB-REQUIRED
  349. FUNCTION getQueryBuffer RETURNS HANDLE
  350. ( /* parameter-definitions */ ) :
  351. /*------------------------------------------------------------------------------
  352. Purpose:
  353. Notes:
  354. ------------------------------------------------------------------------------*/
  355. RETURN BUFFER rowObject:HANDLE.
  356. END FUNCTION.
  357. /* _UIB-CODE-BLOCK-END */
  358. &ANALYZE-RESUME
  359. {&DB-REQUIRED-END}
  360. {&DB-REQUIRED-START}
  361. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION openQuery dTables _DB-REQUIRED
  362. FUNCTION openQuery RETURNS LOGICAL
  363. ( /* parameter-definitions */ ) :
  364. /*------------------------------------------------------------------------------
  365. Purpose: Super Override
  366. Notes:
  367. ------------------------------------------------------------------------------*/
  368. DEF VAR Felder AS CHAR NO-UNDO.
  369. DEF VAR Inhalt AS CHAR NO-UNDO.
  370. DEF VAR ix AS INT NO-UNDO.
  371. DEF VAR cFeld AS CHAR NO-UNDO.
  372. DEF VAR iArtnr AS INT NO-UNDO.
  373. DEF VAR iInhalt AS INT NO-UNDO.
  374. DEF VAR iJahr AS INT NO-UNDO.
  375. DEF VAR abDatum AS DATE FORMAT '99.99.9999' NO-UNDO.
  376. IF NOT fOpen THEN RETURN FALSE.
  377. xWhere = ''.
  378. xSort = ''.
  379. xString = ''.
  380. Felder = DYNAMIC-FUNCTION('getForeignFields':U) NO-ERROR.
  381. Inhalt = DYNAMIC-FUNCTION('getForeignValues':U) NO-ERROR.
  382. abDatum = (IF lAdmin THEN (TODAY + 180) ELSE (TODAY + 1)).
  383. lInaktiv = DYNAMIC-FUNCTION('getAnzeigePreisInaktiv':U) NO-ERROR.
  384. ix = LOOKUP('Artnr', Felder, ',') / 2.
  385. iArtnr = INTEGER(ENTRY (ix , Inhalt, CHR(01))) NO-ERROR.
  386. IF iArtnr = 0 OR
  387. iArtnr = ? THEN RETURN FALSE.
  388. ix = LOOKUP('Inhalt', Felder, ',') / 2.
  389. iInhalt = INTEGER(ENTRY (ix , Inhalt, CHR(01))) NO-ERROR.
  390. ix = LOOKUP('Jahr', Felder, ',') / 2.
  391. iJahr = INTEGER(ENTRY (ix , Inhalt, CHR(01))) NO-ERROR.
  392. xString = 'FOR EACH ArtPreis WHERE '
  393. + 'ArtPreis.Firma = "&1" AND '
  394. + 'ArtPreis.Artnr = &2 AND '
  395. + 'ArtPreis.Inhalt = &3 AND '
  396. + 'ArtPreis.Jahr = &4 AND '
  397. + 'ArtPreis.ab_Datum <= &5 '.
  398. IF NOT lInaktiv THEN xString = xString + 'AND ArtPreis.Aktiv = TRUE '.
  399. xString = xString
  400. + 'NO-LOCK , '
  401. + 'FIRST Tabel NO-LOCK '
  402. + 'WHERE Tabel.Firma = ArtPreis.Firma '
  403. + 'AND Tabel.RecArt = "PREGRP" '
  404. + 'AND Tabel.CodeI = ArtPreis.Preis_Grp '
  405. + 'AND Tabel.Int_2 = 1 '.
  406. xString = xString
  407. + ' INDEXED-REPOSITION '.
  408. xString = SUBSTITUTE(xString, Firma, iArtnr, iInhalt, iJahr, AbDatum ).
  409. { incl/datopenquery.i }
  410. IF xWhere <> '' THEN DYNAMIC-FUNCTION('setQueryWhere':U , INPUT xWhere ).
  411. IF xString <> '' THEN DYNAMIC-FUNCTION('setQueryString':U, INPUT xString).
  412. IF xSort <> '' THEN DYNAMIC-FUNCTION('setQuerySort':U , INPUT xSort ).
  413. RETURN SUPER( ).
  414. END FUNCTION.
  415. /* _UIB-CODE-BLOCK-END */
  416. &ANALYZE-RESUME
  417. {&DB-REQUIRED-END}