Search This Blog

Tuesday, June 18, 2013

Register Concurrent Program from Backend

Register Concurrent Program from Backend 

set serveroutput on 
 set verify off
 declare
  v_param_flag varchar2(1);
  v_appl_name varchar2(240) := '&1';
v_base_path varchar2(240) := '&2';
 begin

 begin
  fnd_program.set_session_mode('seed_data');
 end;
 -----------------------------
 ---  Create  Executable   ---
 -----------------------------
 begin

    if fnd_program.executable_exists(
              executable_short_name => 'ZENGLJEINT'
                       ,application => v_appl_name
                                   )
    then
--DBMS_OUTPUT.PUT_LINE('EXISTS');
NULL;
    else
fnd_program.executable (
                         executable => 'ZENGLJEINT'
                        ,short_name => 'ZENGLJEINT'
                       ,application => 'EAG Customization'
                       ,description => ' GL Journal Entry Interface (Loader and Validation)'
                  ,execution_method => 'Host'
               ,execution_file_name => 'ZENGLJEINT'
                   ,subroutine_name =>   NULL 
                       ,ICON_NAME   => NULL
                   ,LANGUAGE_CODE   => 'US'
               ,EXECUTION_FILE_PATH => NULL
);
    end if;
    exception
      when others then
      raise;
 end;

 -----------------------------
 ---  Create   Program     ---
 -----------------------------
 begin
    if fnd_program.program_exists(
                       program => 'ZENGLJEINT'
                  ,application => 'Oracle General Ledger'
                                )
    then
    DBMS_OUTPUT.PUT_LINE('EXISTS');
    else
        fnd_program.register (
                       program => ' GL Journal Entry Interface (Loader and Validation)'
                  ,application => 'Oracle General Ledger'
                      ,enabled => 'Y'
                   ,short_name => 'ZENGLJEINT'
                  ,description => ' GL Journal Entry Interface (Loader and Validation)'
        ,executable_short_name => 'ZENGLJEINT'
        ,executable_application => 'Oracle General Ledger'
                     ,priority =>  NULL
                  ,save_output => 'Y'
                        ,print => 'N'
                         ,cols => 132
                         ,rows => 45
                        ,style => 'Landscape'
               ,style_required => 'N'
                      ,printer => ''
                   ,use_in_SRS => 'Y'
        ,allow_disabled_values => 'N'
                    ,run_alone => 'N'
                 ,enable_trace => 'N'
                      ,restart => 'Y'
                ,nls_compliant => 'Y'
                  ,output_type => 'Text'
           ,execution_options  => NULL
                 ,request_type => NULL
     ,request_type_application => NULL
                    ,icon_name => NULL
                ,language_code => 'US'
      ,mls_function_short_name => NULL
     ,mls_function_application => NULL
                  ,incrementor => NULL
                           );

begin
SELECT DISTINCT 'Y' INTO v_param_flag FROM fnd_flex_value_sets WHERE flex_value_set_name =
'FND_CHAR240';

        fnd_program.parameter (
     program_short_name => 'ZENGLJEINT'
            ,application => 'Oracle General Ledger'
              ,sequence => 1
             ,parameter => 'File Path Name'
           ,description => 'File Path Name'
               ,enabled => 'Y'
             ,value_set => 'FND_CHAR240'
          ,default_type => ''
   ,default_value => ''
              ,required => 'Y'
       ,enable_security => 'N'
                 ,range => ''
               ,display => 'Y'
          ,display_size => 30
      ,description_size => 50
,concatenated_description_size => 25
                ,prompt => 'File Path Name'
                 ,token => ''
                             );
exception
    when no_data_found then
    raise;
  end;

  begin
    SELECT DISTINCT 'Y' INTO v_param_flag FROM fnd_flex_value_sets WHERE flex_value_set_name =
    'FND_CHAR240';

      fnd_program.parameter (
     program_short_name => 'ZENGLJEINT'
           ,application => 'Oracle General Ledger'
              ,sequence => 2
               ,parameter => 'Base Path'
            ,description => 'Base Path'
               ,enabled => 'Y'
             ,value_set => 'FND_CHAR240'
          ,default_type => 'Constant'
   ,default_value => v_base_path
              ,required => 'Y'
       ,enable_security => 'N'
                 ,range => ''
               ,display => 'Y'
          ,display_size => 15
      ,description_size => 50
      ,concatenated_description_size => 25
                ,prompt => 'Base Path'
                 ,token => ''
                             );
  exception
    when no_data_found then
    raise;
  end;

begin
    SELECT DISTINCT 'Y' INTO v_param_flag FROM fnd_flex_value_sets WHERE flex_value_set_name =
    'FND_NUMBER15_REQUIRED';

     fnd_program.parameter (
     program_short_name => 'ZENGLJEINT'
            ,application => 'Oracle General Ledger'
              ,sequence => 3
       ,parameter => 'Set Of Book Id'
,description => 'Set Of Book Id'
                   ,enabled => 'Y'
 ,value_set => 'FND_NUMBER15_REQUIRED'
                ,default_type => 'Profile'
   ,default_value => 'GL_SET_OF_BKS_ID'
                  ,required => 'Y'
       ,enable_security => 'N'
                 ,range => ''
               ,display => 'N'
          ,display_size => 15
      ,description_size => 50
,concatenated_description_size =>  25
                ,prompt => 'Set Of Book Id'
                  ,token => ''
                             );
exception
when no_data_found then
    raise;
  end;

  begin
    SELECT DISTINCT 'Y' INTO v_param_flag FROM fnd_flex_value_sets WHERE flex_value_set_name =
    'GL_SRS_JOURNAL_SOURCE';

      fnd_program.parameter (
     program_short_name => 'ZENGLJEINT'
           ,application => 'Oracle General Ledger'
              ,sequence => 4
             ,parameter => 'JE Batch Source Name'
           ,description => 'JE Batch Source Name'
               ,enabled => 'Y'
             ,value_set => 'GL_SRS_JOURNAL_SOURCE'
          ,default_type => ''
     ,default_value => ''
              ,required => 'Y'
       ,enable_security => 'N'
                 ,range => ''
               ,display => 'Y'
          ,display_size => 25
      ,description_size => 50
,concatenated_description_size =>  25
                ,prompt => 'JE Batch Source Name'
                  ,token => ''
                             );
exception
    when no_data_found then
    raise;
end;

  begin
    SELECT DISTINCT 'Y' INTO v_param_flag FROM fnd_flex_value_sets WHERE flex_value_set_name =
    'FND_NUMBER15';
      fnd_program.parameter (
     program_short_name => 'ZENGLJEINT'
           ,application => 'Oracle General Ledger'
              ,sequence => 5
             ,parameter => 'Group Id'
           ,description => 'Group Id'
               ,enabled => 'Y'
             ,value_set => 'FND_NUMBER15'
          ,default_type => 'Constant'
   ,default_value => '9999'
  ,required => 'Y'
       ,enable_security => 'N'
                 ,range => ''
               ,display => 'Y'
          ,display_size => 15
      ,description_size => 50
,concatenated_description_size =>  25
                ,prompt => 'Group Id'
                  ,token => ''
                             );
  exception
    when no_data_found then
    raise;
  end;

DBMS_OUTPUT.PUT_LINE('SUCCESS');
end if;
    exception
      when others then
      raise;
    end;
    commit;
    exception
      when others then
      Rollback;
    end;
/

No comments:

Post a Comment