Friday 18 August 2017

Out-Bound Interface

                            
OUTBOUND INTERFACE:
---------------------------------

> DEVELOP THE PLSQL PACKAGE AND TRANSFER TO THE SERVER.

> OUTBOUND MEANS EXTRACT TABLE DATA TO TEXT,EXCEL,HTML ETC.

> OTHER MEANING DATABASE TABLE TO FLAT FILE.

> REGISTER OUR PROGRAM AS CONCURRENT PROGRAM.

> ATTACH TO REQUEST GROUP.

> SUBMIT THE PROGRAM.

> CHECK THE FLAT FILE.

PATH LOCATION:(AFTER THE SUBMIT THE PROGRAM OUR FILE STORE IN THIS PATH)
CHOOSE ANYONE PATH

c:\temp, c:\temp, D:\oracle\VIS\db\tech_st\11.1.0\plsql\temp, D:\oracle\VIS\db\tech_st\11.1.0\appsutil\outbound\VIS_apps, c:\temp 

OUTBOUND CODE:

CREATE OR REPLACE PROCEDURE OUTBOUND_QTY(ERRBUF OUT VARCHAR2,RETCODE OUT VARCHAR2)
IS
QTY UTL_FILE.FILE_TYPE; --DECLARE UTL LOCAL VARIABLE
PATH VARCHAR2(200);
FORMAT VARCHAR2(200);
CURSOR CAGE IS SELECT ITM.SEGMENT1,ITM.DESCRIPTION,QTY.TRANSACTION_QUANTITY,QTY.SUBINVENTORY_CODE FROM MTL_SYSTEM_ITEMS_B ITM,MTL_ONHAND_QUANTITIES QTY
WHERE ITM.ORGANIZATION_ID=QTY.ORGANIZATION_ID
AND ITM.SEGMENT1 LIKE 'SAINT%';
BEGIN
FORMAT := 'QTY_ITEMS.txt';
PATH := 'D:\oracle\VIS\db\tech_st\11.1.0\appsutil\outbound\VIS_apps';
QTY := UTL_FILE.FOPEN(PATH,FORMAT,'W'); --OPEN THE UTL FILE DATA MODE ARE  WRITE AND READ
FOR LION IN CAGE LOOP
UTL_FILE.PUT_LINE(QTY,LION.SEGMENT1||'  '|| LION.DESCRIPTION||'  '||LION.TRANSACTION_QUANTITY||'  '||LION.SUBINVENTORY_CODE);
END LOOP;
UTL_FILE.FCLOSE(QTY);  --CLOSE THE UTL FILE
END;
/


Thursday 17 August 2017

Digital Marketing Course Explanation

Supplier Conversion

Supplier Conversion / Interface :
=================================
-- Used to import the Suppliers from Legacy to Oracle Applications
-- Using Open Interface Approach
   Using API Approach

Open Interface Approach :
-------------------------
Flat File
   |
   |-> SQL *LOader
   |
Staging Table
   |
   |-> PLSQL Package
   |
Interface Table
   |
   |-> Standard Conc Programs
   |
Base Tables (AP_SUPPLIERS / HZ_PARTIES
    AP_SUPPLIER_SITES_ALL / HZ_PARTY_SITES
    AP_SUPPLIER_CONTACTS / PO_VENDOR_CONTACTS
                    )
Interface Tables :
------------------
AP_SUPPLIERS_INT
AP_SUPPLIER_SITES_INT
AP_SUP_SITE_CONTACT_INT

Error Table :
-------------
AP_SUPPLIER_INT_REJECTIONS

Standard Programs :
-------------------
Suppliers Open Interface Import
Supplier Sites Open Interface Import
Supplier Contacts Open Interface Import


API Approach :
--------------
-- Application Program Interface
-- Oracle Standard Package

Process :
---------
Flat File
   |
   |-> SQL *LOader
   |
Staging Table
   |
   |-> PLSQL Package
   |
  API
   |
   |
Base Tables (AP_SUPPLIERS / HZ_PARTIES
    AP_SUPPLIER_SITES_ALL / HZ_PARTY_SITES
    AP_SUPPLIER_CONTACTS / PO_VENDOR_CONTACTS
                    )

API :
-----
AP_VENDOR_PUB_PKG

Creation :
----------
create_vendor
create_vendor_site
create_vendor_contact

Updation :
----------
update_vendor
update_vendor_site
update_vendor_contact

Record Types :
--------------
3
1st Rec Type for Suppliers
2nd Rec Type for Supplier Sites
3rd Rec Type for Supplier Contacts


Supplier :
----------
Supplier Name
Supplier Type
Alias
Purchase Check Box
Receipt Check Box

Supplier Site :
---------------
Site Code
Address Line1
Address Line2
City
State
County
Country
Postal Code
Operating Unit
Supplier Name


Contacts :
----------
Title
First Name
Middle Name
Last Name - *
Job Title
Phone Area Code
Phone Number
Supplier SITE


Back End Mandatory Columns :
----------------------------
AP_SUPPLIERS :
--------------
VENDOR_ID
LAST_UPDATE_DATE
LAST_UPDATED_BY
SEGMENT1
SUMMARY_FLAG
ENABLED_FLAG
CREATION_DATE
CREATED_BY

AP_SUPPLIER_SITES_ALL :
-----------------------
VENDOR_SITE_ID
LAST_UPDATE_DATE
LAST_UPDATED_BY
VENDOR_ID
VENDOR_SITE_CODE
CREATION_DATE
CREATED_BY

AP_SUPPLIER_CONTACTS :
----------------------
VENDOR_CONTACT_ID
LAST_UPDATE_DATE
LAST_UPDATED_BY
CREATION_DATE
CREATED_BY
VENDOR_SITE_ID


Single Insert for Supplier Header :
-----------------------------------
VENDOR_ID
LAST_UPDATE_DATE
LAST_UPDATED_BY
SEGMENT1
SUMMARY_FLAG
ENABLED_FLAG
CREATION_DATE
CREATED_BY
VENDOR_NAME
VENDOR_TYPE_LOOKUP_CODE


DECLARE

V_SUPP_REC AP_VENDOR_PUB_PKG.r_vendor_rec_type;
V_SUPP_SITE_REC AP_VENDOR_PUB_PKG.r_vendor_site_rec_type;

v_return_status VARCHAR2(1);
v_msg_count NUMBER;
v_msg_data varchar2(2000);
v_vendor_id NUMBER;
v_party_id NUMBER;
v_msg varchar2(2000);
v_site_return_status VARCHAR2(1);
v_site_msg_count NUMBER;
v_site_msg_data varchar2(2000);
v_vendor_site_id NUMBER;
v_party_site_id NUMBER;
v_location_id NUMBER;
v_site_msg varchar2(2000);

BEGIN
V_SUPP_REC.VENDOR_NAME := 'RTL Supplier 126';
V_SUPP_REC.VENDOR_ID := 676770;
V_SUPP_REC.VENDOR_TYPE_LOOKUP_CODE := 'SUPPLIER';
V_SUPP_REC.segment1 := '676770';
V_SUPP_REC.SUMMARY_FLAG := 'Y';
V_SUPP_REC.ENABLED_FLAG := 'Y';
V_SUPP_REC.INVOICE_CURRENCY_CODE := 'USD';
V_SUPP_REC.PAYMENT_CURRENCY_CODE := 'USD';

AP_VENDOR_PUB_PKG.Create_Vendor
( p_api_version           => 1.0,
  p_init_msg_list => FND_API.G_FALSE,
p_commit     => FND_API.G_TRUE,
p_validation_level => FND_API.G_VALID_LEVEL_FULL,
x_return_status => v_return_status,
x_msg_count => v_msg_count,
x_msg_data => v_msg_data,
p_vendor_rec => V_SUPP_REC,
x_vendor_id => v_vendor_id,
x_party_id => v_party_id
);

