d-spesenarten.w 15 KB

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