EBS Report开发案例

1.写包:
包头:

CREATE OR REPLACE PACKAGE CUX_FINANCE_DEBUG_REPORT IS

  /* ===============================================================
  *    PROCEDURE NAME: MAIN
  *    AUTHOR      :   LWW
  *    DATE        :   2017-03-08
  *    PURPOSE     :   CUX:财务侦错报告
  *    PARAMETER   :
  *
  *    RETURN      :
  *    UPDATE HISTORY
  *    VERSION    DATE         NAME            DESCRIPTION
  *    --------  ----------  ---------------  --------------------
  *     V1.0     2017-03-08   LWW            CREATION
    ===============================================================*/
  PROCEDURE MAIN
  (
    ERRBUF             OUT VARCHAR2,
    RETCODE            OUT NUMBER,
    p_organization_id in NUMBER
    --p_error_code       varchar2,
  );

END CUX_FINANCE_DEBUG_REPORT;

包体:

CREATE OR REPLACE PACKAGE BODY CUX_FINANCE_DEBUG_REPORT IS

  /* ===============================================================
  *    PROCEDURE NAME: MAIN
  *    AUTHOR      :   LWW
  *    DATE        :   2017-03-08
  *    PURPOSE     :   CUX:财务侦错报告
  *    PARAMETER   :
  *
  *    RETURN      :
  *    UPDATE HISTORY
  *    VERSION    DATE         NAME            DESCRIPTION
  *    --------  ----------  ---------------  --------------------
  *     V1.0     2017-03-08   LWW            CREATION
    ===============================================================*/
  PROCEDURE MAIN
  (
    ERRBUF             OUT VARCHAR2,
    RETCODE            OUT NUMBER,
    p_organization_id  in NUMBER
    --p_error_code       varchar2,
  ) AS
  /*strWhere varchar2;

  if p_error_code is not null then
    strWhere :=‘and TABLE_TEMP.错误代码=‘||p_error_code;
  end if;*/

      CURSOR CUR_ALL IS
         SELECT TABLE_TEMP.组织ID,
       ORG.ORGANIZATION_NAME AS 组织,
       TABLE_TEMP.错误代码,
       TABLE_TEMP.报错描述,
       TABLE_TEMP.单据类型,
       TABLE_TEMP.单据编号,
       TABLE_TEMP.单据日期 AS 单据日期,
       TABLE_TEMP.制单人