COMMIT;
dbms_output.put_line('API Return Status : '||v_return_status);
dbms_output.put_line('v_msg_data : '||v_msg_data);
dbms_output.put_line('v_msg_count : '||v_msg_count);
dbms_output.put_line('Vendor Id : '||v_vendor_id);
dbms_output.put_line('Party Id : '||v_party_id);

for i in 1..v_msg_count
loop
 v_msg := apps.fnd_msg_pub.Get
(   p_msg_index    => i,
       p_encoded    => FND_API.G_TRUE
);
dbms_output.put_line('Error Message : '||v_msg);
end loop;

------- Supplier Sites --------
V_SUPP_SITE_REC.VENDOR_SITE_ID := 676768;
V_SUPP_SITE_REC.VENDOR_SITE_CODE := 'RTL_SITE_126';
V_SUPP_SITE_REC.VENDOR_ID := v_vendor_id;
V_SUPP_SITE_REC.address_line1 := 'Canoga Annex';
V_SUPP_SITE_REC.city := 'Canoga Annex';
V_SUPP_SITE_REC.country := 'US';
V_SUPP_SITE_REC.county := 'Los Angeles';
V_SUPP_SITE_REC.state := 'CA';
V_SUPP_SITE_REC.zip := '60065';
V_SUPP_SITE_REC.org_id := 204;

AP_VENDOR_PUB_PKG.Create_Vendor_site
( p_api_version           => 1.0,
  p_init_msg_list => FND_API.G_FALSE,
p_commit     => FND_API.G_TRUE,
p_validation_level => FND_API.G_VALID_LEVEL_FULL,
x_return_status => v_site_return_status,
x_msg_count => v_site_msg_count,
x_msg_data => v_site_msg_data,
p_vendor_site_rec => V_SUPP_SITE_REC,
x_vendor_site_id => v_vendor_site_id,
x_party_site_id => v_party_site_id,
x_location_id => v_location_id
);

COMMIT;

dbms_output.put_line('API Return Status : '||v_site_return_status);
dbms_output.put_line('v_msg_data : '||v_site_msg_data);
dbms_output.put_line('v_msg_count : '||v_site_msg_count);
dbms_output.put_line('Vendor Site Id : '||v_vendor_site_id);
dbms_output.put_line('Party Site Id : '||v_party_site_id);
dbms_output.put_line('Location Id : '||v_location_id);

for i in 1..v_site_msg_count
loop
 v_site_msg := apps.fnd_msg_pub.Get
(   p_msg_index    => i,
       p_encoded    => FND_API.G_TRUE
);
dbms_output.put_line('Error Message : '||v_site_msg);
end loop;

END;







Xml Publisher Part 2


How to use SQL Functions in .rtf File :
---------------------------------------------

Ex : <?sum(AMOUNT)?>
Ex : <?count(INVOICE_NUM)?>

To Change Field Properties :
----------------------------------
Ex : Number Formatting


How to Split the Pages in .rtf file :
----------------------------------------
-> By Using <?split-by-page-break:?>


How to Print Logos or Images in .rtf :
---------------------------------------------

if we have multiple images
by using <call-template>

Define Template :
---------------------
<?template:A?>
Image1
<?end template:A?>

<?template:B?>
Image2
<?end template:B?>

<?template:C?>
Image3
<?end template:C?>

Call Template :
-----------------
 <?call-template:A?>


Format Triggers in .rtf :
----------------------------
-- Formatting the attributes of Objects.
Ex : No Data Found
-- By Using If Conditions

Syntax :
---------
<?if:col_name = 0?> Print Layout <?end if?>


How to Display the Parameter Values in .rtf :
----------------------------------------------------
in .rdf,
Formula Column

Ex : 1
-------
function CF_P_ORG_VALFormula return Number is
begin
  RETURN :P_ORG_ID;
end;

Ex : 2
-------
function CF_INVOICE_NUM_VALFormula return Char is
begin
  RETURN :P_INVOICE_NUM;
end;



XML Publisher Report with out using .rdf :
------------------------------------------------
-- by Using PLSQL Method

.xml data file format :
-------------------------
<Report Name>
<XXAP_INV_MASTER_DETAILS>
  for loop
      <G_OU_NAME>

                    <OU_NAME>Vision Operations</OU_NAME>
     <INVOICE_NUM>3m_inv1</INVOICE_NUM>

       </G_OU_NAME>
  end for loop;
-- Report Level Columns
</XXAP_INV_MASTER_DETAILS>


SELECT    HOU.NAME OU_NAME,
    AIA.INVOICE_NUM,
    AIA.INVOICE_TYPE_LOOKUP_CODE,
    APS.VENDOR_NAME,
    ASSA.VENDOR_SITE_CODE,
    AIA.INVOICE_AMOUNT,
    AILA.LINE_NUMBER,
    AILA.LINE_TYPE_LOOKUP_CODE,
    (SELECT NAME FROM HR_OPERATING_UNITS
     WHERE ORGANIZATION_ID = AILA.ORG_ID) LINE_OU_NAME,
    AILA.AMOUNT,
    GCC.CONCATENATED_SEGMENTS DIST_ACCOUNT
FROM    HR_OPERATING_UNITS HOU,
    AP_INVOICES_ALL AIA,
    AP_SUPPLIERS APS,
    AP_SUPPLIER_SITES_ALL ASSA,
    AP_INVOICE_LINES_ALL AILA,
    AP_INVOICE_DISTRIBUTIONS_ALL AIDA,
    GL_CODE_COMBINATIONS_KFV GCC
WHERE    1=1
AND    HOU.ORGANIZATION_ID = AIA.ORG_ID
AND    AIA.VENDOR_ID = APS.VENDOR_ID
AND    APS.VENDOR_ID = ASSA.VENDOR_ID
AND    ASSA.VENDOR_SITE_ID = AIA.VENDOR_SITE_ID
AND    ASSA.ORG_ID = HOU.ORGANIZATION_ID
AND     AIA.INVOICE_ID = AILA.INVOICE_ID
AND     AILA.LINE_NUMBER = AIDA.INVOICE_LINE_NUMBER
AND     AIDA.INVOICE_ID = AIA.INVOICE_ID
AND     AIDA.DIST_CODE_COMBINATION_ID = GCC.CODE_COMBINATION_ID
AND    ORGANIZATION_ID = :P_ORG_ID
AND    AIA.VENDOR_ID = NVL(:P_VENDOR_ID, AIA.VENDOR_ID)
AND    AIA.VENDOR_SITE_ID = NVL(:P_VENDOR_SITE_ID,AIA.VENDOR_SITE_ID)
AND    AIA.INVOICE_NUM = NVL(:P_INVOICE_NUM,AIA.INVOICE_NUM);














Xml Publisher Part 1

                                                  --Developed By Sainaatth--


XML Publisher Reports :
----------------------------
-- Is a Template based solustion for Oracle Reports
-- Template based Reporting Tool
-- This is an Independent (Not depend on any Code)
    Depency on .xml data file
-- template builder to add add-ins
we can generate the .xml data file using many methods.
1. Using .rdf
2. PLSQL Method
3. Data Templates / BI
4. HTML Commands
5. Note pad Methods
6. PDF Method

Process :
-----------
1. We have to generate the .xml data file
2. Use the file as input source to the LayOut
    (Layout will be designed in the MS Word -> .rtf)
3. Will see the Output in required format

Process : (Registration) (Using .rdf)
----------
1. We have to develope the .rdf by placing our code in Data Model
    (i.e., No need to design the Lay Out in .rdf)
