In R12, We Can’t just directly get the Code Combination ( i.e Accounting Flex Field) Description from a single table. But Oracle has provided a package, which will help to get the description easily.

Script:
SELECT GCC.CODE_COMBINATION_ID,
       GCC.SEGMENT1,
       GCC.SEGMENT2,
       GCC.SEGMENT3,
       GCC.SEGMENT4,
       GCC.SEGMENT5,
       GCC.SEGMENT6,
       GCC.SEGMENT7,
       GCC.SEGMENT8,
       SUBSTR (
          APPS.GL_FLEXFIELDS_PKG.GET_DESCRIPTION_SQL (
             GCC.CHART_OF_ACCOUNTS_ID,
             1,
             GCC.SEGMENT1),
          1,
          40)
          SEGMENT1_DESC,
       SUBSTR (
          APPS.GL_FLEXFIELDS_PKG.GET_DESCRIPTION_SQL (
             GCC.CHART_OF_ACCOUNTS_ID,
             2,
             GCC.SEGMENT2),
          1,
          40)
          SEGMENT2_DESC,
       DECODE (
          GCC.SEGMENT3,
          NULL, ”,
          SUBSTR (
             APPS.GL_FLEXFIELDS_PKG.GET_DESCRIPTION_SQL (
                GCC.CHART_OF_ACCOUNTS_ID,
                3,
                GCC.SEGMENT3),
             1,
             40))
          SEGMENT3_DESC,
       DECODE (
          GCC.SEGMENT4,
          NULL, ”,
          SUBSTR (
             APPS.GL_FLEXFIELDS_PKG.GET_DESCRIPTION_SQL (
                GCC.CHART_OF_ACCOUNTS_ID,
                4,
                GCC.SEGMENT4),
             1,
             40))
          SEGMENT4_DESC,
       DECODE (
          GCC.SEGMENT5,
          NULL, ”,
          SUBSTR (
             APPS.GL_FLEXFIELDS_PKG.GET_DESCRIPTION_SQL (
                GCC.CHART_OF_ACCOUNTS_ID,
                5,
                GCC.SEGMENT5),
             1,
             40))
          SEGMENT5_DESC,
       DECODE (
          GCC.SEGMENT6,
          NULL, ”,
          SUBSTR (
             APPS.GL_FLEXFIELDS_PKG.GET_DESCRIPTION_SQL (
                GCC.CHART_OF_ACCOUNTS_ID,
                6,
                GCC.SEGMENT6),
             1,
             40))
          SEGMENT6_DESC,
       DECODE (
          GCC.SEGMENT7,
          NULL, ”,
          SUBSTR (
             APPS.GL_FLEXFIELDS_PKG.GET_DESCRIPTION_SQL (
                GCC.CHART_OF_ACCOUNTS_ID,
                7,
                GCC.SEGMENT7),
             1,
             40))
          SEGMENT7_DESC,
       DECODE (
          GCC.SEGMENT9,
          NULL, ”,
          SUBSTR (
             APPS.GL_FLEXFIELDS_PKG.GET_DESCRIPTION_SQL (
                GCC.CHART_OF_ACCOUNTS_ID,
                8,
                GCC.SEGMENT8),
             1,
             40))
          SEGMENT8_DESC,
       GCC.CHART_OF_ACCOUNTS_ID CHART_OF_ACCOUNTS_ID,
       GCC.ACCOUNT_TYPE
  FROM GL_CODE_COMBINATIONS GCC
  WHERE CODE_COMIBINATION_ID = :P_ID

Where: P_ID, you can pass Code Combination Id to get description for particular Accounting Combination.

Pre-Requisites:
    ————–
      a) set of books should be defined
      b) Current Conversion rates and accounting periods need to be defines
      c) Source and Category Name Should be defined

    Interface Tables:
    —————-
      GL_INTERFACE
 
    Base Tables:
    ———–
       GL_JE_HEADERS
       GL_JE_LINES
       GL_JE_BATCHES

 Standard Program:
 Go to General Ledger Vision Operations(USA)
   Run =>Import
 Here Give the Source name and Save.

While Click on the save button  Back end One Program Concurrent Program is running.If it is Success the Records are Successfully loaded from interface table to base Table Others wise Some Error are there.
Copy that Request_id and Enter into Generals our Records will be there………..

   Validation Columns:
   ——————
       Source       period_name   currency_code   set_of_books_id
       je_source    je_catregory  accounting_date entered_dr , entered_cr
       accounted_cr accounted_dr  encumberance_type_id

    Source = ‘NEW’
    period need to be open status in  gl_period_statuses
    souce_name defined in gl_je_source table
    category_name defines  gl_je_Category
    currency available in fnd_Currencies
    accounted_cr and accounted_dr total should be same.

