100% found this document useful (1 vote)
173 views

API Submit Update Time Build Block

This document contains PL/SQL code that initializes global variables, opens a cursor to query a database table, loops through the cursor to update time building blocks and submit timecards, and outputs any messages returned from the process. It initializes the global OTL application, queries the hxc_time_building_blocks table to get a time building block ID, updates that building block and submits timecards while capturing return messages. Any messages returned are translated from codes to text and output.
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
173 views

API Submit Update Time Build Block

This document contains PL/SQL code that initializes global variables, opens a cursor to query a database table, loops through the cursor to update time building blocks and submit timecards, and outputs any messages returned from the process. It initializes the global OTL application, queries the hxc_time_building_blocks table to get a time building block ID, updates that building block and submits timecards while capturing return messages. Any messages returned are translated from codes to text and output.
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

exec dbms_output.

enable(10000000000000000);
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;

lv_time_build_block_id number;
cursor c1 is select htbb.TIME_BUILDING_BLOCK_ID --into lv_time_build_block_id
from hxc_time_building_blocks htbb
where htbb.RESOURCE_ID = 8650
and htbb.SCOPE = 'DETAIL'
and to_char(htbb.DATE_TO,'MM/DD/YYYY') = '12/31/4712'
and to_char(htbb.START_TIME) > '01-JUL-2017';
BEGIN
fnd_global.apps_initialize (1110,23128,809); --- Global OTL Application
Developer RESP_APPL_ID
--fnd_global.apps_initialize
(fnd_profile.value('USER_ID'),fnd_profile.value('RESP_ID'),fnd_profile.value('RESP_
APPL_ID'));
MO_GLOBAL.INIT('HXC');

for c1_rec in c1 loop


hxc_timestore_deposit.update_building_block(p_building_block_id =>
c1_rec.TIME_BUILDING_BLOCK_ID,
p_comment_text => 'submitting' ,
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 loop;
END;

You might also like