FROM (
        --6.‘领料单‘
        SELECT A.ORGANIZATION_ID AS 组织ID,
                ‘6‘ AS 错误代码,
                ‘领料单已发放,已超过1天未过账,请查核!‘ AS 报错描述,
                ‘工单领料‘ AS 单据类型,
                A.REQUISITION_NUMBER AS 单据编号,
                A.CREATION_DATE AS 单据日期,
                CUX_PUBLIC_PKG.GET_PERSON_NAME(A.CREATE_PERSON_ID) AS 制单人
          FROM CUX_WIP_STOCK_REQ_HEADERS A
         WHERE A.REQUISITION_STATUS = ‘RELEASE‘
           AND A.REQUISITION_TYPE = ‘JOBS_P‘
           AND (SYSDATE - A.CREATION_DATE) >= 1
        UNION ALL
        --7.‘退料单‘
        SELECT B.ORGANIZATION_ID AS 组织ID,
               ‘7‘ AS 错误代码,
               ‘退料单已发放,已超过1天未过账,请查核!‘ AS 报错描述,
               ‘工单领料‘ AS 单据类型,
               B.REQUISITION_NUMBER AS 单据编号,
               B.CREATION_DATE AS 单据日期,
               CUX_PUBLIC_PKG.GET_PERSON_NAME(B.CREATE_PERSON_ID) AS 制单人
          FROM CUX_WIP_STOCK_REQ_HEADERS B
         WHERE B.REQUISITION_STATUS = ‘RELEASE‘
           AND B.REQUISITION_TYPE = ‘JOBS_B‘
           AND (SYSDATE - B.CREATION_DATE) >= 1
        UNION ALL
        --8.‘超领单‘
        SELECT C.ORGANIZATION_ID AS 组织ID,
               ‘8‘ AS 错误代码,
               ‘超领单已发放,已超过1天未过账,请查核!‘ AS 报错描述,
               ‘工单领料‘ AS 单据类型,
               C.REQUISITION_NUMBER AS 单据编号,
               C.CREATION_DATE AS 单据日期,
               CUX_PUBLIC_PKG.GET_PERSON_NAME(C.CREATE_PERSON_ID) AS 制单人
          FROM CUX_WIP_STOCK_REQ_HEADERS C
         WHERE C.REQUISITION_STATUS = ‘RELEASE‘
           AND C.REQUISITION_TYPE = ‘PUSH_P‘
           AND (SYSDATE - C.CREATION_DATE) >= 1
        UNION ALL
        --9.‘完工入库‘
        SELECT D.ORGANIZATION_ID AS 组织ID,
               ‘9‘ AS 错误代码,
               ‘完工入库单已申请,已超过1天未过账,请查核!‘ AS 报错描述,
               ‘工单入库‘ AS 单据类型,
               D.TRANSACTION_NUM AS 单据编号,
               D.CREATION_DATE AS 单据日期,
               CUX_PUBLIC_PKG.GET_EMPLOYEE_NAME(D.CREATED_BY) AS 制单人
          FROM CUX_BUWWIP_MOVE_TRANS_HEADERS D
         WHERE D.TRANSACTION_STATUS = ‘RELEASED‘
           AND D.TRANSACTION_TYPE = ‘WIP_COMP‘
           AND (SYSDATE - D.CREATION_DATE) >= 1
        UNION ALL
        --10.‘完工退回‘
        SELECT E.ORGANIZATION_ID AS 组织ID,
               ‘10‘ AS 错误代码,
               ‘完工退回单已申请,已超过1天未过账,请查核!‘ AS 报错描述,
               ‘工单入库‘ AS 单据类型,
               E.TRANSACTION_NUM AS 单据编号,
               E.CREATION_DATE AS 单据日期,
               CUX_PUBLIC_PKG.GET_EMPLOYEE_NAME(E.CREATED_BY) AS 制单人
          FROM CUX_BUWWIP_MOVE_TRANS_HEADERS E
         WHERE E.TRANSACTION_STATUS = ‘RELEASED‘
           AND E.TRANSACTION_TYPE = ‘WIP_COMP_F‘
           AND (SYSDATE - E.CREATION_DATE) >= 1
        UNION ALL
        --11.‘已完工,但尚未报工‘
        SELECT TABLE11.ORGANIZATION_ID AS 组织ID,
               ‘11‘ AS 错误代码,
               ‘工单已完工,但尚未报工,请查核!‘ AS 报错描述,
               ‘工单控制‘ AS 单据类型,
               TABLE11.WIP_ENTITY_NAME AS 单据编号,
               TABLE11.SCHEDULED_START_DATE AS 单据日期,
               CUX_PUBLIC_PKG.GET_EMPLOYEE_NAME(TABLE11.CREATED_BY) AS 制单人
          FROM (SELECT A.ORGANIZATION_ID,
                       A.WIP_ENTITY_NAME,
                       SUM(C.QUANTITY_COMPLETED) AS BG_SUM,
                       B.SCHEDULED_START_DATE,
                       A.CREATED_BY
                  FROM WIP_ENTITIES A
                 INNER JOIN WIP_DISCRETE_JOBS B
                    ON B.WIP_ENTITY_ID = A.WIP_ENTITY_ID
                 INNER JOIN WIP_OPERATIONS C
                    ON C.WIP_ENTITY_ID = A.WIP_ENTITY_ID
                 WHERE B.STATUS_TYPE = ‘4‘ AND B.CLASS_CODE<>‘M4-试制‘
                 GROUP BY A.ORGANIZATION_ID,
                          A.WIP_ENTITY_NAME,
                          B.SCHEDULED_START_DATE,
                          A.CREATED_BY) TABLE11
         WHERE TABLE11.BG_SUM = 0
        UNION ALL
        --12‘已有完工入库,但尚未领料‘
        SELECT TABLE12.ORGANIZATION_ID AS 组织ID,
               ‘12‘ AS 错误代码,
               ‘工单已有完工入库,但尚未领料,请查核!‘ AS 报错描述,
               ‘工单控制‘ AS 单据类型,
               TABLE12.WIP_ENTITY_NAME AS 单据编号,
               TABLE12.SCHEDULED_START_DATE AS 单据日期,
               CUX_PUBLIC_PKG.GET_EMPLOYEE_NAME(TABLE12.CREATED_BY) AS 制单人
          FROM (SELECT A.ORGANIZATION_ID,
                       A.WIP_ENTITY_NAME,
                       B.QUANTITY_COMPLETED,
                       SUM(C.QUANTITY_ISSUED) AS LL_SUM,
                       B.SCHEDULED_START_DATE,
                       A.CREATED_BY
                  FROM WIP_ENTITIES A
                 INNER JOIN WIP_DISCRETE_JOBS B
                    ON B.WIP_ENTITY_ID = A.WIP_ENTITY_ID
                 INNER JOIN WIP_REQUIREMENT_OPERATIONS C
                    ON C.WIP_ENTITY_ID = A.WIP_ENTITY_ID
                 GROUP BY A.ORGANIZATION_ID,
                          A.WIP_ENTITY_NAME,
                          B.QUANTITY_COMPLETED,
                          B.SCHEDULED_START_DATE,
                          A.CREATED_BY) TABLE12
         WHERE TABLE12.QUANTITY_COMPLETED > 0
           AND TABLE12.LL_SUM = 0
        UNION ALL
        --13‘已完工,已领料,已报工,状态需切换‘
        SELECT TABLE13.ORGANIZATION_ID AS 组织ID,
               ‘13‘ AS 错误代码,
               ‘工单已完工入库,已充分领料并报工,请及时将工单【状态】修改为"完工-不计费"!‘ AS 报错描述,
               ‘工单控制‘ AS 单据类型,
               TABLE13.WIP_ENTITY_NAME AS 单据编号,
               TABLE13.SCHEDULED_START_DATE AS 单据日期,
               CUX_PUBLIC_PKG.GET_EMPLOYEE_NAME(TABLE13.CREATED_BY) AS 制单人
          FROM (SELECT A.ORGANIZATION_ID,
                       A.WIP_ENTITY_NAME,
                       SUM(C.QUANTITY_COMPLETED) AS BG_SUM,
                       SUM(D.QUANTITY_ISSUED) AS LL_SUM,
                       B.SCHEDULED_START_DATE,
                       A.CREATED_BY
                  FROM WIP_ENTITIES A
                 INNER JOIN WIP_DISCRETE_JOBS B
                    ON B.WIP_ENTITY_ID = A.WIP_ENTITY_ID
                 INNER JOIN WIP_OPERATIONS C
                    ON C.WIP_ENTITY_ID = A.WIP_ENTITY_ID
                 INNER JOIN WIP_REQUIREMENT_OPERATIONS D
                    ON D.WIP_ENTITY_ID = A.WIP_ENTITY_ID
                 WHERE B.STATUS_TYPE = ‘4‘
                 GROUP BY A.ORGANIZATION_ID,
                          A.WIP_ENTITY_NAME,
                          B.SCHEDULED_START_DATE,
                          A.CREATED_BY) TABLE13
         WHERE TABLE13.LL_SUM <> 0
           AND TABLE13.BG_SUM <> 0
        /*UNION ALL
        --14‘报工数量<>转移数量‘--某些工单导入EBS成功,但移动事务处理没有产生记录
        SELECT TABLE14.ORGANIZATION_ID AS 组织ID,
               ‘14‘ AS 错误代码,
               ‘工单对应工序‘ || TABLE14.OPERATION_SEQ_NUM_S || ‘的报工数量不等于转移数量,请查核!‘ AS 报错提示,
               ‘工单控制‘ AS 单据类型,
               TABLE14.WIP_ENTITY_NAME AS 单据编号,
               TABLE14.SCHEDULED_START_DATE AS 单据日期
          FROM (SELECT DISTINCT A.ORGANIZATION_ID,A.WIP_ENTITY_ID,
                                A.WIP_ENTITY_NAME,
                                D.OPERATION_SEQ_NUM_S,
                                C.QUANTITY_COMPLETED AS BG_SUM, --报工数量(取报工界面上的总报工数)
                                B.SCHEDULED_START_DATE,
                                (SELECT NVL(SUM(E.TRANSACTION_QUANTITY), 0)
                                   FROM WIP_ENTITIES D
                                  INNER JOIN WIP_MOVE_TRANSACTIONS E
                                     ON E.WIP_ENTITY_ID = D.WIP_ENTITY_ID
                                  WHERE D.WIP_ENTITY_NAME = A.WIP_ENTITY_NAME
                                    --AND E.FM_INTRAOPERATION_STEP_TYPE = 1
                                    --AND E.TO_INTRAOPERATION_STEP_TYPE = 3
                                    AND E.FM_OPERATION_SEQ_NUM =
                                        D.OPERATION_SEQ_NUM_S) AS ZY_SUM --转移数量
                  FROM WIP_ENTITIES A
                 INNER JOIN CUX_WIP_MOVE_RESOURCES D ON A.WIP_ENTITY_ID=D.WIP_ENTITY_ID
                 INNER JOIN WIP_DISCRETE_JOBS B
                    ON B.WIP_ENTITY_ID = A.WIP_ENTITY_ID
                 INNER JOIN WIP_OPERATIONS C
                    ON C.WIP_ENTITY_ID = A.WIP_ENTITY_ID AND C.OPERATION_SEQ_NUM=D.OPERATION_SEQ_NUM_S
                ) TABLE14
         WHERE TABLE14.BG_SUM <> TABLE14.ZY_SUM*/
  ) TABLE_TEMP
 INNER JOIN ORG_ORGANIZATION_DEFINITIONS ORG ON TABLE_TEMP.组织ID = ORG.ORGANIZATION_ID
 where ORG.ORGANIZATION_ID=p_organization_id;

 BEGIN
    ERRBUF  := ‘OK‘;
    RETCODE := 0;
    FND_FILE.PUT_LINE(FND_FILE.OUTPUT,
                      ‘<?xml version = ‘‘‘ || ‘1.0‘ || ‘‘‘ encoding = ‘ || ‘‘‘UTF-8‘ || ‘‘‘?>‘);
    FND_FILE.PUT_LINE(FND_FILE.OUTPUT,‘<G1>‘);
    --FND_FILE.PUT_LINE(FND_FILE.OUTPUT, ‘<TIME>‘ || TO_CHAR(SYSDATE,‘YYYY-MM-DD hh24:mi:ss‘) || ‘</TIME>‘);
    FOR CUR_ROW IN CUR_ALL LOOP
          FND_FILE.PUT_LINE(FND_FILE.OUTPUT,‘<G_LINES>‘);
          FND_FILE.PUT_LINE(FND_FILE.OUTPUT,‘<organization_code>‘ || CUR_ROW.组织ID|| ‘</organization_code>‘);
          FND_FILE.PUT_LINE(FND_FILE.OUTPUT,‘<organization_name>‘ || CUR_ROW.组织|| ‘</organization_name>‘);
          FND_FILE.PUT_LINE(FND_FILE.OUTPUT,‘<error_code>‘ || CUR_ROW.错误代码 ||‘</error_code>‘);
          FND_FILE.PUT_LINE(FND_FILE.OUTPUT,‘<error_content>‘ || CUR_ROW.报错描述 ||‘</error_content>‘);
          FND_FILE.PUT_LINE(FND_FILE.OUTPUT,‘<doc_type>‘ || CUR_ROW.单据类型 ||‘</doc_type>‘);
          FND_FILE.PUT_LINE(FND_FILE.OUTPUT,‘<doc_number>‘ || CUR_ROW.单据编号 ||‘</doc_number>‘);
          FND_FILE.PUT_LINE(FND_FILE.OUTPUT,‘<doc_date>‘ || TO_CHAR(CUR_ROW.单据日期,‘YYYY-MM-DD‘) ||‘</doc_date>‘);
          FND_FILE.PUT_LINE(FND_FILE.OUTPUT,‘<doc_man>‘ || CUR_ROW.制单人 ||‘</doc_man>‘);
          FND_FILE.PUT_LINE(FND_FILE.OUTPUT,‘</G_LINES>‘);
      END LOOP;
    FND_FILE.PUT_LINE(FND_FILE.OUTPUT,‘</G1>‘);

    fnd_file.put_line(fnd_file.LOG,
                      ‘**************************************************************‘);
    fnd_file.put_line(fnd_file.LOG,
                      ‘程序开始运行  ‘ ||
                      TO_CHAR(SYSDATE, ‘yyyy-mm-dd hh24:mi:ss‘));
    fnd_file.put_line(fnd_file.LOG, ‘p_organization_id==‘ ||  p_organization_id);

  EXCEPTION
    WHEN OTHERS THEN
      RETCODE := 2;
      ERRBUF := ‘异常:‘||SQLERRM||‘代码行:‘||DBMS_UTILITY.FORMAT_ERROR_BACKTRACE;
      FND_FILE.PUT_LINE(FND_FILE.LOG,ERRBUF);
  END MAIN;