Control file for GL_Interface:

LOAD DATA
INFILE *
TRUNCATE INTO TABLE GL_INTERFACE_TEMP
FIELDS TERMINATED BY ‘,’ OPTIONALLY ENCLOSED BY ‘”‘
TRAILING NULLCOLS
(STATUS,
 SET_OF_BOOKS_ID,
 ACCOUNTING_DATE,
 CURRENCY_CODE,
 DATE_CREATED,
 CREATED_BY,
 ACTUAL_FLAG,
 USER_JE_CATEGORY_NAME,
 USER_JE_SOURCE_NAME,
 SEGMENT1,
 SEGMENT2,
 SEGMENT3,
 SEGMENT4,
 SEGMENT5,
 ENTERED_DR,
 ENTERED_CR,
 ACCOUNTED_DR,
 ACCOUNTED_CR,
 GROUP_ID)

BEGIN DATA
NEW,1,11-AUG-2002,USD,11-AUG-2002,1318,A,Inventory,JETFORMS,01,110,7730,0000,000,555,555,555,555,11
NEW,1,11-AUG-2002,USD,11-AUG-2002,1318,A,Inventory,JETFORMS,01,110,7730,0000,000,554,554,554,554,11

Script
sqlldr apps/apps control=’/apps/aptest/visappl/xxcus/11.5.0/bin/xx_gl.ctl’    log=’/apps/aptest/visappl/xxcus/11.5.0/bin/xx_gl.log’

exit 0

GL Interface Package:

CREATE OR REPLACE package body APPS.xx_gl_int_pkg
is
procedure dis_log(p_msg in varchar2)
is
begin
fnd_file.put_line(fnd_file.log,p_msg);
end;

