d-femeld.w 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294
  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 xWhere AS CHAR NO-UNDO.
  30. DEF VAR xSort AS CHAR NO-UNDO.
  31. /* _UIB-CODE-BLOCK-END */
  32. &ANALYZE-RESUME
  33. &ANALYZE-SUSPEND _UIB-PREPROCESSOR-BLOCK
  34. /* ******************** Preprocessor Definitions ******************** */
  35. &Scoped-define PROCEDURE-TYPE SmartDataObject
  36. &Scoped-define DB-AWARE yes
  37. &Scoped-define ADM-SUPPORTED-LINKS Data-Source,Data-Target,Navigation-Target,Update-Target,Commit-Target,Filter-Target
  38. /* Db-Required definitions. */
  39. &IF DEFINED(DB-REQUIRED) = 0 &THEN
  40. &GLOBAL-DEFINE DB-REQUIRED TRUE
  41. &ENDIF
  42. &GLOBAL-DEFINE DB-REQUIRED-START &IF {&DB-REQUIRED} &THEN
  43. &GLOBAL-DEFINE DB-REQUIRED-END &ENDIF
  44. &Scoped-define QUERY-NAME Query-Main
  45. /* Internal Tables (found by Frame, Query & Browse Queries) */
  46. &Scoped-define INTERNAL-TABLES Femeld
  47. /* Definitions for QUERY Query-Main */
  48. &Scoped-Define ENABLED-FIELDS Sprcd Fenr Fetext
  49. &Scoped-define ENABLED-FIELDS-IN-Femeld Sprcd Fenr Fetext
  50. &Scoped-Define DATA-FIELDS Sprcd Fenr Fetext
  51. &Scoped-define DATA-FIELDS-IN-Femeld Sprcd Fenr Fetext
  52. &Scoped-Define MANDATORY-FIELDS Fenr
  53. &Scoped-Define APPLICATION-SERVICE
  54. &Scoped-Define ASSIGN-LIST
  55. &Scoped-Define DATA-FIELD-DEFS "d-femeld.i"
  56. &Scoped-define QUERY-STRING-Query-Main FOR EACH Femeld NO-LOCK INDEXED-REPOSITION
  57. {&DB-REQUIRED-START}
  58. &Scoped-define OPEN-QUERY-Query-Main OPEN QUERY Query-Main FOR EACH Femeld NO-LOCK INDEXED-REPOSITION.
  59. {&DB-REQUIRED-END}
  60. &Scoped-define TABLES-IN-QUERY-Query-Main Femeld
  61. &Scoped-define FIRST-TABLE-IN-QUERY-Query-Main Femeld
  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. /* ************************ Function Prototypes ********************** */
  67. {&DB-REQUIRED-START}
  68. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION-FORWARD fetchRowIdent dTables _DB-REQUIRED
  69. FUNCTION fetchRowIdent RETURNS CHARACTER
  70. ( INPUT pcRowIdent AS CHARACTER,
  71. INPUT pcViewColList AS CHARACTER) FORWARD.
  72. /* _UIB-CODE-BLOCK-END */
  73. &ANALYZE-RESUME
  74. {&DB-REQUIRED-END}
  75. {&DB-REQUIRED-START}
  76. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION-FORWARD openQuery dTables _DB-REQUIRED
  77. FUNCTION openQuery RETURNS LOGICAL
  78. ( /* parameter-definitions */ ) FORWARD.
  79. /* _UIB-CODE-BLOCK-END */
  80. &ANALYZE-RESUME
  81. {&DB-REQUIRED-END}
  82. /* *********************** Control Definitions ********************** */
  83. {&DB-REQUIRED-START}
  84. /* Query definitions */
  85. &ANALYZE-SUSPEND
  86. DEFINE QUERY Query-Main FOR
  87. Femeld SCROLLING.
  88. &ANALYZE-RESUME
  89. {&DB-REQUIRED-END}
  90. /* ************************ Frame Definitions *********************** */
  91. /* *********************** Procedure Settings ************************ */
  92. &ANALYZE-SUSPEND _PROCEDURE-SETTINGS
  93. /* Settings for THIS-PROCEDURE
  94. Type: SmartDataObject
  95. Allow: Query
  96. Frames: 0
  97. Add Fields to: Neither
  98. Other Settings: PERSISTENT-ONLY COMPILE APPSERVER DB-AWARE
  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 dTables ASSIGN
  112. HEIGHT = 1.62
  113. WIDTH = 54.2.
  114. /* END WINDOW DEFINITION */
  115. */
  116. &ANALYZE-RESUME
  117. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _INCLUDED-LIB dTables
  118. /* ************************* Included-Libraries *********************** */
  119. {src/adm2/data.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 dTables
  125. VISIBLE,,RUN-PERSISTENT */
  126. /* _RUN-TIME-ATTRIBUTES-END */
  127. &ANALYZE-RESUME
  128. /* Setting information for Queries and Browse Widgets fields */
  129. &ANALYZE-SUSPEND _QUERY-BLOCK QUERY Query-Main
  130. /* Query rebuild information for SmartDataObject Query-Main
  131. _TblList = "AnaDat.Femeld"
  132. _Options = "NO-LOCK INDEXED-REPOSITION"
  133. _FldNameList[1] > AnaDat.Femeld.Sprcd
  134. "Sprcd" "Sprcd" ? ? "integer" ? ? ? ? ? ? yes ? no 5.6 yes ""
  135. _FldNameList[2] > AnaDat.Femeld.Fenr
  136. "Fenr" "Fenr" ? ? "integer" ? ? ? ? ? ? yes ? yes 4.2 yes ""
  137. _FldNameList[3] > AnaDat.Femeld.Fetext
  138. "Fetext" "Fetext" "Text/Meldung" ? "character" ? ? ? ? ? ? yes ? no 70 yes ""
  139. _Design-Parent is WINDOW dTables @ ( 1.14 , 2.6 )
  140. */ /* QUERY Query-Main */
  141. &ANALYZE-RESUME
  142. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _MAIN-BLOCK dTables
  143. /* *************************** Main Block *************************** */
  144. &IF DEFINED(UIB_IS_RUNNING) <> 0 &THEN
  145. RUN initializeObject.
  146. &ENDIF
  147. /* _UIB-CODE-BLOCK-END */
  148. &ANALYZE-RESUME
  149. /* ********************** Internal Procedures *********************** */
  150. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE disable_UI dTables _DEFAULT-DISABLE
  151. PROCEDURE disable_UI :
  152. /*------------------------------------------------------------------------------
  153. Purpose: DISABLE the User Interface
  154. Parameters: <none>
  155. Notes: Here we clean-up the user-interface by deleting
  156. dynamic widgets we have created and/or hide
  157. frames. This procedure is usually called when
  158. we are ready to "clean-up" after running.
  159. ------------------------------------------------------------------------------*/
  160. /* Hide all frames. */
  161. IF THIS-PROCEDURE:PERSISTENT THEN DELETE PROCEDURE THIS-PROCEDURE.
  162. END PROCEDURE.
  163. /* _UIB-CODE-BLOCK-END */
  164. &ANALYZE-RESUME
  165. /* ************************ Function Implementations ***************** */
  166. {&DB-REQUIRED-START}
  167. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION fetchRowIdent dTables _DB-REQUIRED
  168. FUNCTION fetchRowIdent RETURNS CHARACTER
  169. ( INPUT pcRowIdent AS CHARACTER,
  170. INPUT pcViewColList AS CHARACTER) :
  171. /*------------------------------------------------------------------------------
  172. Purpose: Super Override
  173. Notes:
  174. ------------------------------------------------------------------------------*/
  175. /* Code placed here will execute PRIOR to standard behavior. */
  176. RETURN SUPER( INPUT pcRowIdent, INPUT pcViewColList ).
  177. END FUNCTION.
  178. /* _UIB-CODE-BLOCK-END */
  179. &ANALYZE-RESUME
  180. {&DB-REQUIRED-END}
  181. {&DB-REQUIRED-START}
  182. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION openQuery dTables _DB-REQUIRED
  183. FUNCTION openQuery RETURNS LOGICAL
  184. ( /* parameter-definitions */ ) :
  185. /*------------------------------------------------------------------------------
  186. Purpose: Super Override
  187. Notes:
  188. ------------------------------------------------------------------------------*/
  189. DEF VAR Sprcd AS INT NO-UNDO.
  190. Sprcd = DYNAMIC-FUNCTION('GETSPRCD':U) NO-ERROR.
  191. xWhere = 'Sprcd = ' + STRING(Sprcd)
  192. + ' AND Fenr >= 1'.
  193. DYNAMIC-FUNCTION('setQueryWhere':U, INPUT xWhere).
  194. /* xSort = ''. */
  195. /* DYNAMIC-FUNCTION('setQuerySort':U, INPUT xSort). */
  196. /* xWhere = ''. */
  197. /* DYNAMIC-FUNCTION('setQueryString':U, INPUT xWhere). */
  198. RETURN SUPER( ).
  199. END FUNCTION.
  200. /* _UIB-CODE-BLOCK-END */
  201. &ANALYZE-RESUME
  202. {&DB-REQUIRED-END}