2. Move the .rdf file in to server ($Custom_TOP/reports/US/)
3. Login to Applications
    Go to System Administrator to create Executable
    Create Concurrent Program by attaching the Executable
  ** Concurrent Program Output method should be XML
4. Add the Conc Program to the Request Group

Navigate the Responsibility, Submit the Request
Get the xml data file.

5. Design the Layout in MS Word by using the .xml data file as source
6. Save the File as .rtf (Rich Text Format)
7. Go to XML Publisher Administrator Responsibility to create Data Definition
    While creating Data Definition,
    we have to give Conc Program Short Name to the "Code" Field.
8. Create Template by giving the Data Definition Details
    and Attach the .rtf file

Diff. b/n .rdf and .rtf :
--------------------------
               RDF                                        RTF
               -----                                        -----
1. Layout Model is dependent on               |1. Layout Model is independent
    Data model Code                             |    (It will look for .xml data file)
2. We can see output in one                       |2. can see the output in different output
    format (by default)                             |    formats
    System parameters
3. we can not use SQL Functions               | 3. We can use SQL Functions at Source
    in rdf Lay out source field                                 field define level
    define level
4. Only one Layout will be there                | 4. we can define multiple .rtf files
                                                    (Multiple .rtf files can be attached
                                                          against to the Single Template)
                                                            (while submitting the conc prog
                                                                we have to select the .rtf file)
5. Not User Friendly                     | 5. User Friendly


AP Invoice Report Using .rdf Method :
--------------------------------------------
 
OU Name   Invoice Number   Invoice Type   Supplier Name  Supp Site  
Invoice Amount

Parameter :
--------------
* OU Name
Supplier Name

Query :
---------
SELECT HOU.NAME OU_NAME,
AIA.INVOICE_NUM,
AIA.INVOICE_TYPE_LOOKUP_CODE,
APS.VENDOR_NAME,
ASSA.VENDOR_SITE_CODE,
AIA.INVOICE_AMOUNT
FROM HR_OPERATING_UNITS HOU,
AP_INVOICES_ALL AIA,
AP_SUPPLIERS APS,
AP_SUPPLIER_SITES_ALL ASSA
WHERE 1=1
AND HOU.ORGANIZATION_ID = AIA.ORG_ID
AND AIA.VENDOR_ID = APS.VENDOR_ID
AND APS.VENDOR_ID = ASSA.VENDOR_ID
AND ASSA.VENDOR_SITE_ID = AIA.VENDOR_SITE_ID
AND ASSA.ORG_ID = HOU.ORGANIZATION_ID
AND ORGANIZATION_ID = :P_ORG_ID
AND AIA.VENDOR_ID = NVL(:P_VENDOR_ID, AIA.VENDOR_ID);




Wednesday 16 August 2017

What Is Collection And Use Of Collection?

Anchor Type Declarations :
--------------------------
%type - Used to give specific column data type to a Variable
%rowtype - Used to give entire row data type to a Variable

Examples : %type
----------
declare
v_vendor_name ap_suppliers.vendor_name%type;
begin
select vendor_name
into v_vendor_name
from ap_suppliers
where vendor_id = 600;
dbms_output.put_line('Vendor Name : '||v_vendor_name);
end;


Examples : %rowtype
----------
declare
v_vendor_type ap_suppliers%rowtype;
begin
select vendor_name,
        segment1,
terms_id,
PAY_GROUP_LOOKUP_CODE
into v_vendor_type.vendor_name,
v_vendor_type.segment1,
v_vendor_type.terms_id,
v_vendor_type.PAY_GROUP_LOOKUP_CODE
from ap_suppliers
where vendor_id = 600;
dbms_output.put_line('Vendor Name : '||v_vendor_type.vendor_name);
dbms_output.put_line('Vendor Number : '||v_vendor_type.segment1);
dbms_output.put_line('Terms ID : '||v_vendor_type.terms_id);
dbms_output.put_line('Pay Group Lookup Code : '||v_vendor_type.PAY_GROUP_LOOKUP_CODE);
end;


PLSQL Collections :
-------------------
-- Composite Data Types / User defined Data types
-- Collection of multiple data types as a Data Type

PLSQL Record Types
PLSQL Table Types (Index by Table)
Nested Table
VARRAY

PLSQL Record Type :
-------------------
-- Collection of Multiple Data Types each with its own name and own attribute
values

Syntax :
--------
TYPE <type_name> is RECORD (col list with Data Type
   );

Ex :
----
TYPE xx_supp_rec IS RECORD (vendor_name ap_suppliers.vendor_name%type,
           segment1 varchar2(100),
   terms_name ap_terms_tl.name%type,
   PAY_GROUP_LOOKUP_CODE varchar2(100)
  );

v_supp_rec xx_supp_rec;

Examples : (RECORD TYPE)
----------
declare
TYPE xx_supp_rec IS RECORD (vendor_name ap_suppliers.vendor_name%type,
           segment1 varchar2(100),
   terms_name ap_terms_tl.name%type,
   PAY_GROUP_LOOKUP_CODE varchar2(100)
  );

v_supp_rec xx_supp_rec;

begin
select vendor_name,
        segment1,
(select name from ap_terms_tl where term_id=aps.terms_id) terms_name,
PAY_GROUP_LOOKUP_CODE
into v_supp_rec.vendor_name,
v_supp_rec.segment1,
v_supp_rec.terms_name,
v_supp_rec.PAY_GROUP_LOOKUP_CODE
from ap_suppliers aps
where vendor_id = 600;
dbms_output.put_line('Vendor Name : '||v_supp_rec.vendor_name);
dbms_output.put_line('Vendor Number : '||v_supp_rec.segment1);
dbms_output.put_line('Terms Name : '||v_supp_rec.terms_name);
dbms_output.put_line('Pay Group Lookup Code : '||v_supp_rec.PAY_GROUP_LOOKUP_CODE);
end;


Examples : (RECORD TYPE with Loop)
----------
declare
cursor c_supp_cur
is
select vendor_name,
        segment1,
(select name from ap_terms_tl where term_id=aps.terms_id) terms_name,
PAY_GROUP_LOOKUP_CODE
from ap_suppliers aps
where rownum < 11;

TYPE xx_supp_rec IS RECORD (vendor_name ap_suppliers.vendor_name%type,
           segment1 varchar2(100),
   terms_name ap_terms_tl.name%type,
   PAY_GROUP_LOOKUP_CODE varchar2(100),
   DESCRIPTION  ap_terms_tl.DESCRIPTION%type
  );

v_supp_rec xx_supp_rec;

begin
for i in c_supp_cur
loop
v_supp_rec.vendor_name := i.vendor_name;
v_supp_rec.segment1 := i.segment1;
v_supp_rec.terms_name := i.terms_name;
v_supp_rec.PAY_GROUP_LOOKUP_CODE := i.PAY_GROUP_LOOKUP_CODE;

select DESCRIPTION
into    v_supp_rec.DESCRIPTION
from ap_terms_tl
where name = i.terms_name;

dbms_output.put_line('Vendor Name : '||v_supp_rec.vendor_name);
dbms_output.put_line('Vendor Number : '||v_supp_rec.segment1);
dbms_output.put_line('Terms Name : '||v_supp_rec.terms_name);
dbms_output.put_line('Terms Desc : '||v_supp_rec.DESCRIPTION);
dbms_output.put_line('Pay Group Lookup Code : '||v_supp_rec.PAY_GROUP_LOOKUP_CODE);
end loop;
end;


PLSQL Table Types :
-------------------
-- Object of Type Table is called PLSQL Table
-- Referenced with Index By

Syntax :
--------
TYPE <type_name> IS TABLE OF <data type>
INDEX BY DATATYPE;

Index By :
----------
pls_interger
varchar2
date


Ex :
----
declare
type xx_emp_tab is TABLE of varchar2
index by pls_integer;

