Hxc_timestore_deposit.create_attribute  doubt in OTL

Hi,
Could you tell me the need to create Attributes using hxc_timestore_deposit API's.
1) Basically i want to know ....why do we create these attributes , if you have any code example...could you please explain.
2) How do we know...how many attributes we need to create for a time card, I read a blog which says i have check the mapping...could you give more details.
hxc_timestore_deposit.create_attribute
Thanks.

i have initialized the session.
NOTE : (the earlierissueis with date formats)
Also the latest update is , the program works fine with the single records like
Project Task ExpenditureType mon tue wed thu fri
ABCD 123 Admin 9 9 9 9 9
but when there are mutiple projects on a single day like
Project Task ExpenditureType mon tue wed thu fri
ABCD 123 Admin 4 4 4 4 4
XYZ 123 Admin 4 4 4 4 4
the program hxc_timestore_deposit.execute_deposit_process completing normal with out populating the OUT variables. Also no error messages too.
Hence the timecard is not visible from the application as the time is not deposited in time store.
Advise please.

Similar Messages

  • OTL hxc_timestore_deposit.create_attribute usage

    Hello Everyone,
    I have the following requirement:
    Users may enter timecards manually and submit it.
    I have to write a program which will pick up these submitted timecards and based on some validation, need to create some attribute for some detail entries.
    How do I go about using the API - hxc_timestore_deposit.create_attribute?
    I just have to create an attribute record against the already existing detail record.
    Regards.

    i have initialized the session.
    NOTE : (the earlierissueis with date formats)
    Also the latest update is , the program works fine with the single records like
    Project Task ExpenditureType mon tue wed thu fri
    ABCD 123 Admin 9 9 9 9 9
    but when there are mutiple projects on a single day like
    Project Task ExpenditureType mon tue wed thu fri
    ABCD 123 Admin 4 4 4 4 4
    XYZ 123 Admin 4 4 4 4 4
    the program hxc_timestore_deposit.execute_deposit_process completing normal with out populating the OUT variables. Also no error messages too.
    Hence the timecard is not visible from the application as the time is not deposited in time store.
    Advise please.

  • OTL Time Upload Requirement

    Hi there,
    We have a requirement where we need to capture two additional pieces of information on the timecard which are mapped to input values sequence 12 and 13 on the element.
    We also have a custom requirement for sites with no application access to allow them to provide CSVs containing multiple employees time which we wish to upload. The original plan was to use the timestore_deposit_api to perform the upload of the times into OTL. Does anyone know if this or another API will allow us to upload time entries which include these additional input values.
    Has anyone done such a customization?
    Any advice on this would be very much appreciated.
    Many Thanks
    Kev

    Kev,
    Each such input value will be a extra attribute. So just use hxc_timestore_deposit. create_attribute api for those extra attributes and attach to each detail building block.
    --Shiv                                                                                                                                                                                                                                                                                                                                                                                               

  • Hxc_timestore_deposit.create_time_entry creating negative values

    Hi,
    I am trying to create time entry through back end using API (hxc_timestore_deposit.create_time_entry) as
    declare
    l_time_building_block_id hxc_time_building_blocks.time_building_block_id%TYPE;
    l_tbl_attributes_info hxc_self_service_time_deposit.app_attributes_info ;
    l_return_status varchar2(30);
    l_tbl_timecard_info hxc_self_service_time_deposit.timecard_info ; --hxc_block_table_type;
    begin
    hxc_timestore_deposit.create_time_entry (
    p_start_time=> fnd_date.canonical_to_date('2009/09/02 09:00:00'),
    p_stop_time=> fnd_date.canonical_to_date('2009/09/02 17:00:00'),
    p_resource_id=> 7427, --9389, -- Identifies a person on our DB, REPLACE WITH YOUR IDs
    p_app_blocks=> l_tbl_timecard_info,
    p_app_attributes=> l_tbl_attributes_info,
    p_time_building_block_id=> l_time_building_block_id
    l_return_status := fnd_api.g_ret_sts_success;
    DBMS_OUTPUT.PUT_LINE('TESTING of hxc_timestore_deposit');
    DBMS_OUTPUT.PUT_LINE('return_status : ' ||l_return_status);
    DBMS_OUTPUT.PUT_LINE(' l_time_building_block_id :- '||l_time_building_block_id);
    end;
    Above code is creating negative values for time_building_block_id.
    Can anyone pls help me.
    Thanks
    Rutuja

    Hi,
    I have developed one more script to create a time card.
    It is also generating negative values.
    Can anyone knows the problem
    Pls help me regarding the same.
    Thanks in advance.
    Rutuja
    DECLARE
    -- Constant declarations
    -- This is the appl_id for OTL, do not change
    c_otl_appl_id CONSTANT NUMBER (3) := 809;
    c_proj_attr1 CONSTANT VARCHAR2 (7) := 'Task_Id';
    c_proj_attr2 CONSTANT VARCHAR2 (10) := 'Project_Id';
    c_proj_attr3 CONSTANT VARCHAR2 (16) := 'Expenditure_Type';
    c_proj_attr4 CONSTANT VARCHAR2 (19) := 'Expenditure_Comment';
    c_proj_attr5 CONSTANT VARCHAR2 (23) := 'SYSTEM_LINKAGE_FUNCTION';
    v_msg_info                VARCHAR2(20000);
    x_status_msg                VARCHAR2(20000);
    vx_msg_index_out           NUMBER;
    -- Variable declarations
    -- declare the PL/SQL Table that will hold the complete timecard (all the BBs)
    l_tbl_timecard_info hxc_self_service_time_deposit.timecard_info;
    -- declare the PL/SQL Table that will hold all the attributes
    l_tbl_attributes_info hxc_self_service_time_deposit.app_attributes_info;
    -- declare the PL/SQL Table that will hold the messages returned by the API
    l_tbl_messages hxc_self_service_time_deposit.message_table;
    -- person ID that this TC belongs to, Replace with your own
    l_person_id per_all_people_f.person_id%TYPE := 2638;--9389;
    -- Replace with your own IDs
    l_task_id VARCHAR2 (4) := '2011';--HOLIDAY--'221';
    -- (l_project_id is NOT the same as task id, they just happen to have the
    -- same ID on our database)
    l_project_id VARCHAR2 (3) := '803';--'221';
    -- Replace with your own values
    l_expenditure_type VARCHAR2 (15) := 'Professional';
    l_ot_expenditure_type VARCHAR2 (15) := 'Overtime';
    l_system_linkage_id VARCHAR2 (15) := 'ST';
    l_ot_system_linkage_id VARCHAR2 (15) := 'OT';
    -- Will hold TC_ID, returned by the deposit process
    l_new_timecard_id NUMBER;
    -- Will hold TC ovn, returned by the deposit process
    l_new_timecard_ovn NUMBER;
    l_message fnd_new_messages.message_text%TYPE;
    l_start_time DATE := fnd_date.canonical_to_date('2009/09/16 00:00:00');
    l_stop_time DATE := fnd_date.canonical_to_date('2009/09/22 23:59:59');
    l_tc_bb_id hxc_time_building_blocks.time_building_block_id%TYPE;
    l_day_bb_id hxc_time_building_blocks.time_building_block_id%TYPE;
    l_detail_bb_id hxc_time_building_blocks.time_building_block_id%TYPE;
    l_time_attribute_id hxc_time_attributes.time_attribute_id%TYPE;
    BEGIN
    -- First initialize your session, this needs to be done for internal reasons so
    -- the TimeStore knows who is trying to deposit the information. When you log
    -- into SS, the same is done for you by the framework, here however we have to do
    -- it manually.
    dbms_application_info.set_client_info(206);
    FND_GLOBAL.APPS_INITIALIZE(1781,51681,809 );-- This is the appl_id for OTL, do not change
    -- PART 1: POPULATE TABLES --
    -- First populate the timecard PL/SQL table:
    -- Start with the TIMECARD BB
    hxc_timestore_deposit.create_timecard_bb(
    p_start_time=> l_start_time,
    p_stop_time=> l_stop_time,
    p_resource_id=> l_person_id,
    p_comment_text=> 'Created using API: Weekly Project TC',
    p_app_blocks=> l_tbl_timecard_info,
    p_time_building_block_id=> l_tc_bb_id);
    DBMS_OUTPUT.PUT_LINE(' l_tc_bb_id :- '||l_tc_bb_id);
    FOR j IN 1..FND_MSG_PUB.Count_Msg
         LOOP
    FND_MSG_PUB.GET( p_msg_index => -1
    ,p_encoded => 'F'
    ,p_data => v_msg_info
    ,p_msg_index_out => vx_msg_index_out);
    x_status_msg := x_status_msg || v_msg_info;
         END LOOP;                         
    DBMS_OUTPUT.PUT_LINE(' 1st API STATUS :- '||x_status_msg);
    COMMIT;                         
    -- Now we create the DAY BB, 7 in total, and since they are all the same we
    -- will loop 7 times
    FOR i_day IN 0 .. 6
    LOOP
    hxc_timestore_deposit.create_day_bb (
    p_day => TRUNC (l_start_time)+ i_day,
    p_parent_building_block_id=> l_tc_bb_id, -- returned by create_timecard_bb
    p_comment_text=> 'Created using API',
    p_app_blocks=> l_tbl_timecard_info,
    p_time_building_block_id=> l_day_bb_id);
    DBMS_OUTPUT.PUT_LINE(' l_day_bb_id :- '||l_day_bb_id);
    v_msg_info := NULL;
    x_status_msg := NULL;
    vx_msg_index_out := NULL;
    FOR j IN 1..FND_MSG_PUB.Count_Msg
         LOOP
    FND_MSG_PUB.GET( p_msg_index => -1
    ,p_encoded => 'F'
    ,p_data => v_msg_info
    ,p_msg_index_out => vx_msg_index_out);
    x_status_msg := x_status_msg|| v_msg_info;
         END LOOP;                         
                             DBMS_OUTPUT.PUT_LINE(' 2nd API STATUS :- '||x_status_msg);
    -- The next call would also work but we choose to use the first one
    -- since we know the TIMECARD's Id. If you do not know the ID you should
    -- use this next call commented out here.
    /* hxc_timestore_deposit.create_day_bb (
    p_day => TRUNC (l_start_time)
    + i_day,
    p_resource_id=> l_person_id,
    p_comment_text=> 'Created using API',
    p_app_blocks=> l_tbl_timecard_info,
    p_time_building_block_id=> l_day_bb_id
    -- We can attache the DETAIL BB for every DAY BB that represents 'normal'
    -- work hours as well here as they are all the same
    -- We only need to do this for weekdays though
    IF i_day < 5
    THEN
    hxc_timestore_deposit.create_detail_bb (
    p_type=> 'MEASURE',
    p_measure=> 8,
    p_parent_building_block_id=> l_day_bb_id,
    p_comment_text=> 'Created using API: NT',
    p_app_blocks=> l_tbl_timecard_info,
    p_app_attributes=> l_tbl_attributes_info,
    p_time_building_block_id=> l_detail_bb_id
    DBMS_OUTPUT.PUT_LINE(' l_detail_bb_id :- '||l_detail_bb_id);
    v_msg_info := NULL;
    x_status_msg := NULL;
    vx_msg_index_out := NULL;
    FOR j IN 1..FND_MSG_PUB.Count_Msg
         LOOP
    FND_MSG_PUB.GET( p_msg_index => -1
    ,p_encoded => 'F'
    ,p_data => v_msg_info
    ,p_msg_index_out => vx_msg_index_out);
    x_status_msg := x_status_msg|| v_msg_info;
         END LOOP;                         
                             DBMS_OUTPUT.PUT_LINE(' 3nd API STATUS :- '||x_status_msg);
    -- The next call would also work but we choose to use the first one
    -- since we know the DAY's Id. If you do not know the ID you should
    -- use this next call commented out here. In fact we use it ourselves
    -- later to add the overtime.
    /* hxc_timestore_deposit.create_time_entry (
    p_measure=> 8,
    p_day => TRUNC (l_start_time)
    + i_day,
    p_resource_id=> l_person_id,
    p_comment_text=> 'Created using API: NT',
    p_app_blocks=> l_tbl_timecard_info,
    p_app_attributes=> l_tbl_attributes_info,
    p_time_building_block_id=> l_detail_bb_id
    -- We can also attach the attributes to every BB that represent
    -- 'normal' work hours
    -- Attribute1
    hxc_timestore_deposit.create_attribute (
    p_building_block_id=> l_detail_bb_id,
    p_attribute_name=> c_proj_attr1,
    p_attribute_value=> l_task_id,
    p_app_attributes=> l_tbl_attributes_info
    -- Attribute2
    hxc_timestore_deposit.create_attribute (
    p_building_block_id=> l_detail_bb_id,
    p_attribute_name=> c_proj_attr2,
    p_attribute_value=> l_project_id,
    p_app_attributes=> l_tbl_attributes_info
    -- Attribute3
    hxc_timestore_deposit.create_attribute (
    p_building_block_id=> l_detail_bb_id,
    p_attribute_name=> c_proj_attr3,
    p_attribute_value=> l_expenditure_type,
    p_app_attributes=> l_tbl_attributes_info
    -- Attribute4
    hxc_timestore_deposit.create_attribute (
    p_building_block_id=> l_detail_bb_id,
    p_attribute_name=> c_proj_attr4,
    p_attribute_value=> 'Expenditure Comment created by API',
    p_app_attributes=> l_tbl_attributes_info
    -- Attribute5
    hxc_timestore_deposit.create_attribute (
    p_building_block_id=> l_detail_bb_id,
    p_attribute_name=> c_proj_attr5,
    p_attribute_value=> l_system_linkage_id,
    p_app_attributes=> l_tbl_attributes_info
    END IF; -- Only for weekdays
    END LOOP; -- End creating normal working days + time
    -- And now we add the Overtime to Tuesday and Wednesday
    -- We have to use create_time_entry here because we do not have the ID
    -- for the Wednesday TBB anymore, using create_time_entry we do not need it
    -- Tuesday
    hxc_timestore_deposit.create_time_entry (
    p_measure=> 1,
    p_day => TRUNC (l_start_time)+ 1,
    p_resource_id=> l_person_id,
    p_comment_text=> 'Created using API: OT',
    p_app_blocks=> l_tbl_timecard_info,
    p_app_attributes=> l_tbl_attributes_info,
    p_time_building_block_id=> l_detail_bb_id
    -- Attribute1
    hxc_timestore_deposit.create_attribute (
    p_building_block_id=> l_detail_bb_id,
    p_attribute_name=> c_proj_attr1,
    p_attribute_value=> l_task_id,
    p_app_attributes=> l_tbl_attributes_info
    -- Attribute2
    hxc_timestore_deposit.create_attribute (
    p_building_block_id=> l_detail_bb_id,
    p_attribute_name=> c_proj_attr2,
    p_attribute_value=> l_project_id,
    p_app_attributes=> l_tbl_attributes_info
    -- Attribute3
    hxc_timestore_deposit.create_attribute (
    p_building_block_id=> l_detail_bb_id,
    p_attribute_name=> c_proj_attr3,
    p_attribute_value=> l_ot_expenditure_type,
    p_app_attributes=> l_tbl_attributes_info
    -- Attribute4
    hxc_timestore_deposit.create_attribute (
    p_building_block_id=> l_detail_bb_id,
    p_attribute_name=> c_proj_attr4,
    p_attribute_value=> 'Expenditure Comment created by API',
    p_app_attributes=> l_tbl_attributes_info
    -- Attribute5
    hxc_timestore_deposit.create_attribute (
    p_building_block_id=> l_detail_bb_id,
    p_attribute_name=> c_proj_attr5,
    p_attribute_value=> l_ot_system_linkage_id,
    p_app_attributes=> l_tbl_attributes_info
    -- Wednesday
    hxc_timestore_deposit.create_time_entry (
    p_measure=> 2,
    p_day => TRUNC (l_start_time)
    + 2,
    p_resource_id=> l_person_id,
    p_comment_text=> 'Created using API: OT',
    p_app_blocks=> l_tbl_timecard_info,
    p_app_attributes=> l_tbl_attributes_info,
    p_time_building_block_id=> l_detail_bb_id
    -- Attribute1
    hxc_timestore_deposit.create_attribute (
    p_building_block_id=> l_detail_bb_id,
    p_attribute_name=> c_proj_attr1,
    p_attribute_value=> l_task_id,
    p_app_attributes=> l_tbl_attributes_info
    -- Attribute2
    hxc_timestore_deposit.create_attribute (
    p_building_block_id=> l_detail_bb_id,
    p_attribute_name=> c_proj_attr2,
    p_attribute_value=> l_project_id,
    p_app_attributes=> l_tbl_attributes_info
    -- Attribute3
    hxc_timestore_deposit.create_attribute (
    p_building_block_id=> l_detail_bb_id,
    p_attribute_name=> c_proj_attr3,
    p_attribute_value=> l_ot_expenditure_type,
    p_app_attributes=> l_tbl_attributes_info
    -- Attribute4
    hxc_timestore_deposit.create_attribute (
    p_building_block_id=> l_detail_bb_id,
    p_attribute_name=> c_proj_attr4,
    p_attribute_value=> 'Expenditure Comment created by API',
    p_app_attributes=> l_tbl_attributes_info
    -- Attribute5
    hxc_timestore_deposit.create_attribute (
    p_building_block_id=> l_detail_bb_id,
    p_attribute_name=> c_proj_attr5,
    p_attribute_value=> l_ot_system_linkage_id,
    p_app_attributes=> l_tbl_attributes_info
    -- END OF PART 1: POPULATE TABLES --
    -- PART 2: DEPOSIT TIMECARD --
    -- Now we call the deposit process, passing in the PL/SQL tables we just
    -- created and populated
    hxc_timestore_deposit.execute_deposit_process (
    p_validate=> FALSE,
    p_app_blocks=> l_tbl_timecard_info,
    p_app_attributes=> l_tbl_attributes_info,
    p_messages=> l_tbl_messages,
    p_mode=> 'SUBMIT',
    p_deposit_process=> 'OTL Deposit Process',
    p_timecard_id=> l_new_timecard_id,
    p_timecard_ovn=> l_new_timecard_ovn
    -- END OF PART 2: DEPOSIT TIMECARD --
    END;
    COMMIT;

  • OTL: Purchasing timecard attributes for Contingent worker

    Hi,
    I am trying to create a timecard for a Contingent worker (a purchasing timecard).
    Using the APIs, I am able to create the timecard in the specific template (having PO NUmber & PO Line Number).
    But the issue I am facing is :
    All the fields are getting populated (project, task, line number), but the 'PO Number' & 'Type' are not getting populated.
    hxc_timestore_deposit.create_attribute(p_building_block_id => l_detail_bb_st_id,
    p_attribute_name => 'Expenditure_Type',
    p_attribute_value => 'Contract Performance Manager',
    p_deposit_process => 'Projects Deposit Process',
    p_app_attributes => l_tbl_attributes_info);
    hxc_timestore_deposit.create_attribute(p_building_block_id => l_detail_bb_st_id,
    p_attribute_name => 'PO Price Type',
    p_attribute_value => 'Standard Rate',
    p_deposit_process => 'Projects Deposit Process',
    p_app_attributes => l_tbl_attributes_info);
    hxc_timestore_deposit.create_attribute(p_building_block_id => l_detail_bb_st_id,
    p_attribute_name => 'PO Header Id',
    p_attribute_value => P_PO_HEADER_ID,
    p_deposit_process => 'Projects Deposit Process',
    p_app_attributes => l_tbl_attributes_info);
    hxc_timestore_deposit.create_attribute(p_building_block_id => l_detail_bb_st_id,
    p_attribute_name => 'PO Line Id',
    p_attribute_value => P_PO_LINE_ID,
    p_deposit_process => 'Projects Deposit Process',
    p_app_attributes => l_tbl_attributes_info);
    * PO Line number is getting populated correctly.
    Please help !!!
    Thanks,
    Sambit

    Did you change the Application set to Proj and Payroll? Also can you put a description of what exactly you want to do with respect to payroll element so that we can gauge the exact layout and setup required.
    --Shiv                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • OTL [Timecard] Modification

    Gurus,
    I have a doubt in OTL modification task...
    The task is,on the Timecared in the column 'Total', '0'[hrs]entry shouldn't get printed on reports
    [i.e '0' entry can submit to database but it shouldn't show on reports.
    OR
    while commiting to database '0' value should be saved as 'null' to database ]
    Exactly what can be done in this case?
    So,What i tried is...
    I took a small scenario like
    1>I created a form which displays records of some table...
    2>then i did 'Insert record' functionality ..
    both[1,2] are working fine.It is displying the inserted record on the form and record is getting saved to database also. :)
    NOW according to task, if i insert '0' for some column say column 'Salary' then while commiting to database that '0' value should be saved as 'null' to database .
    so, I'm lilttle confused wat can be done 'here' at this step ?
    Thanks in adv
    -sDJ

    If you have already extended the EO or VO then iyou can override the setSalary() method
    and in that
    if (value == 0)
      value = null;
    }Else when clicking on apply/save button extend the controller and set the VO attribute corresponding to salary when it is zero to null.
    Thanks
    --Anil
    http://oracleanil.blogspot.com

  • OTL -Timecard Modifications

    Guruz,
    I'm vvvery much new to OAF ...
    well,I have doubts in OTL modification task, one of them is...
    as per requirement ,in the time entry -> create timecard , where we put hrs worked in Mon ,Tues columns etc..
    if some employee has not worked or absent on that particular day by default Hrs entry is 0 [obviously] ..
    Now while saving that timecard, according to requirement 0 shouldn't get stored to db..instead it should be 'null' or blank space etc..
    Exactly what can be done in this case? ...What path should i follow ?
    I have gone through many packages,COs,VOs related to timecard page[This page doesn't have EO]...
    will provide more details if required .
    Thanks in Adv. :)
    -sDJ
    Edited by: user12863742 on Jan 18, 2011 12:52 PM

    Hi,
    ---The OTL Time card page is dynamically created one and vo also.
    ---They r using API to validate the time card ,better to try with this.
    ---TimecardsListCO :u can c the code.
    Regards
    Meher Irk

  • Is there a way to create Timecard Templates from backend?

    Hello Folks
    Is there a way to create Timecard Templates from backend? I tried to create one with the following steps, but did not work. Throws a HXC_HXT_DEP_VAL_ORAERR
    The Oracle error is: &ERROR
    1. Create TIMECARD_TEMPLATE scope BB using hxc_timestore_deposit.create_bb
    2. Create Template_Name Attribute on the above BB
    3. Create DAY BB
    4. Create DETAIL BB for DAY BB
    5. Create Attribute BB for Hours Worked element on the DETAIL BB above
    6. Call hxc_timestore_deposit.execute_deposit_process(p_validate => FALSE
    ,p_app_blocks => l_tbl_timecard_info
    ,p_app_attributes => l_tbl_attributes_info
    ,p_messages => l_tbl_messages
    ,p_mode => 'SAVE'
    ,p_deposit_process => l_deposit_process
    --p_retrieval_process   => 'BEE Retrieval Process'
    , p_template => hxc_timecard.c_yes
    ,p_timecard_id => l_new_timecard_id
    ,p_timecard_ovn => l_new_timecard_ovn
    Any help would be greatly appreciated.
    Thanks
    Srinivasa

    Tim
    Application Release is 12.0.4, those notes do not help. Here is the complete script.
    declare
    l_tbl_timecard_info hxc_self_service_time_deposit.timecard_info;
    l_tbl_attributes_info hxc_self_service_time_deposit.app_attributes_info;
    l_tbl_messages hxc_self_service_time_deposit.message_table;
    --l_token_table                  hxc_deposit_wrapper_utilities.t_simple_table;
    l_blocks hxc_self_service_time_deposit.timecard_info;
    l_attributes hxc_self_service_time_deposit.app_attributes_info;
    l_tc_bb_id hxc_time_building_blocks.time_building_block_id%TYPE;
    l_day_bb_id hxc_time_building_blocks.time_building_block_id%TYPE;
    l_detail_bb_id hxc_time_building_blocks.time_building_block_id%TYPE;
    l_existing_tc_id hxc_timecard_summary.timecard_id%TYPE:= NULL;
    l_deposit_process hxc_deposit_processes.NAME%TYPE:= 'OTL Deposit Process';
    l_count_building_block PLS_INTEGER;
    i PLS_INTEGER;
    l_message fnd_new_messages.message_text%TYPE;
    l_approval_style_id NUMBER;
    l_new_timecard_id NUMBER;
    l_tc_days_counter NUMBER;
    l_new_timecard_ovn NUMBER;
    l_resp_id NUMBER := 50597; -- Responsibility US Employee Services
    l_application_id NUMBER := 809; -- Application HXC
    l_user_id NUMBER := 118189; -- FLORESR
    begin
    -- 1. Set Apps Context
    fnd_global.apps_initialize (l_user_id, l_resp_id, l_application_id);
    -- 2. Get Approval Style ID
    l_approval_style_id := TO_NUMBER(hxc_preference_evaluation.resource_preferences(411669,'TS_PER_APPROVAL_STYLE',1,SYSDATE));
    dbms_output.put_line('l_approval_style_id = '||l_approval_style_id);
    -- 3. Create TIMECARD_TEMPLATE BB similar to the logic in hxc_timestore_deposit.create_timecard_bb passing the scope as TIMECARD_TEMPLATE instead of TIMECARD
    -- We are starting with a new timecard so clear the global tables
    -- hxc_self_service_time_deposit.initialize_globals;
    -- Also clear the local PL/SQL table
    -- hxc_timestore_deposit_util.clear_building_block_table(p_app_blocks => l_tbl_timecard_info);
    l_count_building_block := l_tbl_timecard_info.LAST;
    -- PROCEDURE clear_building_block_table (
    -- p_app_blocks IN OUT NOCOPY hxc_block_table_type
    -- 'generate' a TBB ID
    IF (l_count_building_block IS NULL)
    THEN
    l_tc_bb_id := -2;
    -- never start at -1 because that has a special meaning in the deposit
    ELSE
    l_tc_bb_id := - (l_count_building_block) - 2;
    END IF;
    dbms_output.put_line('Creating Timecard');
    hxc_timestore_deposit.create_timecard_bb (p_start_time => fnd_date.canonical_to_date ('2011/09/26 00:00:00')
    ,p_stop_time => fnd_date.canonical_to_date ('2011/10/09 23:59:59')
    ,p_resource_id => 411669
    ,p_resource_type => hxc_timecard.c_person_resource
    ,p_approval_style_id => l_approval_style_id
    ,p_comment_text => 'Come on start working'
    ,p_app_blocks => l_tbl_timecard_info
    ,p_time_building_block_id => l_tc_bb_id
    hxc_timestore_deposit.create_bb (p_time_building_block_id => l_tc_bb_id
    ,p_type => hxc_timecard.c_range_type
    -- p_measure => DEFAULTS TO NULL
    ,p_unit_of_measure => NULL
    ,p_start_time => fnd_date.canonical_to_date ('2011/09/12 00:00:00')
    ,p_stop_time => fnd_date.canonical_to_date ('2011/09/25 23:59:59')
    ,p_parent_building_block_id => NULL
    -- Timecard Template does not have a parent -- May need to check on this parameter
    ,p_parent_is_new => NULL
    ,p_scope => hxc_timecard.c_template_scope -- Template Scope
    -- p_object_version_number => DEFAULTS TO 1
    -- p_approval_status=> p_approval_status
    ,p_resource_id => 411669
    ,p_resource_type => 'PERSON'
    ,p_approval_style_id => l_approval_style_id
    -- p_date_from => DEFAULTS TO SYSDATE
    -- p_date_to => DEFAULTS TO hr_general.end_of_time
    ,p_comment_text => 'Template Trials'
    -- p_parent_building_block_ovn => DEFAULTS TO NULL
    -- new => DEFAULTS TO 'Y'
    -- changed => DEFAULTS TO 'N'
    ,p_app_blocks => l_tbl_timecard_info
    dbms_output.put_line('After creating Timecard l_tc_bb_id = '||l_tc_bb_id);
    -- 4. Create PRIVATE TEMPLATES Attribute Category and Template Name passed from UI
    dbms_output.put_line('Creating Template_Name Attribute');
    hxc_timestore_deposit.create_attribute(p_building_block_id => l_tc_bb_id
    ,p_attribute_name => 'Template_Name'
    ,p_attribute_value => 'Trial Template from Code'
    ,p_deposit_process => l_deposit_process
    ,p_app_attributes => l_tbl_attributes_info
    dbms_output.put_line('Creating Template_Type Attribute');
    hxc_timestore_deposit.create_attribute(p_building_block_id => l_tc_bb_id
    ,p_attribute_name => 'Template_Type'
    ,p_attribute_value => 'PRIVATE'
    ,p_deposit_process => l_deposit_process
    ,p_app_attributes => l_tbl_attributes_info
    -- Below will be in a loop later
    -- 5. Create the DAY BB
    dbms_output.put_line('Creating DAY BB');
    hxc_timestore_deposit.create_day_bb(p_day => fnd_date.canonical_to_date('2011/09/26')
    ,p_parent_building_block_id => l_tc_bb_id -- returned by create_timecard_bb
    ,p_app_blocks => l_tbl_timecard_info
    ,p_time_building_block_id => l_day_bb_id
    dbms_output.put_line('After Creating DAY BB l_day_bb_id = '||l_day_bb_id);
    -- 6. Create DETAIL BB for first shift, lunch and second shift
    dbms_output.put_line('Create DETAIL BB for first shift, lunch and second shift');
    hxc_timestore_deposit.create_detail_bb(p_type => 'RANGE'
    -- ,p_measure => NULL -- Pass Null as its a template
    ,p_start_time => to_date('2011/09/26 06:00:00','YYYY/MM/DD HH24:MI:SS')
    ,p_stop_time => to_date('2011/09/26 11:00:00','YYYY/MM/DD HH24:MI:SS')
    ,p_parent_building_block_id => l_day_bb_id
    ,p_app_blocks => l_tbl_timecard_info
    ,p_app_attributes => l_tbl_attributes_info
    ,p_time_building_block_id => l_detail_bb_id
    dbms_output.put_line('After Creating DETAIL BB l_detail_bb_id = '||l_detail_bb_id);
    dbms_output.put_line('Creating Attribute 64869');
    hxc_timestore_deposit.create_attribute(p_building_block_id => l_detail_bb_id
    ,p_attribute_name => 'Dummy Element Context'
    ,p_attribute_value => 'ELEMENT - '||'64869' -- 01 Hours Worked
    ,p_app_attributes => l_tbl_attributes_info
    dbms_output.put_line('Creating Detail BB');
    hxc_timestore_deposit.create_detail_bb(p_type => 'RANGE'
    -- ,p_measure => NULL -- Pass Null as its a template
    ,p_start_time => to_date('2011/09/26 11:00:00','YYYY/MM/DD HH24:MI:SS')
    ,p_stop_time => to_date('2011/09/26 11:30:00','YYYY/MM/DD HH24:MI:SS')
    ,p_parent_building_block_id => l_day_bb_id
    ,p_app_blocks => l_tbl_timecard_info
    ,p_app_attributes => l_tbl_attributes_info
    ,p_time_building_block_id => l_detail_bb_id
    dbms_output.put_line('After Creating DETAIL BB l_detail_bb_id = '||l_detail_bb_id);
    dbms_output.put_line('Creating Attribute 65172');
    hxc_timestore_deposit.create_attribute(p_building_block_id => l_detail_bb_id
    ,p_attribute_name => 'Dummy Element Context'
    ,p_attribute_value => 'ELEMENT - '||'65172' -- 02 Unpaid Lunch
    ,p_app_attributes => l_tbl_attributes_info
    dbms_output.put_line('Creating Detail BB');
    hxc_timestore_deposit.create_detail_bb(p_type => 'RANGE'
    -- ,p_measure => NULL -- Pass Null as its a template
    ,p_start_time => to_date('2011/09/26 11:30:00','YYYY/MM/DD HH24:MI:SS')
    ,p_stop_time => to_date('2011/09/26 14:30:00','YYYY/MM/DD HH24:MI:SS')
    ,p_parent_building_block_id => l_day_bb_id
    ,p_app_blocks => l_tbl_timecard_info
    ,p_app_attributes => l_tbl_attributes_info
    ,p_time_building_block_id => l_detail_bb_id
    dbms_output.put_line('After Creating DETAIL BB l_detail_bb_id = '||l_detail_bb_id);
    dbms_output.put_line('Creating Attribute 64869');
    hxc_timestore_deposit.create_attribute(p_building_block_id => l_detail_bb_id
    ,p_attribute_name => 'Dummy Element Context'
    ,p_attribute_value => 'ELEMENT - '||'64869' -- 01 Hours Worked
    ,p_app_attributes => l_tbl_attributes_info
    -- 7. Deposit the Template
    dbms_output.put_line('Deposit the Template ');
    hxc_timestore_deposit.execute_deposit_process(p_validate => FALSE
    ,p_app_blocks => l_tbl_timecard_info
    ,p_app_attributes => l_tbl_attributes_info
    ,p_messages => l_tbl_messages
    ,p_mode => 'SAVE'
    ,p_deposit_process => l_deposit_process
    -- ,p_retrieval_process => 'BEE Retrieval Process'
    , p_template => 'Y'
    ,p_timecard_id => l_new_timecard_id
    ,p_timecard_ovn => l_new_timecard_ovn
    COMMIT;
    dbms_output.put_line('l_new_timecard_id = '||l_new_timecard_id);
    IF (l_tbl_messages.COUNT <> 0) THEN
    i := l_tbl_messages.FIRST;
    LOOP
    EXIT WHEN (NOT l_tbl_messages.EXISTS (i));
    l_message := fnd_message.get_string (appin => l_tbl_messages (i).application_short_name,
    namein => l_tbl_messages (i).message_name);
    DBMS_OUTPUT.put_line (l_tbl_messages (i).message_name);
    DBMS_OUTPUT.put_line (l_message);
    i := l_tbl_messages.NEXT (i);
    END LOOP;
    END IF;
    end;

  • Error while creating Time Card Using API

    Hello
    I have a requirement to run OTL Interface once day to create/update Time Card in OTL for those datea created on sysdate-1 in Service Module (data will get feeded from Service Module). For example this interface will run on sysdate to create time cards for those data created in the service module on sysdate-1.
    I have some sample data and code I am using but it is erroring out with different errors..Can anybody help me on this
    My Interface should run as expected below and my time card range will be Monday 24-Dec-2012 to Sunday 30-Dec-2012
    Interface Run Date Time Entry to process
    25-Dec-2012 24-Dec-2012 Data
    26-Dec-2012 25-Dec-2012 Data
    CREATE OR REPLACE PROCEDURE main_process (o_errbuf OUT VARCHAR2,
    o_ret_code OUT NUMBER,
    l_chr_from_date IN VARCHAR2,
    l_chr_to_date IN VARCHAR2)
    IS
    l_chr_skip VARCHAR2 (1);
    l_chr_task_exists VARCHAR2 (100);
    l_chr_error_msg VARCHAR2 (4000);
    l_num_tbb_id NUMBER;
    l_num_request_id NUMBER := fnd_global.conc_request_id;
    l_num_login_id NUMBER := fnd_global.login_id;
    l_num_user_id NUMBER := fnd_global.user_id;
    l_num_resp_id NUMBER := fnd_Profile.VALUE ('resp_ID');
    l_num_otl_appl_id CONSTANT NUMBER (3) := 809; -- This is the appl_id for OTL, do not change
    l_chr_proj_attr1 CONSTANT VARCHAR2 (7) := 'Task_Id';
    l_chr_proj_attr2 CONSTANT VARCHAR2 (10) := 'Project_Id';
    l_chr_proj_attr3 CONSTANT VARCHAR2 (16) := 'Expenditure_Type';
    l_chr_proj_attr4 CONSTANT VARCHAR2 (19) := 'Expenditure_Comment';
    l_chr_proj_attr5 CONSTANT VARCHAR2 (23) := 'SYSTEM_LINKAGE_FUNCTION';
    i_num_count NUMBER;
    i_num_rows_inserted NUMBER := NULL;
    l_chr_message fnd_new_messages.MESSAGE_TEXT%TYPE;
    l_chr_hdr_eligible VARCHAR2 (5);
    l_tbl_timecard_info hxc_self_service_time_deposit.timecard_info;
    l_tbl_attributes_info hxc_self_service_time_deposit.app_attributes_info;
    l_tbl_messages hxc_self_service_time_deposit.message_table;
    l_new_timecard_id NUMBER;
    l_new_timecard_ovn NUMBER;
    l_num_time_building_block_id hxc_time_building_blocks.time_building_block_id%TYPE;
    I NUMBER; --PENDING REMOVE
    l_message VARCHAR2 (2000); --PENDING REMOVE
    l_time_building_block_id NUMBER; --PENDING REMOVE
    CURSOR process_line
    IS
    SELECT ROWID ROW_ID, a.*
    FROM xxpowl.xxpowl_hxt_otl_intf a
    WHERE 1 = 1 --a.request_id = l_num_request_id
    AND a.status_flag = 'NEW' -- 'VALID'
    AND a.error_desc IS NULL
    AND a.service_activity_type IS NOT NULL;
    BEGIN
    FND_FILE.PUT_LINE (
    fnd_file.LOG,
    'Entered From Date:'
    || (TO_DATE ( (l_chr_from_date), 'YYYY/MM/DD HH24:MI:SS')));
    FND_FILE.PUT_LINE (
    fnd_file.LOG,
    'Entered To Date:'
    || (TO_DATE ( (l_chr_to_date), 'YYYY/MM/DD HH24:MI:SS')));
    FND_GLOBAL.APPS_INITIALIZE (user_id => l_num_user_id,
    resp_id => l_num_resp_id,
    resp_appl_id => l_num_otl_appl_id);
    BEGIN
    FND_FILE.PUT_LINE (
    fnd_file.LOG,
    'Inserting the data in the custom table XXPOWL_HXT_OTL_INTF');
    INSERT INTO xxpowl.XXPOWL_HXT_OTL_INTF (SR_NUMBER,
    PROJECT_TASK_OWNER,
    PROJECT_TASK_OWNER_PERSON_ID,
    PROJECT_ID,
    PROJECT_TASK_ID,
    ASSIGNEE,
    ASSIGNEE_ID,
    ASSIGNEE_PERSON_ID,
    ASSIGNEE_SUPERVISOR_PERSON_ID,
    TASK_NUMBER,
    PARENT_TASK_NUMBER,
    DEBRIEF_NUMBER,
    DEBRIEF_HEADER_ID,
    DEBRIEF_DATE,
    TASK_ASSIGNMENT_ID,
    DEBRIEF_OBJECT_VERSION_NUMBER,
    DEBRIEF_PER_COMPLETE,
    DEBRIEF_LINE_ID,
    DEBRIEF_PROCESS,
    SERVICE_ACTIVITY,
    SERVICE_ACTIVITY_TYPE,
    INVENTORY_ITEM_ID,
    ITEM,
    BUSINESS_PROCESS_ID,
    DEBRIEF_TRANSACTION_TYPE_ID,
    DEBRIEF_UOM_CODE,
    DEBRIEF_HOURS,
    CONV_DEBRIEF_IN_HOURS,
    DEBRIEF_START_TIME,
    DEBRIEF_END_TIME,
    DEBRIEF_SERVICE_DATE,
    NOTES,
    OTL_ELIGIBLE_FLAG,
    NOTIF_SENT_FLAG,
    NOTIF_ELIGIBLE_FLAG,
    ERROR_DESC,
    STATUS_FLAG,
    INITIAL_NOTIF_SENT_DATE,
    CREATION_DATE,
    CREATED_BY,
    LAST_UPDATE_DATE,
    LAST_UPDATED_BY,
    LAST_UPDATE_LOGIN,
    REQUEST_ID,
    INITIAL_REQUEST_ID)
    (SELECT b.incident_number sr_number,
    h.resource_name project_task_owner,
    h.source_id project_task_owner_person_id,
    b.external_attribute_1 project_id,
    b.external_attribute_2 project_task_id,
    jtf_task_utl.get_owner (d.resource_type_code, d.resource_id)
    assignee,
    d.resource_id assignee_id,
    jrre.source_id assignee_person_id,
    paa.supervisor_id assignee_supervisor_person_id,
    c.task_number task_number,
    (SELECT task_number
    FROM jtf_tasks_b z
    WHERE c.parent_task_id = z.task_id)
    parent_task_number,
    a.debrief_number,
    a.debrief_header_id debrief_header_id,
    a.debrief_date debrief_date,
    a.task_assignment_id task_assignment_id,
    a.object_version_number debrief_object_version_number,
    a.attribute1 debrief_per_complete,
    e.debrief_line_id debrief_line_id,
    cbp.name debrief_process,
    cttv.name service_activity,
    DECODE (cttv.attribute1,
    'Y', 'Service-Billable',
    'N', 'Service-Non Billable')
    service_activity_type,
    e.inventory_item_id inventory_item_id, --f.segment1 item,
    (SELECT segment1
    FROM mtl_system_items_b f
    WHERE e.inventory_item_id = f.inventory_item_id
    AND f.organization_id = b.inv_organization_id)
    item, --241 --Mater Org
    e.business_process_id business_process_id,
    e.transaction_type_id debrief_transaction_type_id,
    e.uom_code debrief_uom_code,
    e.quantity debrief_hours,
    (g.conversion_rate * e.quantity) conv_debrief_in_hours,
    e.labor_start_date debrief_start_time,
    e.labor_end_date debrief_end_time,
    e.service_date debrief_service_date,
    (SELECT note_tl.notes
    FROM JTF_NOTES_B NOTE, JTF_NOTES_TL NOTE_TL
    WHERE NOTE.JTF_NOTE_ID = NOTE_TL.JTF_NOTE_ID
    AND NOTE_TL.LANGUAGE = USERENV ('LANG')
    AND NOTE.SOURCE_OBJECT_ID = a.DEBRIEF_HEADER_ID
    AND note.jtf_note_id =
    (SELECT MAX (note1.jtf_note_id)
    FROM JTF_NOTES_B note1
    WHERE NOTE1.SOURCE_OBJECT_ID =
    a.DEBRIEF_HEADER_ID))
    notes,
    'Y',
    'N',
    'X',
    NULL,
    'NEW',
    NULL,
    SYSDATE,
    l_num_user_id,
    SYSDATE,
    l_num_user_id,
    l_num_login_id,
    l_num_request_id,
    l_num_request_id
    FROM csf_debrief_headers a,
    cs_incidents_all_b b,
    jtf_tasks_b c,
    jtf_task_assignments d,
    csf_debrief_lines e, --mtl_system_items_b f,
    mtl_uom_conversions g,
    jtf_rs_resource_extns_vl h,
    cs_business_processes cbp,
    cs_transaction_types_vl cttv --, cs_sr_task_debrief_notes_v notes
    jtf_rs_resource_extns_vl jrre,
    per_all_assignments_f paa
    WHERE a.task_assignment_id = d.task_assignment_id
    AND d.task_id = c.task_id
    AND c.source_object_id = b.incident_id
    AND c.source_object_type_code = 'SR'
    AND a.debrief_header_id = e.debrief_header_id
    AND e.uom_code = g.uom_code
    AND g.uom_class = 'Time'
    AND b.incident_owner_id = h.resource_id(+)
    AND e.business_process_id = cbp.business_process_id
    AND e.transaction_type_id = cttv.transaction_type_id
    AND d.resource_id = jrre.resource_id
    AND jrre.source_id = paa.person_id --= 181
    AND TRUNC (SYSDATE) BETWEEN paa.effective_start_date
    AND paa.effective_end_date
    AND TRUNC (e.last_update_date) BETWEEN TO_DATE (
    (l_chr_from_date),
    'YYYY/MM/DD HH24:MI:SS')
    AND TO_DATE (
    (NVL (
    l_chr_to_date,
    l_chr_from_date)),
    'YYYY/MM/DD HH24:MI:SS')
    AND NOT EXISTS
    (SELECT 1
    FROM xxpowl.XXPOWL_HXT_OTL_INTF old
    WHERE old.debrief_header_id =
    e.debrief_header_id
    AND old.task_number = c.task_number
    AND TRUNC (old.DEBRIEF_SERVICE_DATE) =
    TRUNC (e.SERVICE_DATE)
    AND old.DEBRIEF_TRANSACTION_TYPE_ID =
    e.TRANSACTION_TYPE_ID
    AND old.request_id <> l_num_request_id
    AND old.DEBRIEF_UOM_CODE = e.uom_code
    AND old.DEBRIEF_HOURS = e.quantity));
    i_num_rows_inserted := SQL%ROWCOUNT;
    fnd_file.put_line (fnd_file.LOG,
    'No of rows Inserted:' || i_num_rows_inserted);
    COMMIT;
    EXCEPTION
    WHEN OTHERS
    THEN
    l_chr_error_msg :=
    l_chr_error_msg
    || 'Error while Inserting debrief lines data into custom table.Error: '
    || SQLERRM
    || '. Exiting the interface without processing further';
    fnd_file.put_line (fnd_file.LOG, l_chr_error_msg);
    ROLLBACK;
    RETURN;
    END;
    FOR process_line_rec IN process_line
    LOOP
    l_chr_error_msg := NULL;
    l_tbl_timecard_info.delete;
    l_tbl_attributes_info.delete;
    l_tbl_messages.delete;
    l_new_timecard_id := NULL;
    l_new_timecard_ovn := NULL;
    l_num_time_building_block_id := NULL;
    l_chr_message := NULL;
    i_num_count := 0;
    l_num_tbb_id := NULL;
    BEGIN
    hxc_timestore_deposit.create_time_entry (
    p_measure => process_line_rec.conv_debrief_in_hours,
    p_day => TO_DATE ( (process_line_rec.debrief_service_date),
    'DD/MM/RRRR'),
    p_resource_id => process_line_rec.assignee_person_id,
    p_comment_text => process_line_rec.notes
    || '....Remove this notes in the code logic....Request Id:'
    || l_num_request_id, --pending lokesh
    p_app_blocks => l_tbl_timecard_info,
    p_app_attributes => l_tbl_attributes_info,
    p_time_building_block_id => l_num_time_building_block_id);
    fnd_file.put_line (
    fnd_file.LOG,
    'Step#1 completed, TIME_BUILDING_BLOCK_ID:'
    || l_num_time_building_block_id);
    EXCEPTION
    WHEN OTHERS
    THEN
    l_chr_error_msg :=
    l_chr_error_msg
    || '.Error in INSERT API CALL at Step#1 for the debrief line id: '
    || process_line_rec.debrief_line_id
    || '.Error:'
    || SQLERRM;
    END;
    BEGIN
    -- Classify Time
    -- Attribute1
    hxc_timestore_deposit.create_attribute (
    p_building_block_id => l_num_time_building_block_id,
    p_attribute_name => 'Task_Id',
    p_attribute_value => process_line_rec.project_task_id,
    p_app_attributes => l_tbl_attributes_info);
    EXCEPTION
    WHEN OTHERS
    THEN
    l_chr_error_msg :=
    l_chr_error_msg
    || '.Error in INSERT API CALL at Step#2 for the debrief line id: '
    || process_line_rec.debrief_line_id
    || '.Error:'
    || SQLERRM;
    END;
    BEGIN
    -- Attribute2
    hxc_timestore_deposit.create_attribute (
    p_building_block_id => l_num_time_building_block_id,
    p_attribute_name => 'Project_Id',
    p_attribute_value => process_line_rec.project_id,
    p_app_attributes => l_tbl_attributes_info);
    EXCEPTION
    WHEN OTHERS
    THEN
    l_chr_error_msg :=
    l_chr_error_msg
    || '.Error in INSERT API CALL at Step#3 for the debrief line id: '
    || process_line_rec.debrief_line_id
    || '.Error:'
    || SQLERRM;
    END;
    BEGIN
    -- Attribute3
    hxc_timestore_deposit.create_attribute (
    p_building_block_id => l_num_time_building_block_id,
    p_attribute_name => 'Expenditure_Type',
    p_attribute_value => 'Service-Billable',
    -- p_attribute_value=> 'Service-Non Billable',
    p_app_attributes => l_tbl_attributes_info);
    EXCEPTION
    WHEN OTHERS
    THEN
    l_chr_error_msg :=
    l_chr_error_msg
    || '.Error in INSERT API CALL at Step#4 for the debrief line id: '
    || process_line_rec.debrief_line_id
    || '.Error:'
    || SQLERRM;
    END;
    BEGIN
    -- Attribute4
    hxc_timestore_deposit.create_attribute (
    p_building_block_id => l_num_time_building_block_id,
    p_attribute_name => 'Expenditure_Comment',
    p_attribute_value => 'Expenditure Comment created by API',
    p_app_attributes => l_tbl_attributes_info);
    EXCEPTION
    WHEN OTHERS
    THEN
    l_chr_error_msg :=
    l_chr_error_msg
    || '.Error in INSERT API CALL at Step#5 for the debrief line id: '
    || process_line_rec.debrief_line_id
    || '.Error:'
    || SQLERRM;
    END;
    BEGIN
    -- Attribute5
    hxc_timestore_deposit.create_attribute (
    p_building_block_id => l_num_time_building_block_id,
    p_attribute_name => 'SYSTEM_LINKAGE_FUNCTION',
    p_attribute_value => 'ST',
    p_app_attributes => l_tbl_attributes_info);
    EXCEPTION
    WHEN OTHERS
    THEN
    l_chr_error_msg :=
    l_chr_error_msg
    || '.Error in INSERT API CALL at Step#6 for the debrief line id: '
    || process_line_rec.debrief_line_id
    || '.Error:'
    || SQLERRM;
    END;
    BEGIN
    hxc_timestore_deposit.execute_deposit_process (
    p_validate => FALSE,
    p_app_blocks => l_tbl_timecard_info,
    p_app_attributes => l_tbl_attributes_info,
    p_messages => l_tbl_messages,
    p_mode => 'SAVE', -- p_mode-> 'SUBMIT', 'SAVE', 'MIGRATION', 'FORCE_SAVE' or 'FORCE_SUBMIT'
    p_deposit_process => 'OTL Deposit Process',
    p_timecard_id => l_new_timecard_id,
    p_timecard_ovn => l_new_timecard_ovn);
    COMMIT;
    hxc_timestore_deposit.log_messages (p_messages => l_tbl_messages);
    IF (l_tbl_messages.COUNT <> 0)
    THEN
    l_chr_error_msg :=
    l_chr_error_msg
    || '.Error in INSERT API CALL at Step#7 for the debrief line id: '
    || process_line_rec.debrief_line_id
    || '.Error:'
    || SQLERRM
    || '.API Error messages are:';
    i_num_count := l_tbl_messages.FIRST;
    LOOP
    EXIT WHEN (NOT l_tbl_messages.EXISTS (i_num_count));
    l_chr_message :=
    fnd_message.get_string (
    appin => l_tbl_messages (i_num_count).application_short_name,
    namein => l_tbl_messages (i_num_count).message_name);
    fnd_file.put_line (
    fnd_file.LOG,
    (l_tbl_messages (i_num_count).message_name));
    l_chr_error_msg := l_chr_error_msg || l_chr_message || '.';
    i_num_count := l_tbl_messages.NEXT (i_num_count);
    END LOOP;
    END IF;
    EXCEPTION
    WHEN OTHERS
    THEN
    fnd_file.put_line (
    fnd_file.LOG,
    '**** Error.....Inside Exception Block in execute_deposit_process');
    BEGIN
    hxc_timestore_deposit.log_messages (
    p_messages => l_tbl_messages);
    EXCEPTION
    WHEN OTHERS
    THEN
    fnd_file.put_line (
    fnd_file.LOG,
    '*****Error....Inside Exception Block in hxc_timestore_deposit.log_messages.Error:'
    || SQLERRM);
    END;
    l_chr_error_msg :=
    l_chr_error_msg
    || 'Error in INSERT API CALL at Step#7 for the debrief line id: '
    || process_line_rec.debrief_line_id
    || '.Error:'
    || SQLERRM
    || '.API Error messages are:';
    IF (l_tbl_messages.COUNT <> 0)
    THEN
    i_num_count := l_tbl_messages.FIRST;
    LOOP
    EXIT WHEN (NOT l_tbl_messages.EXISTS (i_num_count));
    l_chr_message :=
    fnd_message.get_string (
    appin => l_tbl_messages (i_num_count).application_short_name,
    namein => l_tbl_messages (i_num_count).message_name);
    l_chr_error_msg := l_chr_error_msg || l_chr_message || '.';
    i_num_count := l_tbl_messages.NEXT (i_num_count);
    END LOOP;
    END IF;
    END;
    COMMIT;
    IF l_chr_error_msg IS NOT NULL OR l_new_timecard_id IS NULL
    THEN
    fnd_file.put_line (fnd_file.LOG,
    '***** Error *****' || l_chr_error_msg);
    o_ret_code := 1;
    END IF;
    BEGIN
    fnd_file.put_line (
    fnd_file.LOG,
    'Updating the status of the record in custom table for debrief_line_id:'
    || process_line_rec.debrief_line_id);
    UPDATE xxpowl.XXPOWL_HXT_OTL_INTF
    SET status_flag =
    DECODE (
    l_chr_error_msg,
    NULL, DECODE (
    l_new_timecard_id,
    NULL, 'FAILED',
    DECODE (SIGN (l_new_timecard_id),
    '1', 'SUCESS',
    'FAILED')),
    'FAILED'),
    time_building_block_id = l_new_timecard_id,
    last_update_date = SYSDATE,
    request_id = l_num_request_id,
    last_updated_by = l_num_user_id,
    error_desc = l_chr_error_msg
    WHERE ROWID = process_line_rec.row_id;
    COMMIT;
    EXCEPTION
    WHEN OTHERS
    THEN
    l_chr_error_msg :=
    l_chr_error_msg
    || '.Error while updating the status to SUCCESS.Error: '
    || SQLERRM;
    END;
    END LOOP; --process_line
    EXCEPTION
    WHEN OTHERS
    THEN
    FND_FILE.PUT_LINE (
    fnd_file.LOG,
    'Unknown/Unhandlled Exception Error......' || SQLERRM);
    o_ret_code := 2;
    END main_process;
    SHOW ERR;
    Error Messages:
    1. Error in INSERT API CALL at Step#7 for the debrief line id: 41011.Error:ORA-00001: unique constraint (HXC.HXC_ROLLBACK_TIMECARDS_PK) violated.
    2. Error in INSERT API CALL at Step#7 for the debrief line id: 41011.Error:ORA-00001: unique constraint (HXC.HXC_LATEST_DETAILS_FK) violated
    Thanks a lot for the help!

    Hello
    We will get this error message when we run this from application other than "Time and Labor Engine". So try to run this concurrent program (if you registered as a conc. program) from Time and Labor Engine application.
    --Lokesh                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Getting error ORA-20001: This person does not have preferences for the sele

    *) I got user_id by following query
    SELECT USER_ID, USER_NAME, FND_USER.*
    from FND_USER where user_name = '205174';
    *) resource_id by following query:
    select * from APPS.PA_PROJECT_ASSIGNMENTS where RESOURCE_ID in (select RESOURCE_ID from APPS.PA_RESOURCES_DENORM where PERSON_ID
    in (select PERSON_ID from APPS.PER_ALL_PEOPLE_F where EMPLOYEE_NUMBER= 205173) ) ;
    *) person_id by following query:
    select * from APPS.PA_RESOURCES_DENORM where PERSON_ID in (select PERSON_ID from APPS.PER_ALL_PEOPLE_F where EMPLOYEE_NUMBER= 205173) ;
    and
    Hi,
    When I am running following query to submit timesheet, getting following warning msg
    anonymous block completed
    ORA-20001: This person does not have preferences for the selected effective date
    Following is query
    set serveroutput on size 1000000
    DECLARE
    l_tbl_messages hxc_message_table_type;
    l_message fnd_new_messages.message_text%type;
    i pls_integer;
    l_app_blocks hxc_block_table_type := hxc_block_table_type();
    l_app_attributes hxc_self_service_time_deposit.app_attributes_info;
    l_time_building_block_id number;
    l_new_timecard_id number;
    l_new_timecard_ovn number;
    l_bb_id number;
    l_resource_id hxc_time_building_blocks.resource_id%TYPE := 3595; -- XPCPAY
    l_start_time hxc_time_building_blocks.start_time%TYPE := fnd_date.canonical_to_date('2011/10/17 00:00:00');
    l_measure hxc_time_building_blocks.measure%TYPE := 1;
    l_element_type_id varchar2(80) := 'ELEMENT - 50809'; -- Jury Duty
    l_comment_text hxc_time_building_blocks.comment_text%TYPE := '';
    l_deposit_process hxc_deposit_processes.NAME%TYPE := 'OTL Deposit Process';
    l_retrieval_process varchar2(250) := 'BEE Retrieval Process';
    BEGIN
    fnd_global.apps_initialize ( user_id => 3850 -- XPCPAY
    , resp_id => 3595 -- Self Service Time
    , resp_appl_id => 809 -- HXC
    hxc_timestore_deposit.create_time_entry ( p_measure => l_measure
    , p_day => l_start_time
    , p_resource_id => l_resource_id
    , p_resource_type => 'PERSON'
    , p_comment_text => l_comment_text
    , p_deposit_process => l_deposit_process
    , p_app_blocks => l_app_blocks
    , p_app_attributes => l_app_attributes
    , p_time_building_block_id => l_bb_id
    hxc_timestore_deposit.create_attribute ( p_building_block_id => l_bb_id
    , p_attribute_name => 'Dummy Element Context'
    , p_attribute_value => l_element_type_id
    , p_deposit_process => l_deposit_process
    , p_app_attributes => l_app_attributes
    hxc_timestore_deposit.execute_deposit_process ( p_validate => TRUE
    , p_app_blocks => l_app_blocks
    , p_app_attributes => l_app_attributes
    , p_messages => l_tbl_messages
    , p_mode => 'SUBMIT'
    , p_deposit_process => l_deposit_process
    , p_retrieval_process => l_retrieval_process
    , p_timecard_id => l_new_timecard_id
    , p_timecard_ovn => l_new_timecard_ovn
    -- OUTPUT MESSAGES --
    DBMS_OUTPUT.put_line ('l_new_timecard_id = ' || l_new_timecard_id);
    DBMS_OUTPUT.put_line ('l_new_timecard_ovn = ' || l_new_timecard_ovn);
    if (l_tbl_messages.COUNT <> 0) THEN
    i := l_tbl_messages.FIRST;
    LOOP
    EXIT WHEN (NOT l_tbl_messages.EXISTS(i));
    l_message := fnd_message.get_string ( appin => l_tbl_messages(i).application_short_name
    , namein => l_tbl_messages(i).message_name
    DBMS_OUTPUT.put_line (l_tbl_messages(i).message_name);
    DBMS_OUTPUT.put_line (l_message);
    i := l_tbl_messages.NEXT(i);
    END LOOP;
    rollback;
    else
    commit;
    end if;
    exception
         when others then
              DBMS_OUTPUT.put_line(SQLERRM);
    END;
    /

    Please check the following MOS notes:
    ORA-20001: This Person Does Not Have Preferences For the Selected Effective Date [ID 876324.1]
    ORA-20001: This Person Does Not Have Preferences For The Selected Effective Date [ID 761470.1]
    Troubleshooting Guide for HRMS API Errors - ORA-20001 and APP Errors [ID 152259.1]
    ''This Person Does Not Have Preferences For The Selected Effective Date'' Message [ID 287581.1]
    Diagnostics - Setup - Time and labour Person - Test failed [ID 397214.1]
    Cheers,
    ND
    Use the "helpful" or "correct" buttons to award points to replies / Mark the thread as answered, if your question is answered.

  • OTL HXC_TIMESTORE_DEPOSIT API populated tables

    Hi,
    Could you let me tables populated when HXC_TIMESTORE_DEPOSIT API is executed.
    Thanks

    Could you let me tables populated when HXC_TIMESTORE_DEPOSIT API is executed.Depends on what procedure you use when you use this API.
    http://etrm.oracle.com/pls/et1211d9/etrm_pnav.show_details?c_name=HXC_TIMESTORE_DEPOSIT&c_owner=APPS&c_type=PACKAGE&c_detail_type=source
    http://etrm.oracle.com/pls/et1211d9/etrm_pnav.show_details?c_name=HXC_TIMESTORE_DEPOSIT&c_owner=APPS&c_type=PACKAGE%20BODY&c_detail_type=source
    Oracle Time and Labor (OTL) HXC TimeStore Deposit API White Paper [ID 223987.1]
    You could enable trace and generate the TKPROF file and this will tell you what tables get populated when you use this API -- FAQ: Common Tracing Techniques within the Oracle Applications 11i/R12 [ID 296559.1]
    Thanks,
    Hussein

  • Hxc_timestore_deposit Doubt on create_time_entry and create_timecard_bb

    Hi,
    Could you tell me the difference b/w these 2 procedures in hxc_timestore_deposit API.
    2 procedures
    create_time_entry
    create_timecard_bb
    Thanks

    Hi,
    Could you tell me the difference b/w these 2 procedures in hxc_timestore_deposit API.
    2 procedures
    create_time_entry
    create_timecard_bb
    Thanks

  • OTL (Oracle Time and Labor) Doubt on Timekeeper Groups API

    Hi,
    Using HXC TimeStore API we can Create/insert/update/delete TimeCards.
    Then what is the use of Timekeeper Groups API's HXC_TIMEKEEPER_GROUP_API ?
    Thanks.

    I see below two calls in the package body, what is meant by 'User Hook'?User hooks provide the client with the ability to add logic to application processing and to disable optional product processing. These User Hooks take the form of procedures that may be called by the application, in sequence, when the application takes a specified action on a specified object type -- http://orclpps.blogspot.ca/2008/01/user-hooks-in-oracle.html
    User Hooks are an easier way of extending the standard functionality of many Oracle Application modules. They are synonymous to database triggers, but are implemented as APIs (package.procedure). -- http://oraclewithbiju.blogspot.ca/2012/06/oracle-applications-user-hooks.html
    http://www.oracle.com/pls/ebs121/search?word=%27User+Hook%27&format=ranked&remark=quick_search
    https://forums.oracle.com/forums/search.jspa?threadID=&q=User+AND+Hooks&objID=c3&dateRange=all&userID=&numResults=15&rankBy=10001
    Thanks,
    Hussein

  • Hxc_timestore_deposit.create_day_bb   parameter for p_resource_id in OTL

    Hi,
    If the Time Card was already existing, now while creating DAY using create_day_bb procedure, how can i pass the parameter
    for p_resource_id.
    Thanks.

    Hi,
    If the Time Card was already existing, now while creating DAY using create_day_bb procedure, how can i pass the parameter
    for p_resource_id.
    Thanks.

  • OTL Time card: Where to write custom validations

    Hi,
    I need to write some validations after the user submits time card.
    WHat is the package in which I can write these custom validations? Does oracle recommend any specific package?
    Also, If i have two projects,
    Time card period: 01-01-12 to 01-08-12
    Project 1 ends on 01-05-12
    Project 2 starts from 01-06-12
    Would it be possible to restrict project lov if user tries to enter project on 01-07-12, not to use project 1?
    if not possible where can I make that validation in the code?
    Appreciate your help.

    Hi,
    I will answering your doubts no 3 and 4
    Instead of using XML template, I would suggest you to use WED Adi, which can be called from the OTL page
    button. And at that time the only thing u have to upload server with the WebAdi template.
    Here you will not need to build a custom table, a view will solve the purpose. And there is not need of further maintenance
    For the file to be read only you can include it in the code while extending your respective controller class.
    But Oracle recommend not to extend controller class. Let the client be aware of it, that it requires the extension
    of controller class of the page. If he thumps up the extension of controller class then your life becomes pretty simple.
    Regards,
    Pankaj Kedia

Maybe you are looking for

  • How to:Create a blank document, and how to make a font available for editin

    Two questions: 1: How do I create a new PDF document? All I see is to create from an existing document or scanner. If I'm creating something from scratch, do I really have to load an existing PDF, delete everything and then start my new document? Tha

  • Limit number of rows from wildcard expansion- DRG-51030

    We use CONTEXT iindex in 11g to search on a text DB column, "Name". This is used in a UI to show autosuggest list of 25 matching names. When the end user types an 'a' we want to show a list of the first 25 names that contain an 'a'. We hit the issue

  • Not to show values in dashboard prompts

    hi friends, I have a rek suuch that .....I have a dashbaord prompt named by nameid in which it has NameID sunny katie david scare but i need only NameID sunny scare how to show these values in the dashboard prompts.any help plzzz

  • Grey box with 'BouncingHeads' test

    Hi, PC under XP with IE 6. with Sun's JVM 1.4.2_02. Bouncing heads test only shows a grey box and http://javatester.org shows 'SunMicrosystems' only not the full version. Would could cause these not to fully work? It seems that the JVM is still half

  • XML Output with multiple categories

    I am driving myself insane trying to get this to output and I can't seem to find much on the internet that is helpful. Sometimes there is 1 category and sometimes there could be 2. For example: <Article> <Heading>Study: Ban on cell phone use hasn't r