SQL Query to get Code Combination Segment Value Description in Oracle Fusion (Invoice Tables)



In this post, we will see how to get Segments Description in Oracle Fusion. For this, we will take example of Code Combination available on AP_INVOICES_ALL table in column ACCTS_PAY_CODE_COMBINATION_ID. We can also use other Code Combination columns available in other Invoices table:



 

 To get the concatenated segments we can use the below function:

GL_FLEXFIELDS_PKG.GET_DESCRIPTION_SQL(
    v_chart_of_account_id,     
    v_segment_number,
    v_segment_value                  
);

So, to get segments descriptions for ACCTS_PAY_CODE_COMBINATION_ID in table AP_INVOICES_ALL use the below SQL:

SELECT
     aia.invoice_id
    ,aia.invoice_num
    ,aia.description
    ,aia.invoice_type_lookup_code
    ,aia.source
    ,aia.invoice_date
    ,aia.invoice_amount
    ,aia.accts_pay_code_combination_id
    ,gcc.segment1
    ,gl_flexfields_pkg.get_description_sql(gcc.chart_of_accounts_id,1,gcc.segment1) segment1_desc
    ,gcc.segment2    
    ,gl_flexfields_pkg.get_description_sql(gcc.chart_of_accounts_id,2,gcc.segment2) segment2_desc
    ,gcc.segment3
    ,gl_flexfields_pkg.get_description_sql(gcc.chart_of_accounts_id,3,gcc.segment3) segment3_desc
    ,gcc.segment4
    ,gl_flexfields_pkg.get_description_sql(gcc.chart_of_accounts_id,4,gcc.segment4) segment4_desc
    ,gcc.segment5
    ,gl_flexfields_pkg.get_description_sql(gcc.chart_of_accounts_id,5,gcc.segment5) segment5_desc
FROM     
     ap_invoices_all aia
    ,gl_code_combinations gcc 
WHERE 1=1
AND gcc.code_combination_id = aia.accts_pay_code_combination_id
AND aia.invoice_id = <InvoiceId>

 

Similarly, we can extract concatenated segments for other columns in other Invoice Tables.

Source: https://docs.oracle.com 



Comments

All Categories

Call Fusion BIP Report2 Change Password1 Code Combinations2 Compute Instance2 CTE1 Custom Images1 Customer1 Data Aggregation2 Database5 Date Conversion1 DB Adapter2 Decryption1 Development1 EBS5 Encryption1 ESS Jobs3 Examine1 FBDI3 Fusion APIs1 Fusion BIP7 GIT2 GL3 GL Journals1 GL_DAILY_CONVERSION_TYPES1 GL_DAILY_RATES1 ICS1 Identity Domain1 Integrations1 Java1 Journal Import1 Keys1 Legal Entity1 LookupTypeLOV1 LOV1 LOVs1 MultiPartAPIs1 Networking1 NVL2 NVL in OIC2 OCI13 OCI Billing1 OCI Compute6 OCI Cost Management1 OCI Events Service1 OCI Free Tier3 oci networking1 OCI Notifification Service1 OCI Security3 OIC4 OIC Mapper2 Oracle26 Oracle ADF17 Oracle APEX1 Oracle Apps60 Oracle Apps R127 Oracle ATP1 Oracle BIP8 Oracle Cloud13 Oracle Cloud Free Tier1 Oracle cloud Infrastructure10 Oracle Cloud Security2 Oracle Cloud VM1 Oracle DB4 oracle ebs6 Oracle ERP4 Oracle ERP Adapter2 Oracle ERP Cloud7 Oracle financials2 Oracle Forms1 Oracle Fusion57 Oracle Fusion BIP4 Oracle Fusion ERP17 Oracle Fusion Financials18 Oracle Integration Cloud3 Oracle OAF17 Oracle OCI14 Oracle OIC22 Oracle SOA 12c10 Oracle SQL17 Oracle VBCS1 Oracle VBS2 Oracle Visual Builder Cloud Service1 Oracle Visual Builder Studio2 Oracle Workflow Notifications1 OracleCloudTutorial1 Others10 Payables2 Payables Import1 Programs1 Properties1 R121 Register BIP as ESS Job1 Reset Password1 Responsibility1 REST4 Security List1 Site Map1 SOAP2 SOAP API2 SOAP UI3 SQL16 SQL Functions3 SQL Queries14 SQL Query8 SQL Tips3 SSH1 TCA1 Value Sets1 VBCS1 vcn1 Virtual Machine2 Virtual Machines1 XML1 XSLT1
Show more