END CUX_FINANCE_DEBUG_REPORT;

2.建模板(可拿原有的rtf模板,在它的基础上修改)

链接:http://pan.baidu.com/s/1hrDMiLe密码:k8ug

3.定义可执行程序

4.定义并发程序

5.上传rtf模板

6.跑报表请求

时间: 2024-12-22 10:41:55

EBS Report开发案例的相关文章

EBS Form开发建立一个最简单的Form并部署到到EBS中

1.      从要开发的EBS服务器上,拷贝下来$AU_TOP/forms/US/和$AU_TOP/resource/目录下的文件到Windows目录. 2.      编辑Windows注册表,把上面的两个目录加入到FORMS_PATH项上面去,如下图,不然的话在引用或者打开EBS上的已有的fmb时会报错. 3.      打开Form Builder,选择菜单File->New->Form using Template…,如下图. 4.      然后选择我们从$AU_TOP/forms

使用pentaho report 开发web报表

使用pentaho report 开发web报表 1.   文档说明 java开源报表软件中,pentaho report算是比较优秀的:能够满足大多数应用,足以和国内商业报表媲美:现记录实际开发报表完整过程教程,让初学者快速入门并应用到项目中. 2.   开发环境说明 1)      工具环境:pentaho report designer5.3.tomcat6.jdk6.Eclipse Java EE (4.3) 2)     mysql以及示例数据库saikla 3)     mysql驱

