Tuesday 8 July 2014

11i GL Account Name Detail Query

/* Formatted on 7/8/2014 8:40:01 AM (QP5 v5.115.810.9015) */
SELECT gjh.period_name "Period",
       gjh.default_effective_date "Document Date",
       gcc.segment1 "Company",
       gcc.segment2 "Department",
       gcc.segment3 "Account",
       ffvt2.description "Account Name",
       gjh.je_source "Source",
       gjh.currency_code "Currency Type",
       gjl.entered_dr "Entered DR",
       gjl.entered_cr "Entered CR",
       gjh.doc_sequence_value "Voucher",
       gjl.description "Line Description"
FROM gl_je_lines gjl,
     gl_je_headers gjh,
     gl_code_combinations gcc,
     fnd_id_flex_structures_tl fifs2,
     fnd_id_flex_segments fidt2,
     fnd_flex_values ffv2,
     fnd_flex_values_tl ffvt2
WHERE     1 = 1
      AND gjh.je_header_id = gjl.je_header_id
   --   AND gcc.segment1 = '30'
      AND gcc.code_combination_id = gjl.code_combination_id
      --AND gjl.set_of_books_id = 52
      AND gjh.je_source NOT IN ('Payables', 'Recievables')
    --  AND fifs2.id_flex_structure_name = 'SSFT Corp'
      AND fifs2.id_flex_num = fidt2.id_flex_num
     -- AND fidt2.application_column_name = 'SEGMENT3'
      AND fidt2.segment_name = 'Account'
      AND fidt2.flex_value_set_id = ffv2.flex_value_set_id
      AND ffv2.flex_value = gcc.segment3
      AND ffv2.flex_value_id = ffvt2.flex_value_id
    --  AND gjh.creation_date BETWEEN '01-JAN-2006' AND '15-JAN-2007'
ORDER BY gjl.description, gjh.period_name

No comments:

Post a Comment