返回列表 发帖
再灌个水 你以后整理了 我直接看
2年之后给你出书
ebs 常见问题汇总

TOP

discover报表去掉某页项里面的"全部"

用discoverer做报表,使用viewer来展现。但在展现时候如图的部门会出来个”全部“,有没有参数调整来去掉这个“全部”?
9I的办法
=========================
Subject: How To Disable The Option In The Page Item For A Tabular Report In Discoverer Plus/Viewer
Doc ID: Note:273484.1 Type: HOWTO
Last Revision Date: 21-FEB-2007 Status: PUBLISHED

In this Document
Goal
Solution
References



--------------------------------------------------------------------------------



Applies to:
Oracle Discoverer - Version: 9.0.2 to 10.1.2
Information in this document applies to any platform.

Goal
Explain how to disable the <All> option in a Discoverer Plus/Viewer tabular worksheet. This does not apply to Discoverer Desktop.
Solution
Edit the pref.txt
The pref.txt file and applypreferences.sh scripts is found in directory $ORACLE_HOME/discoverer902/util (9.0.2) or $ORACLE_HOME/discoverer/util (9.0.4 - 10.1.2).


Under Database section in pref.txt identify the line EnhancedAggregationStrategy and set the value to 0
EnhancedAggregationStrategy = 0


Save the file


Run the script: applypreferences.sh (unix/linux) or applypreferences.bat (Windows) to apply the preferences.



For Discoverer 10g (10.1.2), you also have option to disable the ALL option for each specific worksheet .


Navigatein the menu to: Edit-->Worksheet Properties-->Aggregation Tab (or right-click on the worksheet tab)
Uncheck the option "Use the aggregation behaviour selected by Discoverer manager"
Select either of last two options


Now <ALL> should not appear in the Page Item.

Note : The ALL option would only appear if you have 9.2.x database and EnhancedAggregationStrategy is set to 4. Also, after executing this change you may need to verify totals in other workbooks if they are using this setting as part of aggregating data.The change you would likely see is rollup and cube operators in SQL that are generated in which case Discoverer relies on database rather then computing it locally.

TOP

如何discover报表挂到应用上直接看

把DISCOVER写的报表挂到应用上直接看View Discoverer Reports through Oracle Apps Self Service

In this article we will discuss how to enable Discoverer reports to be viewed through Oracle Applications Menu structure.

We will take an example report say "AR - Invoice Aging Buckets" with developer key "AR_INV_AGING_REPORT"

Let us assume there is a seperate responsibility to view AR reports such as "Accounts Receivables Reports". We also assume that there is a menu (top level) called "ALL_AR_REPORTS" which is attached to this responsibility using the Define Responsibility form.

Using the Discoverer User tool we share the "AR - Invoice Aging Buckets" to "Accounts Recievables Reports" responsibility.

Now we will begin creating the Function and menus for this workbook.




Navigate > System Administrator > Application > Function

Go to the Description TAB
Enter Function Name = AR_INV_AGING_REPORT_DWB
Enter User Function Name = AR - Invoice Aging Buckets
Enter Description = AR - Invoice Aging Buckets
We appended a suffix of "_DWB" at the end of the function name to indicate this is a Discoverer Workbook function. You may choose any other name for your function but it is a good idea to keep the function name same as the developer key for easy identification and tracking.

Now Go to the Properties TAB
Select Type = SSWA plsql function that opens a new window (Kiosk Mode)
Maintenance Mode Support = NoneContext Dependence = Responsibility
Selecting the Kiosk Mode opens the Discoverer workbook in a new window.


Now Go to Form TAB
Enter Parameters => “workbook=AR_INV_AGING_REPORT&viewer=Y”
In the above we entered the workbook developer key and forcing the report to be opened using Discoverer Viewer. (If your ICX profile is set to use Discoverer Viewer then you may omit the part from "&" )




Now Go to Web HTML TAB
Enter HTML Call = OracleOASIS.RunDiscoverer and then Click on the Save Button
Now that we have created our Form Function we will create a new menu to hold this function and then attach this new menu to the "ALL_AR_REPORTS" menu.

Navigate > System Administrator > Application > Menus

Create a new menu "Aging reports"






Then attach the function to this menu



Now query the main menu "ALL_AR_REPORTS"



and add submenu to this main menu




Now we have finally linked all the pieces together. Wait a minute, just ensure that the user who needs to access this report is given the "Accounts Receivables Reports" responsibility. So when user "ARUSER" logs onto Self service signon, the user will see the "Accounts Receivables Reports" responsibility as part of the menu list. Clicking on this responsibility, the user will see the "Aging Reports" as one of the sub-menu and underneath there will be the link to the discoverer workbook. If "all is fine", clicking on the report link will launch a seperate window where user can enter parameter values and execute the report.


NOTE: If the menu changes does not appear as expected then ask your DBA's to bounce the Apache middle tier. Also, make sure all the Discoverer profile values are set properly.

TOP

查询数据库中所有的表以及列

select * from dba_tab_columns

select * from dba_tables

这些在找form对应的表的时候比较常用

TOP

制作ldt文件

