d-adresse-auftrag.w 16 KB

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