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.

Similar Messages

  • 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.

  • 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

  • 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                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • 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.

  • 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.

  • Question OTL Timecard (Auto-Approval).

    Hi All,
    I'm facing a problem while uploading the time via OTL API's.
    I'm using below OTL API's to upload the time.
    1.hxc_timestore_deposit.create_timecard_bb
    2.hxc_timestore_deposit.create_day_bb
    3.hxc_timestore_deposit.create_detail_bb
    4.hxc_timestore_deposit.execute_deposit_process
    By these API's I am able to submit the timesheet with status as 'SUBMITTED' but not as the 'APPROVED' status.
    Is there any setup/profile option to auto-approve these timesheets.
    Can any of guys let me know what is the exact issue.
    Thanks in Advance.
    --Raja                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    Raja,
    What is the approval style defined for the timecard?
    Timecards are always created in the Submitted or Saved mode. If you want the auto approval, make sure that the corresponding approval style is defined in the setup.
    --Shiv                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • OTL Implementation Questions

    Dear All,
    I have an OTL requirement something like this -
    1. HRMS is installed and Payroll is Shared
    2. Have a legacy system that will feed HRMS/OTL on a monthly basis the begining
    balances like Vacation, Sick, Bereavement etc.
    3. Need to create Timekeeper Groups (Assignment Sets) only, no Self Service,
    but need to incorporate Time Entry Validation rules
    4. Show Begining Balances, usage and Monthly Totals in the Layout.
    5. Allow Corrections
    6. Have a placeholder on the layout, once TK gets paper signature
    7. Interface ending balances back to legacy system (BEE/System Extract ?)
    Questions:
    1. Does payroll need to be defined and assigned to assignments, for Time Elements?
    2. Any pointers as to how to achieve each of the above
    Thanks a ton
    Srinivasa

    Hi Ramu -
    Q1.
    The reason I am asking about payroll is, because for OTL we need to setup nonrecurring elements, right?
    But the HRMS guide (Part No. B31613-03) says -
    "Duration of Element Entries
    Some entries are valid for one pay period only. For example, to produce an employee's
    wages or overtime pay for a period you process the entries of regular hours worked or
    overtime hours. You define these elements with the processing type nonrecurring.
    Notice that pay periods are determined by the payroll to which an employee is
    assigned. Employees must be assigned to a payroll to receive nonrecurring elements,
    even if you are entering these for information only and not processing them.
    Other entries, such as salary or company car, should persist until you change them, or
    they reach their end date, or the employee's assignment changes so that he or she is no
    longer eligible for the element. You define these elements with the processing type
    recurring.
    Q2.
    Could you let me know how to customize the Timekeeper layout to show the Monthly Begining Balances from Legacy system, current usage and the monthly ending balances. Do we have to create three element types for e.g. "Begining Vacation", "Vacation Usage" and "Ending Vacation".
    Thanks

  • OTL API's

    Hi all,
    I need to know the affect of this scenario happened...
    * An API used to create an overtime assignment (for No. of hours) and according to that we then create and populate the time card of this assignment using
    hxc_timestore_deposit.create_timecard_bb and hxc_timestore_deposit.execute_deposit_process.
    The above steps created successfully, then we found that an employee was paid cash in advance for his overtime assignment so we went to the overtime assignment screen and delete the record manually.
    Now, as i understand the time card created still exist (right?)
    what is the affect of that? (considering both cases that the OTL module was launched & used and the reverse)?
    should i use an API to delete the time card?? (which API's should be used and how in summary)?
    Thanks a lot

    Please be more precise. Are you creating secondary assignment to capture the OT? Are you capturing the assignment details in timecard? if not, otl just uses the primary assignment and it should be ok. If you are using the secondary assignmnet detail on timecard, it will error on any further action.
    --Shiv                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • OTL Time Card

    Hi,
    Update Time Card API not working.. Can you please correct me where am I doing wrong.
    /* Formatted on 2011/07/20 16:11 (Formatter Plus v4.8.8) */
    DECLARE
    v_tbl_timecard_info hxc_self_service_time_deposit.timecard_info;
    v_tbl_attributes_info hxc_self_service_time_deposit.app_attributes_info;
    v_tbv_messages hxc_self_service_time_deposit.message_table;
    v_new_timecard_id NUMBER;
    v_new_timecard_ovn NUMBER;
    i PLS_INTEGER;
    v_message fnd_new_messages.MESSAGE_TEXT%TYPE;
    BEGIN
    fnd_global.apps_initialize (user_id => 1111,
    resp_id => 23818,
    resp_appl_id => 809
    hxc_timestore_deposit.update_building_block
    (p_building_block_id => 2355,
    p_start_time => TO_DATE
    ('18-Jul-2011 09:00:00',
    'DD-Mon-YYYY HH24:MI:SS'
    p_stop_time => TO_DATE
    ('18-Jul-2011 10:00:00',
    'DD-Mon-YYYY HH24:MI:SS'
    p_comment_text => 'Modification '
    || TO_CHAR (SYSDATE,
    'hh:mi:ss'
    p_app_blocks => v_tbl_timecard_info,
    p_app_attributes => v_tbl_attributes_info
    hxc_timestore_deposit.execute_deposit_process
    (p_validate => FALSE,
    p_app_blocks => v_tbl_timecard_info,
    p_app_attributes => v_tbl_attributes_info,
    p_messages => v_tbv_messages,
    p_mode => 'SAVE',
    p_deposit_process => 'OTL Deposit Process',
    p_timecard_id => v_new_timecard_id,
    p_timecard_ovn => v_new_timecard_ovn
    -- messages have been returned
    IF v_tbv_messages.COUNT != 0
    THEN
    i := v_tbv_messages.FIRST;
    LOOP
    EXIT WHEN (NOT v_tbv_messages.EXISTS (i));
    -- First translate the message as the messagetable returned does not give the actual
    -- message, only the message_name which doesn't mean anything to the user.
    v_message :=
    fnd_message.get_string
    (appin => v_tbv_messages (i).application_short_name,
    namein => v_tbv_messages (i).message_name
    -- returns 4: 4
    DBMS_OUTPUT.put_line ( v_tbv_messages (i).message_name
    || ': '
    || v_message
    i := v_tbv_messages.NEXT (i);
    END LOOP;
    END IF;
    END;
    Thanks,
    Anil

    Confusion reigns!
    The OTL Workflow for Employees (HXCEMP) does appear to have a number of processes... possibly for different functions.
    Is there any other reference of use other than the OTL Implementation and User guide?
    What does the HXCSAW workflow do? This is the seeded approval workflow that really doesnt appear to do anything...
    Thanks,
    Will

  • Hxc_timestore_deposit.execute_deposit_process returns message_name = 4

    I create timecards through the PL/SQL API. The timecards are first saved using p_mode = 'SAVE' (hxc_timestore_deposit.execute_deposit_process) and when the user is ready he submits his timecard using p_mode = 'SUBMIT'.
    When I call hxc_timestore_deposit.execute_deposit_process with p_mode = 'SUBMIT' the PL/SQL table returned contains a 4. What does this mean??
    When I requery the timecard it's submitted (hxc_time_building_blocks.approval_status) and everything seems ok, but why do the API return the number 4?
    DECLARE
      v_tbl_timecard_info         hxc_self_service_time_deposit.timecard_info;     
      v_tbl_attributes_info       hxc_self_service_time_deposit.app_attributes_info;
      v_tbv_messages              hxc_self_service_time_deposit.message_table;
      v_new_timecard_id           NUMBER;
      v_new_timecard_ovn          NUMBER;
      i                           PLS_INTEGER;
      v_message                   fnd_new_messages.message_text%TYPE;
    BEGIN
      FND_GLOBAL.APPS_INITIALIZE( user_id => 75375
                                 ,resp_id => 65477      
                                 ,resp_appl_id => 809 );
      hxc_timestore_deposit.update_building_block(p_building_block_id => 23717233,
                                                  p_app_blocks        => v_tbl_timecard_info,
                                                  p_app_attributes    => v_tbl_attributes_info);
      hxc_timestore_deposit.execute_deposit_process (
        p_validate        => FALSE,
        p_app_blocks      => v_tbl_timecard_info,
        p_app_attributes  => v_tbl_attributes_info,
        p_messages        => v_tbv_messages,
        p_mode            => 'SUBMIT',
        p_deposit_process => 'OTL Deposit Process',
        p_timecard_id     => v_new_timecard_id,
        p_timecard_ovn    => v_new_timecard_ovn);
      -- messages have been returned
      IF v_tbv_messages.COUNT != 0 THEN
        i := v_tbv_messages.FIRST;
        LOOP
          EXIT WHEN (NOT v_tbv_messages.EXISTS (i));
          -- First translate the message as the messagetable returned does not give the actual
          -- message, only the message_name which doesn't mean anything to the user.
          v_message := fnd_message.get_string (appin  => v_tbv_messages (i).application_short_name,
                                               namein => v_tbv_messages (i).message_name);
          -- returns 4: 4
          dbms_output.put_line(v_tbv_messages(i).message_name||': '||v_message);
          i := v_tbv_messages.NEXT (i);
        END LOOP;
      END IF;
    END;
    {code}Regards Daniel                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    Daniel,
    OTL is something which is setup in different ways as per requirements, so I am not sure at all about the kind of setup you have got. Unless you provide more details of setup, we can't be of any help.
    --Shiv                                                                                                                                                                                                                                                                                                                                                                                                                                                       

Maybe you are looking for

  • Client-Auth reports: HTTP4031: Unexpected error receiving data: -5938

    I am trying to deploy the clientcert sample applcation that comes with the platform edition of SunOne V7. I have used openssl as a CA and have created client and server certs. I get the following problem.      Sun ONE Application Server - HTTP Status

  • Migration using data pump Oracle 10g - Oracle 11g

    HI all, 1) Right now I`m using Oracle 11g. I have a plan to import data from Oracle 10g. I would like to know if its possible to import data which was exported by datapump on Oracle 10g ? Should I convert somehow expdp output from Oracle 10g to Oracl

  • XML Invoice - help with Tax Summary

    I've been tasked to modify an already modded XML Invoice using XMLP. I need to add a Tax Summary block at the bottom, showing the breakout of the tax codes and amounts charged on the invoice. I've played around with it, but so far I can only get the

  • UPGRADING FROM ORIGINAL IPHONE. HELP HELP HELP HELP

    is it possible to upgrade from the original stainless steel 1st generation iPhone to the new iPhone3Gs.

  • Virus email. How do I delete and delete my trash box?

    Have received an email with a virus. How can I get rid of it? It is in the Trash box, but I would like to completely delete it. How do I delete completely my trash box? Please....