Search This Blog

Friday, September 16, 2011

R12 Subledger Accounting Process Events

You can run accounting in two ways, one is Online other is batch mode. Online accounting is ideal when you want to generate accounting event for one transaction. Batch mode accounting process will be initiated by submitting accounting concurrent request (Create Accounting, Submit accounting)
There is no difference if you run online accounting or batch accounting in terms of the event generation. Only different is in detailed reporting
Tables that are involved in this process are
XLA_TRANSACTION_ENTITIES
XLA_EVENTS
XLA_AE_HEADERS
XLA_AE_LINES
GL_IMPORT_REFERENCES
GL_JE_LINES
GL_JE_HEADERS
GL_BALANCES

Links Between these tables

GL_JE_LINES (JE_HEADER_ID, JE_LINE_NUM)    GL_IMPORT_REFERENCES (JE_HEADER_ID, JE_LINE_NUM)
GL_IMPORT_REFERENCES (GL_SL_LINK_TABLE, GL_SL_LINK_IDXLA_AE_LINES (GL_SL_LINK_TABLE, GL_SL_LINK_ID)
XLA_AE_LINES (APPLICAITON_ID, AE_HEADER_ID)XLA_AE_HEADERS (APPLICATION_ID, AE_HEADER_ID)
XLA_AE_HEADERS (APPLICATION_ID, EVENT_ID)XLA_EVENTS (APPLICATION_ID, EVENT_ID)
XLA_EVENTS (APPLICATION_ID, ENTITY_ID)XLA_TRANSACTION_ENTITIES (APPLICATION_ID, ENTITY_ID)

Draft : Draft will create journal entries, which are not final, which means they are not ready to be transferred to GL.
You can create accounting on this transaction again and again, which will delete the old journal entries and create new ones. You can’t transfer these journal entries to GL.
xla_events.process_status_code = D
xla_events.event_status_code = U
xla_ae_headers.accounting_entry_status_code = D

Final : Final will create journal entries, which can be transferred to GL. Once it is finally accounted you can’t run create accounting on the particular transaction (specifically on that event).
Run Transfer Journal Entries to GL program
xla_events.process_status_code = P
xla_events.event_status_code = P
xla_ae_headers.accounting_entry_status_code = F

Final Post: Final Post will create journal entries in final mode, transfer them to GL and post them.
xla_ae_headers.accounting_entry_status_code = F
xla_ae_headers.transfer_status_code = Y
xla_events.process_status_code = P
xla_events.event_status_code = P


Source: http://appssupport.com/2010/05/21/r12-subledger-accounting-process-events/

Friday, September 9, 2011

Reading parameterized cursor example

declare
p_eod_signal_type varchar2(29) := 'FAGIO';
p_eod_date varchar2(29) := '2011-08-09';
v_rec_count number := 0;
 CURSOR gl_eod_txns_c(p_eod_date IN VARCHAR2, p_eod_signal_type IN VARCHAR2) IS
SELECT je_header_id,
           period,
           je_line_num,
           effective_date,
           bank_day,
           accounted_cr,
           accounted_dr,
           is_credit,
           verification_number,
           source_nr,
           clnr,
           account_nr,
           rst,
           aggr_flag,
           accounting_sequence,
           ledger_id, --added by p950nle for RESTORE
           je_category_key --added for defect 1037
    FROM   xxogl_f04_gl_eod_txns_v xfgetv
    WHERE  xfgetv.eod_date = p_eod_date
    AND xfgetv.ledger_id in decode(p_eod_signal_type, 'CAL', '2047', 'FAGIO', '2044');
   
begin
  for l2 in gl_eod_txns_c(p_eod_date, p_eod_signal_type)
  loop
     dbms_output.put_line(gl_eod_txns_c%Rowcount || ' ' || l2.ledger_id);
  end loop;
  dbms_output.put_line('Executed');
end;