FNDLOADOracle Application提供的的Loader工具之一 ,将开发测试内容进行移植。可以用fndload来Download和Upload以下常用的数据
请求
   $FND_TOP/bin/FNDLOAD apps/apps 0 Y DOWNLOAD $FND_TOP/admin/import/afcpprog.lct *.ldt PROGRAM CONCURRENT_PROGRAM_NAME=''
   $FND_TOP/bin/FNDLOAD apps/apps 0 Y UPLOAD $FND_TOP/admin/import/afcpprog.lct *.ldt

说明性弹性域
   $FND_TOP/bin/FNDLOAD apps/hfhapps O Y DOWNLOAD $FND_TOP/admin/import/afffload.lct PER_PEOPLE.ldt DESC_FLEX
DESC_FLEX_APPLICATION_SHORT_NAME="PER" DESCRIPTIVE_FLEXFIELD_NAME="PER_PEOPLE"  P_CONTEXT_CODE="OTHER"  
    $FND_TOP/bin/FNDLOAD apps/hfhapps 0 Y UPLOAD $FND_TOP/admin/import/afffload.lct PER_PEOPLE.ldt
值集
    $FND_TOP/bin/FNDLOAD apps/hfhapps 0 Y DOWNLOAD $FND_TOP/admin/import/afffload.lct CAS_TECH_JOB_GRADE_CODE.ldt VALUE_SET
FLEX_VALUE_SET_NAME='CAS_TECH_JOB_GRADE_CODE'
    $FND_TOP/bin/FNDLOAD apps/hfhapps 0 Y UPLOAD $FND_TOP/admin/import/afffload.lct CAS_TECH_JOB_GRADE_CODE.ldt

功能
   $FND_TOP/bin/FNDLOAD apps/apps 0 Y DOWNLOAD $FND_TOP/admin/import/afsload.lct QPAY_LINK_UPDATE.ldt FUNCTION
FUNC_APP_SHORT_NAME="PAY" FUNCTION_NAME="QPAY_LINK_UPDATE"
   $FND_TOP/bin/FNDLOAD apps/apps 0 Y UPLOAD $FND_TOP/admin/import/afsload.lct QPAY_LINKUPDATE_FUNCTION.ldt
配置文件
Download 配置文件使用如下脚本:
$FNDLOAD apps/apps 0 Y DOWNLOAD $FND_TOP/admin/import/afscprof.lct xxx.ldt
PROFILE FND_PROFILE_OPTION_VALUES  PROFILE_NAME=”xxx“ APPLICATION_SHORT_NAME=”xxx”
Upload配置文件使用如下脚本:
$FNDLOAD apps/apps 0 Y UPLOAD $FND_TOP/admin/import/afscprof.lct xxx.ldt


举个例子:
$FND_TOP/bin/FNDLOAD apps/123456 0 Y DOWNLOAD $FND_TOP/admin/import/afffload.lct FA_PERIOD_NAME_FROM.ldt VALUE_SET FLEX_VALUE_SET_NAME="FA_PERIOD_NAME_FROM"

有时候生成的ldt文件是正确的,但是上传到别的服务器上的时候就不起作用,这可能是由于语言的原因.只要把两个服务器的NLS_LANG设置成一样就可以了.
对于用pro*c写的请求,如果在一个环境中进行了修改,是不能用这种方法覆盖到别的系统中去的(经过了多次的验证,目前还没有找到解决办法)

TOP

编译FORM

f60gen module=PAXPREPR userid=apps/123456 output_file=/ora1159/prod/prodappl/pa/11.5.0/forms/US/PAXPREPR.fmx

用上面的语句生成.fmx的文件. 把生成之后的文件用到其他系统环境的时候,用ftp上传的时候必须是二进制的形式上传,否则在应用环境中打开这个form的时候会出现类似于: 不能读取某个路径下的数据或者表格的错误.

TOP

查配置文件值的SQL语句

select a.USER_PROFILE_OPTION_NAME 配置文件名,
       c.user_name 用户名,
       b.profile_option_value 配置文件值,
       a.PROFILE_OPTION_ID ,
       c.user_id,
       c.rowid,
       b.rowid
  from FND_PROFILE_OPTIONS_VL a, fnd_profile_option_values b, fnd_user c
where a.USER_PROFILE_OPTION_NAME = 'FND:诊断'
   and a.PROFILE_OPTION_ID = b.profile_option_id
   and c.user_id = b.level_value
   and b.level_id = 10004 --10004为用户层
给我感触最新的就是gl 帐套标示 (gl_set_of_bks_id)这个配置文件的值,单位一多设置的都不一样.并且很多地方都用到这个值.

还有一个配置文件是: gl 帐套名.  对于多ou的系统,这个配置文件的值一定要设置责任一层.所以我们在配置的时候一般都是下面的步骤:: 先建会计科目,币种,日历, 然后是建立帐套, 然后把这个配置文件的值在责任层设定为新建的帐套

TOP

查找员工上下级关系的SQL

select a.LAST_NAME 员工姓名,
       a.PERSON_ID 员工ID,
       a.SEX 性别,
       a.EMAIL_ADDRESS 电子邮件,
       b.ORGANIZATION_ID,
       aa.LAST_NAME 主管姓名,
       aa.EMAIL_ADDRESS 主管email
  from per_people_f a, PER_ASSIGNMENTS_F b, per_people_f aa