v_emp_tab xx_emp_tab;
begin
select ename
into v_emp_tab
from emp
where empno = 7839;
end;


Ex :
----
declare
TYPE xx_supp_rec IS RECORD (vendor_name ap_suppliers.vendor_name%type,
           segment1 varchar2(100),
   terms_name ap_terms_tl.name%type,
   PAY_GROUP_LOOKUP_CODE varchar2(100)
  );

type xx_sup_tab is TABLE of xx_supp_rec
index by pls_integer;

v_supp_tab xx_sup_tab;

begin

select vendor_name,
        segment1,
(select name from ap_terms_tl where term_id=aps.terms_id) terms_name,
PAY_GROUP_LOOKUP_CODE
into v_supp_tab(1).vendor_name,
v_supp_tab(1).segment1,
v_supp_tab(1).terms_name,
v_supp_tab(1).PAY_GROUP_LOOKUP_CODE
from ap_suppliers aps
where vendor_id = 600;
dbms_output.put_line('Vendor Name : '||v_supp_tab(1).vendor_name);
dbms_output.put_line('Vendor Number : '||v_supp_tab(1).segment1);
dbms_output.put_line('Terms Name : '||v_supp_tab(1).terms_name);
dbms_output.put_line('Pay Group Lookup Code : '||v_supp_tab(1).PAY_GROUP_LOOKUP_CODE);
end;


Table Type Attributes :
-----------------------
FIRST
LAST
COUNT
DELETE
EXTEND
etc..

if v_supp_tab.COUNT >0 then
v_supp_tab.delete;
end if;





Some Of The Exception In Oracle Pl-Sql

EXCEPTIONS:
------------------

- NO_DATA_FOUND:
  --------------------------
   declare
 a number;
 begin
 select empno into a from emp where deptno=100;
 dbms_output.put_line(a);
 exception
 when no_data_found then
 dbms_output.put_line('DATA NOT FOUND');
dbms_output.put_line(SQLCODE);
dbms_output.put_line(SQLERRM);
END;
O/P: DATA NOT FOUND
SQLCODE: 100
SQLERRM:ORA-01403: no data found

- TOO_MANY_ROWS:
  ---------------------------

    declare
a number;
begin
select empno into a from emp where deptno=10;
dbms_output.put_line(a);
exception
when TOO_MANY_ROWS then
dbms_output.put_line('WE CANT EXECUTE MORE THAN ONE ROW');
dbms_output.put_line(SQLCODE);
dbms_output.put_line(SQLERRM);
end;

O/P: WE CANT EXECUTE MORE THAN ONE ROW
CODE: 1433

-- DUP_VAL_ON_INDEX:
   ------------------------------
    begin
INSERT INTO DEPT VALUES(10,'DATA','NO');
exception
when DUP_VAL_ON_INDEX then
dbms_output.put_line('U CANOT ENTER DUPLICATE VALUE IN DEPTNO');
dbms_output.put_line(SQLCODE);
dbms_output.put_line(SQLERRM);
end;

O/P: U CANOT ENTER DUPLICATE VALUE IN DEPTNO
CODE: 0001

-- ZERO_DIVIDE:
   ---------------------
    DECLARE
 A NUMBER;
 begin
 A:=10/0;
 exception
 WHEN ZERO_DIVIDE THEN
 DBMS_OUTPUT.PUT_LINE('DONT ENTER ZEROS IN DIVISION POSITION');
dbms_output.put_line(SQLCODE);
dbms_output.put_line(SQLERRM);
 when NO_DATA_FOUND then
 dbms_output.put_line('U CANOT ENTER DUPLICATE VALUE IN DEPTNO')
 WHEN DUP_VAL_ON_INDEX THEN
 dbms_output.put_line('ANOTHER EXCEPTION');
 WHEN OTHERS THEN
 dbms_output.put_line('ANOTHER TWO');
 end;
O/P: DONT ENTER ZEROS IN DIVISION POSITION
ERRCODE:-1476

--  ERRORS IN EXCEPTIONS:

         1  begin
  2  INSERT INTO DEPT VALUES(10,'DATA','NO');
  3  exception
  4  WHEN OTHERS THEN
  5  dbms_output.put_line('ANOTHER TWO');
  6  when NO_DATA_FOUND then
  7  dbms_output.put_line('U CANOT ENTER DUPLICATE VALUE IN DEPTNO');
  8  WHEN DUP_VAL_N_INDEX THEN
  9  dbms_output.put_line('ANOTHER EXCEPTION');
 10* end;
SQL> /
WHEN OTHERS THEN
*
ERROR at line 4:
ORA-06550: line 4, column 1:
PLS-00370: OTHERS handler must be last among the exception handlers of a block
ORA-06550: line 0, column 0:
PL/SQL: Compilation unit analysis terminated

-- VALUE_ERROR:
   ---------------------

    DECLARE
 A NUMBER;
 begin
 SELECT ENAME INTO A FROM EMP WHERE ENAME LIKE 'KIN%';
 exception
 WHEN ZERO_DIVIDE THEN
 DBMS_OUTPUT.PUT_LINE('DONT ENTER ZEROS IN DIVISION POSITION');
 when NO_DATA_FOUND then
 dbms_output.put_line('U CANOT ENTER DUPLICATE VALUE IN DEPTNO');
 WHEN VALUE_ERROR THEN
 DBMS_OUTPUT.PUT_LINE('DATA TYPE ERROR');
dbms_output.put_line(SQLCODE);
dbms_output.put_line(SQLERRM);
 WHEN DUP_VAL_ON_INDEX THEN
 dbms_output.put_line('ANOTHER EXCEPTION');
 WHEN OTHERS THEN
 dbms_output.put_line('ANOTHER TWO');
 end;

O/P:- DATA TYPE ERROR
ERRCODE:-6502


 DECLARE
 L_SAL EMP.SAL%TYPE;
 BEGIN
 INSERT INTO DEPT VALUES(13,'RAISE','CURSOR');
 SELECT SAL INTO L_SAL FROM EMP WHERE EMPNO=7788;
 IF L_SAL>2000 THEN
 RAISE_APPLICATION_ERROR(-20150,'SAL IS HIGH');
 END IF;
 DBMS_OUTPUT.PUT_LINE('SAL IS'||L_SAL);
 END;


 DECLARE
 SEGMEN MTL_SYSTEM_ITEMS_B.SEGMENT1%TYPE;
 BEGIN
 DELETE FROM DEPT WHERE DEPTNO=90;
 SELECT SEGMENT1 INTO SEGMEN FROM MTL_SYSTEM_ITEMS_B
 WHERE SEGMENT1 LIKE 'SAINT%';
 IF SEGMEN='SAINT BERNARD' THEN
 RAISE_APPLICATION_ERROR(-20150,'USER NAME EXITS');
 END IF;
 DBMS_OUTPUT.PUT_LINE('SAL IS'||SEGMEN);
 END;


Account Payable Interface Process Explanation

                                                             --Code By Sainaatth---


AP Invoice Interface : (Open Interface Approach)
=============
-- To import the legacy supplier invoices into Oracle Payables

Process :
----------
Flat Files (2)
     |
     |--> SQL *Loader (2)
     |
Staging Tables (2)
     |
     |--> PLSQL Package(1 Procedure, 2 Cursors, 2 For Loops, 2 Inserts)
     |
AP_INVOICES_INTERFACE
AP_INVOICE_LINES_INTERFACE
     |
     |--> Payables Open Interface Import
     |
AP_INVOICES_ALL
AP_INVOICE_LINES_ALL
AP_INVOICE_DISTRIBUTIONS_ALL

