f-bestgebinfo.w 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495
  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. /* Temp-Table and Buffer definitions */
  8. DEFINE TEMP-TABLE TTabel NO-UNDO LIKE Tabel.
  9. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _DEFINITIONS F-Frame-Win
  10. /*------------------------------------------------------------------------
  11. File:
  12. Description: from cntnrfrm.w - ADM SmartFrame Template
  13. Input Parameters:
  14. <none>
  15. Output Parameters:
  16. <none>
  17. ------------------------------------------------------------------------*/
  18. /* This .W file was created with the Progress UIB. */
  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 VKnr AS INT NO-UNDO.
  30. DEF VAR VBesnr AS INT NO-UNDO.
  31. /* ---------- Globale Variablen ---------------------------------- */
  32. { v8/globvar.i" " " " "SHARED" }
  33. { v8/debivar.i " " " " "SHARED" }
  34. { v8/artivar.i " " " " "SHARED" }
  35. { v8/contvar.i " " " " "SHARED" }
  36. /* _UIB-CODE-BLOCK-END */
  37. &ANALYZE-RESUME
  38. &ANALYZE-SUSPEND _UIB-PREPROCESSOR-BLOCK
  39. /* ******************** Preprocessor Definitions ******************** */
  40. &Scoped-define PROCEDURE-TYPE SmartFrame
  41. &Scoped-define DB-AWARE no
  42. &Scoped-define ADM-CONTAINER FRAME
  43. /* Name of first Frame and/or Browse and/or first Query */
  44. &Scoped-define FRAME-NAME F-Main
  45. &Scoped-define BROWSE-NAME BROWSE-1
  46. /* Internal Tables (found by Frame, Query & Browse Queries) */
  47. &Scoped-define INTERNAL-TABLES TTabel
  48. /* Definitions for BROWSE BROWSE-1 */
  49. &Scoped-define FIELDS-IN-QUERY-BROWSE-1 TTabel.CodeC TTabel.Bez1 ~
  50. TTabel.Int_1
  51. &Scoped-define ENABLED-FIELDS-IN-QUERY-BROWSE-1
  52. &Scoped-define OPEN-QUERY-BROWSE-1 OPEN QUERY BROWSE-1 FOR EACH TTabel NO-LOCK ~
  53. BY TTabel.Recart ~
  54. BY TTabel.CodeC.
  55. &Scoped-define TABLES-IN-QUERY-BROWSE-1 TTabel
  56. &Scoped-define FIRST-TABLE-IN-QUERY-BROWSE-1 TTabel
  57. /* Definitions for FRAME F-Main */
  58. /* Standard List Definitions */
  59. &Scoped-Define ENABLED-OBJECTS BROWSE-1
  60. /* Custom List Definitions */
  61. /* List-1,List-2,List-3,List-4,List-5,List-6 */
  62. /* _UIB-PREPROCESSOR-BLOCK-END */
  63. &ANALYZE-RESUME
  64. /* *********************** Control Definitions ********************** */
  65. /* Definitions of the field level widgets */
  66. /* Query definitions */
  67. &ANALYZE-SUSPEND
  68. DEFINE QUERY BROWSE-1 FOR
  69. TTabel SCROLLING.
  70. &ANALYZE-RESUME
  71. /* Browse definitions */
  72. DEFINE BROWSE BROWSE-1
  73. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _DISPLAY-FIELDS BROWSE-1 F-Frame-Win _STRUCTURED
  74. QUERY BROWSE-1 DISPLAY
  75. TTabel.CodeC COLUMN-LABEL "Geb-Cd" FORMAT "x(12)":U
  76. TTabel.Bez1 COLUMN-LABEL "Gebinde" FORMAT "x(40)":U
  77. TTabel.Int_1 COLUMN-LABEL "Anzahl" FORMAT "->>>,>>>,>>9":U
  78. /* _UIB-CODE-BLOCK-END */
  79. &ANALYZE-RESUME
  80. WITH NO-ROW-MARKERS SEPARATORS SIZE 71.8 BY 15.91
  81. BGCOLOR 15
  82. TITLE BGCOLOR 15 "Gebindeübersicht der gelieferten Gebinde".
  83. /* ************************ Frame Definitions *********************** */
  84. DEFINE FRAME F-Main
  85. BROWSE-1 AT ROW 3 COL 23.6
  86. WITH 1 DOWN NO-BOX KEEP-TAB-ORDER OVERLAY
  87. SIDE-LABELS NO-UNDERLINE THREE-D
  88. AT COL 1 ROW 1
  89. SIZE 119.6 BY 19.62.
  90. /* *********************** Procedure Settings ************************ */
  91. &ANALYZE-SUSPEND _PROCEDURE-SETTINGS
  92. /* Settings for THIS-PROCEDURE
  93. Type: SmartFrame
  94. Allow: Basic,Browse,DB-Fields,Query,Smart
  95. Other Settings: PERSISTENT-ONLY
  96. Temp-Tables and Buffers:
  97. TABLE: TTabel T "?" NO-UNDO AnaDat Tabel
  98. END-TABLES.
  99. */
  100. /* This procedure should always be RUN PERSISTENT. Report the error, */
  101. /* then cleanup and return. */
  102. IF NOT THIS-PROCEDURE:PERSISTENT THEN DO:
  103. MESSAGE "{&FILE-NAME} should only be RUN PERSISTENT.":U
  104. VIEW-AS ALERT-BOX ERROR BUTTONS OK.
  105. RETURN.
  106. END.
  107. &ANALYZE-RESUME _END-PROCEDURE-SETTINGS
  108. /* ************************* Create Window ************************** */
  109. &ANALYZE-SUSPEND _CREATE-WINDOW
  110. /* DESIGN Window definition (used by the UIB)
  111. CREATE WINDOW F-Frame-Win ASSIGN
  112. HEIGHT = 19.62
  113. WIDTH = 119.6.
  114. /* END WINDOW DEFINITION */
  115. */
  116. &ANALYZE-RESUME
  117. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _INCLUDED-LIB F-Frame-Win
  118. /* ************************* Included-Libraries *********************** */
  119. {src/adm/method/containr.i}
  120. /* _UIB-CODE-BLOCK-END */
  121. &ANALYZE-RESUME
  122. /* *********** Runtime Attributes and AppBuilder Settings *********** */
  123. &ANALYZE-SUSPEND _RUN-TIME-ATTRIBUTES
  124. /* SETTINGS FOR WINDOW F-Frame-Win
  125. VISIBLE,,RUN-PERSISTENT */
  126. /* SETTINGS FOR FRAME F-Main
  127. NOT-VISIBLE */
  128. /* BROWSE-TAB BROWSE-1 1 F-Main */
  129. /* _RUN-TIME-ATTRIBUTES-END */
  130. &ANALYZE-RESUME
  131. /* Setting information for Queries and Browse Widgets fields */
  132. &ANALYZE-SUSPEND _QUERY-BLOCK BROWSE BROWSE-1
  133. /* Query rebuild information for BROWSE BROWSE-1
  134. _TblList = "Temp-Tables.TTabel"
  135. _OrdList = "Temp-Tables.TTabel.Recart|yes,Temp-Tables.TTabel.CodeC|yes"
  136. _FldNameList[1] > Temp-Tables.TTabel.CodeC
  137. "TTabel.CodeC" "Geb-Cd" "x(12)" "character" ? ? ? ? ? ? no ? no no ? yes no no "U" "" ""
  138. _FldNameList[2] > Temp-Tables.TTabel.Bez1
  139. "TTabel.Bez1" "Gebinde" "x(40)" "character" ? ? ? ? ? ? no ? no no ? yes no no "U" "" ""
  140. _FldNameList[3] > Temp-Tables.TTabel.Int_1
  141. "TTabel.Int_1" "Anzahl" "->>>,>>>,>>9" "integer" ? ? ? ? ? ? no ? no no ? yes no no "U" "" ""
  142. _Query is NOT OPENED
  143. */ /* BROWSE BROWSE-1 */
  144. &ANALYZE-RESUME
  145. &ANALYZE-SUSPEND _QUERY-BLOCK FRAME F-Main
  146. /* Query rebuild information for FRAME F-Main
  147. _Options = ""
  148. _Query is NOT OPENED
  149. */ /* FRAME F-Main */
  150. &ANALYZE-RESUME
  151. /* ************************ Control Triggers ************************ */
  152. &Scoped-define SELF-NAME F-Main
  153. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL F-Main F-Frame-Win
  154. ON END-ERROR OF FRAME F-Main
  155. DO:
  156. RUN new-state ( INPUT 'ENDE, MAIN':U ).
  157. RETURN NO-APPLY.
  158. END.
  159. /* _UIB-CODE-BLOCK-END */
  160. &ANALYZE-RESUME
  161. &Scoped-define BROWSE-NAME BROWSE-1
  162. &Scoped-define SELF-NAME BROWSE-1
  163. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL BROWSE-1 F-Frame-Win
  164. ON END-ERROR OF BROWSE-1 IN FRAME F-Main /* Gebindeübersicht der gelieferten Gebinde */
  165. DO:
  166. RUN new-state ( INPUT 'ENDE, MAIN':U ).
  167. RETURN NO-APPLY.
  168. END.
  169. /* _UIB-CODE-BLOCK-END */
  170. &ANALYZE-RESUME
  171. &UNDEFINE SELF-NAME
  172. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _MAIN-BLOCK F-Frame-Win
  173. /* *************************** Main Block *************************** */
  174. &IF DEFINED(UIB_IS_RUNNING) <> 0 &THEN
  175. /* Now enable the interface if in test mode - otherwise this happens when
  176. the object is explicitly initialized from its container. */
  177. RUN dispatch IN THIS-PROCEDURE ('initialize':U).
  178. &ENDIF
  179. /* _UIB-CODE-BLOCK-END */
  180. &ANALYZE-RESUME
  181. /* ********************** Internal Procedures *********************** */
  182. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE adm-create-objects F-Frame-Win _ADM-CREATE-OBJECTS
  183. PROCEDURE adm-create-objects :
  184. /*------------------------------------------------------------------------------
  185. Purpose: Create handles for all SmartObjects used in this procedure.
  186. After SmartObjects are initialized, then SmartLinks are added.
  187. Parameters: <none>
  188. ------------------------------------------------------------------------------*/
  189. END PROCEDURE.
  190. /* _UIB-CODE-BLOCK-END */
  191. &ANALYZE-RESUME
  192. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE adm-row-available F-Frame-Win _ADM-ROW-AVAILABLE
  193. PROCEDURE adm-row-available :
  194. /*------------------------------------------------------------------------------
  195. Purpose: Dispatched to this procedure when the Record-
  196. Source has a new row available. This procedure
  197. tries to get the new row (or foriegn keys) from
  198. the Record-Source and process it.
  199. Parameters: <none>
  200. ------------------------------------------------------------------------------*/
  201. /* Define variables needed by this internal procedure. */
  202. {src/adm/template/row-head.i}
  203. /* Process the newly available records (i.e. display fields,
  204. open queries, and/or pass records on to any RECORD-TARGETS). */
  205. {src/adm/template/row-end.i}
  206. END PROCEDURE.
  207. /* _UIB-CODE-BLOCK-END */
  208. &ANALYZE-RESUME
  209. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE disable_UI F-Frame-Win _DEFAULT-DISABLE
  210. PROCEDURE disable_UI :
  211. /*------------------------------------------------------------------------------
  212. Purpose: DISABLE the User Interface
  213. Parameters: <none>
  214. Notes: Here we clean-up the user-interface by deleting
  215. dynamic widgets we have created and/or hide
  216. frames. This procedure is usually called when
  217. we are ready to "clean-up" after running.
  218. ------------------------------------------------------------------------------*/
  219. /* Hide all frames. */
  220. HIDE FRAME F-Main.
  221. IF THIS-PROCEDURE:PERSISTENT THEN DELETE PROCEDURE THIS-PROCEDURE.
  222. END PROCEDURE.
  223. /* _UIB-CODE-BLOCK-END */
  224. &ANALYZE-RESUME
  225. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE enable_UI F-Frame-Win _DEFAULT-ENABLE
  226. PROCEDURE enable_UI :
  227. /*------------------------------------------------------------------------------
  228. Purpose: ENABLE the User Interface
  229. Parameters: <none>
  230. Notes: Here we display/view/enable the widgets in the
  231. user-interface. In addition, OPEN all queries
  232. associated with each FRAME and BROWSE.
  233. These statements here are based on the "Other
  234. Settings" section of the widget Property Sheets.
  235. ------------------------------------------------------------------------------*/
  236. ENABLE BROWSE-1
  237. WITH FRAME F-Main.
  238. {&OPEN-BROWSERS-IN-QUERY-F-Main}
  239. END PROCEDURE.
  240. /* _UIB-CODE-BLOCK-END */
  241. &ANALYZE-RESUME
  242. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE local-view F-Frame-Win
  243. PROCEDURE local-view :
  244. /*------------------------------------------------------------------------------
  245. Purpose: Override standard ADM method
  246. Notes:
  247. ------------------------------------------------------------------------------*/
  248. VKnr = LVLnr.
  249. VBesnr = LVBesnr.
  250. FOR EACH TTabel:
  251. DELETE TTabel.
  252. END.
  253. FOR EACH Besze USE-INDEX Besze-k1
  254. WHERE Besze.Firma = GVFirma
  255. AND Besze.Besnr = VBesnr NO-LOCK:
  256. DO WHILE TRUE:
  257. IF Besze.KGeb_Cd = '' THEN LEAVE.
  258. IF Besze.KGeb_Me = 0 THEN LEAVE.
  259. FIND KGebinde USE-INDEX KGebinde-k1
  260. WHERE KGebinde.Firma = GVFirma
  261. AND KGebinde.Geb_Cd = Besze.KGeb_Cd NO-LOCK NO-ERROR.
  262. IF NOT AVAILABLE KGebinde THEN LEAVE.
  263. FIND TTabel USE-INDEX Tabel-k1
  264. WHERE TTabel.Firma = GVFirma
  265. AND TTabel.RecArt = 'A'
  266. AND TTabel.CodeC = KGebinde.Geb_Cd
  267. AND TTabel.CodeI = 0
  268. AND TTabel.Sprcd = 1 NO-ERROR.
  269. IF NOT AVAILABLE TTabel THEN DO:
  270. CREATE TTabel.
  271. ASSIGN TTabel.Firma = GVFirma
  272. TTabel.RecArt = 'A'
  273. TTabel.CodeC = KGebinde.Geb_Cd
  274. TTabel.CodeI = 0
  275. TTabel.Sprcd = 1
  276. TTabel.Bez1 = KGebinde.Bez.
  277. END.
  278. TTabel.Int_1 = TTabel.Int_1 + Besze.KGeb_Me.
  279. LEAVE.
  280. END.
  281. DO WHILE TRUE:
  282. IF Besze.VGeb_Cd = '' THEN LEAVE.
  283. IF Besze.VGeb_Me = 0 THEN LEAVE.
  284. FIND VGebinde USE-INDEX VGebinde-k1
  285. WHERE VGebinde.Firma = GVFirma
  286. AND VGebinde.Geb_Cd = Besze.VGeb_Cd NO-LOCK NO-ERROR.
  287. IF NOT AVAILABLE VGebinde THEN LEAVE.
  288. FIND TTabel USE-INDEX Tabel-k1
  289. WHERE TTabel.Firma = GVFirma
  290. AND TTabel.RecArt = 'B'
  291. AND TTabel.CodeC = VGebinde.Geb_Cd
  292. AND TTabel.CodeI = 0
  293. AND TTabel.Sprcd = 1 NO-ERROR.
  294. IF NOT AVAILABLE TTabel THEN DO:
  295. CREATE TTabel.
  296. ASSIGN TTabel.Firma = GVFirma
  297. TTabel.RecArt = 'B'
  298. TTabel.CodeC = VGebinde.Geb_Cd
  299. TTabel.CodeI = 0
  300. TTabel.Sprcd = 1
  301. TTabel.Bez1 = VGebinde.Bez.
  302. END.
  303. TTabel.Int_1 = TTabel.Int_1 + Besze.VGeb_Me.
  304. LEAVE.
  305. END.
  306. DO WHILE TRUE:
  307. IF Besze.GGeb_Cd = '' THEN LEAVE.
  308. IF Besze.GGeb_Me = 0 THEN LEAVE.
  309. FIND GGebinde USE-INDEX GGebinde-k1
  310. WHERE GGebinde.Firma = GVFirma
  311. AND GGebinde.Geb_Cd = Besze.GGeb_Cd NO-LOCK NO-ERROR.
  312. IF NOT AVAILABLE GGebinde THEN LEAVE.
  313. FIND TTabel USE-INDEX Tabel-k1
  314. WHERE TTabel.Firma = GVFirma
  315. AND TTabel.RecArt = 'C'
  316. AND TTabel.CodeC = GGebinde.Geb_Cd
  317. AND TTabel.CodeI = 0
  318. AND TTabel.Sprcd = 1 NO-ERROR.
  319. IF NOT AVAILABLE TTabel THEN DO:
  320. CREATE TTabel.
  321. ASSIGN TTabel.Firma = GVFirma
  322. TTabel.RecArt = 'C'
  323. TTabel.CodeC = GGebinde.Geb_Cd
  324. TTabel.CodeI = 0
  325. TTabel.Sprcd = 1
  326. TTabel.Bez1 = GGebinde.Bez.
  327. END.
  328. TTabel.Int_1 = TTabel.Int_1 + Besze.GGeb_Me.
  329. LEAVE.
  330. END.
  331. END.
  332. RUN dispatch IN THIS-PROCEDURE ( INPUT 'view':U ) .
  333. RUN OPEN_QUERY.
  334. END PROCEDURE.
  335. /* _UIB-CODE-BLOCK-END */
  336. &ANALYZE-RESUME
  337. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE OPEN_QUERY F-Frame-Win
  338. PROCEDURE OPEN_QUERY :
  339. /*------------------------------------------------------------------------------
  340. Purpose:
  341. Parameters: <none>
  342. Notes:
  343. ------------------------------------------------------------------------------*/
  344. DO WITH FRAME {&FRAME-NAME}:
  345. IF NUM-RESULTS("{&BROWSE-NAME}":U) <> ? THEN CLOSE QUERY {&BROWSE-NAME}.
  346. OPEN QUERY {&BROWSE-NAME}
  347. FOR EACH TTabel NO-LOCK
  348. BY TTabel.RecArt
  349. BY TTabel.CodeC .
  350. APPLY 'ENTRY' TO BROWSE {&BROWSE-NAME}.
  351. END.
  352. END PROCEDURE.
  353. /* _UIB-CODE-BLOCK-END */
  354. &ANALYZE-RESUME
  355. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE send-records F-Frame-Win _ADM-SEND-RECORDS
  356. PROCEDURE send-records :
  357. /*------------------------------------------------------------------------------
  358. Purpose: Send record ROWID's for all tables used by
  359. this file.
  360. Parameters: see template/snd-head.i
  361. ------------------------------------------------------------------------------*/
  362. /* Define variables needed by this internal procedure. */
  363. {src/adm/template/snd-head.i}
  364. /* For each requested table, put it's ROWID in the output list. */
  365. {src/adm/template/snd-list.i "TTabel"}
  366. /* Deal with any unexpected table requests before closing. */
  367. {src/adm/template/snd-end.i}
  368. END PROCEDURE.
  369. /* _UIB-CODE-BLOCK-END */
  370. &ANALYZE-RESUME
  371. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE state-changed F-Frame-Win
  372. PROCEDURE state-changed :
  373. /* -----------------------------------------------------------
  374. Purpose:
  375. Parameters: <none>
  376. Notes:
  377. -------------------------------------------------------------*/
  378. DEFINE INPUT PARAMETER p-issuer-hdl AS HANDLE NO-UNDO.
  379. DEFINE INPUT PARAMETER p-state AS CHARACTER NO-UNDO.
  380. END PROCEDURE.
  381. /* _UIB-CODE-BLOCK-END */
  382. &ANALYZE-RESUME