where a.PERSON_ID = b.person_id
   and sysdate between b.EFFECTIVE_START_DATE and b.EFFECTIVE_END_DATE
   and sysdate between a.EFFECTIVE_START_DATE and a.EFFECTIVE_END_DATE
   and sysdate between aa.EFFECTIVE_START_DATE and aa.EFFECTIVE_END_DATE
   and a.PERSON_TYPE_ID <> 9
   and b.SUPERVISOR_ID = aa.PERSON_ID

TOP

月结与年结处理留成

月结与年结处理,是企业财务比较特殊而重要的业务操作。在实施与推广Oracle ERP系统过程中,如何结合现行的会计制度与惯例,充分利用软件功能,做好相应的关账、开账工作,是困扰许多企业财务人员乃至实施顾问的一个热点问题。为此,笔者提出自己一些解决思路,供同仁参考。由于时间紧迫,错漏之处在所难免,欢迎商讨及指正。

    一、什么是月结处理
    通常,企业财务部门每月末终了都要对该月账务进行检查,进行结算处理。例如将当月的制造费用结转为生产成本,在部门间分摊公共费用等等;并制作、打印相关的报表与分析报告。最后才关闭本期期间打开下月期间,开始下个月的账务处理。

    Oracle ERP是一个由多功能模块共同组成的电子商务系统,包括账户处理及事务处理两大部分,其中总账称为账务处理系统,而其他模块,例如:应收、应付、资产、库存,称之为业务处理系统,习惯上叫:子系统。由于大量业务数据在子系统中完成, Oracle月结的流程已不仅仅停留在总账系统层次上,因此要按一定的顺序依次核对子系统的账务,并关闭子系统会计期间,最后才关闭总账期间。通常建议按如下顺序进行月结关账流程:
   关闭采购期间>>关闭库存期间>>关闭应付期间>>关闭资产期间>>关闭应收期间>>关闭总账期间
二、月结处理与期间关闭
  子模块的月结业务,通常就是确保所有的当月业务已经完成,在子模块中运行相应的报表,并与总账中所对应的科目进行对账。对有差异的部分查找原因,合理的在总账中加以调整,做到账账相符。
下面来看看如何按顺序关闭子系统的期间:
一) 关闭采购会计期间
1、运行“采购订单明细报表”、“采购订单和发放明细报表”、“未结采购订报表(按采购员)”“打开采购订单报表(按成本中心)”等报表,显示出订购的数量和实收数量,并对其进行核对(路径:报表>>运行);
2、运行“未开票接收报表”,查看并核对其中的数据(路径:报表>>运行);
3、对于费用采购类的期末应计会计,运行“接收应计 - 期末”流程,将采购日记账导入总账(路径:报表>>运行);
4、及关闭采购期间(路径:设置>>财务系统>>会计>>控制采购期间)。

二) 关闭库存会计期间
1、确保当月所有事务处理已经完成,并且导入总账;
2、查看当月是否存在待定事务处理,要求有关人员处理(路径:查看事务处理>>待定物料事务处理);
3、关闭库存会计期间(路径:会计关闭期间>>库存会计期)。

三) 关闭应收会计期间
应收模块的多数业务基于订单管理模块和库存模块的操作,因此应收模块的月结应该在订单管理模块和库存模块月结后才能关闭会计期。
1、提交“未完成发票报表”、“未核销收款登记表”等程序,检查是否存在未完成状态的发票、贷项通知单及“记账”状态的收款等(路径:报表>>会计);
2、运行自动开票,确保当月发票已经完全从订单系统导入(路径:接口>>自动开票);
3、运行导入总账系统的程序,确保当月发票、收款等已经完全导入总账系统(路径:接口>>总账管理系统);
4、关闭应收会计期间(路径:控制>>会计>>打开/关闭期间)。

四) 关闭应付会计期间
应付模块的多数业务基于采购模块和库存模块的操作,因此应付模块的月结应该在采购模块和库存模块月结后才能关闭会计期。
1、运行“发票登记”程序,检查是否存在未审批、需要重新审批的发票、贷项通知单等(路径:其它>>请求>>运行);
2、运行“应付账款管理系统会计核算流程”、“将应付账款传送至总账”,确保当月事务处理完全传送到总账(路径:其它>>请求>>运行);
3、运行“创建成批增加”,确保采购固定资产、在建工程发票信息传送到了固定资产模块(路径:其它>>请求>>运行);
4、关闭应付会计期间(路径:会计>>控制应付款期间)。

五) 关闭固定资产会计期间
资产模块期间一般在应付期间关闭后才进行关闭,以防止有当期固定资产采购未创建资本化。
1、请检查是否存在新增固定资产或者在建工程未导入(路径:成批增加>>准备成批增加);
2、确认所有资产被指定分配行,如果资产未被指定到分配行,则期末的折旧程序不能完成,期间也不能关闭。运行“未分配给任何成本中心的资产列表报表”可确定哪些资产未被指定到分配行。针对这些资产,指定其分配行信息。(路径:其它>>请求>>运行)
3、运行未关闭期间的折旧,确保折旧的日记账账务正确,并且已经导入到了总账(路径:折旧>>运行折旧);
4、运行折旧关闭期间(路径:折旧>>运行折旧)。