jplogic 快速开发平台开发案例其一

jplogic v1.0开发陆续更新,意在和广大网友分享交流,通过寻求合作伙伴,交流群376447127.下面是jplogic的关于知识库模块的部分功能,如下进行功能展示: 知识库主界面: 新增知识类别: 新增文档: 调整类别结构: 附件明细操作: 文档信息查看:(将上传的各种文本文件转化成swf格式,便可以实现仿百度文库在线阅读功能) 海量知识库文档高级检索(数据库检索.索引检索(全文检索))等功能. jplogic 快速开发平台开发案例其一,布布扣,bubuko.com

EBS OAF开发中如何实现功能页签(Global Tab)

(版权声明,本人原创或者翻译的文章如需转载,如转载用于个人学习,请注明出处:否则请与本人联系,违者必究) 功能页签的实现不需要任何编码,和subTab不一样,可以和subTab共存.其主要实现是靠配置,步骤如下: 1.      建立两个OAF页面的Function. 2.      为每个function分别建立一个HTML Tab 类型的菜单,并把相应的Function加入到菜单中,但不要声明Prompt,如下: 3.      建立一个Home Page类型的菜单,并把上面建立的两个HTM

使用Jquery+EasyUI进行框架项目开发案例解说之中的一个---员工管理源代码分享

