壹佰网|ERP100 - 企业信息化知识门户

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 3138|回复: 1

自定义总账接口表功能开发源代码

[复制链接]
发表于 2008/3/16 18:21:25 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。如果您注册时有任何问题请联系客服QQ: 83569622  。

您需要 登录 才可以下载或查看,没有帐号?注册

x
取自Oracle EBS内部提供的源代码


  1. CREATE OR REPLACE PACKAGE GL_JOURNAL_IMPORT_PKG as
  2. /* $Header: glujimns.pls 120.6 2006/06/07 16:30:32 djogg ship $ */
  3. /*#
  4. * Provides functions to use with Journal Import.
  5. * @rep:scope public
  6. * @rep:product GL
  7. * @rep:lifecycle active
  8. * @rep:displayname Journal Import Functions
  9. * @rep:compatibility S
  10. * @rep:category BUSINESS_ENTITY GL_JOURNAL
  11. */
  12. --
  13. -- Package
  14. --   GL_JOURNAL_IMPORT_PKG
  15. -- Purpose
  16. --   Various utilities for working directly with Journal Import
  17. -- History
  18. --   09-OCT-2000  D J Ogg          Created.
  19. --
  20.   -- This exception is raised when we fail to get the applsys schema
  21.   -- information in the create_table and drop_table routines
  22.   CANNOT_GET_APPLSYS_SCHEMA EXCEPTION;
  23.   -- This exception is raised when the populate_interface_control routine
  24.   -- is passed an invalid journal entry source name
  25.   INVALID_JE_SOURCE EXCEPTION;
  26.   -- This exception is raised when the populate_interface_control routine
  27.   -- is passed an invalid processed_data_action
  28.   INVALID_PROCESSED_ACTION EXCEPTION;
  29.   -- This exception is raised when the populate_interface_control routine
  30.   -- is passed parameters that would imply that gl_interface should be
  31.   -- dropped.
  32.   CANNOT_DROP_GL_INTERFACE EXCEPTION;

  33.   -- Constants for use with the processed_data_action parameter of
  34.   -- the populate_interface_control procedure.
  35.   SAVE_DATA  CONSTANT VARCHAR2(1) := 'S';
  36.   DELETE_DATA  CONSTANT VARCHAR2(1) := 'D';
  37.   DROP_INTERFACE_TABLE CONSTANT VARCHAR2(1) := 'R';
  38.   --
  39.   -- Procedure
  40.   --   create_table
  41.   -- Purpose
  42.   --   Creates a copy of the gl_interface table with the given
  43.   --   name and storage parameters.  The table will be created
  44.   --   in the gl schema.
  45.   -- History
  46.   --   09-OCT-2000  D. J. Ogg    Created
  47.   -- Arguments
  48.   --   table_name        The name of the new table
  49.   --   tablespace  The tablespace the table should be created in
  50.   --   physical_attributes The physical attributes clause for the
  51.   --                            creation of the table
  52.   --   create_n1_index          Indicates whether or not the n1 index should
  53.   --                            be created
  54.   --   n1_tablespace            The tablespace the n1 index should be created
  55.   --                            in
  56.   --   n1_physical_attributes   The physical attributes clause for the
  57.   --                            creation of the n1 index
  58.   --   create_n2_index          Indicates whether or not the n2 index should
  59.   --                            be created
  60.   --   n2_tablespace            The tablespace the n2 index should be created
  61.   --                            in
  62.   --   n2_physical_attributes   The physical attributes clause for the
  63.   --                            creation of the n2 index
  64.   -- Example
  65.   --   gl_journal_import_pkg.create_table(
  66.   --      'GL_CUSTOM_INTERFACE',
  67.   --      'TAB1',
  68.   --      'PCTFREE 10 STORAGE (INITIAL 500K NEXT 1M)',
  69.   --      FALSE,
  70.   --      NULL,
  71.   --      NULL,
  72.   --      TRUE,
  73.   --      'IND1',
  74.   --      'STORAGE (INITIAL 10K NEXT 20K)');
  75.   -- Notes
  76.   --
  77. /*#
  78. * Creates a copy of the GL_INTERFACE table. The newly created copy is created in
  79. * the GL schema and has the name and storage parameters provided by the user.
  80. * Journal Import can pull data from the newly created interface table to
  81. * create journals.
  82. * @param table_name Name of new table.
  83. * @param tablespace Tablespace that will contain the new table.
  84. * @param physical_attributes Physical attributes clause to be used in the creation of the new table.
  85. * @param create_n1_index Indicates whether a copy of the GL_INTERFACE_N1 index is created for this table.
  86. * @param n1_tablespace Tablespace that will contain a copy of the GL_INTERFACE_N1 index.
  87. * @param n1_physical_attributes Physical attributes clause to be used in the creation of a copy of the GL_INTERFACE_N1 index.
  88. * @param create_n2_index Indicates whether a copy of the GL_INTERFACE_N2 index is created for this table.
  89. * @param n2_tablespace Tablespace that will contain a copy of the GL_INTERFACE_N2 index.
  90. * @param n2_physical_attributes Physical attributes clause to be used in the creation of a copy of the GL_INTERFACE_N2 index.
  91. * @rep:scope public
  92. * @rep:lifecycle active
  93. * @rep:displayname Create Journal Interface Table
  94. * @rep:compatibility S
  95. * @rep:category BUSINESS_ENTITY GL_JOURNAL
  96. */
  97.   PROCEDURE create_table(table_name    VARCHAR2,
  98.                          tablespace    VARCHAR2 DEFAULT NULL,
  99.                          physical_attributes   VARCHAR2 DEFAULT NULL,
  100.     create_n1_index  BOOLEAN DEFAULT TRUE,
  101.     n1_tablespace   VARCHAR2 DEFAULT NULL,
  102.     n1_physical_attributes  VARCHAR2 DEFAULT NULL,
  103.     create_n2_index  BOOLEAN DEFAULT TRUE,
  104.     n2_tablespace   VARCHAR2 DEFAULT NULL,
  105.     n2_physical_attributes  VARCHAR2 DEFAULT NULL
  106.                         );
  107.   --
  108.   -- Procedure
  109.   --   drop_table
  110.   -- Purpose
  111.   --   Drops a copy of the gl_interface table from the gl schema
  112.   -- History
  113.   --   09-OCT-2000  D. J. Ogg    Created
  114.   -- Arguments
  115.   --   table_name        The name of the new table
  116.   -- Example
  117.   --   gl_journal_import_pkg.drop_table(
  118.   --      'GL_CUSTOM_INTERFACE');
  119.   -- Notes
  120.   --
  121. /*#
  122. * Drops a copy of the GL_INTERFACE table, which must be in the GL schema.
  123. * @param table_name Name of the table to drop.
  124. * @rep:scope public
  125. * @rep:lifecycle active
  126. * @rep:displayname Drop Journal Interface Table
  127. * @rep:compatibility S
  128. * @rep:category BUSINESS_ENTITY GL_JOURNAL
  129. */
  130.   PROCEDURE drop_table(table_name    VARCHAR2);
  131.   --
  132.   -- Procedure
  133.   --   populate_interface_control
  134.   -- Purpose
  135.   --   Populates the gl_interface_control table.  This routine does not
  136.   --   do a commit.  Returns the interface run id.
  137.   -- History
  138.   --   09-OCT-2000  D. J. Ogg    Created
  139.   -- Arguments
  140.   --   user_je_source_name      User friendly version of the source name
  141.   --   group_id                 Group id to be processed.  If none is
  142.   --                            provided, one will be automatically generated
  143.   --                            and passed back through this parameter.
  144.   --   set_of_books_id          Ledger Id to be used
  145.   --   interface_run_id  Interface run id to be used.  If none is
  146.   --                            provided, one will be automatically generated
  147.   --                            and passed back through this parameter.
  148.   --   table_name        The name of the new table
  149.   --   processed_data_action    Indicates what to do with the data and table
  150.   --                            if it is successfully imported.
  151.   --                            Valid options are SAVE_DATA, DELETE_DATA,
  152.   --                            and DROP_INTERFACE_TABLE
  153.   -- Example
  154.   --   gl_journal_import_pkg.populate_interface_control(
  155.   --      'Custom',
  156.   --      5001,
  157.   --      1,
  158.   --      'GL_CUSTOM_INTERFACE');
  159.   -- Notes
  160.   --
  161. /*#
  162. * Communicates to Journal Import the source and GROUP_ID of transaction data
  163. * to be processed, its location, and the action to take when it is
  164. * imported successfully. This information is stored in the GL_INTERFACE_CONTROL
  165. * table under the specified value of INTERFACE_RUN_ID. When Journal Import
  166. * is run for that INTERFACE_RUN_ID, the specified data is processed.
  167. *
  168. * The TABLE_NAME parameter specifies the table in which the data is stored.
  169. * If no value is specified for this parameter, then the table is assumed to be
  170. * GL_INTERFACE. If the data is stored in a table other than GL_INTERFACE, then
  171. * information about the location of the data is saved in GL_INTERFACE_CONTROL
  172. * until the data is imported successfully. Any Journal Import run that processes
  173. * that source and GROUP_ID will retrieve data from the specified table,
  174. * even if run for a different INTERFACE_RUN_ID. Once the data is imported
  175. * successfully, the row is deleted from GL_INTERFACE_CONTROL. Any
  176. * additional runs of Journal Import for that source and GROUP_ID will retrieve
  177. * data from the GL_INTERFACE table.
  178. *
  179. * The PROCESSED_DATA_ACTION parameter specifies the method to use in handling
  180. * the data once it is successfully processed. Valid values are
  181. * gl_journal_import_pkg.SAVE_DATA, gl_journal_import_pkg.DELETE_DATA,
  182. * and gl_journal_import_pkg.DROP_INTERFACE_TABLE. The value,
  183. * gl_journal_import_pkg.SAVE_DATA, leaves the data in
  184. * the interface table, but does not allow it to be reimported. The value,
  185. * gl_journal_import_pkg.DELETE_DATA, indicates the data should be deleted from
  186. * the interface table, and the value, gl_journal_import_pkg.DROP_INTERFACE_TABLE,
  187. * indicates the interface table should be dropped if all of its data has been
  188. * processed successfully by the Journal Import run. If the table cannot be
  189. * dropped or if all of the data in the table has not been processed, the data is
  190. * deleted. Note, however, that the GL_INTERFACE table is never
  191. * dropped, regardless of the setting of the PROCESSED_DATA_ACTION parameter.
  192. *
  193. * If no value is specified for the PROCESSED_DATA_ACTION parameter, then the
  194. * data is deleted once it has been successfully processed. If a value is
  195. * specified other than gl_journal_import_pkg.DELETE_DATA, then the action to
  196. * take for this data is saved in
  197. * GL_INTERFACE_CONTROL until the data is imported successfully. Any Journal
  198. * Import run that processes that source and GROUP_ID will execute this action
  199. * upon importing the data successfully, even if run for a different
  200. * INTERFACE_RUN_ID. Once the data is imported successfully, the row is
  201. * deleted from GL_INTERFACE_CONTROL. Any additional runs of Journal Import
  202. * for that source and GROUP_ID will execute the default action of deleting
  203. * any successfully imported data.
  204. *
  205. * If a null value of INTERFACE_RUN_ID is passed to this routine, then the routine
  206. * automatically generates and returns a unique INTERFACE_RUN_ID.  If a null value
  207. * of GROUP_ID is passed to this routine, then the routine automatically
  208. * generates and returns a unique GROUP_ID.
  209. * @param user_je_source_name User-friendly journal source name of the data to be processed.
  210. * @param group_id Group id of the data to be processed.
  211. * @param set_of_books_id Ledger id of the data to be processed.
  212. * @param interface_run_id Identifier of a specific Journal Import run.
  213. * @param table_name Table that contains the data to be processed.
  214. * @param processed_data_action Action to take once the data has been successfully processed.
  215. * @rep:scope public
  216. * @rep:lifecycle active
  217. * @rep:displayname Populate Interface Control
  218. * @rep:compatibility S
  219. * @rep:category BUSINESS_ENTITY GL_JOURNAL
  220. */
  221.   PROCEDURE populate_interface_control(
  222.               user_je_source_name VARCHAR2,
  223.        group_id   IN OUT NOCOPY NUMBER,
  224.               set_of_books_id           NUMBER,
  225.               interface_run_id   IN OUT NOCOPY  NUMBER,
  226.        table_name          VARCHAR2 DEFAULT NULL,
  227.               processed_data_action    VARCHAR2 DEFAULT NULL);
  228.   --
  229.   -- Procedure
  230.   --   get_last_sql
  231.   -- Purpose
  232.   --   Returns the last attempted sql*statement executed by the
  233.   --   create_table and drop_table routines
  234.   -- History
  235.   --   09-OCT-2000  D. J. Ogg    Created
  236.   -- Arguments
  237.   --   * NONE *
  238.   -- Example
  239.   --   last_sql := gl_journal_import_pkg.get_last_sql;
  240.   -- Notes
  241.   --
  242. /*#
  243. * Returns the last sql* statement executed by the CREATE_TABLE and DROP_TABLE
  244. * routines.
  245. * @return Last sql*statement executed by the CREATE_TABLE and DROP_TABLE routines.
  246. * @rep:scope public
  247. * @rep:lifecycle active
  248. * @rep:displayname Get Last Create/Drop SQL Statement
  249. * @rep:compatibility S
  250. * @rep:category BUSINESS_ENTITY GL_JOURNAL
  251. */
  252.   FUNCTION get_last_sql RETURN VARCHAR2;
  253.   --
  254.   -- Procedure
  255.   --   get_error_msg
  256.   -- Purpose
  257.   --   Returns the last error message, if any, for the create_table
  258.   --   and drop_table routines
  259.   -- History
  260.   --   09-OCT-2000  D. J. Ogg    Created
  261.   -- Arguments
  262.   --   * NONE *
  263.   -- Example
  264.   --   errmsg := gl_journal_import_pkg.get_error_msg;
  265.   -- Notes
  266.   --
  267. /*#
  268. * Returns the last error message, if any, produced by the CREATE_TABLE and DROP_TABLE
  269. * routines.
  270. * @return Last error message produced by the CREATE_TABLE and DROP_TABLE routines.
  271. * @rep:scope public
  272. * @rep:lifecycle active
  273. * @rep:displayname Get Last Create/Drop Error Message
  274. * @rep:compatibility S
  275. * @rep:category BUSINESS_ENTITY GL_JOURNAL
  276. */
  277.   FUNCTION get_error_msg RETURN VARCHAR2;

  278. END GL_JOURNAL_IMPORT_PKG;