To Identify Interface Tables :
-----------------------------------
SELECT * FROM ALL_OBJECTS
WHERE OWNER = 'AP'
AND OBJECT_NAME LIKE 'AP%INV%INTERFACE%'
AND OBJECT_TYPE = 'TABLE'

AP_INVOICES_INTERFACE
AP_INVOICE_LINES_INTERFACE


Single Insert Process :
--------------------------
1. Identify the Mandatory columns from the Front End

At Header :
-------------
Invoice Type
Supplier Name
Supplier Number
Supplier Site
Invoice Date
Invoice Num
Invoice Currency Code
Invoice Amount
GL Date
Payment Currency Code
Terms Date
Terms Name
Payment Method

At Lines :
-----------
Line Num
Line Type
Line Amount
GL Date

At Distributions :
--------------------
Dist Num
Dist Type
Dist Amount
GL Date
Account

2. Identify the Mandatory Columns from Back End

SELECT COLUMN_NAME
FROM ALL_TAB_COLS
WHERE TABLE_NAME = 'AP_INVOICES_ALL'
AND OWNER = 'AP'
AND NULLABLE = 'N';

At AP_INVOICES_ALL :
---------------------------
GL_DATE
APPROVAL_READY_FLAG
WFAPPROVAL_STATUS
INVOICE_ID
LAST_UPDATE_DATE
LAST_UPDATED_BY
INVOICE_NUM
SET_OF_BOOKS_ID
INVOICE_CURRENCY_CODE
PAYMENT_CURRENCY_CODE
PAYMENT_CROSS_RATE

At AP_INVOICE_LINES_ALL :
----------------------------------
LAST_UPDATED_BY
LAST_UPDATE_DATE
INVOICE_ID
LINE_NUMBER
LINE_TYPE_LOOKUP_CODE
ACCOUNTING_DATE
SET_OF_BOOKS_ID
AMOUNT
WFAPPROVAL_STATUS

At AP_INVOICE_DISTRIBUTIONS_ALL :
-----------------------------------------------
INVOICE_DISTRIBUTION_ID
ACCOUNTING_DATE
ASSETS_ADDITION_FLAG
ASSETS_TRACKING_FLAG
DISTRIBUTION_LINE_NUMBER
DIST_CODE_COMBINATION_ID
INVOICE_ID
LAST_UPDATED_BY
LAST_UPDATE_DATE
LINE_TYPE_LOOKUP_CODE
PERIOD_NAME
SET_OF_BOOKS_ID

At AP_INVOICES_INTERFACE :
-------------------------------------
INVOICE_ID

At AP_INVOICE_LINES_INTERFACE :
--------------------------------------------
INVOICE_ID


3. Check Base table Mandatory columns are exist in Interface Table or not

AP_INVOICES_ALL : (Exist in AP_INVOICES_INTERFACE)
------------------------
 GL_DATE
,INVOICE_ID
,LAST_UPDATE_DATE
,LAST_UPDATED_BY
,INVOICE_NUM
,INVOICE_CURRENCY_CODE
,PAYMENT_CURRENCY_CODE
,PAYMENT_CROSS_RATE

AP_INVOICE_LINES_ALL & AP_INVOICE_DISTRIBUTIONS_ALL :
----------------------------------------------------------------------------
(Exist in AP_INVOICE_LINES_INTERFACE)

 LAST_UPDATED_BY
,LAST_UPDATE_DATE
,INVOICE_ID
,LINE_NUMBER
,LINE_TYPE_LOOKUP_CODE
,ACCOUNTING_DATE
,AMOUNT
,ACCOUNTING_DATE
,ASSETS_TRACKING_FLAG
,DIST_CODE_COMBINATION_ID
,INVOICE_ID
,LAST_UPDATED_BY
,LAST_UPDATE_DATE
,LINE_TYPE_LOOKUP_CODE

4. Remove the Duplicate columns from the 3rd step columns

AP_INVOICES_INTERFACE :
---------------------------------
 GL_DATE
,INVOICE_ID
,LAST_UPDATE_DATE
,LAST_UPDATED_BY
,INVOICE_NUM
,INVOICE_CURRENCY_CODE
,PAYMENT_CURRENCY_CODE
,PAYMENT_CROSS_RATE

AP_INVOICE_LINES_INTERFACE :
-----------------------------------------
 LAST_UPDATED_BY
,LAST_UPDATE_DATE
,INVOICE_ID
,LINE_NUMBER
,LINE_TYPE_LOOKUP_CODE
,ACCOUNTING_DATE
,AMOUNT
,ASSETS_TRACKING_FLAG
,DIST_CODE_COMBINATION_ID


5. Compare the 4th step (Back End Mandatory Columns) with 1st step columns
   (Front End Mandatory Columns)

Headers :
-----------
 INVOICE_NUM
,GL_DATE
,INVOICE_ID
,INVOICE_TYPE_LOOKUP_CODE
,VENDOR_ID
,VENDOR_SITE_ID
,INVOICE_DATE
,INVOICE_AMOUNT
,LAST_UPDATE_DATE
,LAST_UPDATED_BY
,INVOICE_CURRENCY_CODE
,PAYMENT_CURRENCY_CODE
,PAYMENT_CROSS_RATE
,TERMS_DATE
,TERMS_ID
,PAYMENT_METHOD_CODE
,ORG_ID
,SOURCE

Lines and Distributions :
----------------------------
 LAST_UPDATED_BY
,LAST_UPDATE_DATE
,INVOICE_ID
,LINE_NUMBER
,LINE_TYPE_LOOKUP_CODE
,ACCOUNTING_DATE
,AMOUNT
,DIST_CODE_COMBINATION_ID
,ORG_ID

6. Insert a Single Record into Interface Table then Submit Standard Program

INSERT INTO AP_INVOICES_INTERFACE
(
INVOICE_NUM
,GL_DATE,INVOICE_ID
,INVOICE_TYPE_LOOKUP_CODE,VENDOR_ID
,VENDOR_SITE_ID,INVOICE_DATE,INVOICE_AMOUNT
,LAST_UPDATE_DATE,LAST_UPDATED_BY
,INVOICE_CURRENCY_CODE,PAYMENT_CURRENCY_CODE
,PAYMENT_CROSS_RATE,TERMS_DATE
,TERMS_ID,PAYMENT_METHOD_CODE
,ORG_ID,SOURCE
)
VALUES
('TEST INV2 31MAY16'
,'31-MAY-2010', AP_INVOICES_INTERFACE_S.NEXTVAL
,'STANDARD', 600
,1414, '31-MAY-2010', 300
,SYSDATE, 1318
,'USD','USD'
,1, '31-MAY-2010'
,10002,'CHECK'
,204, 'ERS'
);

INSERT INTO AP_INVOICE_LINES_INTERFACE
(
LAST_UPDATED_BY
,LAST_UPDATE_DATE
,INVOICE_ID
,LINE_NUMBER
,LINE_TYPE_LOOKUP_CODE
,ACCOUNTING_DATE
,AMOUNT
,DIST_CODE_COMBINATION_ID
,ORG_ID
)
VALUES
(1318
,SYSDATE
,AP_INVOICES_INTERFACE_S.CURRVAL
,1
,'ITEM'
,'31-MAY-2010'
,300
,12854
,204
);

COMMIT;


SQL *Loader :
=========

'$1' - Used to pass parameter to the control file

XXAP_INV_HDR_LOAD_EXE
XXAP_INV_LINES_LOAD_EXE


XXAP Invoice Interface Header Loader Program

XXAP Invoice Interface Lines Loader Program


Note :
-------
When we are finding the Request Group name from Responsibility window,
Note the Request Group name along with Application



D:\oracle\VIS\apps\apps_st\appl\ap\12.0.0\bin

AP_INV_HDR_DATA.dat
AP_INV_LINE_DATA.dat


Interview Questions:
------------------------