六) 采用每月结转损益的处理(可选)
如果企业月末需要结转损益的,还要根据需要将收入、费用结转到本年利润科目。通常我们采用手工日记账或者经常性日记账的方式来完成。注意,由于需要保留每个科目的余额供生成报表,因此通常采用定义一个虚拟收入科目、一个虚拟费用科目方式,并在总账模块生成如下分录:
借: 虚拟收入科目 本月总收入
贷:虚拟费用科目 本月总费用
借/贷: 本年利润科目 本月总收入-本月总费用|

七) 成本差异分摊
前提:请确保子模块账务都已经导入总账,所有的人工/导入日记账已经过账。
以下以标准成本法下的成本差异分摊为例,给出一个通常的做法:
对于采购价格差异、发票价格差异,每月末按原材料、自制品、库存商品、销售成本的月末价值权数分摊,在总账作如下分摊处理:
借:销售成本 - 产品
产成品 - 差异
半成品 - 差异
原材料 - 差异
贷:成本差异 - 材料价差
成本差异 - 发票价差
对于WIP物料用量、资源效率、制造费用差异,每月末按当月完工的产品价值分摊,在总账作如下分摊处理:
借:销售成本-产品
产成品 - 差异
半成品 - 差异
贷: 成本差异 – 材料量差
成本差异 – 资源效率差异
成本差异 – 制造费用差异
对于标准成本调整差异,在原材料、自制件、产成品、销售成本月末价值权数分摊,在总账作如下分摊处理:
借:销售成本-产品
产成品 - 差异
半成品 - 差异
原材料 - 差异
贷: 成本差异 – 成本调整差异
使用平均成本方法,一般来说差异都比较小,可以直接结转到当月的销售成本中去。如果确实需要分摊,也可以按标准成本差异类似的原则进行分摊。

八) 关闭总账会计期间
1、确保所有日记账过账后,运行“试算表 - 明细”,核对余额,确保正确(路径:其他>>请求);
2、关闭总账会计期间(路径:设置>>打开/关闭)。

通常,企业月末采用表结法(即只出报表而不实际进行损益结转)进行结账工作,年末才将所有收入和费用结转到本年利润科目。

   如果我们不需要任何年结分录的出现,我们就直接打开新会计年度的第一期,以启动并发进程来更新账户余额。在打开新会计年度的第一期时,系统会自动结算损益表,并将差额过账至在会计账套中指定的留存收益账户。

如果我们需要产生年结分录,请参考如下做法:
  为了方便年结处理后的期间余额不至于受到年结分录的影响,我们通常将会计期间设置为每年13期(年末设置1个调整期间)、14期(年初、年末各设置1个调整期间)。年结分录均在调整期间内完成。

  到了年末12月期间,所有账务处理完成后,关闭12月期间,打开年末调整期间。如果需要创建实际结算日记账分录,以显示将损益表账户结转至留存收益的记录,请提交“关闭流程 - 创建损益表以关闭日记账”程序,此程序会创建可审核的结算日记账分录。如果当地会计规则要求您结算资产负债表,请提交“关闭流程 - 创建资产负债表以关闭日记账”程序。

  此外,还可以执行年终保留处理来标识未清采购订单和申请保留款,取消某些或全部保留款,并将保留、预算和可用资金余额结转至新的会计年度。如果不结转保留款,则可能需要取消包含保留款的现有申请和采购订单。

TOP

资产负债表不平的原因(针对我们系统的情况)

如果是年初的话,资产负债表不平可能是因为科目属性设置的不对,科目组合属性设置的不对.可能中间做过修改,但是那个科目组合的属性是保留的.需要进行调帐,把那个科目的数据调整到别的科目去,如果是年中的话,可能是因为中转科目有余额

TOP

fnd_profile用法

fnd_profile.value的用法:
select fnd_profile.value('gl_set_of_books_id')
   from dual
select fnd_profile.value('mfg_organization_id')
   from dual   --取子库
select fnd_profile.value('GL_SET_OF_BKS_ID')
   from dual--取帐套  

用此方式調整正確的當前咝协h境,特別是在multi_org環境下(在報表前,報表後均要執行因有可能在咝羞^程中變量被人為改變)
有一些view用到org環境參數的,一般要如下設定後,才能select到記錄:
begin
dbms_application_info.set_client_info(rg_id);--如1,2,3之類的
end;

可用'FND_PROFILE.GET' function 查看以下一些參數
取得set of book id
Select fnd_profile.value('GL_SET_OF_BKS_ID') from dual
取得master_id
select fnd_profile.value('SO_ORGANIZATION_ID') from dual;
取得當前org_id
select to_number(fnd_profile.value('ORG_ID')) from dual;
org_id = PROFILES$.ORG_ID;也可用此來取得,在定義報表參數時來定義

fnd_profile.value('MFG_ORGANIZATION_ID') 與上的區別
取得當前user_id
select TO_NUMBER(FND_PROFILE.VALUE('USER_ID')) from dual;
FND_GLOBAL.USER_ID 用此方式在report中有可能不好用,在report中建議用上一種方式FND_WHO.PROFILE('USERID') 又一種方式取得當前login_id
select TO_NUMBER(FND_PROFILE.VALUE('login_ID')) from dual;
取得當前username
Declare
username varchar2(30);
begin
username := FND_PROFILE.VALUE('USERNAME');
end;
另獲取username 也可以用FND_Global.User_Name
fnd_global package可以取得一些關於當前login in用戶的信息
取得當前request_id
select FND_PROFILE.VALUE('CONCURRENT_REQUEST_ID') from dual;
FND_REQUEST.SUBMIT_REQUEST 另一種方式
請看fnd_concurrent_requests functions
在PL/SQL Develop中没有环境变量,所以如果要查询多组织的View,需要先执行设置环境变量函数
dbms_application_info.set_client_info(81);end;与 BEGIN    fnd_client_info.set_org_context(82)END; 效果一样,这个81是指OU_ID,业务实体的ID

TOP

api中的一些控制参数

p_validate:This parameter is used to control whether the database is updated or not.The default is False, which means that the API performs normally by doing all neccessary validation,insert,update or deletes. If it is set to True then the API will just check that the operation will be valid . All insert,update or delete operations are rolled back.

p_effective_date:This is  a datetrack parameter, and is the date when the particular insertion or change becomes effective. It will only be present in thoes APIs which are performing operations on datetracked tables. It is used in conjunction with one of the modes below.

p_datetrack_update_mode:APIs that do updates on at least one datetracked table will contain this parameter. It defines the type of datetracked operation to be performed.

p_datetracke_delete_mode:APIs that do delete operations on a datetracked table will contain this parameter. It allows you to define the type of datetrack deletes to make.

p_effective_start_date/p_effective_end_date: These two dates are passed OUT whenever a datetrack operation is made. They are set to NULL when a delete style uses ZAP mode.

TOP

查找FORM在服务器上的位置

oracle ERP中要查找某个form的名字和它在服务器上的位置,可以通过菜单-〉帮助-〉关于 Oracle Application 里面的信息找到。但是这些信息如果程序员在做form(pre-form中的fnd_stand.form_info)的时候没有更新的话,这些信息是没有任何用户的。用户就需要从系统中去查找:
举例说明:(查找日记帐-导入-运行)这个form为例(责任为:总帐超级用户)
1.用系统管理员身份进入系统:安全性-责任-定义  找到总帐超级用户这个责任对应的菜单。(CAS_GL_SUPERUSER)
2.进入:应用-菜单。找到菜单CAS_GL_SUPERUSER下面的自菜单。知道追溯到 导入 这个菜单下的子菜单。可以看到运行对应的功能为:CAS导入日记帐。
3.进入:应用-功能。查找用户功能名为:CAS导入日记帐 对应的功能,这个功能就是form的名字(CGLXJIRUN) 点到表单这个页签,可以看到这个表单对应的应用(这里为CAS oracle总帐管理系统)
4.进入:应用-注册。查找刚才找到的应用,找到基本路径和简称。(CGL_TOP)
5.进入到服务器。输入:echo $CGL_TOP
就可以找到form放置的路径。

TOP

结帐的过程

结账:在Oracle ERP中的一些步骤

结合各自公司的情况主要有如下的工作:
AR:
1)核对所有收入数据,并过帐到总帐.
2)调整部分在总帐中录入日记帐,并过帐.
3)核对收入数据,总帐收入科目=应收+总帐调整.
4)运行为过帐事务处理登记.查看是否有未过帐的分录.
FA:
1)在AP中运行成批增加请求后,在FA模块中导入资产(运行准备成批增加),并运行请求生成总帐日记帐.
2)在FA中作固定资产的报废,调整.折旧等等,然后过帐到总帐.
3)关闭FA会计期(FA会计期关闭后就不能再打开,需要慎重)
AP:
1)核对所有应付账款.
2)确保所有固定资产采购发票,已经录入,并已经运行了固定资产成批增加(将固定资产信息导入FA).
3)公司常用费用的录入:水电费,房租(因公司的不同,有些公司是在GL中利用经常性日记帐).
4)过帐所有分录.
HRMS:
1)运行工资单,并过帐到GL.
GL:
1)导入所有日记帐,并过帐.
2)运行经常性日记帐,和成批分配日记帐等等
3)导入工资单数据和HRMS的数据进行核对.
4)检查各项中转科目是否结平.
5)运行损益表,并和预算进行比较.
6)核对无误后,关闭子模块会计期和总帐会计期,然后打开下一个月会计期.

TOP

日记帐行的摘要对应的gl_interface中的字段

在从别的模块导入日记帐的过程中,首先会把日记帐信息导入到总帐接口表:gl_interface中,然后在总帐模块进行日记帐导入,生成日记帐。其中日记帐行的摘要对应的gl_interface中的字段为:reference10.

TOP

与预付款金额,核销金额,欠款金额相关的几张表

ap_invoices_all ap
ap_invoice_distributions_all aid
ap_ae_lines_all apl
po_vendors pv
gl_code_combinations  gcc