procedure main(errbuf out varchar2,
               retcode out varchar2
               )
 is
 cursor c1 is select a.rowid row_id,a.* from GL_INTERFACE_TEMP a;
 v_gl_int    gl_interface%rowtype;
 v_process_flag    varchar2(10);
 v_error_msg   varchar2(100);
 v_tot_err_msg   varchar2(1000);
 begin
 
   dis_log(‘before entering the loop’);
 
 
 for i in c1 loop
                v_error_msg :=null;
                v_process_flag:=’S’;
                v_tot_err_msg:=null;
                v_gl_int:=null;
              –currency_code validation
                begin
                select  currency_code into v_gl_int.currency_code
                                      from fnd_currencies
                                     where currency_code=i.currency_code;
                 exception
                 when no_data_found then
                    v_process_flag:=’E’;
                    v_error_msg  := ‘Invalid Currency Code =>’||i.currency_code;
                    v_tot_err_msg:= v_tot_err_msg||’ ‘||v_error_msg ;
                 when others then
                    v_process_flag:=’E’;
                    v_error_msg   := ‘ Exception at Currency Code =>’||i.currency_code;
                    v_tot_err_msg:= v_tot_err_msg||’ ‘||v_error_msg ;
                end;    
               
               
                –user_je_source_name validation
               
                begin
               
                  select user_je_source_name into v_gl_int.user_je_source_name
                                             from gl_je_sources
                                            where user_je_source_name=i.user_je_source_name;
                  exception
                 when no_data_found then
                    v_process_flag:=’E’;
                    v_error_msg  := ‘Invalid Sourec Name =>’||i.user_je_source_name;
                    v_tot_err_msg:= v_tot_err_msg||’ ‘||v_error_msg ;
                 when others then
                    v_process_flag:=’E’;
                    v_error_msg   := ‘ Exception at Sourec Name =>’||i.user_je_source_name;
                    v_tot_err_msg:= v_tot_err_msg||’ ‘||v_error_msg ;
                end;    
               
                –category_name  validation
                begin
                     select user_je_category_name into v_gl_int.user_je_category_name
                     from gl_je_categories
                     where user_je_category_name=i.user_je_category_name;
                  exception
                  when no_data_found then
                    v_process_flag:=’E’;
                    v_error_msg  := ‘Invalid category_name =>’||i.user_je_category_name;
                    v_tot_err_msg:= v_tot_err_msg||’ ‘||v_error_msg ;
                  when others then
                    v_process_flag:=’E’;
                    v_error_msg   := ‘ Exception at category_name =>’||i.user_je_category_name;
                    v_tot_err_msg:= v_tot_err_msg||’ ‘||v_error_msg ;  
                 
                end;
               
                 –user id validation
               
                begin
                     select user_id into v_gl_int.created_by from fnd_user
                                   where  user_id = i.created_by;
                  exception
                  when no_data_found then
                    v_process_flag:=’E’;
                    v_error_msg  := ‘Invalid user id =>’||i.created_by;
                    v_tot_err_msg:= v_tot_err_msg||’ ‘||v_error_msg ;
                  when others then
                    v_process_flag:=’E’;
                    v_error_msg   := ‘ Exception at user id =>’||i.created_by;
                    v_tot_err_msg:= v_tot_err_msg||’ ‘||v_error_msg ;
                   
                end;
               
                 — set of books id validation
               
                begin
               
                      SELECT SET_OF_BOOKS_ID INTO v_gl_int.set_of_books_id
                      FROM GL_SETS_OF_BOOKS WHERE SET_OF_BOOKS_ID=i.set_of_books_id;
                   exception
                  when no_data_found then
                    v_process_flag:=’E’;
                    v_error_msg  := ‘Invalid set of books id =>’||i.set_of_books_id;
                    v_tot_err_msg:= v_tot_err_msg||’ ‘||v_error_msg ;
                  when others then
                    v_process_flag:=’E’;
                    v_error_msg   := ‘ Exception atset of books id =>’||i.set_of_books_id;
                    v_tot_err_msg:= v_tot_err_msg||’ ‘||v_error_msg ;
                end;
             
                         v_gl_int.status                    :=i.status;
                        — v_gl_int.set_of_books_id           :=i.set_of_books_id;
                         v_gl_int.accounting_date           :=i.accounting_date;
                        — v_gl_int.currency_code             :=i.currency_code;
                         v_gl_int.date_created              :=i.date_created;
                         –v_gl_int.created_by                :=i.created_by;
                         v_gl_int.actual_flag               :=i.actual_flag ;
                         –v_gl_int.user_je_category_name     :=i.user_je_category_name;
                        –v_gl_int.user_je_source_name       :=i.user_je_source_name;
                         v_gl_int.segment1                  :=i.segment1;
                         v_gl_int.segment2                  :=i.segment2;
                         v_gl_int.segment3                  :=i.segment3;
                         v_gl_int.segment4                  :=i.segment4;
                         v_gl_int.segment5                  :=i.segment5 ;
                         v_gl_int.entered_dr                :=i.entered_dr;
                         v_gl_int.entered_cr                :=i.entered_cr;
                         v_gl_int.accounted_dr               :=i.accounted_dr;
                         v_gl_int.accounted_cr              :=i.accounted_cr;
                         v_gl_int.group_id                  :=i.group_id;
                       
             
               
                 dis_log(‘before inserting the loop’);  
               
                   if v_process_flag = ‘S’ then    
               
                    insert into gl_interface values v_gl_int;
               
                   end if;
           update GL_INTERFACE_TEMP set process_flag=v_process_flag,
                                           error_message=v_tot_err_msg
                       where rowid=i.row_id;
                 
                 dis_log(‘after inserting the loop’);    
 end loop;
 exception
 when others then
 dis_log(‘exception occured at main loop’);
 end main;
 end xx_gl_int_pkg;

The ledger is a basic concept in Release 12. The ledger replaces the 11i concept of a set of books. It represents an accounting representation for one or more legal entities or for a business need such as consolidation or management reporting. Companies can now clearly and efficiently model its legal entities and their accounting representations in Release 12. This seems to be a major area in getting success of the shared service center and single instance initiatives where many or all legal entities of an enterprise are accounted for in a single instance, and data, setup, and processing must be effectively secured but also possibly shared.

Now, legal Entities can be mapped to entire Ledgers or if you account for more than one legal entity within a ledger, you can map a legal entity to balancing segments within a ledger.
While a set of books is defined by 3Cs

  1. chart of accounts
  2. functional currency
  3. accounting calendar,

The addition in this list the ledger is defined by a 4th C: the accounting method.

This 4th C allows you to assign and manage a specific accounting method for each ledger. Therefore, when a legal entity is subject to multiple reporting requirements, separate ledgers can be used to record the accounting information.
Accounting Setup Manager is a new feature that allows you to set up your common financial setup components from a central location.