1. Interface Process
(Note: Know the Tables(Int&Base), Standard Program with Parameters,
         Validations for all Interfaces and Conversions)

2. How to process Error Records
-- Generate a Report using Queries or Scripts
-- Give the rejected data to the Users or Clients
-- Users validate that data and correct it
   and they will place the new data/files into the server
-- Again run the programs for re process

DBA's will place the files into server

3. how will u get the flat file
custom_top/data/in/






Tuesday 15 August 2017

Oracle Report Builder Explanation


                                                          Oracle Report Builders



1)Report Builder is one of the Oracle GUI Tool
   Graphical user Interface

2)By using this we can develop simple and Complex reports

3)There are two ways we can develop the report
         1)Wizard base
         2)Manuval

4)   1)Data Model
       2)Layout model

DataModel will be used to select the data from Database,
SELECT Statemen and Formulas,Summary functions and so on.......

Layout model will used to displays the data model fields in the desired
format.


Layout Model Objects:

1)Text : Will be used to display the standard text information
         like titles,prompts,headings,Address...............

2)Frame : Will be used to display the layout objects only one time
           like totals,titles,Headings and so on

3)Repeating Frame: Will be used to display the objects multiple times
           like database columns,Sub Totals,Page Totals.......

4)Field  : Will be used to display the Data base columns,variables and
           so on.

  First page :  Employee Information Report


Second Page :  Empno Ename  Sal  hiredate   Comm

Last page  : End of the report

Summary Column : If we want to apply summary functions then we will
go for summary columns like Average,count,min,max and so on.

1)Group level   : Executed for every record in the group
2)Report Level  : executed only once for entire report.
Empno  Ename   Sal    HireDate

Total    Emp:
Total    Sal:
Min Salary  :
Max Salary  :


Formula Columns : When we want implement some logic and return the
  value then we will use formula columns.

It is a PL/SQL Function. where we can write PL/SQL code

we can return only one value.

1)Group Level
2)Report Level

Empno   Ename   Sal    Grade  (If sal >5000 'A'
                              (If sal<=5000 and >3000 'B')
                              (if sal<=3000 then  'C')




Total  Emp:
Total  Salary:
Average Emp Salary : (Total salary/TotalEmp)



Place Holder Columns:

A datatype which stores some value and we can use this across the
report.

It will work lika Global variable in the reports.


If we want to return more than one value from the Formula Columns then
it will be used.




Empno   Ename  Sal   HireDate Comm   TotalSal(SAl+Comm) Tax



Tax : if (totalsal>5000 then 7% tax
         (Totalsal>3000 and <=5000 then 4%tax
         (Totalsal<=3000 then 2% tax)

Empno   Ename   Sal   Comm   Tax   Netsalary

Comm :=  15% sal
tax  : 7 % (sal+comm)
netsal  : sal+comm-tax


Triggers  :

Format Trigger
Validation Trigger
Action Trigger
Report Triggers

Format Trigger : To Hide or display the layout objects dynamically it will be
                 used.

layout objects means frame,repeating frame,field,............

Action Triggers: If we want to develop drill down reports then we will use
                 Action Triggers.
       Place the Button in the layout when user press the button we can
       execute some PL/SQL code.

Report Triggers:  5 Types which will fired automatically when we run the
              report

Sequence Order

1)Before Parameter Form
2)after Parameter Form
3)Before report
4)Between pages
5)After REport


Before Parameter Form : Will Execute before the parameter form is going to
                        open.

To assign any default values for the parameter.

After Parameter Form  : After the Parameters are entered in the form and
                        submit it will be executed.

    To change the Parameter values dynamically
And To populate the Lexical parameter values.

Before Report : It will be executed before report is executing and select
                data from database.

Between Pages : When cursor moves from one page to another page it will be
                executed .
                It will be executed (n-1) times.

After Report : after completion of the report. once the output is reach the
               destination (Printer,file,fax,e-mail) then it will be executed.


Parameters :

1)System Parameters
2)User Defined Parameters 1)Bind
                          2)Lexical

Bind parameters will used to pass the the value into the query in the WHERE
Clause

Lexical parameters will be used to replace the string in side of the query
in any clause.

From Deptno
                          To Deptno


Deptno   Empno   Ename   Sal   HireDate




Total Emp     :    should display if >=5
Total Salary  :    Should display if >=7000


Before Parameter form is open Deptno = 10
                              To Deptno = 20

                Sort By : Empno
                          Sal
                          Deptno

SELECT * FROM EMP
&P_ORDER_BY

After Parameter Form Trigger


From Deptno
                                  To Deptno

if user pass the deptno then select between that
otherwise select all the dept employees data


SELECT * FROM EMP
WHERE DEPTNO BETWEEN :P_FROM AND :P_TO

If P_from is entered then it should retrieve all dept from the specified dept

if p_to is entered then it whould retireve upto specified deptno.


WHERE DEPTNO>=:P_FROM

WHERE DEPTNO<=:P_TO

                   Bind                                                            Lexical

1)To pass the Values into the WHERE     1) To Replace the string in the
  clause                                                     query.
2)We will use the symbol ":"           2)We will use the symbol "&"
3)Can be used only in the WHERE         3)In Any Clause
  clause



System Parameters : 

DESFORMAT     :  Html,pdf.....
DESNAME       :  Name of the Printer,E-mail,Fax,File
DESTYPE       :  File,Screen,Print,Fax,E-mail
MODE          :  Bitmap,Character

Confine Mode : 
Lock mode if it is on then we can not take
the child object out of the Parent Object.If it is
off then we can take out of the parent.

FlexMode:
If Flex mode is on . If we Incr/Decr the child
 object automatically parent object also incr/decr.
If it is off then Only child object will be decr/Incr.

Program Unit : 
  Is a PL/SQL objects(Procedures,Functions,Packages)
which will be stored in the Report we can use only in
the Current Report.

                 Program units                            PL/SQL Objects
1)Will be stored in the file                      1)Stored in the Database.
2)Can be used only in the                       2)We can use any report
  Current Report        
3)Improve the Performance                    3)It takes more time

Libraries : Group of Program units and Libraries
We can attach the Attach the Library to another report
and use the Program units.

We can not attach the Program units to another reports
directley that's why we will PL/SQL Library to attach

.pll  - Source Code - Program Link Library
.plx  - Executable Code - Program Link Executable



triggers - srw.message(message ref no,'message');  ( srw => standard report writer)


Before paramete form trigger - it will be used to replace or to apply any logic in parameter form.





  Ex -

:P_ORDER := 'ORDER BY EMPNO ASC';   ------ P_ORDER has already created.







































































     


















Oracle Form Builder Properties

  Form Properties :
 
   First Navigation data block  : If we have multiple data  blocks in the form
         which block you want to navigate first.

  Data block Properties :
         DatabaseDatablock : If we set 'Yes' then it is a Database datablock
         If we set 'No' then it is a Control datablock.

        Maximum records displayed: we can specify how many records we can
        display at a time in the CAnvas.
       
        Query Datasource Name : Table Name

 Trigger properties :
       execution Hierarchy : To change the Triggers sequence firing in the
             different order.
  Item Properties :

   Enabled  :
   Case Restriction
   Required  :
   Database item
   Insert Allowed
   Pripmery Key
   List of VAlues
   Visuval Attributes.

  To Change the Properties in the Runtime we will use


   SET_ITEM_PROPERTY

   set_Item_Property(Field Name,
                     Property Name,
                     Value);
 

    set_Item_Property(DNO,
                     enabled,
                     YES);



  window Propertis:
    Model : No it means model less window
            Yes it is Model window.


   System Variables :
   Will be used to find the form information dynamically like
    form status,block name,item name,cursor field...........
   
    Syntax:     :SYSTEM.CURRENT_FORM

  Go_block :  To got the Perticular block.
 
  Name_in functions:
     Returns the value of the indicated variable.














  

