Tuesday, March 6, 2012

API to delete Template in OTL

begin
hxc_self_service_time_deposit.delete_timecard(37275916, sysdate, 'DELETE','OTL Deposit Process',null);
end;

API To Delete whole time card for the week in OTL

DECLARE
   -- Constant declarations
   l_otl_appl_id   CONSTANT NUMBER (3) := 809;            --OTL application id
   l_resp_appl_id           NUMBER (10) := 51102;      --OTL Responsibility id
   l_user_id                VARCHAR2 (20) := 120345; -- id from fnd_user table
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.
   FND_GLOBAL.
    APPS_INITIALIZE (user_id        => l_user_id,
                     resp_id        => l_resp_appl_id,
                     resp_appl_id   => l_otl_appl_id); -- This is the appl_id for OTL, do not change

   --
   --Delte time card API calling
   --
   hxc_timestore_deposit.DELETE_TIMECARD (p_building_block_id => 37275996); --p_building_block_id  is the timecard id with scope 'Timecard' and endate should be ''12/31/4712

   COMMIT;
END;

API To Delete timecard Detail(row wise) in OTL

DECLARE
-- Constant declarations
-- This is the appl_id for OTL, do not change
c_otl_appl_id CONSTANT NUMBER (3) := 809;
-- 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;
l_out_timecard_id hxc_time_building_blocks.time_building_block_id%TYPE;
l_out_timecard_ovn hxc_time_building_blocks.object_version_number%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.
FND_GLOBAL.APPS_INITIALIZE( user_id => 120345
,resp_id => 51102
,resp_appl_id => 809 );-- This is the appl_id for OTL, do not change
--xc_self_service_time_deposit.delete_timecard(37276080, sysdate, 'DELETE','OTL Deposit Process',null);
hxc_timestore_deposit.delete_detail_bb (
p_building_block_id =>37276080,
p_app_blocks=> l_tbl_timecard_info,
p_app_attributes=> l_tbl_attributes_info
);
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_out_timecard_id,
p_timecard_ovn=> l_out_timecard_ovn
);
COMMIT;
END;