Thursday, May 31, 2012

Unix Find and Replace

Find and replace particular text from script .
This is useful in any install shell scripts which need paths in LDT to be changed based on instance 

mv testfindrep.sh testfindrep.old
sed 's/ebstdev/ebstst1/g' testfindrep.old > testfindrep.sh

Here
s means substitute
ebstdev expr to find
ebstst1 expr to replace with

g means globally - find all

> redirects output to the file


What are default parameters for Concurrent Program / Request Set

Use below queries to get all programs with specific default value, set as parameter value. i.e. You know default value and need to search programs using it
This is useful to find programs having paths defaulted

--- Query to get default parameters for all concurrent programs

SELECT fcp.user_concurrent_program_name, fcp.concurrent_program_name,
       fdfcu.end_user_column_name, fdfcu.DEFAULT_VALUE
  FROM fnd_descr_flex_column_usages fdfcu, fnd_concurrent_programs_vl fcp
 WHERE fcp.concurrent_program_name =
                          REPLACE (fdfcu.descriptive_flexfield_name, '$SRS$.')
   AND fdfcu.DEFAULT_VALUE LIKE '/opt/apps%'   
  
-- Query to get default parameters for all concurrent request sets
SELECT frsv.user_request_set_name, frspa.descriptive_flexfield_name,
       fdfcu.end_user_column_name, frspa.DEFAULT_VALUE
  FROM fnd_request_set_program_args frspa,
       fnd_request_sets_vl frsv,
       fnd_descr_flex_column_usages fdfcu
 WHERE 1 = 1
   AND frspa.DEFAULT_VALUE LIKE '/opt%'
   AND frspa.request_set_id = frsv.request_set_id
   AND fdfcu.descriptive_flexfield_name = frspa.descriptive_flexfield_name
   AND frspa.application_column_name = fdfcu.application_column_name

Setting Operating Unit Mode mo_global.get_current_org_id

In R12 Development, we are using mo_global.get_current_org_id profile in parameters to get default value based on operating unit.
But Most of the cases these values returning null.

Ex: techwah, techwah HK/CN programs.
 
Application Way of doing it is
 
 
Please go to System Administration --Concurrent programs-- Go to Request tab --Select Operating Unit value as Single or Multiple.

This will stamp multi_org_category in fnd_concurrent_programs . 



In case of some restrictions.. backend update also can be used

For this, from back end  we need to run below query or from application  we need to update multi org category from system administration responsibility for that particular concurrent program .

update fnd_concurrent_programs 
set multi_org_category = 'S'
where concurrent_program_name = <conc prog name>