Thursday 6 June 2013

GL Account code and Its description

If CODE_COMBINATION_ID is known then use these FUNCTIONS.
Note :- Here CCID is passed as parameter which gives the value of CODE_COMBINATION_ID.

FOR ACCOUNT CODE

function CF_accountFormula return VARCHAR2 is
v_account VARCHAR2(1000);
v_ccid number;
v_ca_id NUMBER;

begin
    select distinct CHART_OF_ACCOUNTS_ID,
          CODE_COMBINATION_ID
   into  v_ca_id,
         v_ccid
   from  gl_code_combinations_kfv
   where CODE_COMBINATION_ID=:CCID;
 jai_cmn_gl_pkg.get_account_number(v_ca_id, v_ccid, v_account);

RETURN(v_account);
exception
    when others then
    RETURN(NULL);   
end;

FOR ACCOUNT DESCRIPTION

function CF_ACCOUNT_DESCFormula return Char is
v_account VARCHAR2(1000);
v_ccid number;
v_ca_id   number;
begin
   select distinct CHART_OF_ACCOUNTS_ID,
          CODE_COMBINATION_ID
   into  v_ca_id,
         v_ccid
   from  gl_code_combinations_kfv
   where CODE_COMBINATION_ID=:CCID;              
  
   v_account := xla_oa_functions_pkg.get_ccid_description
                                (v_ca_id,
                                 v_ccid
                                );
   return (v_account);
exception
     when others then return(null);
END; 


2 comments: