d-provsumm.w 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272
  1. &ANALYZE-SUSPEND _VERSION-NUMBER AB_v9r12 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. DEF VAR Firma AS CHAR NO-UNDO.
  32. DEF VAR SAktiv AS LOG NO-UNDO INIT FALSE.
  33. /* _UIB-CODE-BLOCK-END */
  34. &ANALYZE-RESUME
  35. &ANALYZE-SUSPEND _UIB-PREPROCESSOR-BLOCK
  36. /* ******************** Preprocessor Definitions ******************** */
  37. &Scoped-define PROCEDURE-TYPE SmartDataObject
  38. &Scoped-define DB-AWARE yes
  39. &Scoped-define ADM-SUPPORTED-LINKS Data-Source,Data-Target,Navigation-Target,Update-Target,Commit-Target,Filter-Target
  40. /* Db-Required definitions. */
  41. &IF DEFINED(DB-REQUIRED) = 0 &THEN
  42. &GLOBAL-DEFINE DB-REQUIRED TRUE
  43. &ENDIF
  44. &GLOBAL-DEFINE DB-REQUIRED-START &IF {&DB-REQUIRED} &THEN
  45. &GLOBAL-DEFINE DB-REQUIRED-END &ENDIF
  46. &Scoped-define QUERY-NAME Query-Main
  47. /* Internal Tables (found by Frame, Query & Browse Queries) */
  48. &Scoped-define INTERNAL-TABLES ProvSumm
  49. /* Definitions for QUERY Query-Main */
  50. &Scoped-Define ENABLED-FIELDS Firma Prov_Summ Bez Inhalt Menge Betrag Prov_Art Prov_Wert
  51. &Scoped-define ENABLED-FIELDS-IN-ProvSumm Firma Prov_Summ Bez Inhalt Menge ~
  52. Betrag Prov_Art Prov_Wert
  53. &Scoped-Define DATA-FIELDS Firma Prov_Summ Bez Inhalt Menge Betrag Prov_Art Prov_Wert
  54. &Scoped-define DATA-FIELDS-IN-ProvSumm Firma Prov_Summ Bez Inhalt Menge ~
  55. Betrag Prov_Art Prov_Wert
  56. &Scoped-Define MANDATORY-FIELDS
  57. &Scoped-Define APPLICATION-SERVICE
  58. &Scoped-Define ASSIGN-LIST
  59. &Scoped-Define DATA-FIELD-DEFS "d-provsumm.i"
  60. {&DB-REQUIRED-START}
  61. &Scoped-define OPEN-QUERY-Query-Main OPEN QUERY Query-Main FOR EACH ProvSumm NO-LOCK INDEXED-REPOSITION.
  62. {&DB-REQUIRED-END}
  63. &Scoped-define TABLES-IN-QUERY-Query-Main ProvSumm
  64. &Scoped-define FIRST-TABLE-IN-QUERY-Query-Main ProvSumm
  65. /* Custom List Definitions */
  66. /* List-1,List-2,List-3,List-4,List-5,List-6 */
  67. /* _UIB-PREPROCESSOR-BLOCK-END */
  68. &ANALYZE-RESUME
  69. /* ************************ Function Prototypes ********************** */
  70. {&DB-REQUIRED-START}
  71. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION-FORWARD openQuery dTables _DB-REQUIRED
  72. FUNCTION openQuery RETURNS LOGICAL
  73. ( /* parameter-definitions */ ) FORWARD.
  74. /* _UIB-CODE-BLOCK-END */
  75. &ANALYZE-RESUME
  76. {&DB-REQUIRED-END}
  77. /* *********************** Control Definitions ********************** */
  78. {&DB-REQUIRED-START}
  79. /* Query definitions */
  80. &ANALYZE-SUSPEND
  81. DEFINE QUERY Query-Main FOR
  82. ProvSumm SCROLLING.
  83. &ANALYZE-RESUME
  84. {&DB-REQUIRED-END}
  85. /* ************************ Frame Definitions *********************** */
  86. /* *********************** Procedure Settings ************************ */
  87. &ANALYZE-SUSPEND _PROCEDURE-SETTINGS
  88. /* Settings for THIS-PROCEDURE
  89. Type: SmartDataObject
  90. Allow: Query
  91. Frames: 0
  92. Add Fields to: Neither
  93. Other Settings: PERSISTENT-ONLY COMPILE APPSERVER DB-AWARE
  94. */
  95. /* This procedure should always be RUN PERSISTENT. Report the error, */
  96. /* then cleanup and return. */
  97. IF NOT THIS-PROCEDURE:PERSISTENT THEN DO:
  98. MESSAGE "{&FILE-NAME} should only be RUN PERSISTENT.":U
  99. VIEW-AS ALERT-BOX ERROR BUTTONS OK.
  100. RETURN.
  101. END.
  102. &ANALYZE-RESUME _END-PROCEDURE-SETTINGS
  103. /* ************************* Create Window ************************** */
  104. &ANALYZE-SUSPEND _CREATE-WINDOW
  105. /* DESIGN Window definition (used by the UIB)
  106. CREATE WINDOW dTables ASSIGN
  107. HEIGHT = 2
  108. WIDTH = 65.2.
  109. /* END WINDOW DEFINITION */
  110. */
  111. &ANALYZE-RESUME
  112. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _INCLUDED-LIB dTables
  113. /* ************************* Included-Libraries *********************** */
  114. {src/adm2/data.i}
  115. /* _UIB-CODE-BLOCK-END */
  116. &ANALYZE-RESUME
  117. /* *********** Runtime Attributes and AppBuilder Settings *********** */
  118. &ANALYZE-SUSPEND _RUN-TIME-ATTRIBUTES
  119. /* SETTINGS FOR WINDOW dTables
  120. VISIBLE,,RUN-PERSISTENT */
  121. /* _RUN-TIME-ATTRIBUTES-END */
  122. &ANALYZE-RESUME
  123. /* Setting information for Queries and Browse Widgets fields */
  124. &ANALYZE-SUSPEND _QUERY-BLOCK QUERY Query-Main
  125. /* Query rebuild information for SmartDataObject Query-Main
  126. _TblList = "AnaDat.ProvSumm"
  127. _Options = "NO-LOCK INDEXED-REPOSITION"
  128. _FldNameList[1] > AnaDat.ProvSumm.Firma
  129. "Firma" "Firma" ? ? "character" ? ? ? ? ? ? yes ? no 8 yes
  130. _FldNameList[2] > AnaDat.ProvSumm.Prov_Summ
  131. "Prov_Summ" "Prov_Summ" ? ? "integer" ? ? ? ? ? ? yes ? no 11.4 yes
  132. _FldNameList[3] > AnaDat.ProvSumm.Bez
  133. "Bez" "Bez" ? ? "character" ? ? ? ? ? ? yes ? no 20 yes
  134. _FldNameList[4] > AnaDat.ProvSumm.Inhalt
  135. "Inhalt" "Inhalt" ? ? "decimal" ? ? ? ? ? ? yes ? no 14 yes
  136. _FldNameList[5] > AnaDat.ProvSumm.Menge
  137. "Menge" "Menge" ? ? "decimal" ? ? ? ? ? ? yes ? no 14 yes
  138. _FldNameList[6] > AnaDat.ProvSumm.Betrag
  139. "Betrag" "Betrag" ? ? "decimal" ? ? ? ? ? ? yes ? no 14 yes
  140. _FldNameList[7] > AnaDat.ProvSumm.Prov_Art
  141. "Prov_Art" "Prov_Art" ? ? "integer" ? ? ? ? ? ? yes ? no 8.2 yes
  142. _FldNameList[8] > AnaDat.ProvSumm.Prov_Wert
  143. "Prov_Wert" "Prov_Wert" ? ? "decimal" ? ? ? ? ? ? yes ? no 10.2 yes
  144. _Design-Parent is WINDOW dTables @ ( 1.14 , 2.6 )
  145. */ /* QUERY Query-Main */
  146. &ANALYZE-RESUME
  147. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _MAIN-BLOCK dTables
  148. /* *************************** Main Block *************************** */
  149. SAktiv = DYNAMIC-FUNCTION('getSuperAktiv':U) NO-ERROR.
  150. IF SAktiv THEN DO:
  151. Firma = DYNAMIC-FUNCTION('GETMANDANT':U) NO-ERROR.
  152. END.
  153. &IF DEFINED(UIB_IS_RUNNING) <> 0 &THEN
  154. RUN initializeObject.
  155. &ENDIF
  156. /* _UIB-CODE-BLOCK-END */
  157. &ANALYZE-RESUME
  158. /* ********************** Internal Procedures *********************** */
  159. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE disable_UI dTables _DEFAULT-DISABLE
  160. PROCEDURE disable_UI :
  161. /*------------------------------------------------------------------------------
  162. Purpose: DISABLE the User Interface
  163. Parameters: <none>
  164. Notes: Here we clean-up the user-interface by deleting
  165. dynamic widgets we have created and/or hide
  166. frames. This procedure is usually called when
  167. we are ready to "clean-up" after running.
  168. ------------------------------------------------------------------------------*/
  169. /* Hide all frames. */
  170. IF THIS-PROCEDURE:PERSISTENT THEN DELETE PROCEDURE THIS-PROCEDURE.
  171. END PROCEDURE.
  172. /* _UIB-CODE-BLOCK-END */
  173. &ANALYZE-RESUME
  174. /* ************************ Function Implementations ***************** */
  175. {&DB-REQUIRED-START}
  176. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION openQuery dTables _DB-REQUIRED
  177. FUNCTION openQuery RETURNS LOGICAL
  178. ( /* parameter-definitions */ ) :
  179. /*------------------------------------------------------------------------------
  180. Purpose: Super Override
  181. Notes:
  182. ------------------------------------------------------------------------------*/
  183. xWhere = 'ProvSumm.Firma = "' + Firma + '" '.
  184. DYNAMIC-FUNCTION('setQueryWhere':U, INPUT xWhere).
  185. /* xSort = ''. */
  186. /* DYNAMIC-FUNCTION('setQuerySort':U, INPUT xSort). */
  187. /* xWhere = ''. */
  188. /* DYNAMIC-FUNCTION('setQueryString':U, INPUT xWhere). */
  189. RETURN SUPER( ).
  190. END FUNCTION.
  191. /* _UIB-CODE-BLOCK-END */
  192. &ANALYZE-RESUME
  193. {&DB-REQUIRED-END}