Wednesday, 22 June 2016

Brazil Electronic File Transfer in Receivables

Companies in Brazil use bank services to collect customers. The Brazilian Electronic File Transfer for Receivables (CLL F034) provides the functionality to electronically transfer collection documents to banks using files in the standard CNAB format. The CLL F034 features allows companies to meet Brazilian Bank Transfer requirements by providing customers with the most important bank file formats in Brazil, as each bank has its own format.

Bank Collection Flow
Bank Collection – Setup
1.       Create Bank Accounts: Receivables à Setup à Receipt à Banks à Bank Accounts
2.       Define Format Programs: Receivables à Setup à Receipt à Format Programs
3.       Define Receipt Class: Receivables à Setup à Receipt à Receipt Classes
4.       Define Receipt method Accounts: Brazilian Localizations à Setup à Bank Collections à Receipt Method Accounts
5.       Define bank Instruction Codes: Brazilian Localization à Setup à Bank Collections à Instruction Codes
6.       Define Bank Occurrence Codes: Brazilian Localization à Setup à Bank Collections à Occurrence Codes

Tuesday, 14 June 2016

Excel Merge and Download using Custom Template in APEX


For Merging cells in Excel and for other CSS in download property, i.e  to create 
down loadable XLS formatted sheets from any version of APEX use the following steps:

1. Create a new blank page in the application using Customized template. In that customized template remove all the contents in the page, like navigation menus, APEX page Toolbar, and others , since by putting this in a Before Header process on a page, the entire page will be downloaded as a native Excel Spreadsheet.

2. Create PLSQL Region with no template.

-- Should use recursion for a full tree, but we only need executives. 
DECLARE
   l_dirtotal   NUMBER (12, 2);
BEGIN
   HTP.p
      ('<table border=1 white-space=nowrap><tr style="background-color:silver;">
    <th colspan=5>Employee</th><th>Title</th><th>Salary</th>
    <th>Direct Report Total</th></tr>'
      );

   FOR c_exec IN (SELECT *
                    FROM employee
                   WHERE direct_report_id IS NULL)
   LOOP
      SELECT SUM (salary)
        INTO l_dirtotal
        FROM employee
       WHERE direct_report_id = c_exec.ID;

      HTP.p
         (   '<tr height=80><th align=right><img src="'
          || c_exec.image
          || '"></th><th colspan=4 style="white-space:nowrap;font-size:36px;color:green;background-color:#CCFFCC;">'
          || c_exec.NAME
          || '</th><th>'
          || c_exec.title
          || '</th>
    <th style="font-size:36px;">'
          || TO_CHAR (c_exec.salary, '$999G999G999D00')
          || '</th><th>'
          || TO_CHAR (l_dirtotal, '$999G999G999G999D00')
          || '</th></tr>'
         );

      -- Layer 1
      FOR c_vp IN (SELECT *
                     FROM employee
                    WHERE direct_report_id = c_exec.ID)
      LOOP
         SELECT SUM (salary)
           INTO l_dirtotal
           FROM employee
          WHERE direct_report_id = c_vp.ID;

         HTP.p
            (   '<tr height=55><th colspan=3 align=right><img src="'
             || c_vp.image
             || '"></td><td colspan=2 style="font-size:24px;color:#0000CC;white-space:nowrap;background-color:#CCCCFF;">'
             || c_vp.NAME
             || '</td><td style="text-size:18px;text-align:center;">'
             || c_vp.title
             || '</td><td style="color:red;text-align:right;font-size:20px;">'
             || TO_CHAR (c_vp.salary, '$999G999G999D00')
             || '</td><td>'
             || TO_CHAR (l_dirtotal, '$999G999G999G999D00')
             || '</td></tr>'
            );

         -- Layer 2
         FOR c_grunt IN (SELECT *
                           FROM employee
                          WHERE direct_report_id = c_vp.ID)
         LOOP
            HTP.p
               (   '<tr height=50><th colspan=4 align=right>
        <img src="'
                || c_grunt.image
                || '"></td><td style="text-size:14px;white-space:nowrap;">'
                || c_grunt.NAME
                || '</td><td style="text-align:center;">'
                || c_grunt.title
                || '</td><td style="text-align:right;">'
                || TO_CHAR (c_grunt.salary, '$999G999G999D00')
                || '</td></tr>'
               );
         END LOOP;
      END LOOP;
   END LOOP;

   HTP.p ('</table>');
END;
(Modify the code as per the requirement)


3. Create Before Header process to set HTTP Headers.

BEGIN
   OWA_UTIL.mime_header ('application/vnd.ms-excel', FALSE);
   HTP.prn ('Content-Disposition: attachment; filename="spreadsheet.xls"
'  );
   OWA_UTIL.http_header_close;
END;


4. Redirect the Download button in your screen to this new page.

Sample Output:






















Get Filtered Columns and Values in APEX Interactive Report


In order to get the filtered columns and their corresponding values in APEX Interactive Report, we can use this code. 

So if the user selects multiple filters in IR and we need to retrieve the values of filter columns and their corresponding values, conditions, operators used for the conditions,etc we can retrieve using the below code:


SELECT ircond.condition_name, ircond.condition_type, ircol.report_label,
       ircond.condition_column_name, ircond.condition_operator,
       ircond.condition_expr_type, ircond.condition_expression,
       ircond.condition_expression2, ircond.condition_sql,
       ircond.condition_display, ircond.condition_enabled
  FROM apex_application_page_ir ir JOIN apex_application_page_ir_rpt irr
       ON ir.interactive_report_id = irr.interactive_report_id
       JOIN apex_application_page_ir_cond ircond
       ON irr.report_id = ircond.report_id
       JOIN apex_application_page_ir_col ircol
       ON ir.interactive_report_id = ircol.interactive_report_id
     AND ircond.condition_column_name = ircol.column_alias
 WHERE ir.application_id = TO_NUMBER (:app_id)
   AND ir.page_id = TO_NUMBER (:app_page_id)
   AND ir.region_name = 'Interactive Report'
   AND ircond.condition_type = 'Filter'
   AND irr.session_id = :app_session
   AND irr.base_report_id =
          (SELECT apex_ir.get_last_viewed_report_id (TO_NUMBER (:app_page_id),
                                                     ir.region_id
                                                    )
             FROM DUAL)



Use a condition to identify the specific interactive report using either the region name or a static region ID. 

Note: Can filter using Actions Menu and also using Header column filter. 


Example:
The below filtered columns and corresponding values can be retrieved using the above code.

















Friday, 10 June 2016

Open Script - DataBank - CSV or Text File

Open Script - DataBank  

It is used to Provide input data  to Open Script at run time from a Text File.

Click on the below link to read the document

                           DataBank_Text_file_Read                                


By 
Venkata GANNE

Thursday, 9 June 2016

Open Script - DataBank - Database Table

Topics
1.DataBank - DataBase Table Use
2.How to Run Iterations

Objective:- How to Use DataBase Table as Data Bank

Please click on this link to read the document


By
Venkata GANNE