其中ap_ae_lines_all放的是所有的跟发票,付款有关的会计分录,此表中的source_table有四种类型:AP_CHECKS,AP_INVOICES,AP_INVOICE_DISTRIBUTIONS,AP_INVOICE_PAYMENTS, 此表和ap_invoice_distributions_all通过souce_id=invoice_distribution_id


在发票验证之后,在ap_invoice_distributions_all这个表中的match_status_flag会变成A,在发票创建完会计分录之后,此表中的posted_flag字段的值会变成Y,其中的reversal_flag是表示冲销分配行,一般在取消发票不要用这种冲销分配行的方式.
发票验证之后,如果启用了预算控制,则资金就自动保留了,此表中的encubered_flag字段就是变成Y值(点击活动->取消发票,也会变成Y) ,这两种取消发票的区别就是,用冲销发票分配行的方式取消,同时也会取消资金保留,后者不会取消资金保留,后者会在cancellation_flag中表现出来.
取消发票也会产生分录,只不过借贷相反而已

select aid.dist_code_combination_id as code_combination_id,
       pv.vendor_name as 借款人,
       a.invoice_num as 发票编号,
       (select hou.name
          from per_assignments_f paaf, hr_organization_units hou
         where paaf.PERSON_ID = pv.employee_id
           and paaf.ORGANIZATION_ID = hou.organization_id
           and trunc(sysdate) between paaf.effective_start_date and
               paaf.effective_end_date
           and paaf.primary_flag = 'Y') 所属部门,
       a.invoice_num as 冲抵号,
       a.invoice_date as 日期,
       (select a.displayed_field
          from ap_lookup_codes a
         where a.lookup_type = 'PREPAY STATUS'
           and a.lookup_code =
               AP_INVOICES_PKG.GET_APPROVAL_STATUS(a.INVOICE_ID,
                                                   a.INVOICE_AMOUNT,
                                                   a.PAYMENT_STATUS_FLAG,
                                                   a.INVOICE_TYPE_LOOKUP_CODE)) 状态,
      
       apl.subledger_doc_sequence_value as 凭证编号,
       aid.description                  as 摘要,
      
       nvl(aid.amount, 0) as 借款金额,
       DECODE(a.PAYMENT_STATUS_FLAG,
              'Y',
              nvl(AID.PREPAY_AMOUNT_REMAINING, aid.amount),
              'P',
              nvl(AID.PREPAY_AMOUNT_REMAINING, aid.amount),
              0) 欠款金额,
      
        (select aia.invoice_num
          from Ap_Invoices_All aia
         where aia.invoice_id =
               (select max(aidstand.invoice_id)
                  from ap_invoice_distributions_all aidstand
                 where aidstand.prepay_distribution_id =
                       aid.invoice_distribution_id
                   and aidstand.line_type_lookup_code = 'PREPAY')) as 核销发票编号,
      
       (select nvl(-sum(aidstand.amount), 0)
          from ap_invoice_distributions_all aidstand
         where aidstand.prepay_distribution_id = aid.invoice_distribution_id) 核销金额,
      
        (select aa.accounting_date
          from ap_invoice_distributions_all aa
         where aa.invoice_distribution_id =
               (select max(aidstand.invoice_distribution_id)
                  from ap_invoice_distributions_all aidstand
                 where aidstand.prepay_distribution_id =
                       aid.invoice_distribution_id
                   and aidstand.line_type_lookup_code = 'PREPAY')) 核销日期,
          (select aa.description
          from ap_invoice_distributions_all aa
         where aa.invoice_distribution_id =
               (select max(aidstand.invoice_distribution_id)
                  from ap_invoice_distributions_all aidstand
                 where aidstand.prepay_distribution_id =
                       aid.invoice_distribution_id
                   and aidstand.line_type_lookup_code = 'PREPAY')) 核销说明
  from Ap_Invoices_All              a,
       ap_invoice_distributions_all aid,
       ap_ae_lines_all              apl,
       PO_VENDORS                   PV,
       gl_code_combinations         gcc
where a.invoice_type_lookup_code = 'PREPAYMENT'
   and a.invoice_id = aid.invoice_id
   and a.vendor_id = pv.vendor_id
   and aid.invoice_distribution_id = apl.source_id(+)
   and apl.source_table(+) = 'AP_INVOICE_DISTRIBUTIONS'
   and a.set_of_books_id = Fnd_Profile.Value('GL_SET_OF_BKS_ID')
   and aid.dist_code_combination_id = gcc.code_combination_id
   and reversal_flag is null
         
   and exists (select 1
          from dual
         where CAP_PKG.Fnc_Check_VS_SECURITYEx('SEGMENT1',
                                               gcc.SEGMENT1,
                                               fnd_profile.VALUE('RESP_ID'),
                                               fnd_profile.VALUE('GL_SET_OF_BKS_ID')) = 1)
   and exists (select 1
          from dual
         where CAP_PKG.Fnc_Check_VS_SECURITYEx('SEGMENT3',
                                               gcc.SEGMENT3,
                                               fnd_profile.VALUE('RESP_ID'),
                                               fnd_profile.VALUE('GL_SET_OF_BKS_ID')) = 1)
   and exists (select 1
          from dual
         where CAP_PKG.Fnc_Check_VS_SECURITYEx('SEGMENT4',
                                               gcc.SEGMENT4,
                                               fnd_profile.VALUE('RESP_ID'),
                                               fnd_profile.VALUE('GL_SET_OF_BKS_ID')) = 1)
   and exists (select 1
          from dual
         where CAP_PKG.Fnc_Check_VS_SECURITYEx('SEGMENT5',
                                               gcc.SEGMENT5,
                                               fnd_profile.VALUE('RESP_ID'),
                                               fnd_profile.VALUE('GL_SET_OF_BKS_ID')) = 1)
   and exists
