🔹 Join the OracleApps88 Telegram Group - Stay up to date with the latest on Oracle EBS R12 and Oracle Cloud/Fusion Applications. 📌 Telegram Group : https://t.me/OracleApps88

💡 Facing issues copying code/scripts or viewing posts? We're here to help!
📬 Contact on Telegram : https://t.me/apps88
📱 Telegram/WhatsApp: +91 905 957 4321
📧 Email Support: OracleApp88@Yahoo.com

Saturday, December 30, 2017

Query to Get Purchase Order (PO) Details

  SELECT
         poh.type_lookup_code po_type,
         poh.po_header_id,
         poh.segment1 po_number,
         poh.authorization_status po_status,
         poh.comments description,
         pov.vendor_name supplier_name,
         povs.vendor_site_code site_code,
         hrls.location_code ship_to,
         hrlb.location_code bill_to,
         ppf.full_name buyer_name,
         poh.closed_code,
         polt.line_type,
         pol.line_num,
         pol.item_description,
         pol.unit_price,
         pol.quantity,
         gcc.concatenated_segments
    FROM po_headers_all poh,
         po_lines_all pol,
         po_line_locations_all poll
         po_distributions_all pod,
         ap_suppliers pov,
         ap_supplier_sites_all povs,
         hr_locations_all hrls,
         hr_locations_all hrlb,
         per_all_people_f ppf,
         po_line_types polt,
         gl_code_combinations_kfv gcc
   WHERE     1 = 1
         AND polt.line_type_id = pol.line_type_id
         AND povs.vendor_site_id = poh.vendor_site_id
         AND pov.vendor_id = poh.vendor_id
         AND poh.po_header_id = pol.po_header_id
         AND pol.po_line_id = pod.po_line_id
         AND poll.line_location_id = pod.line_location_id
         AND poh.ship_to_location_id = hrls.location_id
         AND poh.bill_to_location_id = hrlb.location_id
         AND poh.agent_id = ppf.person_id
         AND pod.code_combination_id = gcc.code_combination_id
         AND pol.org_id = 142

ORDER BY poh.segment1, pol.line_num

Monday, December 11, 2017

Query To Get Payment Method for Supplier and Supplier Sites

This information is stored in IBY_EXT_PARTY_PMT_MTHDS which joins to IBY_EXTERNAL_PAYEES_ALL by ...
IBY_EXT_PARTY_PMT_MTHDS.ext_pmt_party_id = IBY_EXTERNAL_PAYEES_ALL.ext_payee_id.

This table holds any payment method that has been the default for the site. The current default
will have IBY_EXT_PARTY_PMT_MTHDS.Primary_Flag = 'Y'.

You could use these queries to see the rows for a given supplier site:

This one will show the default payment method (if any) at the Site level:
  SELECT SUP.vendor_name SUPPLIER,
         SITE.vendor_site_code SITE,
         SITE.vendor_site_id,
         SITE.org_id,
         IBEPPM.payment_method_code
    FROM ap_suppliers SUP,
         iby_external_payees_all IBEP,
         iby_ext_party_pmt_mthds IBEPPM,
         ap_supplier_sites_all SITE
   WHERE     SUP.party_id = IBEP.payee_party_id
         AND IBEPPM.ext_pmt_party_id = IBEP.ext_payee_id
         AND SITE.vendor_id = SUP.vendor_id
         AND IBEP.supplier_site_id = SITE.vendor_site_id
         AND IBEPPM.primary_flag = 'Y'
         AND SUP.vendor_name = '<Supplier Name>'
ORDER BY SUPPLIER, SITE;


This one will show the default payment method (if any) at the Supplier level:
SELECT SUP.vendor_name SUPPLIER, IBEPPM.payment_method_code
  FROM ap_suppliers SUP,
       iby_external_payees_all IBEP,
       iby_ext_party_pmt_mthds IBEPPM
 WHERE     SUP.party_id = IBEP.payee_party_id
       AND IBEPPM.ext_pmt_party_id = IBEP.ext_payee_id
       AND IBEP.supplier_site_id IS NULL
       AND SUP.vendor_name = '<Supplier Name>';


This will show all Payees associated with a given supplier. The payee associated with a Supplier site will have a value for Supplier_Site_ID
SELECT SUP.vendor_name, PAYEE.*
  FROM iby_external_payees_all PAYEE, ap_suppliers SUP
 WHERE PAYEE.payee_party_id = SUP.party_id

       AND SUP.vendor_name = '<Supplier Name>'

Saturday, December 2, 2017

Script to update the Supplier Sites "auto_tax_calc_flag" (Options : Y,N and NULL)

DECLARE
CURSOR CUR_SITES
IS
  select
    asa.vendor_site_id
  from
    ap_suppliers aps
    ,ap_supplier_sites_all asa
  where 1=1
    and aps.vendor_id = asa.vendor_id
    and NVL(vendor_type_lookup_code,0) != 'EMPLOYEE'
    and asa.inactive_date is null
    and asa.org_id = 204
    and aps.segment1 in ('5689')
  order by asa.auto_tax_calc_flag,aps.VENDOR_NAME,asa.vendor_site_code
  ;
 
  l_vendor_site_id           NUMBER;
  l_SITES_msg_count          NUMBER;
  l_SITES_msg_data           VARCHAR2(4000);
  l_SITES_return_status      VARCHAR2(10);
  l_vendor_site_rec          AP_VENDOR_PUB_PKG.r_vendor_site_rec_type;

BEGIN
  FND_GLOBAL.apps_initialize(1230,50239,200);

FOR SITES_REC IN CUR_SITES
 LOOP
 l_vendor_site_id                       := SITES_REC.VENDOR_SITE_ID;
 l_vendor_site_rec.AUTO_TAX_CALC_FLAG   := 'N';

 AP_VENDOR_PUB_PKG.UPDATE_VENDOR_SITE
 (p_api_version     => '1.0',
  p_init_msg_list    => FND_API.G_TRUE ,
  p_commit           => FND_API.G_TRUE,
  p_validation_level => FND_API.G_VALID_LEVEL_FULL,
  p_vendor_site_id   => l_vendor_site_id,
  p_vendor_site_rec  => l_vendor_site_rec,
  x_return_status    => l_SITES_return_status,
  x_msg_count        => l_SITES_msg_count,
  x_msg_data         => l_SITES_msg_data
  );

  IF l_SITES_return_status = 'S'
  THEN
    COMMIT;
    dbms_output.put_line('Vendor Site ID : '||l_vendor_site_id||' Status is : '||l_SITES_return_status); 
  ELSE
    ROLLBACK;
    dbms_output.put_line('Vendor Site ID : '||l_vendor_site_id||' Status is : '||l_SITES_return_status);   
  END IF;

  FOR I IN 1..l_SITES_msg_count
  LOOP
    l_SITES_msg_data := SUBSTR(FND_MSG_PUB.GET(p_encoded=>'T'),1,255);
    dbms_output.put_line(l_SITES_msg_data);
  END LOOP ;
 END LOOP ;

END;


If you are facing any issues while copying the Code/Script or any issues with Posts, Please send a mail to OracleApp88@Yahoo.com or message me at @apps88 or +91 905 957 4321 in telegram.
Best Blogger TipsGet Flower Effect