d-horelager.w 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803
  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. DEFINE VARIABLE rHoReLager AS RECID NO-UNDO.
  30. DEFINE VARIABLE lRefresh AS LOGICAL NO-UNDO INIT FALSE.
  31. &SCOPED-DEFINE Tabelle HoReLager
  32. &SCOPED-DEFINE TabWhere USE-INDEX HoReLager-k1 ~
  33. WHERE {&Tabelle}.Firma = tRowObject.Firma ~
  34. AND {&Tabelle}.Art = tRowObject.Art ~
  35. AND {&Tabelle}.Lager = tRowObject.Lager ~
  36. AND {&Tabelle}.Regal = tRowObject.Regal ~
  37. AND {&Tabelle}.Niveau = tRowObject.Niveau ~
  38. AND {&Tabelle}.Platz = tRowObject.Platz ~
  39. AND {&Tabelle}.Sf = tRowObject.Sf
  40. { incl/datdefinition.i }
  41. DEF TEMP-TABLE tArtst LIKE Artst
  42. FIELD KGeb_Bez AS CHAR
  43. FIELD VGeb_Bez AS CHAR
  44. FIELD GGeb_Bez AS CHAR
  45. FIELD Bez1 AS CHAR
  46. FIELD Bez2 AS CHAR
  47. .
  48. /* _UIB-CODE-BLOCK-END */
  49. &ANALYZE-RESUME
  50. &ANALYZE-SUSPEND _UIB-PREPROCESSOR-BLOCK
  51. /* ******************** Preprocessor Definitions ******************** */
  52. &Global-define DATA-LOGIC-PROCEDURE .p
  53. &Scoped-define PROCEDURE-TYPE SmartDataObject
  54. &Scoped-define DB-AWARE yes
  55. &Scoped-define ADM-SUPPORTED-LINKS Data-Source,Data-Target,Navigation-Target,Update-Target,Commit-Target,Filter-Target
  56. /* Db-Required definitions. */
  57. &IF DEFINED(DB-REQUIRED) = 0 &THEN
  58. &GLOBAL-DEFINE DB-REQUIRED TRUE
  59. &ENDIF
  60. &GLOBAL-DEFINE DB-REQUIRED-START &IF {&DB-REQUIRED} &THEN
  61. &GLOBAL-DEFINE DB-REQUIRED-END &ENDIF
  62. &Scoped-define QUERY-NAME Query-Main
  63. /* Internal Tables (found by Frame, Query & Browse Queries) */
  64. &Scoped-define INTERNAL-TABLES HoReLager
  65. /* Definitions for QUERY Query-Main */
  66. &Scoped-Define ENABLED-FIELDS Firma Art Lager Regal Niveau Platz Sf cSort Bezeichnung iStatus Artnr~
  67. Inhalt Jahr Bestand Eingang Verfall Lotnummer MaxMenge_KGeb MaxMenge_GGeb~
  68. MaxMenge_VGeb MinMenge_GGeb MinMenge_VGeb MinMenge_KGeb KGebinde GGebinde~
  69. VGebinde Artikel HoReLager_Id
  70. &Scoped-define ENABLED-FIELDS-IN-HoReLager Firma Art Lager Regal Niveau ~
  71. Platz Sf cSort Bezeichnung iStatus Artnr Inhalt Jahr Bestand Eingang ~
  72. Verfall Lotnummer MaxMenge_KGeb MaxMenge_GGeb MaxMenge_VGeb MinMenge_GGeb ~
  73. MinMenge_VGeb MinMenge_KGeb HoReLager_Id
  74. &Scoped-Define DATA-FIELDS Firma Art Lager Regal Niveau Platz Sf cSort Bezeichnung iStatus Artnr~
  75. Inhalt Jahr Bestand Eingang Verfall Lotnummer MaxMenge_KGeb MaxMenge_GGeb~
  76. MaxMenge_VGeb MinMenge_GGeb MinMenge_VGeb MinMenge_KGeb KGebinde GGebinde~
  77. VGebinde Artikel HoReLager_Id
  78. &Scoped-define DATA-FIELDS-IN-HoReLager Firma Art Lager Regal Niveau Platz ~
  79. Sf cSort Bezeichnung iStatus Artnr Inhalt Jahr Bestand Eingang Verfall ~
  80. Lotnummer MaxMenge_KGeb MaxMenge_GGeb MaxMenge_VGeb MinMenge_GGeb ~
  81. MinMenge_VGeb MinMenge_KGeb HoReLager_Id
  82. &Scoped-Define MANDATORY-FIELDS
  83. &Scoped-Define APPLICATION-SERVICE
  84. &Scoped-Define ASSIGN-LIST
  85. &Scoped-Define DATA-FIELD-DEFS "d-horelager.i"
  86. &Scoped-Define DATA-TABLE-NO-UNDO NO-UNDO
  87. &Scoped-define QUERY-STRING-Query-Main FOR EACH HoReLager NO-LOCK INDEXED-REPOSITION
  88. {&DB-REQUIRED-START}
  89. &Scoped-define OPEN-QUERY-Query-Main OPEN QUERY Query-Main FOR EACH HoReLager NO-LOCK INDEXED-REPOSITION.
  90. {&DB-REQUIRED-END}
  91. &Scoped-define TABLES-IN-QUERY-Query-Main HoReLager
  92. &Scoped-define FIRST-TABLE-IN-QUERY-Query-Main HoReLager
  93. /* Custom List Definitions */
  94. /* List-1,List-2,List-3,List-4,List-5,List-6 */
  95. /* _UIB-PREPROCESSOR-BLOCK-END */
  96. &ANALYZE-RESUME
  97. /* ************************ Function Prototypes ********************** */
  98. {&DB-REQUIRED-START}
  99. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION-FORWARD getArtbez dTables _DB-REQUIRED
  100. FUNCTION getArtbez RETURNS CHARACTER
  101. ( ipiArtnr AS INT, ipiInhalt AS INT, ipiJahr AS INT ) FORWARD.
  102. /* _UIB-CODE-BLOCK-END */
  103. &ANALYZE-RESUME
  104. {&DB-REQUIRED-END}
  105. {&DB-REQUIRED-START}
  106. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION-FORWARD getCurrentRecid dTables _DB-REQUIRED
  107. FUNCTION getCurrentRecid RETURNS RECID
  108. ( /* parameter-definitions */ ) FORWARD.
  109. /* _UIB-CODE-BLOCK-END */
  110. &ANALYZE-RESUME
  111. {&DB-REQUIRED-END}
  112. {&DB-REQUIRED-START}
  113. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION-FORWARD getGGebinde dTables _DB-REQUIRED
  114. FUNCTION getGGebinde RETURNS CHARACTER
  115. ( ipiArtnr AS INT, ipiInhalt AS INT, ipiJahr AS INT ) FORWARD.
  116. /* _UIB-CODE-BLOCK-END */
  117. &ANALYZE-RESUME
  118. {&DB-REQUIRED-END}
  119. {&DB-REQUIRED-START}
  120. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION-FORWARD getKGebinde dTables _DB-REQUIRED
  121. FUNCTION getKGebinde RETURNS CHARACTER
  122. ( ipiArtnr AS INT, ipiInhalt AS INT, ipiJahr AS INT ) FORWARD.
  123. /* _UIB-CODE-BLOCK-END */
  124. &ANALYZE-RESUME
  125. {&DB-REQUIRED-END}
  126. {&DB-REQUIRED-START}
  127. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION-FORWARD getQueryBuffer dTables _DB-REQUIRED
  128. FUNCTION getQueryBuffer RETURNS HANDLE
  129. ( /* parameter-definitions */ ) FORWARD.
  130. /* _UIB-CODE-BLOCK-END */
  131. &ANALYZE-RESUME
  132. {&DB-REQUIRED-END}
  133. {&DB-REQUIRED-START}
  134. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION-FORWARD getVGebinde dTables _DB-REQUIRED
  135. FUNCTION getVGebinde RETURNS CHARACTER
  136. ( ipiArtnr AS INT, ipiInhalt AS INT, ipiJahr AS INT ) FORWARD.
  137. /* _UIB-CODE-BLOCK-END */
  138. &ANALYZE-RESUME
  139. {&DB-REQUIRED-END}
  140. {&DB-REQUIRED-START}
  141. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION-FORWARD openQuery dTables _DB-REQUIRED
  142. FUNCTION openQuery RETURNS LOGICAL
  143. ( /* parameter-definitions */ ) FORWARD.
  144. /* _UIB-CODE-BLOCK-END */
  145. &ANALYZE-RESUME
  146. {&DB-REQUIRED-END}
  147. /* *********************** Control Definitions ********************** */
  148. {&DB-REQUIRED-START}
  149. /* Query definitions */
  150. &ANALYZE-SUSPEND
  151. DEFINE QUERY Query-Main FOR
  152. HoReLager SCROLLING.
  153. &ANALYZE-RESUME
  154. {&DB-REQUIRED-END}
  155. /* ************************ Frame Definitions *********************** */
  156. /* *********************** Procedure Settings ************************ */
  157. &ANALYZE-SUSPEND _PROCEDURE-SETTINGS
  158. /* Settings for THIS-PROCEDURE
  159. Type: SmartDataObject
  160. Allow: Query
  161. Frames: 0
  162. Add Fields to: Neither
  163. Other Settings: PERSISTENT-ONLY COMPILE APPSERVER DB-AWARE
  164. */
  165. /* This procedure should always be RUN PERSISTENT. Report the error, */
  166. /* then cleanup and return. */
  167. IF NOT THIS-PROCEDURE:PERSISTENT THEN
  168. DO:
  169. MESSAGE "{&FILE-NAME} should only be RUN PERSISTENT.":U
  170. VIEW-AS ALERT-BOX ERROR BUTTONS OK.
  171. RETURN.
  172. END.
  173. &ANALYZE-RESUME _END-PROCEDURE-SETTINGS
  174. /* ************************* Create Window ************************** */
  175. &ANALYZE-SUSPEND _CREATE-WINDOW
  176. /* DESIGN Window definition (used by the UIB)
  177. CREATE WINDOW dTables ASSIGN
  178. HEIGHT = 1.62
  179. WIDTH = 83.6.
  180. /* END WINDOW DEFINITION */
  181. */
  182. &ANALYZE-RESUME
  183. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _INCLUDED-LIB dTables
  184. /* ************************* Included-Libraries *********************** */
  185. {src/adm2/data.i}
  186. /* _UIB-CODE-BLOCK-END */
  187. &ANALYZE-RESUME
  188. /* *********** Runtime Attributes and AppBuilder Settings *********** */
  189. &ANALYZE-SUSPEND _RUN-TIME-ATTRIBUTES
  190. /* SETTINGS FOR WINDOW dTables
  191. VISIBLE,,RUN-PERSISTENT */
  192. /* _RUN-TIME-ATTRIBUTES-END */
  193. &ANALYZE-RESUME
  194. /* Setting information for Queries and Browse Widgets fields */
  195. &ANALYZE-SUSPEND _QUERY-BLOCK QUERY Query-Main
  196. /* Query rebuild information for SmartDataObject Query-Main
  197. _TblList = "AnaDat.HoReLager"
  198. _Options = "NO-LOCK INDEXED-REPOSITION"
  199. _FldNameList[1] > AnaDat.HoReLager.Firma
  200. "Firma" "Firma" ? ? "character" ? ? ? ? ? ? yes ? no 5 yes ?
  201. _FldNameList[2] > AnaDat.HoReLager.Art
  202. "Art" "Art" ? ? "integer" ? ? ? ? ? ? yes ? no 2.6 yes ?
  203. _FldNameList[3] > AnaDat.HoReLager.Lager
  204. "Lager" "Lager" ? ? "integer" ? ? ? ? ? ? yes ? no 5.4 yes ?
  205. _FldNameList[4] > AnaDat.HoReLager.Regal
  206. "Regal" "Regal" ? ? "character" ? ? ? ? ? ? yes ? no 5.6 yes ?
  207. _FldNameList[5] > AnaDat.HoReLager.Niveau
  208. "Niveau" "Niveau" ? ? "character" ? ? ? ? ? ? yes ? no 6.8 yes ?
  209. _FldNameList[6] > AnaDat.HoReLager.Platz
  210. "Platz" "Platz" ? ? "character" ? ? ? ? ? ? yes ? no 4.6 yes ?
  211. _FldNameList[7] > AnaDat.HoReLager.Sf
  212. "Sf" "Sf" ? ? "character" ? ? ? ? ? ? yes ? no 3 yes ?
  213. _FldNameList[8] > AnaDat.HoReLager.cSort
  214. "cSort" "cSort" ? ? "character" ? ? ? ? ? ? yes ? no 20 yes ?
  215. _FldNameList[9] > AnaDat.HoReLager.Bezeichnung
  216. "Bezeichnung" "Bezeichnung" ? ? "character" ? ? ? ? ? ? yes ? no 12.4 yes ?
  217. _FldNameList[10] > AnaDat.HoReLager.iStatus
  218. "iStatus" "iStatus" ? ? "integer" ? ? ? ? ? ? yes ? no 6.4 yes ?
  219. _FldNameList[11] > AnaDat.HoReLager.Artnr
  220. "Artnr" "Artnr" ? ? "integer" ? ? ? ? ? ? yes ? no 7.2 yes ?
  221. _FldNameList[12] > AnaDat.HoReLager.Inhalt
  222. "Inhalt" "Inhalt" ? ? "integer" ? ? ? ? ? ? yes ? no 5.2 yes ?
  223. _FldNameList[13] > AnaDat.HoReLager.Jahr
  224. "Jahr" "Jahr" ? ? "integer" ? ? ? ? ? ? yes ? no 4.8 yes ?
  225. _FldNameList[14] > AnaDat.HoReLager.Bestand
  226. "Bestand" "Bestand" ? ? "decimal" ? ? ? ? ? ? yes ? no 7.8 yes ?
  227. _FldNameList[15] > AnaDat.HoReLager.Eingang
  228. "Eingang" "Eingang" ? ? "date" ? ? ? ? ? ? yes ? no 10.8 yes ?
  229. _FldNameList[16] > AnaDat.HoReLager.Verfall
  230. "Verfall" "Verfall" ? ? "date" ? ? ? ? ? ? yes ? no 10.8 yes ?
  231. _FldNameList[17] > AnaDat.HoReLager.Lotnummer
  232. "Lotnummer" "Lotnummer" ? ? "character" ? ? ? ? ? ? yes ? no 20 yes ?
  233. _FldNameList[18] > AnaDat.HoReLager.MaxMenge_KGeb
  234. "MaxMenge_KGeb" "MaxMenge_KGeb" ? ? "decimal" ? ? ? ? ? ? yes ? no 17.2 yes ?
  235. _FldNameList[19] > AnaDat.HoReLager.MaxMenge_GGeb
  236. "MaxMenge_GGeb" "MaxMenge_GGeb" ? ? "decimal" ? ? ? ? ? ? yes ? no 17.4 yes ?
  237. _FldNameList[20] > AnaDat.HoReLager.MaxMenge_VGeb
  238. "MaxMenge_VGeb" "MaxMenge_VGeb" ? ? "decimal" ? ? ? ? ? ? yes ? no 17.2 yes ?
  239. _FldNameList[21] > AnaDat.HoReLager.MinMenge_GGeb
  240. "MinMenge_GGeb" "MinMenge_GGeb" ? ? "decimal" ? ? ? ? ? ? yes ? no 16.8 yes ?
  241. _FldNameList[22] > AnaDat.HoReLager.MinMenge_VGeb
  242. "MinMenge_VGeb" "MinMenge_VGeb" ? ? "decimal" ? ? ? ? ? ? yes ? no 16.6 yes ?
  243. _FldNameList[23] > AnaDat.HoReLager.MinMenge_KGeb
  244. "MinMenge_KGeb" "MinMenge_KGeb" ? ? "decimal" ? ? ? ? ? ? yes ? no 16.6 yes ?
  245. _FldNameList[24] > "_<CALC>"
  246. "DYNAMIC-FUNCTION('getKGebinde':U IN THIS-PROCEDURE, RowObject.Artnr, RowObject.Inhalt, RowObject.Jahr)" "KGebinde" ? "x(20)" "character" ? ? ? ? ? ? yes ? no 20 no ?
  247. _FldNameList[25] > "_<CALC>"
  248. "DYNAMIC-FUNCTION('getGGebinde':U IN THIS-PROCEDURE, RowObject.Artnr, RowObject.Inhalt, RowObject.Jahr)" "GGebinde" ? "x(20)" "character" ? ? ? ? ? ? yes ? no 20 no ?
  249. _FldNameList[26] > "_<CALC>"
  250. "DYNAMIC-FUNCTION('getVGebinde':U IN THIS-PROCEDURE, RowObject.Artnr, RowObject.Inhalt, RowObject.Jahr)" "VGebinde" ? "x(20)" "character" ? ? ? ? ? ? yes ? no 20 no ?
  251. _FldNameList[27] > "_<CALC>"
  252. "DYNAMIC-FUNCTION('getArtbez':U IN THIS-PROCEDURE, RowObject.Artnr, RowObject.Inhalt, RowObject.Jahr)" "Artikel" ? "x(50)" "character" ? ? ? ? ? ? yes ? no 50 no ?
  253. _FldNameList[28] > AnaDat.HoReLager.HoReLager_Id
  254. "HoReLager_Id" "HoReLager_Id" ? ? "integer" ? ? ? ? ? ? yes ? no 14 yes ?
  255. _Design-Parent is WINDOW dTables @ ( 1.14 , 2.6 )
  256. */ /* QUERY Query-Main */
  257. &ANALYZE-RESUME
  258. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _MAIN-BLOCK dTables
  259. /* *************************** Main Block *************************** */
  260. { incl/datmainblock.i }
  261. fOpen = FALSE.
  262. &IF DEFINED(UIB_IS_RUNNING) <> 0 &THEN
  263. RUN initializeObject.
  264. &ENDIF
  265. /* _UIB-CODE-BLOCK-END */
  266. &ANALYZE-RESUME
  267. /* ********************** Internal Procedures *********************** */
  268. {&DB-REQUIRED-START}
  269. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE DATA.CALCULATE dTables DATA.CALCULATE _DB-REQUIRED
  270. PROCEDURE DATA.CALCULATE :
  271. /*------------------------------------------------------------------------------
  272. Purpose: Calculate all the Calculated Expressions found in the
  273. SmartDataObject.
  274. Parameters: <none>
  275. ------------------------------------------------------------------------------*/
  276. ASSIGN
  277. rowObject.Artikel = (DYNAMIC-FUNCTION('getArtbez':U IN THIS-PROCEDURE, RowObject.Artnr, RowObject.Inhalt, RowObject.Jahr))
  278. rowObject.GGebinde = (DYNAMIC-FUNCTION('getGGebinde':U IN THIS-PROCEDURE, RowObject.Artnr, RowObject.Inhalt, RowObject.Jahr))
  279. rowObject.KGebinde = (DYNAMIC-FUNCTION('getKGebinde':U IN THIS-PROCEDURE, RowObject.Artnr, RowObject.Inhalt, RowObject.Jahr))
  280. rowObject.VGebinde = (DYNAMIC-FUNCTION('getVGebinde':U IN THIS-PROCEDURE, RowObject.Artnr, RowObject.Inhalt, RowObject.Jahr))
  281. .
  282. END PROCEDURE.
  283. /* _UIB-CODE-BLOCK-END */
  284. &ANALYZE-RESUME
  285. {&DB-REQUIRED-END}
  286. {&DB-REQUIRED-START}
  287. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE dataAvailable dTables _DB-REQUIRED
  288. PROCEDURE dataAvailable :
  289. /*------------------------------------------------------------------------------
  290. Purpose: Super Override
  291. Parameters:
  292. Notes:
  293. ------------------------------------------------------------------------------*/
  294. { incl/datdataavailable.i }
  295. END PROCEDURE.
  296. /* _UIB-CODE-BLOCK-END */
  297. &ANALYZE-RESUME
  298. {&DB-REQUIRED-END}
  299. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE disable_UI dTables _DEFAULT-DISABLE
  300. PROCEDURE disable_UI :
  301. /*------------------------------------------------------------------------------
  302. Purpose: DISABLE the User Interface
  303. Parameters: <none>
  304. Notes: Here we clean-up the user-interface by deleting
  305. dynamic widgets we have created and/or hide
  306. frames. This procedure is usually called when
  307. we are ready to "clean-up" after running.
  308. ------------------------------------------------------------------------------*/
  309. /* Hide all frames. */
  310. IF THIS-PROCEDURE:PERSISTENT THEN DELETE PROCEDURE THIS-PROCEDURE.
  311. END PROCEDURE.
  312. /* _UIB-CODE-BLOCK-END */
  313. &ANALYZE-RESUME
  314. {&DB-REQUIRED-START}
  315. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE INAKTIVIEREN dTables _DB-REQUIRED
  316. PROCEDURE INAKTIVIEREN :
  317. /*------------------------------------------------------------------------------
  318. Purpose:
  319. Parameters: <none>
  320. Notes:
  321. ------------------------------------------------------------------------------*/
  322. { incl/datinaktivieren.i }
  323. END PROCEDURE.
  324. /* _UIB-CODE-BLOCK-END */
  325. &ANALYZE-RESUME
  326. {&DB-REQUIRED-END}
  327. {&DB-REQUIRED-START}
  328. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE initializeObject dTables _DB-REQUIRED
  329. PROCEDURE initializeObject :
  330. /*------------------------------------------------------------------------------
  331. Purpose: Super Override
  332. Parameters:
  333. Notes:
  334. ------------------------------------------------------------------------------*/
  335. { incl/datinitialize.i }
  336. END PROCEDURE.
  337. /* _UIB-CODE-BLOCK-END */
  338. &ANALYZE-RESUME
  339. {&DB-REQUIRED-END}
  340. {&DB-REQUIRED-START}
  341. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE REAKTIVIEREN dTables _DB-REQUIRED
  342. PROCEDURE REAKTIVIEREN :
  343. /*------------------------------------------------------------------------------
  344. Purpose:
  345. Parameters: <none>
  346. Notes:
  347. ------------------------------------------------------------------------------*/
  348. { incl/datreaktivieren.i }
  349. END PROCEDURE.
  350. /* _UIB-CODE-BLOCK-END */
  351. &ANALYZE-RESUME
  352. {&DB-REQUIRED-END}
  353. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE REFRESHLAGER dTables
  354. PROCEDURE REFRESHLAGER:
  355. /*------------------------------------------------------------------------------
  356. Purpose:
  357. Notes:
  358. ------------------------------------------------------------------------------*/
  359. DEFINE VARIABLE cRowid AS CHARACTER NO-UNDO.
  360. DEFINE BUFFER bHoReLager FOR HoReLager.
  361. rHoReLager = DYNAMIC-FUNCTION ('getCurrentRecid':U) NO-ERROR.
  362. IF rHoReLager = ? OR
  363. rHoReLager = 0 THEN RETURN NO-APPLY.
  364. FIND bHoReLager NO-LOCK WHERE RECID(bHoReLager) = rHoReLager.
  365. cRowid = STRING(ROWID(bHoReLager)).
  366. lRefresh = TRUE.
  367. DYNAMIC-FUNCTION ('openQuery':U).
  368. lRefresh = FALSE.
  369. DYNAMIC-FUNCTION ('openQuery':U).
  370. DYNAMIC-FUNCTION ('fetchRowIdent':U, cRowid, ?).
  371. END PROCEDURE.
  372. /* _UIB-CODE-BLOCK-END */
  373. &ANALYZE-RESUME
  374. {&DB-REQUIRED-START}
  375. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE REPOS_TABELLE dTables _DB-REQUIRED
  376. PROCEDURE REPOS_TABELLE :
  377. /*------------------------------------------------------------------------------
  378. Purpose:
  379. Parameters: <none>
  380. Notes:
  381. ------------------------------------------------------------------------------*/
  382. { incl/datrepos.i }
  383. END PROCEDURE.
  384. /* _UIB-CODE-BLOCK-END */
  385. &ANALYZE-RESUME
  386. {&DB-REQUIRED-END}
  387. {&DB-REQUIRED-START}
  388. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE SET_FILTER dTables _DB-REQUIRED
  389. PROCEDURE SET_FILTER :
  390. /*------------------------------------------------------------------------------
  391. Purpose:
  392. Parameters: <none>
  393. Notes:
  394. ------------------------------------------------------------------------------*/
  395. { incl/datsetfilter.i }
  396. END PROCEDURE.
  397. /* _UIB-CODE-BLOCK-END */
  398. &ANALYZE-RESUME
  399. {&DB-REQUIRED-END}
  400. {&DB-REQUIRED-START}
  401. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE SET_OPENFLAG dTables _DB-REQUIRED
  402. PROCEDURE SET_OPENFLAG :
  403. /*------------------------------------------------------------------------------
  404. Purpose:
  405. Parameters: <none>
  406. Notes:
  407. ------------------------------------------------------------------------------*/
  408. { incl/datsetopenflag.i }
  409. END PROCEDURE.
  410. /* _UIB-CODE-BLOCK-END */
  411. &ANALYZE-RESUME
  412. {&DB-REQUIRED-END}
  413. {&DB-REQUIRED-START}
  414. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE SET_SORT dTables _DB-REQUIRED
  415. PROCEDURE SET_SORT :
  416. /*------------------------------------------------------------------------------
  417. Purpose:
  418. Parameters: <none>
  419. Notes:
  420. ------------------------------------------------------------------------------*/
  421. { incl/datsetsort.i }
  422. END PROCEDURE.
  423. /* _UIB-CODE-BLOCK-END */
  424. &ANALYZE-RESUME
  425. {&DB-REQUIRED-END}
  426. /* ************************ Function Implementations ***************** */
  427. {&DB-REQUIRED-START}
  428. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION getArtbez dTables _DB-REQUIRED
  429. FUNCTION getArtbez RETURNS CHARACTER
  430. ( ipiArtnr AS INT, ipiInhalt AS INT, ipiJahr AS INT ) :
  431. /*------------------------------------------------------------------------------
  432. Purpose:
  433. Notes:
  434. ------------------------------------------------------------------------------*/
  435. EMPTY TEMP-TABLE tArtst.
  436. CREATE tArtst.
  437. DO WHILE ipiArtnr > 0:
  438. FIND FIRST Artst NO-LOCK
  439. WHERE Artst.Firma = Firma
  440. AND Artst.Artnr = ipiArtnr
  441. AND Artst.Inhalt = ipiInhalt
  442. AND Artst.Aktiv = TRUE
  443. AND Artst.Ausverk < 9 NO-ERROR.
  444. IF NOT AVAILABLE Artst THEN
  445. DO:
  446. FIND FIRST Artst NO-LOCK
  447. WHERE Artst.Firma = Firma
  448. AND Artst.Artnr = ipiArtnr
  449. AND Artst.Inhalt = ipiInhalt
  450. AND Artst.Aktiv = TRUE NO-ERROR.
  451. END.
  452. IF NOT AVAILABLE Artst THEN LEAVE.
  453. BUFFER-COPY Artst TO tArtst.
  454. FIND FIRST Artbez NO-LOCK OF Artst NO-ERROR.
  455. IF AVAILABLE Artbez THEN
  456. DO:
  457. ASSIGN
  458. tArtst.Bez1 = Artbez.Bez1
  459. tArtst.Bez2 = Artbez.Bez2.
  460. END.
  461. ASSIGN
  462. tArtst.GGeb_Bez = DYNAMIC-FUNCTION('getGGebindeKBez':U, tArtst.GGeb_Cd)
  463. tArtst.VGeb_Bez = DYNAMIC-FUNCTION('getVGebindeKBez':U, tArtst.VGeb_Cd)
  464. tArtst.KGeb_Bez = DYNAMIC-FUNCTION('getKGebindeKBez':U, tArtst.KGeb_Cd) NO-ERROR.
  465. RELEASE Artbez.
  466. RELEASE Artst.
  467. LEAVE.
  468. END.
  469. RETURN TRIM(tArtst.Bez1 + ' ' + tArtst.Bez2).
  470. END FUNCTION.
  471. /* _UIB-CODE-BLOCK-END */
  472. &ANALYZE-RESUME
  473. {&DB-REQUIRED-END}
  474. {&DB-REQUIRED-START}
  475. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION getCurrentRecid dTables _DB-REQUIRED
  476. FUNCTION getCurrentRecid RETURNS RECID
  477. ( /* parameter-definitions */ ) :
  478. /*------------------------------------------------------------------------------
  479. Purpose:
  480. Notes:
  481. ------------------------------------------------------------------------------*/
  482. { incl/datgetcurrentrecid.i }
  483. END FUNCTION.
  484. /* _UIB-CODE-BLOCK-END */
  485. &ANALYZE-RESUME
  486. {&DB-REQUIRED-END}
  487. {&DB-REQUIRED-START}
  488. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION getGGebinde dTables _DB-REQUIRED
  489. FUNCTION getGGebinde RETURNS CHARACTER
  490. ( ipiArtnr AS INT, ipiInhalt AS INT, ipiJahr AS INT ) :
  491. /*------------------------------------------------------------------------------
  492. Purpose:
  493. Notes:
  494. ------------------------------------------------------------------------------*/
  495. FIND FIRST tArtst.
  496. RETURN tArtst.GGeb_Bez.
  497. END FUNCTION.
  498. /* _UIB-CODE-BLOCK-END */
  499. &ANALYZE-RESUME
  500. {&DB-REQUIRED-END}
  501. {&DB-REQUIRED-START}
  502. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION getKGebinde dTables _DB-REQUIRED
  503. FUNCTION getKGebinde RETURNS CHARACTER
  504. ( ipiArtnr AS INT, ipiInhalt AS INT, ipiJahr AS INT ) :
  505. /*------------------------------------------------------------------------------
  506. Purpose:
  507. Notes:
  508. ------------------------------------------------------------------------------*/
  509. FIND FIRST tArtst.
  510. RETURN tArtst.KGeb_Bez.
  511. END FUNCTION.
  512. /* _UIB-CODE-BLOCK-END */
  513. &ANALYZE-RESUME
  514. {&DB-REQUIRED-END}
  515. {&DB-REQUIRED-START}
  516. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION getQueryBuffer dTables _DB-REQUIRED
  517. FUNCTION getQueryBuffer RETURNS HANDLE
  518. ( /* parameter-definitions */ ) :
  519. /*------------------------------------------------------------------------------
  520. Purpose:
  521. Notes:
  522. ------------------------------------------------------------------------------*/
  523. RETURN BUFFER rowObject:HANDLE.
  524. END FUNCTION.
  525. /* _UIB-CODE-BLOCK-END */
  526. &ANALYZE-RESUME
  527. {&DB-REQUIRED-END}
  528. {&DB-REQUIRED-START}
  529. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION getVGebinde dTables _DB-REQUIRED
  530. FUNCTION getVGebinde RETURNS CHARACTER
  531. ( ipiArtnr AS INT, ipiInhalt AS INT, ipiJahr AS INT ) :
  532. /*------------------------------------------------------------------------------
  533. Purpose:
  534. Notes:
  535. ------------------------------------------------------------------------------*/
  536. FIND FIRST tArtst.
  537. RETURN tArtst.VGeb_Bez.
  538. END FUNCTION.
  539. /* _UIB-CODE-BLOCK-END */
  540. &ANALYZE-RESUME
  541. {&DB-REQUIRED-END}
  542. {&DB-REQUIRED-START}
  543. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION openQuery dTables _DB-REQUIRED
  544. FUNCTION openQuery RETURNS LOGICAL
  545. ( /* parameter-definitions */ ) :
  546. /*------------------------------------------------------------------------------
  547. Purpose: Super Override
  548. Notes:
  549. ------------------------------------------------------------------------------*/
  550. DEF VAR Felder AS CHAR NO-UNDO.
  551. DEF VAR Inhalt AS CHAR NO-UNDO.
  552. DEF VAR ix AS INT NO-UNDO.
  553. DEF VAR cFeld AS CHAR NO-UNDO.
  554. DEF VAR iArt AS INT NO-UNDO.
  555. DEF VAR iLager AS INT NO-UNDO.
  556. IF NOT fOpen THEN RETURN FALSE.
  557. iArt = DYNAMIC-FUNCTION('getLagerart':U IN hKontainer) NO-ERROR.
  558. iLager = DYNAMIC-FUNCTION('getLager':U IN hKontainer) NO-ERROR.
  559. IF iArt = ? THEN iArt = 0.
  560. IF iLager = ? THEN iLager = 0.
  561. xWhere = ''.
  562. xSort = ''.
  563. xString = ''.
  564. Felder = DYNAMIC-FUNCTION('getForeignFields':U) NO-ERROR.
  565. Inhalt = DYNAMIC-FUNCTION('getForeignValues':U) NO-ERROR.
  566. /* ix = LOOKUP('Feld', Felder, ',') / 2. */
  567. /* cFeld = ENTRY (ix , Inhalt, CHR(01)). */
  568. IF lRefresh THEN iLager = 99.
  569. xWhere
  570. = 'HoReLager.Firma = "&1" AND '
  571. + 'HoReLager.Art = &2 AND '
  572. + 'HoReLager.Lager = &3 '.
  573. xWhere = SUBSTITUTE(xWhere, Firma, iArt, iLager ).
  574. xSort = ' BY HoReLager.Regal BY HoReLager.Platz BY HoReLager.Niveau BY HoReLager.Sf '.
  575. /* xString = 'FOR EACH Debop ' + xSort + 'WHERE ' */
  576. /* + 'Debop.Firma = "' + Firma + '" AND ' */
  577. /* + 'Debop.Knr = ' + STRING(Knr) + ' ' */
  578. /* + 'NO-LOCK BY Debop.FakDat DESCENDING INDEXED-REPOSITION '. */
  579. { incl/datopenquery.i }
  580. IF xWhere <> '' THEN DYNAMIC-FUNCTION('setQueryWhere':U , INPUT xWhere ).
  581. IF xString <> '' THEN DYNAMIC-FUNCTION('setQueryString':U, INPUT xString).
  582. IF xSort <> '' THEN DYNAMIC-FUNCTION('setQuerySort':U , INPUT xSort ).
  583. RETURN SUPER( ).
  584. END FUNCTION.
  585. /* _UIB-CODE-BLOCK-END */
  586. &ANALYZE-RESUME
  587. {&DB-REQUIRED-END}