General Ledger Setup Flowchart

While you can set up your Oracle General Ledger application in many different ways, and defer optional set up steps until you are ready to use the corresponding functionality, we recommend you use the order suggested in the following flowchart: Some of the steps outlined in this flowchart and setup checklist are Required and some are Optional. You need to perform Optional steps only if you plan to use the related feature or complete certain business functions.

The following setup steps are a high level overview of the setup steps related to Oracle
General Ledger and Accounting Setup Manager. 



Leger is created in 5 stages
1. Create Legal Entity.
2. Define Leger.
3. Define Accounting Options.
4. Assign Legal entities to your Ledger .

5. Assign Balancing Segment Values to respective Legal entities. 


Navigation: General Ledger –> Setup –> Financials –> Accounting Setup Manager –> Accounting Setups.


  • Create legal entity
Click on Create Accounting Setup and then click on Create Legal entity.

Click on Apply and then click on Next.

  • Define Leger



Click on Next and then Finish.

  • Define Accounting Options

Click on Define Accounting Options and click on update.


 Click on Next, and assign Retained earnings Account.

  
  Click on Next, Nextand Finsh.

Assign Legal entities to your Ledger.

Click on Add Legal Entity.
  
 Click on Add Legal entity.

 Add your Legal entity and click on Apply.


  • Assign Balancing segment values to legal entities

Click on the update Balancing Segment Values


Click on Add Balancing Segment Value.


Assign Balancing segment values to these legal entities.


Click on Apply and then click onComplete.


 Once you complete ledger we are getting the following Warning.


 Click on Yes.

 Ofter click on the yes we are getting the following confirmation. 


Click on Return to Accounting Setups.

An organization that uses Oracle subledgers, such as Oracle Cash Management, Order Management and Shipping Execution, Oracle Payables, Oracle Purchasing, Oracle Receivables, and related products. It may be a sales office, a division, or a department. Operating units are not associated with legal entities. 

Operating units are assigned to ledgers and a default legal context. Information is secured by operating unit for these applications using responsibilities. Each user can access, process, and report on data only for the operating units assigned to the MO: Operating Unit or MO: Security Profile profile option. 

The MO: Operating Unit profile option only provides access to one operating unit. 

The MO: Security Profile provides access to multiple operating units from a single responsibility. You can define operating units from the Define Organization window in Oracle HRMS or from Accounting Setup Manager in General Ledger.

For further reference: Visit Google.com and search for “Oracle Multiple Organization Manual”. download the pdf file for detailed information on multiple ORG.

Prerequisites for defining operating unit:

 1. Define Location.
 2. Define Business Group.
 3. Define Ledger.

 Navigation: HRMS –> Work Structures –> Organization –> Description.

Click on New.


Type your operating unit name, type ,location and organization classification.

   
Click on Others.

Selecoperating unit information.

   
Enter the Primary Ledger nameLegal entity name and Operating unit short code

If you want to predict needs of your material or to plan material requirement then you can configure workday calendar for this.
Work day calendar(Oracle Inventory Calendar) provide lot of flexibility in terms of shifts, pattern for working days also you can configure exceptions.
Following are Configuration Steps.
1.       Go to work day calendar.
Setup>Organizations>Calendars

On Workday Calendar Window.

You can choose weekly calendar, monthly or periodic calendar type.
Like 4/4/5 is two four-week periods followed by one five week period and 5/4/4 is vice versa.
For twelve months in a year use calendar months.
 13 Periods is thirteen for week period’s year wise.
Start date and end date are very important in configuring work day calendar.
As your organization standard on and off days will be calculated on the base of start date along with week day.
i.e.  For standard five day week your start date must fall on Monday.
Ok it’s all done on work day calendar window.
Workday Patterns

Now navigate to Workday pattern window.
Like 5 days on 2 day off or 7 day on 0 day off. Whatever is your requirement?
Configuring Shifts

Multiple no of shifts can be configured for single calendar.

Enter shift start time and end time.
Likewise you can separately define different shifts and their specific time lines.

Now navigate back to Inventory Calendar window and save you work.
Saving your work will generate complete calendar from start date to end date given in calendar window.

Handling Exception
Click on any date and then navigate to exceptions window. Do this by choosing the exception list button.
Here you can define exception related to this date.
Like in following picture we create an exception by declaring and off day as on.

Save your work.