Pages

Friday, January 31, 2014

Calling Con-current program using procedure

create or replace procedure call_con_prg(l_return_code out number,
                               l_return_msg out varchar2)
is
l_con_prg   varchar2(100);
--l_return_msg    varchar2(200);
--l_return_code   number;
begin                              
fnd_global.apps_initialize (user_id           => 1548,
                                resp_id           => 50664,            --l_resp,          
                                resp_appl_id      => 7000              --l_appl          
                               );
l_con_prg := fnd_request.submit_request ('SQLAP',                          -- application
                                'JSAISALE',                                -- program (short name)
                                'SALES ORDER CREATION',                    -- description (optional)
                                '',                                        -- start_time (optional)
                                FALSE                                     -- sub_request (optional)
                                );
l_return_msg := 'Request submitted. ID = ' || l_con_prg;
l_return_code := 0;

exception
when others then
l_return_msg:='Reqest submission Error:'||sqlerrm;
l_return_code:=2;
end call_con_prg;                              


DECLARE
V_RETURN_CODE NUMBER;
V_RETURN_MSG VARCHAR2(200);
BEGIN
call_con_prg(
l_RETURN_CODE => V_RETURN_CODE,
l_RETURN_MSG => V_RETURN_MSG
);
DBMS_OUTPUT.PUT_LINE('V_RETURN_CODE = ' || V_RETURN_CODE);
DBMS_OUTPUT.PUT_LINE('V_RETURN_MSG = ' || V_RETURN_MSG);
END;

No comments:

Post a Comment