Oracle Form Builder Explanation

Form Builder:
---------------- 


 Window : 
------------

 1) Model  : we can not resize,minimize
                 
 2) Model Less window : User Friendly we can easily
       navigate other forms and minimize and maximize
    Default : Model less Window

If we want to make it model window Go to Window
 propeties: Model  = Yes

  canvases  : 5 Types
    Content              (Default)
    Stacked
    Horizontal Toolbar
    Vertical Toolbar
    TAB  Pages

   Property  : Type  = Content

  Data block : Database Data block : Select Data from table
              Control Data block : Without table

   Database Data block : Yes


Record Groups :
A record group is an internal Form Builder data structure
that has a column/row framework similar to a database table

    Static           : Enter the values manually
    Query based      : based on the select statement get the values
    Non-Query based  : Change the values dynamically.

LOV: List of Value which will be used to provide the list of values
       in the fields user can select the value from the list.

  Without Record group we can not create LOV.

Once LOV is created it will be attached to the field by selecting
the property called 'List Of Values'

Note : CREATE_GROUP by using this procedure we can create the Record
       group dynamically.



 Property Classes                                  Visual Attributes

1)Group of Properties                        1)Group of Look and Feel properties
                            Font,Color,Size.....

2)We can not change dynamically    2)Visual attributes can be changed      
                                                                SET_VA_PROPERTY Procedure

3)We can define the Triggers for       3)We can not define
  Property Class

Note : If same property given in both Property Class and Visual
       Attribute then Visual Attribute will take the High priority.


Popup Menu : Will be created To populate group of menu options
  when we select the Right click option.
Once popup is created then it will be assigned to field or Canvas.

Alerts : Alerts are nothing but Messages which will be used to display
         message boxes based on the user input we can change the Form
         execution.



   Triggers Levels :

   Form Level
   Data Block  Level
   Record Level
   Item Level

   Form Level : it Will be executed once for the entire Form.
   Block  Level : It Will be executed when we enter into the data block.
   Record level : It Will be executed for every record.
   Item Level   : It Will be executed for the Particular Item.


   Types Of Triggers:

    1)When Triggers
    2)Transactional Triggers
    3)Validation Triggers
    4)Query Time Triggers
    5)On-Triggers
    6)Pre-Triggers
    7)Post-Triggers
    8)Navigational Triggers
    9)Master Detail Triggers
   10)Mouse Event Triggers
   11)Key Triggers.




WHEN Triggers :  WHEN-BUTTON-PRESSED
                 WHEN-WINDOW-CLOSED
                 WHEN-VALIDATE-ITEM
                 WHEN-VALIDATE-RECORD
                 WHEN-NEW-FORM-INSTANCE
                 WHEN-NEW-RECORD-INSTANCE
                 WHEN-NEW-ITEM-INSTANCE
                 WHEN-NEW-BLOCK-INSTANCE  
                 WHEN-MOUSE-CLICK
                 WHEN-MOUSE-DOUBLE CLICK

WHEN-VALIDATE-RECORD  : when user change the value in the fields then
            it will be fired.
WHEN-NEW-RECORD-INSTANCE : When user create new record then it will be
           fired.


Transactional Triggers: When user make some Transaction like
(INSERT,UPDATE,DELETE,SELECT,COMMIT,ROLLBACK,QUERY,CLOSE)
That time these triggers will be fired.

PRE-INSERT    ON-INSERT    POST-INSERT
PRE-UPDATE    ON-UPDATE    POST-UPDATE
PRE-DELETE    ON-DELETE    POST-DELETE
PRE-QUERY                  POST-QUERY.............

Validation Triggers : 

WHEN-VALIDATE-ITEM    - At any level
WHEN-VALIDATE-RECORD  - At Block Level

When we change the value in the item (or) record it will be
fired.

Query Time Trigers: 

Pre-Query  : Trigger will be fired before query the data
             Only once

Post-Query  : Will be fired after query the data multiple times
              for every record once it will be fired.
              To Populate Non-Database Items.

Navigational Triggers :

When we navigate from one form to another form
               from one data block to another data block
               from one record to another record these triggers
               from one field to another field then these triggers
               will be fired

  PRE-Block   WHEN-NEW-BLOCK-INSTANCE   POST-BLOCK
  PRE-FORM    WHEN-NEW-FORM-INSTANCE    POST-FORM
  PRE-RECORD  WHEN-NEW-RECORD-INSTANCE  POST-RECORD
  PRE-TEXT-ITEM WHEN-NEW-ITEM-INSTANCE  POST-TEXT-ITEM

Master Detail Triggers:
=======================

When we define the master detail relation ship between the Data blocks then
Master - Detail triggers will be created automatically.


    Types Master Detail Relationships:

 Non-Isolated   : (Default) The master record cannot be deleted
                             if associated detail records exist
                             in the database

 Isolated        :  The master record can be deleted,
                    but the associated detail records are not deleted
                    from the database.

 Cascade        :  The master record can be deleted,
                    and any associated detail records are automatically
                    deleted from the database at commit time.


   Master - Detail Triggers : 
                            ON-CHECK-DELETE-MASTER (Non-Isolated)
                            ON-CLEAR-DETAILS
                            ON-POPULATE-DETAILS
                            Pre-delete        (Cascade)  

   Deptno : 10
   Dname   : Accounting

  Empno   Ename          Sal       Deptno
  4411    SaiNaatth        12500    10
  4422    Vivek              12452    10
  1545   Madhuri             2365    10


  Deferred : yes : We must place the cursor in the detail block

  Automatic Query : yes : Data will be retrieved automatically in the detail
                          block.



  Key Triggers:

 Key-Fun     : A Key-Fun trigger fires when an operator presses
              the associated key

 key-Others :A Key-Others trigger is associated with all keys
             that can have key triggers associated with
             them but are not currently defined by function key triggers








































Discoverer Explanation Part 3

Example 3:
WHERE vendor_id between :fromif and :toid

Attach the Parameters and Conditions:
===================== ================
1)Goto Toole Menu =>Parameters=>New
  Select the Column Name and Define the Parameter

Use Parameter in the Condition:
================================
1)Goto Tools Meneu=>Conditions=>New
  Selct Condition , Item And Value
2)If we would  like to provide multiple conditions by using either AND (or) OR
  we will use the Add Button

3)Double click on the AND it will be changed to OR


LOV Creation:
============
Goto Admin Edition select Business Area => Folder
Right Click=> Item Classes =>Select column Name.

2)Goto the Desktop Edition Parameters attach the parameter
  will be displayed LOV.

Display Total:
==============
1)Goto Tools=>Total option => New button
   select group function and Column Name
   select either Grand Total or Sub Total (If it subtotal At what level)
2)Enter the Prompt as per that value will be displayed

Disply Formula Columns:
=======================
1)Toolsmenu=>Calculations options=>New
  select the Function an pass the Aruments select column in the Workbook
  Layout

Register UserDefined Functions:
===============================
1)Goto SQl Prompt create Function with return value compile succesfully.
2)Goto Admin Edition => Toole=>Register PL/SQL Function=>
  Enter the Function Name (If package function enter package name also)
3)Goto Arguments tab enter the Parameter details also.
4)Select Validiate button and Ok button.
5)goto Desktop Edition Tools=>Calculations=>Allfunction
  where we can find the function whatever we have registered.
6)Select the function pass the parameter we can get the result.













Discoverer Explanation Part 2

Simple Folder : from Single Table

Complex Folder: Join two simple folders


Custom Folder : SQL query WHERE ORDER BY Having Group By


