APP-SQLAP-10000: ORA-00001: unique constraint .......的問題
2012年8月28日 星期二
Oracle EBS R12 Pay On Receipt AutoInvoice 出現錯誤
每天定時執行的 Pay On Receipt AutoInvoice,居然出現錯誤(其實是 Payable Open Invoice Import),造成從收料那邊過來的無法產生發票,怎麼會每天順順的,今天就有問題,花了很多時間檢查,加上使用者在 AP 手動新增 Invoice 時,也出現了一個問題。
APP-SQLAP-10000: ORA-00001: unique constraint .......的問題
所以直接去查詢 table ap_payment_schedules_all 的資料才發現到有很多的怪資料存在,原來是當初在導入 R12時,顧問直接把 R11的舊資料直接 insert至 R12上了,所以作法是把這些舊資料刪除即可,不過記得選擇好導入的顧問真的很重要,上天堂或是天天加班的日子就要靠他們了。
APP-SQLAP-10000: ORA-00001: unique constraint .......的問題
2012年8月27日 星期一
Generating Ext JS and Java CRUD Applications with CDB
文章網址:http://flexblog.faratasystems.com/2012/04/18/generating-ext-js-and-java-crud-applications-with-cdb-part-1
以前前端是用 flex作為元件,目前這一家很棒的廠商已經開發出前端為 javascript的版本,我自己已經測試過,還蠻好的,如果有人就是覺得 html5 的 solution 永遠比 flex 好的話,特別是在這個時間、在企業應用的話,可以來玩看
以前前端是用 flex作為元件,目前這一家很棒的廠商已經開發出前端為 javascript的版本,我自己已經測試過,還蠻好的,如果有人就是覺得 html5 的 solution 永遠比 flex 好的話,特別是在這個時間、在企業應用的話,可以來玩看
Oracle EBS R12 Data Fix - undo accounting 注意事項
最多問題且花最多時間就是 AP 模組,當初顧問在幫忙導入的時候並沒有告知或建議那些重要的 patch要先 apply ,導致在上線後,使用者一直在告訴我那些操作或資料有問題,而我就一直到 oracle support 找文章, create SR,我建立的 SR 跟別人比的話是用倍數計算的。 所以這邊先分享一個關於執行 Data fix 如果會 undo accounting的注意事項。
1. 如果 undo accounting 在不同的月份,在當月會產生一正一負的會科(reverse),也會可能會產生匯兌損益的會科出現,會計人員要在 GL手動調帳。
2. 如果要在當月執行但已關帳的情況下,要打開 GL, AP, PO的 Period,作完之後再關閉
Tomcat 上新增 DataSource
1.tomcat_home/conf/ 的 server.xml 或 context.xml (官方建議)內新增如下
2.在 web.xml 內加入設定
res-ref-name 要指定步驟 1的 resource name
OAuth for Spring Security 應用實作
參考來源:https://github.com/SpringSource/spring-security-oauth/wiki/tutorial
程式下載:https://github.com/SpringSource/spring-security-oauth 網頁下面有文字說明如何使用 maven將 source code下載回來。
目前 tutorial 有實作 OAuth1, OAuth2 的Server 和 Client, Client 可以下載 Server 的圖片。 而我的目的就是可以建立一個公司內部認證網站(OAuth 是用來作授權用的),使用者在連其它公司自製網站時可以連來這個網站使用 Notes or AD, Oracle ERP 的帳號作登入,當帳號、密碼正確時就可以允許 oauth client 存取 登入使用者的工號、部門、 email等。
修改部份:
首先我選擇的是拿 OAuth2的範列來改,Server 的 source code 代號為 Sparklr2,Client 的代號為 Tonr2。
因為要讓使用者可以用Notes or AD, Oracle ERP 的帳號作登入,所以要先改 OAuth2 Server 的部份,目前 spring security 選擇 authentication的方式有兩種,一種是 AuthenticationProvider ,一種是UserService,我選擇的是AuthenticationProvider ,所以要實作一個 class implements org.springframework.security.authentication.AuthenticationProvider 並實作兩個 method
1.public Authentication authenticate(Authentication authentication) ==>讓我可以用Notes or AD, Oracle ERP 的帳號、宓碼登入後檢查是否正確。
2. public boolean supports(Class authentication) {
return authentication.equals(UsernamePasswordAuthenticationToken.class);
}
等這個 provider實作好之後,就要在 WEB-INF\spring-servlet.xml 內加上設定,這樣就可以完成認證的功能了。
再來就是分享員工資訊的程式了, 可以實作自己的 controller,參考原程式分享 photoID的 service : PhotoController, PhotoServiceImpl,PhotoService
記得WEB-INF\spring-servlet.xml 也要將相關的 tag 加上。
而 Client 的程式也請參考原程式如何存取 photoID
等 server , client 的程式都實作好之後就可以放到 tomcat 上了。 目前實作好之後才發現 Client 要先自己認證完成,才可以去 Server再去作認證一次,才可以存取我的員工資訊,但我想的是 Client 本身不用有認證的程序,直接到 server 作認證後存取資料。上網找了一下資訊,發現好像沒有人分享怎麼設定 OAuth2才可以達到我的要求,所以我又拿了 OAuth1的 source code改了一次。
OAuth1 跟 OAuth2 設定上有一點不一樣,除了WEB-INF\spring-servlet.xml之外,又多了一個檔案 applicationContext.xml,也是 spring 標準設定檔。
這邊也是實作我自己的 AuthenticationProvider ,但是在設定上就不是在 spring-servlet.xml新增的資訊了,而是要放在 applicationContext.xml ,而且 bean 要改為 beans:bean 這樣才可以。 其它 controller or service的程式才在spring-servlet.xml 註冊。
再來就是 oauth:consumer-details-service id="consumerDetails" 的設定
程式下載:https://github.com/SpringSource/spring-security-oauth 網頁下面有文字說明如何使用 maven將 source code下載回來。
目前 tutorial 有實作 OAuth1, OAuth2 的Server 和 Client, Client 可以下載 Server 的圖片。 而我的目的就是可以建立一個公司內部認證網站(OAuth 是用來作授權用的),使用者在連其它公司自製網站時可以連來這個網站使用 Notes or AD, Oracle ERP 的帳號作登入,當帳號、密碼正確時就可以允許 oauth client 存取 登入使用者的工號、部門、 email等。
修改部份:
首先我選擇的是拿 OAuth2的範列來改,Server 的 source code 代號為 Sparklr2,Client 的代號為 Tonr2。
因為要讓使用者可以用Notes or AD, Oracle ERP 的帳號作登入,所以要先改 OAuth2 Server 的部份,目前 spring security 選擇 authentication的方式有兩種,一種是 AuthenticationProvider ,一種是UserService,我選擇的是AuthenticationProvider ,所以要實作一個 class implements org.springframework.security.authentication.AuthenticationProvider 並實作兩個 method
1.public Authentication authenticate(Authentication authentication) ==>讓我可以用Notes or AD, Oracle ERP 的帳號、宓碼登入後檢查是否正確。
2. public boolean supports(Class authentication) {
return authentication.equals(UsernamePasswordAuthenticationToken.class);
}
等這個 provider實作好之後,就要在 WEB-INF\spring-servlet.xml 內加上設定,這樣就可以完成認證的功能了。
再來就是分享員工資訊的程式了, 可以實作自己的 controller,參考原程式分享 photoID的 service : PhotoController, PhotoServiceImpl,PhotoService
記得WEB-INF\spring-servlet.xml 也要將相關的 tag 加上。
而 Client 的程式也請參考原程式如何存取 photoID
等 server , client 的程式都實作好之後就可以放到 tomcat 上了。 目前實作好之後才發現 Client 要先自己認證完成,才可以去 Server再去作認證一次,才可以存取我的員工資訊,但我想的是 Client 本身不用有認證的程序,直接到 server 作認證後存取資料。上網找了一下資訊,發現好像沒有人分享怎麼設定 OAuth2才可以達到我的要求,所以我又拿了 OAuth1的 source code改了一次。
OAuth1 跟 OAuth2 設定上有一點不一樣,除了WEB-INF\spring-servlet.xml之外,又多了一個檔案 applicationContext.xml,也是 spring 標準設定檔。
這邊也是實作我自己的 AuthenticationProvider ,但是在設定上就不是在 spring-servlet.xml新增
再來就是 oauth:consumer-details-service id="consumerDetails" 的設定
這邊就可增加自己 oauth:consumer
實作分享員工資訊的程式也跟 OAuth2實作差不多,設定上 OAuth1 OAuth2會有差異,只要參考原程式存取 photoID怎麼寫和怎麼設定應該就沒什麼大問題了。
最後我想測試用 asp.net 也可以存取我的 OAuth1實作出來的 server員工資訊,這一次我採用
DotNetOpenAuth http://www.dotnetopenauth.net/
實作自己的 service comsumer
public static readonly ServiceProviderDescription ServiceDescription = new ServiceProviderDescription {
RequestTokenEndpoint = new MessageReceivingEndpoint("http://ip:port/OAuth1Server/oauth/request_token", HttpDeliveryMethods.GetRequest | HttpDeliveryMethods.AuthorizationHeaderRequest),
UserAuthorizationEndpoint = new MessageReceivingEndpoint("http://ip:port/OAuth1Server /oauth/confirm_access", HttpDeliveryMethods.GetRequest | HttpDeliveryMethods.AuthorizationHeaderRequest),
AccessTokenEndpoint = new MessageReceivingEndpoint("http:// ip:port/OAuth1Server /oauth/access_token", HttpDeliveryMethods.GetRequest | HttpDeliveryMethods.AuthorizationHeaderRequest),
TamperProtectionElements = new ITamperProtectionChannelBindingElement[] { new HmacSha1SigningBindingElement() },
};
/// The URI to get the data on the user's home page.
///
private static readonly MessageReceivingEndpoint cattonEmpInfoEndpoint = new MessageReceivingEndpoint("http:// ip:port/OAuth1Server/service?format=json", HttpDeliveryMethods.GetRequest | HttpDeliveryMethods.AuthorizationHeaderRequest);
private static InMemoryTokenManager ShortTermUserSessionTokenManager {
get {
var store = HttpContext.Current.Session;
var tokenManager = (InMemoryTokenManager)store["CattonOAuth1SessionTokenManager"];
if (tokenManager == null) {
string consumerKey = ConfigurationManager.AppSettings["CattonOAuthConsumerKey"];
string consumerSecret = ConfigurationManager.AppSettings["CattonOAuthConsumerSecret"];
if (IsTwitterConsumerConfigured) {
tokenManager = new InMemoryTokenManager(consumerKey, consumerSecret);
store["CattonOAuth1SessionTokenManager"] = tokenManager;
} else {
throw new InvalidOperationException("No Catton OAuth consumer key and secret could be found in web.config AppSettings.");
}
}
return tokenManager;
}
}
public static string GetUserInfo(ConsumerBase cattonOAuthCB, string accessToken) {
IncomingWebResponse response = cattonOAuthCB.PrepareAuthorizedRequestAndSend(cattonEmpInfoEndpoint, accessToken);
return response.GetResponseReader().ReadToEnd();
}
實作畫面
2012年1月1日 星期日
Oracle ERP receipt accruals - period-end no entries Period LOV找不到的問題
1 確認AP period 是Closed的狀態 (要執行暫估的那個月份)
2 PO and GL period 是 Open
3 下一期的PO and GL periods 狀態應該是 Future or Open
2 PO and GL period 是 Open
3 下一期的PO and GL periods 狀態應該是 Future or Open
2011年11月6日 星期日
R12 AP Invoice Distribution 產生的時間點
R12 在 ap invoice validate 後 Distribution 才會產生資料哦,跟 R11不同,所以一些報表需要改寫
訂閱:
文章 (Atom)