2022年11月22日 星期二

[EBS]OM 銷售到出倉所經歷的表

 https://www.twblogs.net/a/5b8cf6cd2b7177188337aec1

2022年11月15日 星期二

[EBS]查看某個Request的Output File

 

Oracle EBS標準功能中request執行完後只能看到自己執行的結果(view output), 

系統人員有時要幫忙查看問題就顯得有些麻煩...

2023更新: Responsibility>Application Developer > Concurrent > Requests > 可以Find其他人執行的結果

查看有個function可以取到request的output, 取得EBS report網址:

SELECT fnd_webfile.get_url(
                           file_type   => 4,                --輸出類行
                           id          => 60240818,         --Request_id
                           gwyuid      => '',               --不使用 (環境參數)
                           two_task    => '',               --不使用 (Two Task)
                           expire_time => 10                --URL保留分鐘數
                          ) url
  FROM dual;


/* Define file types for get_url */

process_log constant number := 1;

icm_log constant number := 2;

request_log constant number := 3;

request_out constant number := 4;

request_mgr constant number := 5;

frd_log constant number := 6;

generic_log constant number := 7;

generic_trc constant number := 8;

generic_ora constant number := 9;

generic_cfg constant number := 10;

context_file constant number := 11;

generic_text constant number := 12;

generic_binary constant number := 13;

request_xml_output constant number :=14;




DECLARE
   l_request_id   NUMBER := :P_REQ_ID;                       -- The request id
   l_two_task     VARCHAR2 (256);
   l_gwyuid       VARCHAR2 (256);
   l_url          VARCHAR2 (1024);
BEGIN
   -- Get the value of the profile option named, Gateway User ID (GWYUID)
   --- l_gwyuid := fnd_profile.VALUE ('APPLSYSPUB/PUB');

   SELECT   profile_option_value
     INTO   l_gwyuid
     FROM   fnd_profile_options o, fnd_profile_option_values ov
    WHERE       profile_option_name = 'GWYUID'
            AND o.application_id = ov.application_id
            AND o.profile_option_id = ov.profile_option_id;


   -- Get the value of the profile option named, Two Task(TWO_TASK)

   SELECT   profile_option_value
     INTO   l_two_task
     FROM   fnd_profile_options o, fnd_profile_option_values ov
    WHERE       profile_option_name = 'TWO_TASK'
            AND o.application_id = ov.application_id
            AND o.profile_option_id = ov.profile_option_id;


   l_url :=
      fnd_webfile.get_url (file_type     => fnd_webfile.request_out, -- for out file
                           ID            => l_request_id,
                           gwyuid        => l_gwyuid,
                           two_task      => l_two_task,
                           expire_time   => 500-- minutes, security!.
                           );

   DBMS_OUTPUT.put_line (l_url);

END;


2022年11月10日 星期四

[EBS] Sales Order Bill_to and Ship_to Address

 Order To Bill_to and Ship_to Customer Address

https://jayantaapps.blogspot.com/2017/07/order-to-bill-to-customer-address.html


----------------------Bill To Customer-------------------------------
SELECT hp.party_name,
       hp.party_number,
       hca.account_number,
       hca.cust_account_id,
       hp.party_id,
       hps.party_site_id,
       hcsu.cust_acct_site_id,
       hps.location_id,
       hl.address1,
       hl.address2,
       hl.address3,
       hl.city,
       hl.state,
       ter.nls_territory,
       hl.postal_code,
       hl.province,
       hcsu.site_use_code,
       hcsu.site_use_id,
       hcsa.bill_to_flag
FROM hz_parties hp,
     hz_party_sites hps,
     hz_locations hl,
     hz_cust_accounts_all hca,
     hz_cust_acct_sites_all hcsa,
     hz_cust_site_uses_all hcsu,
     fnd_territories ter
WHERE     hp.party_id = hps.party_id
      AND hps.location_id = hl.location_id
      AND hp.party_id = hca.party_id
      AND hcsa.party_site_id = hps.party_site_id
      AND hcsu.cust_acct_site_id = hcsa.cust_acct_site_id
      AND hca.cust_account_id = hcsa.cust_account_id
      AND hl.country = ter.territory_code
      AND hcsu.site_use_code = 'BILL_TO'
      AND hca.cust_account_id=:SOLD_TO_ORG_ID --Select SOLD_TO_ORG_ID  From oe_order_headers_all
      and hcsu.site_use_id=:INVOICE_TO_ORG_ID --225009  Select INVOICE_TO_ORG_ID From oe_order_headers_all

----------------------Ship To Customer-------------------------------
/* Formatted on 7/17/2017 3:05:46 PM (QP5 v5.115.810.9015) */
SELECT hp.party_name,
       hp.party_number,
       hca.account_number,
       hca.cust_account_id,
       hp.party_id,
       hps.party_site_id,
       hcsu.cust_acct_site_id,
       hps.location_id,
       hl.address1,
       hl.address2,
       hl.address3,
       hl.city,
       hl.state,
       ter.nls_territory,
       hl.postal_code,
       hl.province,
       hcsu.site_use_code,
       hcsu.site_use_id,
       hcsa.bill_to_flag,
       hcsu.location
FROM hz_parties hp,
     hz_party_sites hps,
     hz_locations hl,
     hz_cust_accounts_all hca,
     hz_cust_acct_sites_all hcsa,
     hz_cust_site_uses_all hcsu,
     fnd_territories ter
WHERE     hp.party_id = hps.party_id
      AND hps.location_id = hl.location_id
      AND hp.party_id = hca.party_id
      AND hcsa.party_site_id = hps.party_site_id
      AND hcsu.cust_acct_site_id = hcsa.cust_acct_site_id
      AND hca.cust_account_id = hcsa.cust_account_id
      AND hl.country = ter.territory_code
      AND hcsu.site_use_code = 'SHIP_TO'
      AND hca.cust_account_id=:SOLD_TO_ORG_ID --Select SOLD_TO_ORG_ID From oe_order_headers_all
      and hcsu.site_use_id=:SHIP_TO_ORG_ID --Select SHIP_TO_ORG_ID  From oe_order_headers_all 

--- Upto INR 40000 off on Desktop CPUs & All in One Computers; No Cost EMI available

2022年11月3日 星期四

JS樂透程式範例

 


While迴圈

var lottery = [];
var n;

while (lottery.length<6) {
  n=Math.floor(Math.random()*49)+1;
  if (lottery.indexOf(n)===-1) {
    lottery.push(n);    
  }
}

console.log(lottery);


For迴圈

var lottery = [];
var n;

for(i = 0; i < 6; i++){
    n=Math.floor(Math.random()*49)+1;
    if (lottery.indexOf(n)===-1) {
    lottery.push(n);    
  }
}

console.log(lottery);

2022年11月2日 星期三

JS邏輯運算子

會先將值轉換為布林值, 再取兩者其中之一.


var a = 123;
var b = "abc";
var c = null;
var d = undefined;
//undefined, Null, +0, -0 or NaN, 空字串""或''會轉換為falsy, 其他為truthy

console.log(a||c); // ||(or) 若第一個值轉換為truthy, 則回傳第一個值
console.log(c||a); // ||(or) 若第一個值轉換為falsy, 則回傳第二個值
console.log(a&&c); // &&(and) 若第一個truthy, 則回傳第二個值
console.log(c&&a); // &&(and) 若第一個值為falsy, 則回傳第一個值