d-fahrer.w 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512
  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 cRecArt AS CHAR INIT 'FAHRER' NO-UNDO.
  30. &glob DATA-LOGIC-PROCEDURE .p
  31. &SCOPED-DEFINE Tabelle Tabel
  32. &SCOPED-DEFINE TabWhere USE-INDEX Tabel-k1 ~
  33. WHERE {&Tabelle}.Firma = tRowObject.Firma ~
  34. AND {&Tabelle}.RecArt = tRowObject.RecArt ~
  35. AND {&Tabelle}.CodeC = tRowObject.CodeC ~
  36. AND {&Tabelle}.CodeI = tRowObject.CodeI ~
  37. AND {&Tabelle}.Sprcd = tRowObject.Sprcd
  38. { incl/datdefinition.i }
  39. /* _UIB-CODE-BLOCK-END */
  40. &ANALYZE-RESUME
  41. &ANALYZE-SUSPEND _UIB-PREPROCESSOR-BLOCK
  42. /* ******************** Preprocessor Definitions ******************** */
  43. &Scoped-define PROCEDURE-TYPE SmartDataObject
  44. &Scoped-define DB-AWARE yes
  45. &Scoped-define ADM-SUPPORTED-LINKS Data-Source,Data-Target,Navigation-Target,Update-Target,Commit-Target,Filter-Target
  46. /* Db-Required definitions. */
  47. &IF DEFINED(DB-REQUIRED) = 0 &THEN
  48. &GLOBAL-DEFINE DB-REQUIRED TRUE
  49. &ENDIF
  50. &GLOBAL-DEFINE DB-REQUIRED-START &IF {&DB-REQUIRED} &THEN
  51. &GLOBAL-DEFINE DB-REQUIRED-END &ENDIF
  52. &Scoped-define QUERY-NAME Query-Main
  53. /* Internal Tables (found by Frame, Query & Browse Queries) */
  54. &Scoped-define INTERNAL-TABLES Tabel
  55. /* Definitions for QUERY Query-Main */
  56. &Scoped-Define ENABLED-FIELDS Firma Recart CodeI CodeC Sprcd Bez1 Bez2
  57. &Scoped-define ENABLED-FIELDS-IN-Tabel Firma Recart CodeI CodeC Sprcd Bez1 ~
  58. Bez2
  59. &Scoped-Define DATA-FIELDS Firma Recart CodeI CodeC Sprcd Bez1 Bez2
  60. &Scoped-define DATA-FIELDS-IN-Tabel Firma Recart CodeI CodeC Sprcd Bez1 ~
  61. Bez2
  62. &Scoped-Define MANDATORY-FIELDS Firma Recart
  63. &Scoped-Define APPLICATION-SERVICE
  64. &Scoped-Define ASSIGN-LIST
  65. &Scoped-Define DATA-FIELD-DEFS "d-fahrer.i"
  66. &Scoped-Define DATA-TABLE-NO-UNDO NO-UNDO
  67. &Scoped-define QUERY-STRING-Query-Main FOR EACH Tabel NO-LOCK INDEXED-REPOSITION
  68. {&DB-REQUIRED-START}
  69. &Scoped-define OPEN-QUERY-Query-Main OPEN QUERY Query-Main FOR EACH Tabel NO-LOCK INDEXED-REPOSITION.
  70. {&DB-REQUIRED-END}
  71. &Scoped-define TABLES-IN-QUERY-Query-Main Tabel
  72. &Scoped-define FIRST-TABLE-IN-QUERY-Query-Main Tabel
  73. /* Custom List Definitions */
  74. /* List-1,List-2,List-3,List-4,List-5,List-6 */
  75. /* _UIB-PREPROCESSOR-BLOCK-END */
  76. &ANALYZE-RESUME
  77. /* ************************ Function Prototypes ********************** */
  78. {&DB-REQUIRED-START}
  79. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION-FORWARD getCurrentRecid dTables _DB-REQUIRED
  80. FUNCTION getCurrentRecid RETURNS RECID
  81. ( /* parameter-definitions */ ) FORWARD.
  82. /* _UIB-CODE-BLOCK-END */
  83. &ANALYZE-RESUME
  84. {&DB-REQUIRED-END}
  85. {&DB-REQUIRED-START}
  86. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION-FORWARD getQueryBuffer dTables _DB-REQUIRED
  87. FUNCTION getQueryBuffer RETURNS HANDLE
  88. ( /* parameter-definitions */ ) FORWARD.
  89. /* _UIB-CODE-BLOCK-END */
  90. &ANALYZE-RESUME
  91. {&DB-REQUIRED-END}
  92. {&DB-REQUIRED-START}
  93. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION-FORWARD openQuery dTables _DB-REQUIRED
  94. FUNCTION openQuery RETURNS LOGICAL
  95. ( /* parameter-definitions */ ) FORWARD.
  96. /* _UIB-CODE-BLOCK-END */
  97. &ANALYZE-RESUME
  98. {&DB-REQUIRED-END}
  99. /* *********************** Control Definitions ********************** */
  100. {&DB-REQUIRED-START}
  101. /* Query definitions */
  102. &ANALYZE-SUSPEND
  103. DEFINE QUERY Query-Main FOR
  104. Tabel SCROLLING.
  105. &ANALYZE-RESUME
  106. {&DB-REQUIRED-END}
  107. /* ************************ Frame Definitions *********************** */
  108. /* *********************** Procedure Settings ************************ */
  109. &ANALYZE-SUSPEND _PROCEDURE-SETTINGS
  110. /* Settings for THIS-PROCEDURE
  111. Type: SmartDataObject
  112. Allow: Query
  113. Frames: 0
  114. Add Fields to: Neither
  115. Other Settings: PERSISTENT-ONLY COMPILE APPSERVER DB-AWARE
  116. */
  117. /* This procedure should always be RUN PERSISTENT. Report the error, */
  118. /* then cleanup and return. */
  119. IF NOT THIS-PROCEDURE:PERSISTENT THEN DO:
  120. MESSAGE "{&FILE-NAME} should only be RUN PERSISTENT.":U
  121. VIEW-AS ALERT-BOX ERROR BUTTONS OK.
  122. RETURN.
  123. END.
  124. &ANALYZE-RESUME _END-PROCEDURE-SETTINGS
  125. /* ************************* Create Window ************************** */
  126. &ANALYZE-SUSPEND _CREATE-WINDOW
  127. /* DESIGN Window definition (used by the UIB)
  128. CREATE WINDOW dTables ASSIGN
  129. HEIGHT = 1.62
  130. WIDTH = 46.6.
  131. /* END WINDOW DEFINITION */
  132. */
  133. &ANALYZE-RESUME
  134. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _INCLUDED-LIB dTables
  135. /* ************************* Included-Libraries *********************** */
  136. {src/adm2/data.i}
  137. /* _UIB-CODE-BLOCK-END */
  138. &ANALYZE-RESUME
  139. /* *********** Runtime Attributes and AppBuilder Settings *********** */
  140. &ANALYZE-SUSPEND _RUN-TIME-ATTRIBUTES
  141. /* SETTINGS FOR WINDOW dTables
  142. VISIBLE,,RUN-PERSISTENT */
  143. /* _RUN-TIME-ATTRIBUTES-END */
  144. &ANALYZE-RESUME
  145. /* Setting information for Queries and Browse Widgets fields */
  146. &ANALYZE-SUSPEND _QUERY-BLOCK QUERY Query-Main
  147. /* Query rebuild information for SmartDataObject Query-Main
  148. _TblList = "AnaDat.Tabel"
  149. _Options = "NO-LOCK INDEXED-REPOSITION"
  150. _FldNameList[1] > AnaDat.Tabel.Firma
  151. "Firma" "Firma" ? ? "character" ? ? ? ? ? ? yes ? yes 8 yes ?
  152. _FldNameList[2] > AnaDat.Tabel.Recart
  153. "Recart" "Recart" ? ? "character" ? ? ? ? ? ? yes ? yes 12 yes ?
  154. _FldNameList[3] > AnaDat.Tabel.CodeI
  155. "CodeI" "CodeI" ? ? "integer" ? ? ? ? ? ? yes ? no 7.2 yes ?
  156. _FldNameList[4] > AnaDat.Tabel.CodeC
  157. "CodeC" "CodeC" ? ? "character" ? ? ? ? ? ? yes ? no 8 yes ?
  158. _FldNameList[5] > AnaDat.Tabel.Sprcd
  159. "Sprcd" "Sprcd" ? ? "integer" ? ? ? ? ? ? yes ? no 5.6 yes ?
  160. _FldNameList[6] > AnaDat.Tabel.Bez1
  161. "Bez1" "Bez1" ? ? "character" ? ? ? ? ? ? yes ? no 30 yes ?
  162. _FldNameList[7] > AnaDat.Tabel.Bez2
  163. "Bez2" "Bez2" ? ? "character" ? ? ? ? ? ? yes ? no 30 yes ?
  164. _Design-Parent is WINDOW dTables @ ( 1.14 , 2.6 )
  165. */ /* QUERY Query-Main */
  166. &ANALYZE-RESUME
  167. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _MAIN-BLOCK dTables
  168. /* *************************** Main Block *************************** */
  169. { incl/datmainblock.i }
  170. &IF DEFINED(UIB_IS_RUNNING) <> 0 &THEN
  171. RUN initializeObject.
  172. &ENDIF
  173. /* _UIB-CODE-BLOCK-END */
  174. &ANALYZE-RESUME
  175. /* ********************** Internal Procedures *********************** */
  176. {&DB-REQUIRED-START}
  177. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE dataAvailable dTables _DB-REQUIRED
  178. PROCEDURE dataAvailable :
  179. /*------------------------------------------------------------------------------
  180. Purpose: Super Override
  181. Parameters:
  182. Notes:
  183. ------------------------------------------------------------------------------*/
  184. { incl/datdataavailable.i }
  185. END PROCEDURE.
  186. /* _UIB-CODE-BLOCK-END */
  187. &ANALYZE-RESUME
  188. {&DB-REQUIRED-END}
  189. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE disable_UI dTables _DEFAULT-DISABLE
  190. PROCEDURE disable_UI :
  191. /*------------------------------------------------------------------------------
  192. Purpose: DISABLE the User Interface
  193. Parameters: <none>
  194. Notes: Here we clean-up the user-interface by deleting
  195. dynamic widgets we have created and/or hide
  196. frames. This procedure is usually called when
  197. we are ready to "clean-up" after running.
  198. ------------------------------------------------------------------------------*/
  199. /* Hide all frames. */
  200. IF THIS-PROCEDURE:PERSISTENT THEN DELETE PROCEDURE THIS-PROCEDURE.
  201. END PROCEDURE.
  202. /* _UIB-CODE-BLOCK-END */
  203. &ANALYZE-RESUME
  204. {&DB-REQUIRED-START}
  205. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE INAKTIVIEREN dTables _DB-REQUIRED
  206. PROCEDURE INAKTIVIEREN :
  207. /*------------------------------------------------------------------------------
  208. Purpose:
  209. Parameters: <none>
  210. Notes:
  211. ------------------------------------------------------------------------------*/
  212. { incl/datinaktivieren.i }
  213. END PROCEDURE.
  214. /* _UIB-CODE-BLOCK-END */
  215. &ANALYZE-RESUME
  216. {&DB-REQUIRED-END}
  217. {&DB-REQUIRED-START}
  218. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE initializeObject dTables _DB-REQUIRED
  219. PROCEDURE initializeObject :
  220. /*------------------------------------------------------------------------------
  221. Purpose: Super Override
  222. Parameters:
  223. Notes:
  224. ------------------------------------------------------------------------------*/
  225. { incl/datinitialize.i }
  226. END PROCEDURE.
  227. /* _UIB-CODE-BLOCK-END */
  228. &ANALYZE-RESUME
  229. {&DB-REQUIRED-END}
  230. {&DB-REQUIRED-START}
  231. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE REAKTIVIEREN dTables _DB-REQUIRED
  232. PROCEDURE REAKTIVIEREN :
  233. /*------------------------------------------------------------------------------
  234. Purpose:
  235. Parameters: <none>
  236. Notes:
  237. ------------------------------------------------------------------------------*/
  238. { incl/datreaktivieren.i }
  239. END PROCEDURE.
  240. /* _UIB-CODE-BLOCK-END */
  241. &ANALYZE-RESUME
  242. {&DB-REQUIRED-END}
  243. {&DB-REQUIRED-START}
  244. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE REPOS_TABELLE dTables _DB-REQUIRED
  245. PROCEDURE REPOS_TABELLE :
  246. /*------------------------------------------------------------------------------
  247. Purpose:
  248. Parameters: <none>
  249. Notes:
  250. ------------------------------------------------------------------------------*/
  251. { incl/datrepos.i }
  252. END PROCEDURE.
  253. /* _UIB-CODE-BLOCK-END */
  254. &ANALYZE-RESUME
  255. {&DB-REQUIRED-END}
  256. {&DB-REQUIRED-START}
  257. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE SET_FILTER dTables _DB-REQUIRED
  258. PROCEDURE SET_FILTER :
  259. /*------------------------------------------------------------------------------
  260. Purpose:
  261. Parameters: <none>
  262. Notes:
  263. ------------------------------------------------------------------------------*/
  264. { incl/datsetfilter.i }
  265. END PROCEDURE.
  266. /* _UIB-CODE-BLOCK-END */
  267. &ANALYZE-RESUME
  268. {&DB-REQUIRED-END}
  269. {&DB-REQUIRED-START}
  270. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE SET_OPENFLAG dTables _DB-REQUIRED
  271. PROCEDURE SET_OPENFLAG :
  272. /*------------------------------------------------------------------------------
  273. Purpose:
  274. Parameters: <none>
  275. Notes:
  276. ------------------------------------------------------------------------------*/
  277. { incl/datsetopenflag.i }
  278. END PROCEDURE.
  279. /* _UIB-CODE-BLOCK-END */
  280. &ANALYZE-RESUME
  281. {&DB-REQUIRED-END}
  282. {&DB-REQUIRED-START}
  283. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE SET_SORT dTables _DB-REQUIRED
  284. PROCEDURE SET_SORT :
  285. /*------------------------------------------------------------------------------
  286. Purpose:
  287. Parameters: <none>
  288. Notes:
  289. ------------------------------------------------------------------------------*/
  290. { incl/datsetsort.i }
  291. END PROCEDURE.
  292. /* _UIB-CODE-BLOCK-END */
  293. &ANALYZE-RESUME
  294. {&DB-REQUIRED-END}
  295. /* ************************ Function Implementations ***************** */
  296. {&DB-REQUIRED-START}
  297. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION getCurrentRecid dTables _DB-REQUIRED
  298. FUNCTION getCurrentRecid RETURNS RECID
  299. ( /* parameter-definitions */ ) :
  300. /*------------------------------------------------------------------------------
  301. Purpose:
  302. Notes:
  303. ------------------------------------------------------------------------------*/
  304. { incl/datgetcurrentrecid.i }
  305. END FUNCTION.
  306. /* _UIB-CODE-BLOCK-END */
  307. &ANALYZE-RESUME
  308. {&DB-REQUIRED-END}
  309. {&DB-REQUIRED-START}
  310. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION getQueryBuffer dTables _DB-REQUIRED
  311. FUNCTION getQueryBuffer RETURNS HANDLE
  312. ( /* parameter-definitions */ ) :
  313. /*------------------------------------------------------------------------------
  314. Purpose:
  315. Notes:
  316. ------------------------------------------------------------------------------*/
  317. RETURN BUFFER rowObject:HANDLE.
  318. END FUNCTION.
  319. /* _UIB-CODE-BLOCK-END */
  320. &ANALYZE-RESUME
  321. {&DB-REQUIRED-END}
  322. {&DB-REQUIRED-START}
  323. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION openQuery dTables _DB-REQUIRED
  324. FUNCTION openQuery RETURNS LOGICAL
  325. ( /* parameter-definitions */ ) :
  326. /*------------------------------------------------------------------------------
  327. Purpose: Super Override
  328. Notes:
  329. ------------------------------------------------------------------------------*/
  330. DEF VAR Felder AS CHAR NO-UNDO.
  331. DEF VAR Inhalt AS CHAR NO-UNDO.
  332. DEF VAR ix AS INT NO-UNDO.
  333. DEF VAR cFeld AS CHAR NO-UNDO.
  334. /* IF NOT fOpen THEN RETURN FALSE. */
  335. xWhere = ''.
  336. xSort = ''.
  337. xString = ''.
  338. Felder = DYNAMIC-FUNCTION('getForeignFields':U) NO-ERROR.
  339. Inhalt = DYNAMIC-FUNCTION('getForeignValues':U) NO-ERROR.
  340. /* ix = LOOKUP('Feld', Felder, ',') / 2. */
  341. /* cFeld = ENTRY (ix , Inhalt, CHR(01)). */
  342. xWhere = 'Tabel.Firma = ' + QUOTER(Firma) + ' AND '
  343. + 'Tabel.RecArt = ' + QUOTER(cRecArt) + ' '.
  344. /* xString = 'FOR EACH Debop ' + xSort + 'WHERE ' */
  345. /* + 'Debop.Firma = "' + Firma + '" AND ' */
  346. /* + 'Debop.Knr = ' + STRING(Knr) + ' ' */
  347. /* + 'NO-LOCK BY Debop.FakDat DESCENDING INDEXED-REPOSITION '. */
  348. { incl/datopenquery.i }
  349. IF xWhere <> '' THEN DYNAMIC-FUNCTION('setQueryWhere':U , INPUT xWhere ).
  350. IF xString <> '' THEN DYNAMIC-FUNCTION('setQueryString':U, INPUT xString).
  351. IF xSort <> '' THEN DYNAMIC-FUNCTION('setQuerySort':U , INPUT xSort ).
  352. RETURN SUPER( ).
  353. END FUNCTION.
  354. /* _UIB-CODE-BLOCK-END */
  355. &ANALYZE-RESUME
  356. {&DB-REQUIRED-END}