Thursday, 12 January 2012

PO RECEIPT WITH ACCOUNT

SELECT /*+INDEX (RSH RCV_SHIPMENT_HEADERS_U1) INDEX (GCCK GL_CODE_COMBINATIONS_U1)*/
       rsh.receipt_num, rt.transaction_type, NULL account_type,
       gcck.concatenated_segments, rrsl.accounted_cr, rrsl.accounted_dr,
       rrsl.currency_code, ood.organization_code organization_code,
       rrsl.accounting_date gl_date
  FROM rcv_receiving_sub_ledger rrsl,
       rcv_transactions rt,
       rcv_shipment_headers rsh,
       gl_code_combinations_kfv gcck,
       org_organization_definitions ood
 WHERE rrsl.rcv_transaction_id = rt.transaction_id
   AND rt.shipment_header_id = rsh.shipment_header_id
   AND rrsl.code_combination_id = gcck.code_combination_id
   AND rsh.organization_id = ood.organization_id
   AND rrsl.accounting_date between :p_from_date and :to_from_date
   AND ood.organization_code = :organization_code
UNION
SELECT jirjb.receipt_num, jirjb.acct_nature, jirjb.acct_type,
       gcck.concatenated_segments, jirjb.entered_cr, jirjb.entered_dr,
       jirjb.currency_code, ood.organization_code organization_code,
       jirjb.transaction_date gl_date
  FROM ja_in_rcv_journals_b jirjb,
       gl_code_combinations_kfv gcck,
       org_organization_definitions ood
 WHERE jirjb.code_combination_id = gcck.code_combination_id
   AND jirjb.organization_code = ood.organization_code
   AND jirjb.transaction_date between :p_from_date and :to_from_date
   AND ood.organization_code = :organization_code


select * from JAI_RCV_JOURNAL_ENTRIES   ---->  This table is R12

ja_in_rcv_journals_b    ----- >   This is 11i table

No comments:

Post a Comment