d-prodgrp.w 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296
  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. 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 ProdGrp
  49. /* Definitions for QUERY Query-Main */
  50. &Scoped-Define ENABLED-FIELDS Firma Wgr Prod_Grp Bez1 Bez2 BezL Int_1 Int_2 Dec_1 Dec_2 Sort_Preisliste~
  51. Titel_Druck lShopB2B lShopB2C Sort_B2C Sort_B2B
  52. &Scoped-define ENABLED-FIELDS-IN-ProdGrp Firma Wgr Prod_Grp Bez1 Bez2 BezL ~
  53. Int_1 Int_2 Dec_1 Dec_2 Sort_Preisliste Titel_Druck lShopB2B lShopB2C ~
  54. Sort_B2C Sort_B2B
  55. &Scoped-Define DATA-FIELDS Firma Wgr Prod_Grp Bez1 Bez2 BezL Int_1 Int_2 Dec_1 Dec_2 Sort_Preisliste~
  56. Titel_Druck lShopB2B lShopB2C Sort_B2C Sort_B2B
  57. &Scoped-define DATA-FIELDS-IN-ProdGrp Firma Wgr Prod_Grp Bez1 Bez2 BezL ~
  58. Int_1 Int_2 Dec_1 Dec_2 Sort_Preisliste Titel_Druck lShopB2B lShopB2C ~
  59. Sort_B2C Sort_B2B
  60. &Scoped-Define MANDATORY-FIELDS
  61. &Scoped-Define APPLICATION-SERVICE
  62. &Scoped-Define ASSIGN-LIST
  63. &Scoped-Define DATA-FIELD-DEFS "d-prodgrp.i"
  64. &Scoped-define QUERY-STRING-Query-Main FOR EACH ProdGrp NO-LOCK INDEXED-REPOSITION
  65. {&DB-REQUIRED-START}
  66. &Scoped-define OPEN-QUERY-Query-Main OPEN QUERY Query-Main FOR EACH ProdGrp NO-LOCK INDEXED-REPOSITION.
  67. {&DB-REQUIRED-END}
  68. &Scoped-define TABLES-IN-QUERY-Query-Main ProdGrp
  69. &Scoped-define FIRST-TABLE-IN-QUERY-Query-Main ProdGrp
  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 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. ProdGrp 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 = 46.6.
  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.ProdGrp"
  132. _Options = "NO-LOCK INDEXED-REPOSITION"
  133. _FldNameList[1] > AnaDat.ProdGrp.Firma
  134. "Firma" "Firma" ? ? "character" ? ? ? ? ? ? yes ? no 9.6 yes ""
  135. _FldNameList[2] > AnaDat.ProdGrp.Wgr
  136. "Wgr" "Wgr" ? "999" "integer" ? ? ? ? ? ? yes ? no 4 yes ""
  137. _FldNameList[3] > AnaDat.ProdGrp.Prod_Grp
  138. "Prod_Grp" "Prod_Grp" ? "999" "integer" ? ? ? ? ? ? yes ? no 9 yes ""
  139. _FldNameList[4] > AnaDat.ProdGrp.Bez1
  140. "Bez1" "Bez1" ? ? "character" ? ? ? ? ? ? yes ? no 35 yes ""
  141. _FldNameList[5] > AnaDat.ProdGrp.Bez2
  142. "Bez2" "Bez2" ? ? "character" ? ? ? ? ? ? yes ? no 35 yes ""
  143. _FldNameList[6] > AnaDat.ProdGrp.BezL
  144. "BezL" "BezL" ? ? "character" ? ? ? ? ? ? yes ? no 80 yes ""
  145. _FldNameList[7] > AnaDat.ProdGrp.Int_1
  146. "Int_1" "Int_1" ? ? "integer" ? ? ? ? ? ? yes ? no 10.2 yes ""
  147. _FldNameList[8] > AnaDat.ProdGrp.Int_2
  148. "Int_2" "Int_2" ? ? "integer" ? ? ? ? ? ? yes ? no 10.2 yes ""
  149. _FldNameList[9] > AnaDat.ProdGrp.Dec_1
  150. "Dec_1" "Dec_1" ? ? "decimal" ? ? ? ? ? ? yes ? no 10.2 yes ""
  151. _FldNameList[10] > AnaDat.ProdGrp.Dec_2
  152. "Dec_2" "Dec_2" ? ? "decimal" ? ? ? ? ? ? yes ? no 10.2 yes ""
  153. _FldNameList[11] > AnaDat.ProdGrp.Sort_Preisliste
  154. "Sort_Preisliste" "Sort_Preisliste" ? ? "character" ? ? ? ? ? ? yes ? no 13.2 yes ?
  155. _FldNameList[12] > AnaDat.ProdGrp.Titel_Druck
  156. "Titel_Druck" "Titel_Druck" ? ? "logical" ? ? ? ? ? ? yes ? no 11 yes ?
  157. _FldNameList[13] > AnaDat.ProdGrp.lShopB2B
  158. "lShopB2B" "lShopB2B" ? ? "logical" ? ? ? ? ? ? yes ? no 9.4 yes ?
  159. _FldNameList[14] > AnaDat.ProdGrp.lShopB2C
  160. "lShopB2C" "lShopB2C" ? ? "logical" ? ? ? ? ? ? yes ? no 9.4 yes ?
  161. _FldNameList[15] > AnaDat.ProdGrp.Sort_B2C
  162. "Sort_B2C" "Sort_B2C" ? ? "character" ? ? ? ? ? ? yes ? no 9 yes ?
  163. _FldNameList[16] > AnaDat.ProdGrp.Sort_B2B
  164. "Sort_B2B" "Sort_B2B" ? ? "character" ? ? ? ? ? ? yes ? no 14 yes ?
  165. _Design-Parent is WINDOW dTables @ ( 1.14 , 2.6 )
  166. */ /* QUERY Query-Main */
  167. &ANALYZE-RESUME
  168. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _MAIN-BLOCK dTables
  169. /* *************************** Main Block *************************** */
  170. SAktiv = DYNAMIC-FUNCTION('getSuperAktiv':U) NO-ERROR.
  171. IF SAktiv THEN DO:
  172. Firma = DYNAMIC-FUNCTION('GETMANDANT':U) NO-ERROR.
  173. END.
  174. /* xWhere = 'ProdGrp.Firma = "' + Firma + '" '. */
  175. /* DYNAMIC-FUNCTION('setQueryWhere':U, INPUT xWhere). */
  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. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE disable_UI dTables _DEFAULT-DISABLE
  183. PROCEDURE disable_UI :
  184. /*------------------------------------------------------------------------------
  185. Purpose: DISABLE the User Interface
  186. Parameters: <none>
  187. Notes: Here we clean-up the user-interface by deleting
  188. dynamic widgets we have created and/or hide
  189. frames. This procedure is usually called when
  190. we are ready to "clean-up" after running.
  191. ------------------------------------------------------------------------------*/
  192. /* Hide all frames. */
  193. IF THIS-PROCEDURE:PERSISTENT THEN DELETE PROCEDURE THIS-PROCEDURE.
  194. END PROCEDURE.
  195. /* _UIB-CODE-BLOCK-END */
  196. &ANALYZE-RESUME
  197. /* ************************ Function Implementations ***************** */
  198. {&DB-REQUIRED-START}
  199. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION openQuery dTables _DB-REQUIRED
  200. FUNCTION openQuery RETURNS LOGICAL
  201. ( /* parameter-definitions */ ) :
  202. /*------------------------------------------------------------------------------
  203. Purpose: Super Override
  204. Notes:
  205. ------------------------------------------------------------------------------*/
  206. /* xWhere = ''. */
  207. /* DYNAMIC-FUNCTION('setQueryWhere':U, INPUT xWhere). */
  208. /* xSort = ''. */
  209. /* DYNAMIC-FUNCTION('setQuerySort':U, INPUT xSort). */
  210. /* xWhere = ''. */
  211. /* DYNAMIC-FUNCTION('setQueryString':U, INPUT xWhere). */
  212. RETURN SUPER( ).
  213. END FUNCTION.
  214. /* _UIB-CODE-BLOCK-END */
  215. &ANALYZE-RESUME
  216. {&DB-REQUIRED-END}