d-ruestart.w 15 KB

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