Thursday 21 February 2013

How to get Request Id for the program run

Below SQL gives the Concurrent Request information,  parameter is concurrent program name.

select fcr.request_id request_id,
fcp.user_concurrent_program_name,substr(resp.responsibility_name ,1,50) responsibility_name,
to_char(fcr.ACTUAL_START_DATE, 'DD-MON-YYYY HH24:MI:SS') Start_date,
to_char(fcr.ACTUAL_COMPLETION_DATE, 'DD-MON-YYYY HH24:MI:SS') completion_date,
round(((fcr.ACTUAL_COMPLETION_DATE-fcr.ACTUAL_START_DATE)*24*60),2) Time_taken,
substr(users.description,1,30) user_description,
substr(fcp.user_concurrent_program_name,1,55) program_name,
fcr.phase_code,fcr.status_code,users.user_name,fcr.argument_text
from apps.fnd_concurrent_requests fcr,
apps.fnd_concurrent_programs_tl fcp,
apps.fnd_user users,
apps.fnd_responsibility_tl resp
where 1 = 1
and fcr.responsibility_id = resp.responsibility_id
and fcr.requested_by = users.user_id
and fcp.concurrent_program_id = fcr.concurrent_program_id
and fcr.request_date > (sysdate - 200)
and fcp.user_concurrent_program_name like &User_Conc_prog_name
order by fcr.request_date desc ;

How to get object definition from database

Below statement gets the database object definition from database.

select dbms_metadata.get_ddl('OBJECT_TYPE','OBJECT_NAME','SCHEMA') from dual;

Object_type,Object_name and Schema should be in Caps.

How to set Org Context in R12

Set org context in R12


The SQL command to set the ORG_ID prior to running a script is:


SQL> exec mo_global.init('AR');
exec mo_global.set_policy_context('S','&org_id');
Enter the org_id when prompted.


The procedure - mo_global.set_policy_context has two parameters
p_access_mode & p_org_id


p_access_mode          Description
S In case you want your current session to work against Single ORG_ID
M In case you want your current session to work against multiple ORG_IDs


p_org_id: Only applicable if p_access_mode is passed value of "S"


If using Toad
Begin
mo_global.set_policy_context(‘S’, &org_id);
End;


Set org context in 11i:


The SQL command to set the ORG_ID prior to running a script is:
SQL> execute dbms_application_info.set_client_info(&org_id);
Enter the org_id when prompted.
If using Toad
Begin
fnd_client_info.set_org_context(&org_id);
End;

Wednesday 20 February 2013

How to create element entries and value in Payroll using API

1) API for creating element entries is PAY_ELEMENT_ENTRY_API.create_element_entry.
2) The procedure has lot of parameters, it mainly depends from project to project which all parameters value have to be passed.
3) There are few mandatory parameters which can be found in the PAY_ELEMENT_ENTRY_API spec.

4) Below is the example API for creating element entry with out any value.

         PAY_ELEMENT_ENTRY_API.create_element_entry
                           (p_validate                    => FALSE
                           ,p_effective_date              => to_date('01-JAN-2013','DD/MM/YYYY')--trunc('01-JAN-2013')
                           ,p_business_group_id           => emp_rec.business_group_id
                           ,p_assignment_id               => emp_rec.assignment_id
                           ,p_element_link_id             => element_rec.element_link_id
                           ,p_entry_type                  => 'E'
                           ,p_input_value_id1             => element_rec.input_value_id
                           ,p_entry_value1                => NULL
                           ,p_effective_start_date        => ld_effective_start_date
                           ,p_effective_end_date          => ld_effective_end_date
                           ,p_element_entry_id            => ln_element_entry_id
                           ,p_object_version_number       => ln_object_version_number
                           ,p_create_warning              => lc_create_warning
                            );

5) Also refer the table pay_element_types_f  ,pay_element_links_f   ,pay_input_values_f   for much understanding about the element entries.

How to disable Correction or Update button on Oracle HRMS screen

1) In Oracle apps HRMS Employee screen, after any changes to the employee, two options popup.
Correction and Update.

2) I have seen some clients asking to disable the correction button, the button cannot be removed by Personalization.

3) This can be done by using CUSTOM Pll.

4) Go to procedure style in CUSTOM Pll, and add the condition on DT_SELECT_MODE.
   if event_name = 'DT_SELECT_MODE'
        then
return custom.after;
else
return custom.standard;
end if;

5) Then after that go to event and add the below to disable the Correction Button.

  if (event_name = 'DT_SELECT_MODE') then
    if name_in('GLOBAL.G_DT_CORRECTION') = 'TRUE' then
    copy('FALSE', 'GLOBAL.G_DT_CORRECTION');
    copy('TRUE', 'GLOBAL.G_DT_UPDATE');
    end if;
    end if;

6) This can be applied to any button after changing the data in Employee screen.

For more details, refer the implementation guide.
http://docs.oracle.com/cd/E18727_01/doc.121/e13535.pdf

Friday 8 February 2013

Oracle apps initialize

Oracle apps initialize

fnd_global.APPS_INITIALIZE(user_id=>l_user_id,
                                                   resp_id=>l_resp_id,
                                                resp_appl_id=>l_resp_appl_id);

    l_user_id is the fnd user ID which will be utilized during the call.
    l_resp_id is the responsibility ID
    l_resp_appl_id is the responsibility application ID.