Oracle Forum - The Knowledge Center for Oracle Professionals - Looking Beyond the Possibilities
How to run GL Journal Import program through PL SQL? - Printable Version

+- Oracle Forum - The Knowledge Center for Oracle Professionals - Looking Beyond the Possibilities (http://www.oraerp.com)
+-- Forum: Oracle Applications (http://www.oraerp.com/forum-39.html)
+--- Forum: Oracle Tutorials, Articles, eBooks, Tools & Tips (http://www.oraerp.com/forum-12.html)
+--- Thread: How to run GL Journal Import program through PL SQL? (/thread-71160.html)



How to run GL Journal Import program through PL SQL? - umar79 - 09-08-2014

declare
-- Local variables here
cur_request_id number; v_wait boolean; v_int_run_id number; p_grp_id number;
lc_phase VARCHAR2 (100);
lc_status VARCHAR2 (100);
lc_dev_phase VARCHAR2 (100);
lc_dev_status VARCHAR2 (100);
lc_message VARCHAR2 (100);
begin
-- Test statements here

fnd_file.put_line(fnd_file.log, 'Begin Control intilization');

apps.Gl_Journal_Import_Pkg.Populate_Interface_Control(user_je_source_name => 'Manual', group_id => p_grp_id, set_of_books_id => -1, interface_run_id => v_int_run_id);

update gl_interface_control set group_id = null where interface_run_id = v_int_run_id;
commit;

fnd_file.put_line(fnd_file.log, 'Run ID: ' || to_char(nvl(v_int_run_id,0)));
--27755, 1005, N, , , N, O, Y

cur_request_id := Apps.FND_REQUEST.SUBMIT_REQUEST ( Application => 'SQLGL' -- application short name
, Program => 'GLLEZL' -- program short name
, Description => 'Manual' -- program name
, Start_Time => SysDate -- start date
, Sub_Request => FALSE -- sub-request
, Argument1 => v_int_run_id -- interface run id
, Argument2 => 1005 -- set of books id
, Argument3 => 'N' -- error to suspense flag
, Argument4 => NULL -- from accounting date
, Argument5 => NULL -- to accounting date
, Argument6 => 'N' -- l_summary_flag, -- create summary flag
, Argument7 => 'O' -- import desc flex flag
, Argument8 => 'Y' -- Data security mode flag
);
COMMIT;

fnd_file.put_line(fnd_file.log, 'Request_ID: ' || to_char(cur_request_id));

v_wait := FND_CONCURRENT.WAIT_FOR_REQUEST(cur_request_id,2,60,phase => lc_phase
,status => lc_status
,dev_phase => lc_dev_phase
,dev_status => lc_dev_status
,message => lc_message);

end;