(select 1
          from dual
         where CAP_PKG.Fnc_Check_VS_SECURITYEx('SEGMENT6',
                                               gcc.SEGMENT6,
                                               fnd_profile.VALUE('RESP_ID'),
                                               fnd_profile.VALUE('GL_SET_OF_BKS_ID')) = 1)

[ 本帖最后由 jessie 于 2007-9-1 13:07 编辑 ]

TOP

日期格式转换

1.日期和字符转换用法(to_date,to_char)
  例1:
  select to_char( to_date(222,'J'),'Jsp') from dual
  得到的结果是:
   Two Hundred Twenty-Two
例2:
  求某天是星期几
  select to_char(to_date('2007-09-01','yyyy-mm-dd'),'day') from dual;
  结果是:
  星期六
例3:
  用英文显示某天是星期几
select to_char(to_date('2007-09-01','yyyy-mm-dd'),'day','NLS_DATE_LANGUAGE = American') from dual;
例4:
  设置日期语言
ALTER SESSION SET NLS_DATE_LANGUAGE='AMERICAN';   
也可以这样   
TO_DATE ('2002-08-26', 'YYYY-mm-dd', 'NLS_DATE_LANGUAGE = American')



例5 :
两个日期间的天数
select floor(sysdate - to_date('20020405','yyyymmdd')) from dual;  
例6 :
时间为null的用法,注意要用to_date(null)
select id, active_date from table1   
UNION   
select 1, TO_DATE(null) from dual;  

例7:
  a_date between to_date('20011201','yyyymmdd') and to_date('20011231','yyyymmdd')   
那么1231号中午12点之后和121号的12点之前是不包含在这个范围之内的。
所以,当时间需要精确的时候,觉得to_char还是必要的



例8:
输入的格式要看你安装的ORACLE字符集的类型, 比如: US7ASCII, date格式的类型就是: '01-Jan-01'   
alter system set NLS_DATE_LANGUAGE = American   
alter session set NLS_DATE_LANGUAGE = American   
或者在to_date中写   
select to_char(to_date('2002-08-26','yyyy-mm-dd'),'day','NLS_DATE_LANGUAGE = American') from dual;   
注意我这只是举了NLS_DATE_LANGUAGE,当然还有很多,
可查看   
select * from nls_session_parameters   
select * from V$NLS_PARAMETERS  



例9 :


