d-abwprgrp.w 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412
  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 AbwPrGrp
  30. /* &SCOPED-DEFINE TabWhere USE-INDEX AbwPrGrp-k1 ~ */
  31. /* WHERE {&Tabelle}.Firma = ADFirma ~ */
  32. /* AND {&Tabelle}.Knr = tRowObject.Knr */
  33. { incl/datdefinition.i }
  34. /* _UIB-CODE-BLOCK-END */
  35. &ANALYZE-RESUME
  36. &ANALYZE-SUSPEND _UIB-PREPROCESSOR-BLOCK
  37. /* ******************** Preprocessor Definitions ******************** */
  38. &Scoped-define PROCEDURE-TYPE SmartDataObject
  39. &Scoped-define DB-AWARE yes
  40. &Scoped-define ADM-SUPPORTED-LINKS Data-Source,Data-Target,Navigation-Target,Update-Target,Commit-Target,Filter-Target
  41. /* Db-Required definitions. */
  42. &IF DEFINED(DB-REQUIRED) = 0 &THEN
  43. &GLOBAL-DEFINE DB-REQUIRED TRUE
  44. &ENDIF
  45. &GLOBAL-DEFINE DB-REQUIRED-START &IF {&DB-REQUIRED} &THEN
  46. &GLOBAL-DEFINE DB-REQUIRED-END &ENDIF
  47. &Scoped-define QUERY-NAME Query-Main
  48. /* Internal Tables (found by Frame, Query & Browse Queries) */
  49. &Scoped-define INTERNAL-TABLES AbwPrGrp
  50. /* Definitions for QUERY Query-Main */
  51. &Scoped-Define ENABLED-FIELDS Firma Knr Wg_Grp Warengruppe Preis_Grp Preisgruppe Res_i
  52. &Scoped-define ENABLED-FIELDS-IN-AbwPrGrp Firma Knr Wg_Grp Preis_Grp Res_i
  53. &Scoped-Define DATA-FIELDS Firma Knr Wg_Grp Warengruppe Preis_Grp Preisgruppe Res_i
  54. &Scoped-define DATA-FIELDS-IN-AbwPrGrp Firma Knr Wg_Grp Preis_Grp Res_i
  55. &Scoped-Define MANDATORY-FIELDS
  56. &Scoped-Define APPLICATION-SERVICE
  57. &Scoped-Define ASSIGN-LIST
  58. &Scoped-Define DATA-FIELD-DEFS "d-abwprgrp.i"
  59. &Scoped-define QUERY-STRING-Query-Main FOR EACH AbwPrGrp NO-LOCK INDEXED-REPOSITION
  60. {&DB-REQUIRED-START}
  61. &Scoped-define OPEN-QUERY-Query-Main OPEN QUERY Query-Main FOR EACH AbwPrGrp NO-LOCK INDEXED-REPOSITION.
  62. {&DB-REQUIRED-END}
  63. &Scoped-define TABLES-IN-QUERY-Query-Main AbwPrGrp
  64. &Scoped-define FIRST-TABLE-IN-QUERY-Query-Main AbwPrGrp
  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 getCurrentRecid dTables _DB-REQUIRED
  72. FUNCTION getCurrentRecid RETURNS RECID
  73. ( /* parameter-definitions */ ) FORWARD.
  74. /* _UIB-CODE-BLOCK-END */
  75. &ANALYZE-RESUME
  76. {&DB-REQUIRED-END}
  77. {&DB-REQUIRED-START}
  78. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION-FORWARD openQuery dTables _DB-REQUIRED
  79. FUNCTION openQuery RETURNS LOGICAL
  80. ( /* parameter-definitions */ ) FORWARD.
  81. /* _UIB-CODE-BLOCK-END */
  82. &ANALYZE-RESUME
  83. {&DB-REQUIRED-END}
  84. /* *********************** Control Definitions ********************** */
  85. {&DB-REQUIRED-START}
  86. /* Query definitions */
  87. &ANALYZE-SUSPEND
  88. DEFINE QUERY Query-Main FOR
  89. AbwPrGrp SCROLLING.
  90. &ANALYZE-RESUME
  91. {&DB-REQUIRED-END}
  92. /* ************************ Frame Definitions *********************** */
  93. /* *********************** Procedure Settings ************************ */
  94. &ANALYZE-SUSPEND _PROCEDURE-SETTINGS
  95. /* Settings for THIS-PROCEDURE
  96. Type: SmartDataObject
  97. Allow: Query
  98. Frames: 0
  99. Add Fields to: Neither
  100. Other Settings: PERSISTENT-ONLY COMPILE APPSERVER DB-AWARE
  101. */
  102. /* This procedure should always be RUN PERSISTENT. Report the error, */
  103. /* then cleanup and return. */
  104. IF NOT THIS-PROCEDURE:PERSISTENT THEN DO:
  105. MESSAGE "{&FILE-NAME} should only be RUN PERSISTENT.":U
  106. VIEW-AS ALERT-BOX ERROR BUTTONS OK.
  107. RETURN.
  108. END.
  109. &ANALYZE-RESUME _END-PROCEDURE-SETTINGS
  110. /* ************************* Create Window ************************** */
  111. &ANALYZE-SUSPEND _CREATE-WINDOW
  112. /* DESIGN Window definition (used by the UIB)
  113. CREATE WINDOW dTables ASSIGN
  114. HEIGHT = 2.38
  115. WIDTH = 72.
  116. /* END WINDOW DEFINITION */
  117. */
  118. &ANALYZE-RESUME
  119. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _INCLUDED-LIB dTables
  120. /* ************************* Included-Libraries *********************** */
  121. {src/adm2/data.i}
  122. /* _UIB-CODE-BLOCK-END */
  123. &ANALYZE-RESUME
  124. /* *********** Runtime Attributes and AppBuilder Settings *********** */
  125. &ANALYZE-SUSPEND _RUN-TIME-ATTRIBUTES
  126. /* SETTINGS FOR WINDOW dTables
  127. VISIBLE,,RUN-PERSISTENT */
  128. /* _RUN-TIME-ATTRIBUTES-END */
  129. &ANALYZE-RESUME
  130. /* Setting information for Queries and Browse Widgets fields */
  131. &ANALYZE-SUSPEND _QUERY-BLOCK QUERY Query-Main
  132. /* Query rebuild information for SmartDataObject Query-Main
  133. _TblList = "AnaDat.AbwPrGrp"
  134. _Options = "NO-LOCK INDEXED-REPOSITION"
  135. _FldNameList[1] > AnaDat.AbwPrGrp.Firma
  136. "Firma" "Firma" ? ? "character" ? ? ? ? ? ? yes ? no 8 yes ""
  137. _FldNameList[2] > AnaDat.AbwPrGrp.Knr
  138. "Knr" "Knr" ? ? "integer" ? ? ? ? ? ? yes ? no 7.2 yes ""
  139. _FldNameList[3] > AnaDat.AbwPrGrp.Wg_Grp
  140. "Wg_Grp" "Wg_Grp" "Wgr" ? "integer" ? ? ? ? ? ? yes ? no 8 yes ""
  141. _FldNameList[4] > "_<CALC>"
  142. "DYNAMIC-FUNCTION('GETWARENGRP':U, INPUT RowObject.Wg_Grp )" "Warengruppe" "Warengruppe" "x(30)" "character" ? ? ? ? ? ? yes ? no 30 no ?
  143. _FldNameList[5] > AnaDat.AbwPrGrp.Preis_Grp
  144. "Preis_Grp" "Preis_Grp" "Pgr" ? "integer" ? ? ? ? ? ? yes ? no 9.2 yes ""
  145. _FldNameList[6] > "_<CALC>"
  146. "DYNAMIC-FUNCTION('GETPREISGRP':U, INPUT RowObject.Preis_Grp )" "Preisgruppe" "Preisgruppe" "x(30)" "character" ? ? ? ? ? ? yes ? no 30 no ?
  147. _FldNameList[7] > AnaDat.AbwPrGrp.Res_i
  148. "Res_i" "Res_i" ? ? "integer" ? ? ? ? ? ? yes ? no 5.4 yes ""
  149. _Design-Parent is WINDOW dTables @ ( 1.14 , 2.6 )
  150. */ /* QUERY Query-Main */
  151. &ANALYZE-RESUME
  152. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _MAIN-BLOCK dTables
  153. /* *************************** Main Block *************************** */
  154. { incl/datmainblock.i }
  155. /* SAktiv = DYNAMIC-FUNCTION('getSuperAktiv':U) NO-ERROR. */
  156. /* IF SAktiv THEN DO: */
  157. /* Firma = DYNAMIC-FUNCTION('GETMANDANT':U) NO-ERROR. */
  158. /* END. */
  159. SUBSCRIBE TO 'SETOPENFLAGDEBST' ANYWHERE.
  160. &IF DEFINED(UIB_IS_RUNNING) <> 0 &THEN
  161. RUN initializeObject.
  162. &ENDIF
  163. /* _UIB-CODE-BLOCK-END */
  164. &ANALYZE-RESUME
  165. /* ********************** Internal Procedures *********************** */
  166. {&DB-REQUIRED-START}
  167. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE DATA.CALCULATE dTables DATA.CALCULATE _DB-REQUIRED
  168. PROCEDURE DATA.CALCULATE :
  169. /*------------------------------------------------------------------------------
  170. Purpose: Calculate all the Calculated Expressions found in the
  171. SmartDataObject.
  172. Parameters: <none>
  173. ------------------------------------------------------------------------------*/
  174. ASSIGN
  175. rowObject.Preisgruppe = (DYNAMIC-FUNCTION('GETPREISGRP':U, INPUT RowObject.Preis_Grp ))
  176. rowObject.Warengruppe = (DYNAMIC-FUNCTION('GETWARENGRP':U, INPUT RowObject.Wg_Grp ))
  177. .
  178. END PROCEDURE.
  179. /* _UIB-CODE-BLOCK-END */
  180. &ANALYZE-RESUME
  181. {&DB-REQUIRED-END}
  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 INAKTIVIEREN dTables _DB-REQUIRED
  212. PROCEDURE INAKTIVIEREN :
  213. /*------------------------------------------------------------------------------
  214. Purpose:
  215. Parameters: <none>
  216. Notes:
  217. ------------------------------------------------------------------------------*/
  218. { incl/datinaktivieren.i }
  219. END PROCEDURE.
  220. /* _UIB-CODE-BLOCK-END */
  221. &ANALYZE-RESUME
  222. {&DB-REQUIRED-END}
  223. {&DB-REQUIRED-START}
  224. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE REAKTIVIEREN dTables _DB-REQUIRED
  225. PROCEDURE REAKTIVIEREN :
  226. /*------------------------------------------------------------------------------
  227. Purpose:
  228. Parameters: <none>
  229. Notes:
  230. ------------------------------------------------------------------------------*/
  231. { incl/datreaktivieren.i }
  232. END PROCEDURE.
  233. /* _UIB-CODE-BLOCK-END */
  234. &ANALYZE-RESUME
  235. {&DB-REQUIRED-END}
  236. {&DB-REQUIRED-START}
  237. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE SETOPENFLAGDEBST dTables _DB-REQUIRED
  238. PROCEDURE SETOPENFLAGDEBST :
  239. /*------------------------------------------------------------------------------
  240. Purpose:
  241. Parameters: <none>
  242. Notes:
  243. ------------------------------------------------------------------------------*/
  244. DEF INPUT PARAMETER ipFlag AS LOG NO-UNDO.
  245. FOpen = ipFlag.
  246. IF Fopen THEN DYNAMIC-FUNCTION('openQuery':U).
  247. END PROCEDURE.
  248. /* _UIB-CODE-BLOCK-END */
  249. &ANALYZE-RESUME
  250. {&DB-REQUIRED-END}
  251. /* ************************ Function Implementations ***************** */
  252. {&DB-REQUIRED-START}
  253. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION getCurrentRecid dTables _DB-REQUIRED
  254. FUNCTION getCurrentRecid RETURNS RECID
  255. ( /* parameter-definitions */ ) :
  256. /*------------------------------------------------------------------------------
  257. Purpose:
  258. Notes:
  259. ------------------------------------------------------------------------------*/
  260. { incl/datgetcurrentrecid.i }
  261. END FUNCTION.
  262. /* _UIB-CODE-BLOCK-END */
  263. &ANALYZE-RESUME
  264. {&DB-REQUIRED-END}
  265. {&DB-REQUIRED-START}
  266. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION openQuery dTables _DB-REQUIRED
  267. FUNCTION openQuery RETURNS LOGICAL
  268. ( /* parameter-definitions */ ) :
  269. /*------------------------------------------------------------------------------
  270. Purpose: Super Override
  271. Notes:
  272. ------------------------------------------------------------------------------*/
  273. DEF VAR cString AS CHAR NO-UNDO.
  274. cString = DYNAMIC-FUNCTION('getForeignValues':U).
  275. IF cString = ? THEN RETURN FALSE.
  276. IF NOT FOpen THEN RETURN FALSE.
  277. /* xWhere = ''. */
  278. /* DYNAMIC-FUNCTION('setQueryWhere':U, INPUT xWhere). */
  279. /* xSort = ''. */
  280. /* DYNAMIC-FUNCTION('setQuerySort':U, INPUT xSort). */
  281. /* xWhere = ''. */
  282. /* DYNAMIC-FUNCTION('setQueryString':U, INPUT xWhere). */
  283. RETURN SUPER( ).
  284. END FUNCTION.
  285. /* _UIB-CODE-BLOCK-END */
  286. &ANALYZE-RESUME
  287. {&DB-REQUIRED-END}