1)Connect to the Admin Edition
2)Create Business Area and Create Simple Folder
3)Connect to the Desktop Edition and Create new Workbook by select
  the Business Area whatever we have created.
4)Once we select the Business Area it will shows the folders which we have in the Business Area
  select folder and Columns => Select Next button and Finish Button
 
Note:- In the Business Area we have more than one Simple folder we can select only one
        simple folder columns not multiple folder

2)If we want to select  columns from Multiple folders then we will go for creation of
  Complex Folders.
 
VenodrID VendorName Cdate SiteID SiteCode Cdate City
=======  ========== ===== ====== ======== ===== ====

1)Create Two Simple Folders in Admin Edition
2)Select the Primary key from Simple Folder => Right click=>New join
   Select the Join Condition.
   Note: for Outer join select Options Button
         for multiple join conditions select Multi Item Button
3)System will create the join condition between the Simple folder we can find that end of the
  Simple folder.

4)Goto Desktop Edition and Create Workbook by select Business Area select the columns from
  multiple folders and design the Format.
 
Sort Options :
=============
1)Right Click on the Workbook column name => Item Properties  =>to change the Column Name
                                          => Group Sort       =>To make grouping
 => Sort Low  to High =>Assending order
 => Sort high to Low  =>Desending order
 => Foramt Data     => To format the Data
 => Format Heading  => Format the Heading
 => Format Exception =>To give the Format Conditions

Add Title to the Workbook:
=======================

1)Goto Tools Menu=> Options=> Table Tab=>Check the Title Check Box
  Double click on the Title Text enter the Title

2)Select the Button called Insert button  to Inser Date , Time, Parameter valued and so on

 
Custom Folder:
===============  SQL Query

1)Goto Admin Edition
2)Rigjht click Business Ares => New Custom Folder
                             => New Folder From Database to Create Simple Folder
3)Goto Desktop dition and select the Business Area
  we can find both Simple and Custom Folder
Note: Once we select column from Custom Folder Simple folders will be disabled we can not
      select the Colmn from simple folders.

4)Select the Column and Select Finish Button.

Discoverer Explanation Part 1

1)creation of Custom Folder:
==============================

1)Goto Administrator  Edition Select the Business area =>Right Click
  select the option called New Custom Folder

2)Enter the  Select Statement whatever is valid

3)Define the Workbook in the Desktop Edition by selecting the Business area.

Grouping the Records:
=====================

If we would like to apply any group by clause then we will select Column name
=>Right Click => Group Sort which will group the records based on the column

Attach the Title
================

goto the Tools menu Options field =Select the Tab called Table check the
check box called Title => Double click on that and enter the Title.

Select  Insert button to insert the Data , Time and as well as Parameter Values.


Attach the parameters:
=====================
Select Tools Menu Parameters option
select the new button select the column name for comparision select the relation
and specifuy the condition.

To Display the parameter value in the Title then goto title Select Insert button
insert the Parameter name .

Item Classes :
==============
Item class is nothing but list of values which will be attach to the parameter to
select single value or multiple values.
Goto Admin Edition select Item classes tab =>Right Click select Item classes
select the Folder . and select the column name
so that we can use that LOV for that folder and as well as for the selected column.

Go To DeskTop Edition attach the parameter
Check the check box called Allow users to enter multiple values.
so that user can select multiple values at a time otherwise single value.

Copolex Folders :
=================
Joins Simple Folders by using Join Condition
 For Ex :ap_invoices_all              simple folder
         ap_invocie_distributions_all Simple Folder
Use the Join condition between both the Foler select data fro both the tables.

Goto Desktop edition select the columns from both the folders whatever are required
and design the work sheet

Display the Total:
=================

select  Toole menu Totals option to disply the Grand total and as well as the
Sub Total
select the Group function and column Name and select either Grand total or Subtotal.

Press OK

Discoverer Tool


Steps for Creating a Workbook and Graph In Discoverer


  • Connect to administrator Edition with APPS/APPS@VIS
  • Select Create a new Business Area From Load Wizard.
  • Click on the On-Line Dictionary (By Default), Click Next
  • Select the Database Link <Default Database>
  • Select the user from the list. Ex. APPS
  • Click on Next Button
  • In the Available list of APPS all the tables and views will be displayed Select the corresponding table/view on which workbook has to be created.
  • Select the table and move it to Selected List
  • Click Next Button
  • The following screen will be displayed


Select the Options as given in the screen.
·         Click Next
·         Give the name to business area and Also a Meaningful Description
·         Click on Finish Button
·         Select the Tool -> Security


·         Select the Business Area which has been created
·         Move the Available Users/roles to Selected User/roles
·         Click on the User -> Business Area
·         Select User/role – APPS

     


·         Select the Business Area – REGION and Click on the Allow Administration Check box.
·         Click on Apply
·         Click OK Button
·         Click on Tools -> Privileges




·         In the Privileges table give the Appropriate privileges for the user like Create/Edit business Area, Format Business Area Etc.
·         Click on Apply Button
·         Click OK Button


Connect to Discover Desktop Edition – APPS/APPS@VIS


  • Once connected to Discoverer Desktop Workbook Wizard will be opened
  • Select Create a new workbook Option
  • Select Table
  • Click on Next
  • Select the Business area (REGION) which has been created in Admin Edition



·         Select the XX_MYREGION_COUNTRY
·         Select the Columns which You want to display in workbook
·         Move it to Selected List.
·         Click Next
·         Click on the Show Page Items Checkbox
·         Drag the Region CD and move it to page items
·         Click on the Hide Duplicate Check box also
·         Click on the Next
·         If any condition need to be specified can be specified in workbook wizard Step 4
·         Click Next
·         In Workbook wizard of step 5 Sorting Order can be specified
·         Click Next
·         In Workbook wizard of step 6 calculation like Totals, % Etc can be specified
·         Click on Finish
·         Workbook will be created
·         Now Click on the graph
·         Select the Type of the graph
·         Click on the Next
·         Click on Finish
·         Graph will be created.
·         Save the workbook in the database.
·         In File ->Manage Workbooks giving sharing to users, so that they can access the workbook.
·         For Connecting to Oracle Applications the following steps has to be done.
·         In Administration Select Tools – Options


Select the 3 Option Button and specify the gateway/Password, FNDNAM
·         Now connect with Oracle Application User Id Preceded with : for example 10975:
·         Click on Oracle Application User Check box


                                   


·         Once we click on the connect Responsibility Pop-Up window will be Populated will all the responsibilities will be displayed.


·         Select One responsibility and press ok


The Process for Creating the Business Area and Workbook remains the same. In oracle Application the DBA has to give access to all the business areas then only user will be able to access the business areas.

In the Security also user can give access to Application Users and responsibility for accessing the business areas.

The Steps for Calling the Oracle Discover workbook and Graph in Oracle Applications


·                                                                                 Create a function as specified in the tab


In Tab of Properties select Type as SSWA PL/SQL Function


   In the Form Tab Give the workbook Name which you have created. Give the name as specified in the Discoverer workbook. In Discover Desktop Edition select manage workbook and click on Properties. In that identifier name will be there. It should be same what we specify in the parameters workbook = ‘ASSET’


In HTML Call give the values as OracleOASIS.RunDiscoverer

·      Save the function
·      Create a Menu and attach the Function
·      Assign this menu to Responsibility.
·      Assign the responsibility to User.
·      Log in with the user and select the responsibility





·      In This Menu Graph will invoke the discoverer workbook and graph.
·      Select the menu entry for discoverer. Which will invoke the Discoverer workbook and graph will be displayed on the browser.





                                    

Calling Different Language Layout Based On Conditions :

API For Calling Layout : 1.fnd_request.add_layout CREATE OR REPLACE procedure APPSLSPO_Calling_Templates1(ERRBUFF OUT VARCHAR,RETCODE O...