select count(*)   
from ( select rownum-1 rnum   
from all_objects   
where rownum <= to_date('2002-02-28','yyyy-mm-dd') - to_date('2002-   
02-01','yyyy-mm-dd')+1   
)   
where to_char( to_date('2002-02-01','yyyy-mm-dd')+rnum-1, 'D' )   
not   
in ( '1', '7' )   

查找2002-02-282002-02-01间除星期一和七的天数
在前后分别调用DBMS_UTILITY.GET_TIME, 让后将结果相减(得到的是1/100, 而不是毫秒).   



例10:


select months_between(to_date('01-31-1999','MM-DD-YYYY'),   
to_date('12-31-1998','MM-DD-YYYY')) "MONTHS" FROM DUAL;   
1   

select months_between(to_date('02-01-1999','MM-DD-YYYY'),   
to_date('12-31-1998','MM-DD-YYYY')) "MONTHS" FROM DUAL;   

1.03225806451613



例11:
Next_day(date, day)   

Monday-Sunday, for format code DAY   
Mon-Sun, for format code DY   
1-7, for format code D  



例12:


select to_char(sysdate,'hh:mi:ss') TIME from all_objects   
注意:第一条记录的TIME 与最后一行是一样的
可以建立一个函数来处理这个问题   
create or replace function sys_date return date is   
begin   
return sysdate;   
end;  

select to_char(sys_date,'hh:mi:ss') from all_objects;


例13:


获得小时数   

SELECT EXTRACT(HOUR FROM TIMESTAMP '2001-02-16 2:38:40') from offer   
SQL> select sysdate ,to_char(sysdate,'hh') from dual;   

SYSDATE TO_CHAR(SYSDATE,'HH')   
-------------------- ---------------------   
2003-10-13 19:35:21 07   

SQL> select sysdate ,to_char(sysdate,'hh24') from dual;   

SYSDATE TO_CHAR(SYSDATE,'HH24')   
-------------------- -----------------------   
2003-10-13 19:35:21 19   

获取年月日与此类似



例14:


年月日的处理   
select older_date,   
newer_date,   
years,   
months,   
abs(   
trunc(   
newer_date-   
add_months( older_date,years*12+months )   
)   
) days   
from ( select   
trunc(months_between( newer_date, older_date )/12) YEARS,   
mod(trunc(months_between( newer_date, older_date )),   
12 ) MONTHS,   
newer_date,   
older_date   
from ( select hiredate older_date,   
add_months(hiredate,rownum)+rownum newer_date   
from emp )   
)   





例15:


处理月份天数不定的办法   
select to_char(add_months(last_day(sysdate) +1, -2), 'yyyymmdd'),last_day(sysdate) from dual   

例16.   
找出今年的天数   
select add_months(trunc(sysdate,'year'), 12) - trunc(sysdate,'year') from dual   

闰年的处理方法   
to_char( last_day( to_date('02' || :year,'mmyyyy') ), 'dd' )   
如果是28就不是闰年



例17:
yyyyrrrr的区别   
'YYYY99 TO_C   
------- ----   
yyyy 99 0099   
rrrr 99 1999   
yyyy 01 0001   
rrrr 01 2001   



例18:


不同时区的处理   
select to_char( NEW_TIME( sysdate, 'GMT','EST'), 'dd/mm/yyyy hh:mi:ss') ,sysdate   
from dual;



例19:


5秒钟一个间隔   
Select TO_DATE(FLOOR(TO_CHAR(sysdate,'SSSSS')/300) * 300,'SSSSS') ,TO_CHAR(sysdate,'SSSSS')   
from dual

2002-11-1 9:55:00 35786   
SSSSS
表示5位秒数

例20:
一年的第几天   
select TO_CHAR(SYSDATE,'DDD'),sysdate from dual   
310 2002-11-6 10:03:51  


例21


select   
Days,   
A,   
TRUNC(A*24) Hours,   
TRUNC(A*24*60 - 60*TRUNC(A*24)) Minutes,   
TRUNC(A*24*60*60 - 60*TRUNC(A*24*60)) Seconds,   
TRUNC(A*24*60*60*100 - 100*TRUNC(A*24*60*60)) mSeconds   
from   
(   
select   
trunc(sysdate) Days,   
sysdate - trunc(sysdate) A   
from dual   
)   



select * from tabname   
order by decode(mode,'FIFO',1,-1)*to_char(rq,'yyyymmddhh24miss');   

//   
floor((date2-date1) /365)
作为年   
floor((date2-date1, 365) /30)
作为月   
mod(mod(date2-date1, 365), 30)
作为日.  





例 22:


next_day函数   
next_day(sysdate,6)
是从当前开始下一个星期五。后面的数字是从星期日开始算起。   
1 2 3 4 5 6 7   












这个是别人总结的,贴在这里,以便以后查看. 总结的不错,学到很多心东西.感谢总结分享的人.

TOP

如何增加临时表空间

通过Select * From dba_temp_files和select * from v$tempfile 都可以查临时表空间所在的位置.



alter database tempfile '/u02/oracle/oradata/test/temp01.dbf' resize 300M;

alter tablespace<tablespace_name>add tempfile ′<path_and_file_name>′size<n>m;

TOP

值集的类型

None - A value set of the type None has no list of approved values associated with it. A None value set performs only minimal checking of, for example, data type and length.
Independent - Independent type value sets perform basic checking but also check a value entered against the list of approved values you define.

Dependent - A Dependent value set is associated with an Independent value set. Dependent value sets ensure that all dependent values are associated with a value in the related Independent value set.

Table - Table value sets obtain their lists of approved values from existing application tables. When defining your table value set, you specify a SQL query to retrieve all the approved values from the table.

Special - This specialized value set provides another flexfield as a value set for a single segment.
Pair - This specialized value set provides a range flexfield as a value set for a pair of segments. Translatable

Independent - A Translatable Independent value set is similar to an Independent value set in that it provides a predefined list of values for a segment. However, a Translatable Independent value set can contain display values that are translated into different languages.

Translatable Dependent - A Translatable Dependent value set is similar to a Dependent value set in that the available values in the list and the meaning of a given value depend on which independent value was selected in a prior segment of the flexfield structure. However, a Translatable Dependent value set can contain display values that are translated into different languages.

TOP

摘取的别人的开发整理文档

_all,基表,保存多组织数据,里面有一个Org_Id字段,一般不直接出现在我们的DML中
去掉_all的视图,根据用户环境过滤掉组织,相当于普通的基表,我们直接使用它,就当它是基表
_v,视图,给Form用
_kfv,启用关键性弹性域的时候动态生成的视图,包含Concact过的字段组合
_dfv,启用描述性弹性域的时候动态生成的视图,我们取弹性域子段的描述的时候,需要用用户出口函数。。。。。。。。。。。
_tl,基表,有language字段,us肯定有,其他的看安装
_vl,视图,根据环境设置过滤语种,所以做报表用_vl
_s,序列号
_API,Package,保证向后兼容
_PKG,Package,Program
_SV,Package,供Form调用

一个用户对应一个或多个responsibility,一个responsibility对应一个或多个menu,一个底层menu对应一个function,一个function对应一个form或者一个报表或者一个程序;一个responsibility对应一个请求组,一个请求组对应一个或多个报表和程序,这个应该放过来说,在定义报表的时候可以选择哪个请求组;一个responsibility对应一个Application,这个不要和该responsibility拥有的菜单混淆,菜单没有限制

TOP

返回列表