使用Jquery+EasyUI 进行框架项目开发案例解说之中的一个 员工管理源代码分享 在開始解说之前,我们先来看一下什么是Jquery EasyUI?jQuery EasyUI是一组基于jQuery的UI插件集合,而jQuery EasyUI的目标就是帮助web开发人员更轻松的打造出功能丰富而且美观的UI界面.开发人员不须要编写复杂的javascript,也不须要对css样式有深入的了解,开发人员须要了解的仅仅有一些简单的html标签.jQuery EasyUI为我们提供了大多数UI控件的使用

EBS OAF开发中如何通过ReferenceAO进行验证

(版权声明,本人原创或者翻译的文章如需转载,如转载用于个人学习,请注明出处:否则请与本人联系,违者必究) Reference AO 除了用于VO中的数据展示,还可以用于对EO进行辅助验证,比如在示例中建立的Employee和Manager的AO,假设如果有Employee的工资不能比其Manager的工资的高的验证就可以通过AO在EO轻松实现. 1.      AO的创建参考之前的文章和OAF Tutorial 示例代码,在AO设置可以在Employee EO访问Manager EO,这里的Ac

【小程序源码案例】微信小程序项目开发案例分享

作者:web小二本文标签: 微信小程序 小程序源码案例 小程序项目小程序的开发,并不是适合所有公司,我今天跟大家分享小程序方面的教程,主要是供大家学习使用.学习这种东西,有时候则是单纯的喜欢,没有任何目的,很单纯的为了好玩,记得很早之前学flash,没有想法,就是觉得好玩,纯娱乐爱好而已.到后来玩视频剪辑也是出于同样的原因,不图钱财名利,只是图自己个人爱好娱乐. 但是,学习,有时候则是需要有明确目的,特别是关系到自己吃饭问题的时候,你就需要非常有目的去学习,并且还需要制定好学习的计划与目标,希望

使用Jquery+EasyUI 进行框架项目开发案例讲解之五 模块(菜单)管理源码分享

http://www.cnblogs.com/huyong/p/3454012.html 使用Jquery+EasyUI 进行框架项目开发案例讲解之五  模块(菜单)管理源码分享    在上四篇文章  <使用Jquery+EasyUI进行框架项目开发案例讲解之一---员工管理源码分享>  <使用Jquery+EasyUI 进行框架项目开发案例讲解之二---用户管理源码分享>  <使用Jquery+EasyUI 进行框架项目开发案例讲解之三---角色管理源码分享> <

EBS OAF开发中实现参数式弹出窗口

(版权声明,本人原创或者翻译的文章如需转载,如转载用于个人学习,请注明出处:否则请与本人联系,违者必究) 概览 参数式弹出窗口和嵌入式弹出窗口不一样,它拥有独立的区域,并不嵌入到使用页面中,它里面的内容根据需要来获取和生成,它拥有自己的AM和页面状态,对popup页面事件的处理也不一样.两种弹出式窗口都只在下面四种组件所支持,既不能改变大小也不可移动. 1.        Text(messageStyledText) 2.        Image 3.        Link 4.