a-tabel-i.w 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431
  1. &ANALYZE-SUSPEND _VERSION-NUMBER UIB_v8r12 GUI ADM1
  2. &ANALYZE-RESUME
  3. /* Connected Databases
  4. anadat PROGRESS
  5. */
  6. &Scoped-define WINDOW-NAME CURRENT-WINDOW
  7. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _DEFINITIONS B-table-Win
  8. /*------------------------------------------------------------------------
  9. File:
  10. Description: from BROWSER.W - Basic SmartBrowser Object Template
  11. Input Parameters:
  12. <none>
  13. Output Parameters:
  14. <none>
  15. ------------------------------------------------------------------------*/
  16. /* This .W file was created with the Progress UIB. */
  17. /*----------------------------------------------------------------------*/
  18. /* Create an unnamed pool to store all the widgets created
  19. by this procedure. This is a good default which assures
  20. that this procedure's triggers and internal procedures
  21. will execute in this procedure's storage, and that proper
  22. cleanup will occur on deletion of the procedure. */
  23. CREATE WIDGET-POOL.
  24. /* *************************** Definitions ************************** */
  25. /* Parameters Definitions --- */
  26. /* Local Variable Definitions --- */
  27. DEF VAR VCodeI AS INT NO-UNDO.
  28. DEF BUFFER BTabel FOR Tabel.
  29. /* ---------- Globale Variablen ---------------------------------- */
  30. { v8/globvar.i " " " " "SHARED" }
  31. { v8/debivar.i " " " " "SHARED" }
  32. { v8/artivar.i " " " " "SHARED" }
  33. { v8/contvar.i " " " " "SHARED" }
  34. /* _UIB-CODE-BLOCK-END */
  35. &ANALYZE-RESUME
  36. &ANALYZE-SUSPEND _UIB-PREPROCESSOR-BLOCK
  37. /* ******************** Preprocessor Definitions ******************** */
  38. &Scoped-define PROCEDURE-TYPE SmartBrowser
  39. &Scoped-define DB-AWARE no
  40. &Scoped-define ADM-SUPPORTED-LINKS Record-Source,Record-Target,TableIO-Target
  41. /* Name of first Frame and/or Browse and/or first Query */
  42. &Scoped-define FRAME-NAME F-Main
  43. &Scoped-define BROWSE-NAME br_table
  44. /* Internal Tables (found by Frame, Query & Browse Queries) */
  45. &Scoped-define INTERNAL-TABLES Tabel
  46. /* Define KEY-PHRASE in case it is used by any query. */
  47. &Scoped-define KEY-PHRASE TRUE
  48. /* Definitions for BROWSE br_table */
  49. &Scoped-define FIELDS-IN-QUERY-br_table Tabel.Bez1 Tabel.Bez2
  50. &Scoped-define ENABLED-FIELDS-IN-QUERY-br_table
  51. &Scoped-define OPEN-QUERY-br_table OPEN QUERY br_table FOR EACH Tabel WHERE ~{&KEY-PHRASE} ~
  52. AND Tabel.Firma = LVFirma ~
  53. AND Tabel.Recart = LVRecArt ~
  54. AND Tabel.CodeC = "" ~
  55. AND Tabel.Sprcd = LVSprcd NO-LOCK ~
  56. ~{&SORTBY-PHRASE}.
  57. &Scoped-define TABLES-IN-QUERY-br_table Tabel
  58. &Scoped-define FIRST-TABLE-IN-QUERY-br_table Tabel
  59. /* Definitions for FRAME F-Main */
  60. /* Standard List Definitions */
  61. &Scoped-Define ENABLED-OBJECTS br_table
  62. /* Custom List Definitions */
  63. /* List-1,List-2,List-3,List-4,List-5,List-6 */
  64. /* _UIB-PREPROCESSOR-BLOCK-END */
  65. &ANALYZE-RESUME
  66. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _XFTR "Foreign Keys" B-table-Win _INLINE
  67. /* Actions: ? adm/support/keyedit.w ? ? ? */
  68. /* STRUCTURED-DATA
  69. <KEY-OBJECT>
  70. &BROWSE-NAME
  71. </KEY-OBJECT>
  72. <FOREIGN-KEYS>
  73. </FOREIGN-KEYS>
  74. <EXECUTING-CODE>
  75. **************************
  76. * Set attributes related to FOREIGN KEYS
  77. */
  78. RUN set-attribute-list (
  79. 'Keys-Accepted = "",
  80. Keys-Supplied = ""':U).
  81. /**************************
  82. </EXECUTING-CODE> */
  83. /* _UIB-CODE-BLOCK-END */
  84. &ANALYZE-RESUME
  85. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _XFTR "Advanced Query Options" B-table-Win _INLINE
  86. /* Actions: ? adm/support/advqedit.w ? ? ? */
  87. /* STRUCTURED-DATA
  88. <KEY-OBJECT>
  89. &BROWSE-NAME
  90. </KEY-OBJECT>
  91. <SORTBY-OPTIONS>
  92. </SORTBY-OPTIONS>
  93. <SORTBY-RUN-CODE>
  94. ************************
  95. * Set attributes related to SORTBY-OPTIONS */
  96. RUN set-attribute-list (
  97. 'SortBy-Options = ""':U).
  98. /************************
  99. </SORTBY-RUN-CODE>
  100. <FILTER-ATTRIBUTES>
  101. </FILTER-ATTRIBUTES> */
  102. /* _UIB-CODE-BLOCK-END */
  103. &ANALYZE-RESUME
  104. /* *********************** Control Definitions ********************** */
  105. /* Definitions of the field level widgets */
  106. /* Query definitions */
  107. &ANALYZE-SUSPEND
  108. DEFINE QUERY br_table FOR
  109. Tabel SCROLLING.
  110. &ANALYZE-RESUME
  111. /* Browse definitions */
  112. DEFINE BROWSE br_table
  113. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _DISPLAY-FIELDS br_table B-table-Win _STRUCTURED
  114. QUERY br_table NO-LOCK DISPLAY
  115. Tabel.Bez1 COLUMN-LABEL "Bezeichnung 1" FORMAT "x(25)":U
  116. Tabel.Bez2 COLUMN-LABEL "Bezeichnung 2" FORMAT "x(25)":U
  117. /* _UIB-CODE-BLOCK-END */
  118. &ANALYZE-RESUME
  119. WITH NO-ASSIGN NO-ROW-MARKERS SEPARATORS SIZE 56 BY 6.19
  120. BGCOLOR 15 .
  121. /* ************************ Frame Definitions *********************** */
  122. DEFINE FRAME F-Main
  123. br_table AT ROW 1 COL 1
  124. WITH 1 DOWN NO-BOX KEEP-TAB-ORDER OVERLAY
  125. SIDE-LABELS NO-UNDERLINE THREE-D
  126. AT COL 1 ROW 1 SCROLLABLE
  127. BGCOLOR 8 FGCOLOR 0 .
  128. /* *********************** Procedure Settings ************************ */
  129. &ANALYZE-SUSPEND _PROCEDURE-SETTINGS
  130. /* Settings for THIS-PROCEDURE
  131. Type: SmartBrowser
  132. Allow: Basic,Browse
  133. Frames: 1
  134. Add Fields to: EXTERNAL-TABLES
  135. Other Settings: PERSISTENT-ONLY COMPILE
  136. */
  137. /* This procedure should always be RUN PERSISTENT. Report the error, */
  138. /* then cleanup and return. */
  139. IF NOT THIS-PROCEDURE:PERSISTENT THEN DO:
  140. MESSAGE "{&FILE-NAME} should only be RUN PERSISTENT.":U
  141. VIEW-AS ALERT-BOX ERROR BUTTONS OK.
  142. RETURN.
  143. END.
  144. &ANALYZE-RESUME _END-PROCEDURE-SETTINGS
  145. /* ************************* Create Window ************************** */
  146. &ANALYZE-SUSPEND _CREATE-WINDOW
  147. /* DESIGN Window definition (used by the UIB)
  148. CREATE WINDOW B-table-Win ASSIGN
  149. HEIGHT = 6.57
  150. WIDTH = 72.6.
  151. /* END WINDOW DEFINITION */
  152. */
  153. &ANALYZE-RESUME
  154. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _INCLUDED-LIB B-table-Win
  155. /* ************************* Included-Libraries *********************** */
  156. {src/adm/method/browser.i}
  157. /* _UIB-CODE-BLOCK-END */
  158. &ANALYZE-RESUME
  159. /* *********** Runtime Attributes and AppBuilder Settings *********** */
  160. &ANALYZE-SUSPEND _RUN-TIME-ATTRIBUTES
  161. /* SETTINGS FOR WINDOW B-table-Win
  162. NOT-VISIBLE,,RUN-PERSISTENT */
  163. /* SETTINGS FOR FRAME F-Main
  164. NOT-VISIBLE Size-to-Fit */
  165. /* BROWSE-TAB br_table 1 F-Main */
  166. ASSIGN
  167. FRAME F-Main:SCROLLABLE = FALSE
  168. FRAME F-Main:HIDDEN = TRUE.
  169. /* _RUN-TIME-ATTRIBUTES-END */
  170. &ANALYZE-RESUME
  171. /* Setting information for Queries and Browse Widgets fields */
  172. &ANALYZE-SUSPEND _QUERY-BLOCK BROWSE br_table
  173. /* Query rebuild information for BROWSE br_table
  174. _TblList = "AnaDat.Tabel"
  175. _Options = "NO-LOCK KEY-PHRASE SORTBY-PHRASE"
  176. _Where[1] = "Tabel.Firma = LVFirma
  177. AND Tabel.Recart = LVRecArt
  178. AND Tabel.CodeC = """"
  179. AND Tabel.Sprcd = LVSprcd"
  180. _FldNameList[1] > AnaDat.Tabel.Bez1
  181. "Tabel.Bez1" "Bezeichnung 1" "x(25)" "character" ? ? ? ? ? ? no ? no no ? yes no no "U" "" ""
  182. _FldNameList[2] > AnaDat.Tabel.Bez2
  183. "Tabel.Bez2" "Bezeichnung 2" "x(25)" "character" ? ? ? ? ? ? no ? no no ? yes no no "U" "" ""
  184. _Query is NOT OPENED
  185. */ /* BROWSE br_table */
  186. &ANALYZE-RESUME
  187. &ANALYZE-SUSPEND _QUERY-BLOCK FRAME F-Main
  188. /* Query rebuild information for FRAME F-Main
  189. _Options = "NO-LOCK"
  190. _Query is NOT OPENED
  191. */ /* FRAME F-Main */
  192. &ANALYZE-RESUME
  193. /* ************************ Control Triggers ************************ */
  194. &Scoped-define BROWSE-NAME br_table
  195. &Scoped-define SELF-NAME br_table
  196. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL br_table B-table-Win
  197. ON ROW-ENTRY OF br_table IN FRAME F-Main
  198. DO:
  199. /* This code displays initial values for newly added or copied rows. */
  200. {src/adm/template/brsentry.i}
  201. END.
  202. /* _UIB-CODE-BLOCK-END */
  203. &ANALYZE-RESUME
  204. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL br_table B-table-Win
  205. ON ROW-LEAVE OF br_table IN FRAME F-Main
  206. DO:
  207. /* Do not disable this code or no updates will take place except
  208. by pressing the Save button on an Update SmartPanel. */
  209. {src/adm/template/brsleave.i}
  210. END.
  211. /* _UIB-CODE-BLOCK-END */
  212. &ANALYZE-RESUME
  213. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL br_table B-table-Win
  214. ON VALUE-CHANGED OF br_table IN FRAME F-Main
  215. DO:
  216. IF AVAILABLE Tabel THEN DO:
  217. LVCodeI = Tabel.CodeI.
  218. END.
  219. {src/adm/template/brschnge.i}
  220. END.
  221. /* _UIB-CODE-BLOCK-END */
  222. &ANALYZE-RESUME
  223. &UNDEFINE SELF-NAME
  224. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _MAIN-BLOCK B-table-Win
  225. /* *************************** Main Block *************************** */
  226. VCodeI = LVCodeI.
  227. &IF DEFINED(UIB_IS_RUNNING) <> 0 &THEN
  228. RUN dispatch IN THIS-PROCEDURE ('initialize':U).
  229. &ENDIF
  230. /* _UIB-CODE-BLOCK-END */
  231. &ANALYZE-RESUME
  232. /* ********************** Internal Procedures *********************** */
  233. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE adm-row-available B-table-Win _ADM-ROW-AVAILABLE
  234. PROCEDURE adm-row-available :
  235. /*------------------------------------------------------------------------------
  236. Purpose: Dispatched to this procedure when the Record-
  237. Source has a new row available. This procedure
  238. tries to get the new row (or foriegn keys) from
  239. the Record-Source and process it.
  240. Parameters: <none>
  241. ------------------------------------------------------------------------------*/
  242. /* Define variables needed by this internal procedure. */
  243. {src/adm/template/row-head.i}
  244. /* Process the newly available records (i.e. display fields,
  245. open queries, and/or pass records on to any RECORD-TARGETS). */
  246. {src/adm/template/row-end.i}
  247. END PROCEDURE.
  248. /* _UIB-CODE-BLOCK-END */
  249. &ANALYZE-RESUME
  250. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE disable_UI B-table-Win _DEFAULT-DISABLE
  251. PROCEDURE disable_UI :
  252. /*------------------------------------------------------------------------------
  253. Purpose: DISABLE the User Interface
  254. Parameters: <none>
  255. Notes: Here we clean-up the user-interface by deleting
  256. dynamic widgets we have created and/or hide
  257. frames. This procedure is usually called when
  258. we are ready to "clean-up" after running.
  259. ------------------------------------------------------------------------------*/
  260. /* Hide all frames. */
  261. HIDE FRAME F-Main.
  262. IF THIS-PROCEDURE:PERSISTENT THEN DELETE PROCEDURE THIS-PROCEDURE.
  263. END PROCEDURE.
  264. /* _UIB-CODE-BLOCK-END */
  265. &ANALYZE-RESUME
  266. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE local-open-query B-table-Win
  267. PROCEDURE local-open-query :
  268. /*------------------------------------------------------------------------------
  269. Purpose: Override standard ADM method
  270. Notes:
  271. ------------------------------------------------------------------------------*/
  272. RUN dispatch IN THIS-PROCEDURE ('open-query':U).
  273. DO WITH FRAME {&FRAME-NAME}:
  274. IF NUM-RESULTS("{&BROWSE-NAME}":U) = ? THEN RETURN.
  275. IF NUM-RESULTS("{&BROWSE-NAME}":U) = 0 THEN RETURN.
  276. APPLY 'VALUE-CHANGED' TO BROWSE {&BROWSE-NAME}.
  277. END.
  278. FIND BTabel USE-INDEX Tabel-k1
  279. WHERE BTabel.Firma = LVFirma
  280. AND BTabel.RecArt = LVRecArt
  281. AND BTabel.CodeC = ''
  282. AND BTabel.CodeI = VCodeI
  283. AND BTabel.Sprcd = LVSprcd NO-LOCK NO-ERROR.
  284. IF AVAILABLE BTabel THEN DO:
  285. REPOSITION {&BROWSE-NAME} TO ROWID ROWID(BTabel).
  286. APPLY 'VALUE-CHANGED' TO BROWSE {&BROWSE-NAME}.
  287. END.
  288. END PROCEDURE.
  289. /* _UIB-CODE-BLOCK-END */
  290. &ANALYZE-RESUME
  291. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE send-records B-table-Win _ADM-SEND-RECORDS
  292. PROCEDURE send-records :
  293. /*------------------------------------------------------------------------------
  294. Purpose: Send record ROWID's for all tables used by
  295. this file.
  296. Parameters: see template/snd-head.i
  297. ------------------------------------------------------------------------------*/
  298. /* Define variables needed by this internal procedure. */
  299. {src/adm/template/snd-head.i}
  300. /* For each requested table, put it's ROWID in the output list. */
  301. {src/adm/template/snd-list.i "Tabel"}
  302. /* Deal with any unexpected table requests before closing. */
  303. {src/adm/template/snd-end.i}
  304. END PROCEDURE.
  305. /* _UIB-CODE-BLOCK-END */
  306. &ANALYZE-RESUME
  307. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE state-changed B-table-Win
  308. PROCEDURE state-changed :
  309. /* -----------------------------------------------------------
  310. Purpose:
  311. Parameters: <none>
  312. Notes:
  313. -------------------------------------------------------------*/
  314. DEFINE INPUT PARAMETER p-issuer-hdl AS HANDLE NO-UNDO.
  315. DEFINE INPUT PARAMETER p-state AS CHARACTER NO-UNDO.
  316. CASE p-state:
  317. /* Object instance CASEs can go here to replace standard behavior
  318. or add new cases. */
  319. {src/adm/template/bstates.i}
  320. END CASE.
  321. END PROCEDURE.
  322. /* _UIB-CODE-BLOCK-END */
  323. &ANALYZE-RESUME