google analytics

meta

adsense

Showing posts with label EBS. Show all posts
Showing posts with label EBS. Show all posts

Sunday, March 29, 2015

Incrementing or Manipulating non date concurrent program parameters without a wrapper for scheduling

Recently I came across a scenario where I had to schedule a concurrent program which contained couple of parameters.

One of the parameter was a date parameters and one was a character parameter which was defaulted to a string value based on SYSDATE when submitted from SRS. This was done using program definition defaults.

The program was scheduled with increment date parameters on and we observed that the non date parameter was the same for all schedules. This is because Oracle only increments date parameters and doesn't honor the defaulting logic setup at the concurrent program definitions.

This is a classic problem and everybody knows the classic solution :

Write a wrapper that implements the defaulting logic and submit the program in question. This wrapper program can be then scheduled.


Oracle provides a much less intrusive and a straight forward approach to achieve this common requirement : Concurrent Request Incrementor

An example incrementor procedure is below. Note that we completely take over the incrementing logic and it becomes our responsibility to increment the data parameters too.

PROCEDURE parameter_incrementor
IS
   l_para1         VARCHAR2 (1000);
   l_defaulted_param    VARCHAR2 (1000);
   l_date_param   VARCHAR2 (1000);
   l_param4        VARCHAR2 (1000);
BEGIN
   -- get parameter1 value
   l_para1 := FND_RESUB_PRIVATE.GET_PARAMETER (1);

   -- get paramter4 value
   l_param4 := FND_RESUB_PRIVATE.GET_PARAMETER (4);

-- contruct the string parameter that needs to be used when resubmitting
-- adn aslo increment the date parameter

      SELECT    'XXXXX_'
             || l_para1
             || 'XXXXXXXXX_'
             || TO_CHAR (SYSDATE, 'MMDDYYYY_HH24MISS'),
             TO_CHAR (TO_DATE (l_param4, 'YYYY/MM/DD HH24:MI:SS') + 1,
                      'YYYY/MM/DD HH24:MI:SS')
        INTO l_defaulted_param, l_date_param
        FROM DUAL;


   -- setting parameter values

   FND_RESUB_PRIVATE.SET_PARAMETER (2, l_defaulted_param);
   FND_RESUB_PRIVATE.SET_PARAMETER (3, l_defaulted_param);
   FND_RESUB_PRIVATE.SET_PARAMETER (4, l_date_param);
EXCEPTION
   WHEN OTHERS
   THEN
      RAISE;

END parameter_incrementor;

Now this procedure can be given as the Incrementor function in the program definition window as shown below.




Friday, March 27, 2015

R12 - SQL Query to get payment method for a vendor site

Unlike in 11i, the payment method code for a vendor site is no longer present in ap_supplier_sites_all table in R12. This is now moved to the Oracle Payments module tables.

The below query can be used to get the payment method code for a given vendor site id in R12:


SELECT ieppm.payment_method_code
FROM ap_supplier_sites_all assa,
   ap_suppliers sup,
   iby_external_payees_all iepa,
   iby_ext_party_pmt_mthds ieppm
WHERE sup.vendor_id                     = assa.vendor_id
AND assa.vendor_site_id                 = iepa.supplier_site_id
AND iepa.ext_payee_id                   = ieppm.ext_pmt_party_id
AND NVL(ieppm.inactive_date, SYSDATE+1) > SYSDATE
AND assa.vendor_site_id                 = :vendor_site_id
AND ieppm.primary_flag                  = 'Y'
AND assa.pay_site_flag                  = 'Y';

LinkWithin

Related Posts Plugin for WordPress, Blogger...