复制代码
发表于 2008/3/24 21:16:06 | 显示全部楼层

太好了

@rep:scope public
* @rep:lifecycle active
* @rep:displayname Get Last Create/Drop SQL Statement
* @rep:compatibility S
* @rep:category BUSINESS_ENTITY GL_JOURNAL
*/
  FUNCTION get_last_sql RETURN VARCHAR2;
  --
  -- Procedure
  --   get_error_msg
  -- Purpose
  --   Returns the last error message, if any, for the create_table
  --   and drop_table routines
  -- History
  --   09-OCT-2000  D. J. Ogg    Created
  -- Arguments
  --   * NONE *
  -- Example
  --   errmsg := gl_journal_import_pkg.get_error_msg;
  -- Notes
  --
/*#
* Returns the last error message, if any, produced by the CREATE_TABLE and DROP_TABLE
* routines.
* @return Last error message produced by the CREATE_TABLE and DROP_TABLE routines.
* @rep:scope public
* @rep:lifecycle active
* @rep:displayname Get Last Create/Drop Error Message
* @rep:compatibility S
* @rep:category BUSINESS_ENTITY GL_JOURNAL
*/
  FUNCTION get_error_msg RETURN VARCHAR2;

END GL_JOURNAL_IMPORT_PKG;
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|小黑屋|手机版|壹佰网 ERP100 ( 京ICP备19053597号-2 )

Copyright © 2005-2012 北京海之大网络技术有限责任公司 服务器托管由互联互通
手机:13911575376
网站技术点击发送消息给对方83569622   广告&合作 点击发送消息给对方27675401   点击发送消息给对方634043306   咨询及人才点击发送消息给对方138011526

GMT+8, 2025/11/30 21:54 , Processed in 0.013726 second(s), 13 queries , File On.

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表