EnterpriseResource Planning ORACLE APPLICATIONS (11.5.9) S SS SELECT ELECT ELECT ELECT * ** * FROM FROM FROM FROM C CC CONTENTS ONTENTS ONTENTS ONTENTS; ;; ; SQL CONCEPTS SQL CONCEPTS SQL CONCEPTS SQL CONCEPTS ................................ ................................ ................................ ................................................................ ................................ ................................ ................................................................ ................................ ................................ ......................................... ......... ......... ......... CLASSIFICATION OF SQ CLASSIFICATION OF SQ CLASSIFICATION OF SQ CLASSIFICATION OF SQL COMMANDS L COMMANDS L COMMANDS L COMMANDS................................ ................................ ................................ ............................................................. ............................. ............................. ............................. 1 11 1 TABLES TABLES TABLES TABLES................................ ................................ ................................ ................................................................ ................................ ................................ ................................................................ ................................ ................................ .............................................. .............. .............. .............. 2 22 2 VI VI VI VIEWS EWS EWS EWS................................ ................................ ................................ ................................................................ ................................ ................................ ................................................................ ................................ ................................ ................................................. ................. ................. ................. 3 33 3 SEQUENCES SEQUENCES SEQUENCES SEQUENCES................................ ................................ ................................ ................................................................ ................................ ................................ ................................................................ ................................ ................................ ....................................... ....... ....... ....... 3 33 3 EXPLAIN PLAN EXPLAIN PLAN EXPLAIN PLAN EXPLAIN PLAN................................ ................................ ................................ ................................................................ ................................ ................................ ................................................................ ................................ ................................ ................................... ... ... ...4 44 4 SQLTRACE SQLTRACE SQLTRACE SQLTRACE ................................ ................................ ................................ ................................................................ ................................ ................................ ................................................................ ................................ ................................ ......................................... ......... ......... ......... 5 55 5 TKPROF TKPROF TKPROF TKPROF ................................ ................................ ................................ ................................................................ ................................ ................................ ................................................................ ................................ ................................ .............................................. .............. .............. .............. 5 55 5 PL SQL CONCEPTS PL SQL CONCEPTS PL SQL CONCEPTS PL SQL CONCEPTS ................................ ................................ ................................ ................................................................ ................................ ................................ ................................................................ ................................ ................................ .................................... .... .... .... BLOCK STRUCTURE BLOCK STRUCTURE BLOCK STRUCTURE BLOCK STRUCTURE ................................ ................................ ................................ ................................................................ ................................ ................................ .......................................................... .......................... .......................... .......................... 6 66 6 CURSORS CURSORS CURSORS CURSORS................................ ................................ ................................ ................................................................ ................................ ................................ ................................................................ ................................ ................................ ........................................... ........... ........... ...........7 77 7 CURSOR ATTRIBUTES CURSOR ATTRIBUTES CURSOR ATTRIBUTES CURSOR ATTRIBUTES ................................ ................................ ................................ ................................................................ ................................ ................................ ...................................................... ...................... ...................... ...................... 8 88 8 EXCEPTIONS EXCEPTIONS EXCEPTIONS EXCEPTIONS................................ ................................ ................................ ................................................................ ................................ ................................ ................................................................ ................................ ................................ ....................................... ....... ....... ....... 9 99 9 PROCEDURES PROCEDURES PROCEDURES PROCEDURES................................ ................................ ................................ ................................................................ ................................ ................................ ................................................................ ................................ ................................ ................................... ... ... ... 10 10 10 10 FUNCTIONS FUNCTIONS FUNCTIONS FUNCTIONS................................ ................................ ................................ ................................................................ ................................ ................................ ................................................................ ................................ ................................ ...................................... ...... ...... ...... 11 11 11 11 PACKAGES PACKAGES PACKAGES PACKAGES................................ ................................ ................................ ................................................................ ................................ ................................ ................................................................ ................................ ................................ ....................................... ....... ....... ....... 12 12 12 12 TRIGGERS TRIGGERS TRIGGERS TRIGGERS................................ ................................ ................................ ................................................................ ................................ ................................ ................................................................ ................................ ................................ ........................................ ........ ........ ........ 13 13 13 13 ORACLE APPLICATIONS ORACLE APPLICATIONS ORACLE APPLICATIONS ORACLE APPLICATIONS................................ ................................ ................................ ................................................................ ................................ ................................ ............................................................ ............................ ............................ ............................ ERP & AIM METHODOLOG ERP & AIM METHODOLOG ERP & AIM METHODOLOG ERP & AIM METHODOLOGY YY Y................................ ................................ ................................ ................................................................ ................................ ................................ .............................................. .............. .............. .............. 14 14 14 14 INTRODUCTION INTRODUCTION INTRODUCTION INTRODUCTION................................ ................................ ................................ ................................................................ ................................ ................................ ................................................................ ................................ ................................ ................................ 15 15 15 15 DATABASE STR DATABASE STR DATABASE STR DATABASE STRUCTURE UCTURE UCTURE UCTURE................................ ................................ ................................ ................................................................ ................................ ................................ ................................................. ................. ................. ................. 16 16 16 16 FILE ARCHITECTURE FILE ARCHITECTURE FILE ARCHITECTURE FILE ARCHITECTURE ................................ ................................ ................................ ................................................................ ................................ ................................ ....................................................... ....................... ....................... ....................... 17 17 17 17 ENTERING ORACLE APPL ENTERING ORACLE APPL ENTERING ORACLE APPL ENTERING ORACLE APPLICATIONS 11.5.9 ICATIONS 11.5.9 ICATIONS 11.5.9 ICATIONS 11.5.9................................ ................................ ................................ ...................................................... ...................... ...................... ...................... 18 18 18 18 USER CREATION USER CREATION USER CREATION USER CREATION................................ ................................ ................................ ................................................................ ................................ ................................ .............................................................. .............................. .............................. .............................. 19 19 19 19 STEPS TO REGISTER A STEPS TO REGISTER A STEPS TO REGISTER A STEPS TO REGISTER A REPORT REPORT REPORT REPORT................................ ................................ ................................ ................................................................ ................................ ................................ ..................................... ..... ..... ..... 20 20 20 20 PL/SQL PROCEDURE REG PL/SQL PROCEDURE REG PL/SQL PROCEDURE REG PL/SQL PROCEDURE REGISTRATION STEPS ISTRATION STEPS ISTRATION STEPS ISTRATION STEPS ................................ ................................ ................................ ................................................ ................ ................ ................27 27 27 27 XML PUBLISHER REPORT XML PUBLISHER REPORT XML PUBLISHER REPORT XML PUBLISHER REPORT REGISTRATION STEPS REGISTRATION STEPS REGISTRATION STEPS REGISTRATION STEPS................................ ................................ ................................ ........................................ ........ ........ ........ 34 34 34 34 TABLE REGISTRATION S TABLE REGISTRATION S TABLE REGISTRATION S TABLE REGISTRATION STEPS IN APPS TEPS IN APPS TEPS IN APPS TEPS IN APPS ................................ ................................ ................................ ......................................................... ......................... ......................... ......................... 39 39 39 39 VALUSETS EXPLANATION VALUSETS EXPLANATION VALUSETS EXPLANATION VALUSETS EXPLANATION................................ ................................ ................................ ................................................................ ................................ ................................ .............................................. .............. .............. .............. 41 41 41 41 WORKING WITH USER EX WORKING WITH USER EX WORKING WITH USER EX WORKING WITH USER EXITS ITS ITS ITS ................................ ................................ ................................ ................................................................ ................................ ................................ ......................................... ......... ......... ......... 45 45 45 45 PROFILES PROFILES PROFILES PROFILES................................ ................................ ................................ ................................................................ ................................ ................................ ................................................................ ................................ ................................ ......................................... ......... ......... ......... 49 49 49 49 DIFFERENT API'S WITH DIFFERENT API'S WITH DIFFERENT API'S WITH DIFFERENT API'S WITH SYNTAX SYNTAX SYNTAX SYNTAX................................ ................................ ................................ ................................................................ ................................ ................................ ..................................... ..... ..... ..... 51 51 51 51 MULTI ORG MULTI ORG MULTI ORG MULTI ORG................................ ................................ ................................ ................................................................ ................................ ................................ ................................................................ ................................ ................................ ....................................... ....... ....... ....... 53 53 53 53 FLEX FEILDS FLEX FEILDS FLEX FEILDS FLEX FEILDS................................ ................................ ................................ ................................................................ ................................ ................................ ................................................................ ................................ ................................ ..................................... ..... ..... ..... 55 55 55 55 INTERFACES INTERFACES INTERFACES INTERFACES ................................ ................................ ................................ ................................................................ ................................ ................................ ................................................................ ................................ ................................ .................................... .... .... .... 56 56 56 56 SQL LOADER SQL LOADER SQL LOADER SQL LOADER................................ ................................ ................................ ................................................................ ................................ ................................ ................................................................ ................................ ................................ .................................... .... .... .... 58 58 58 58 CONVERSIONS CONVERSIONS CONVERSIONS CONVERSIONS................................ ................................ ................................ ................................................................ ................................ ................................ ................................................................ ................................ ................................ ................................. .. . 60 60 60 60 ITEM CONVERSION CONV ITEM CONVERSION CONV ITEM CONVERSION CONV ITEM CONVERSION CONVERSION SCRIPT ERSION SCRIPT ERSION SCRIPT ERSION SCRIPT ................................ ................................ ................................ ..................................................... ..................... ..................... ..................... 62 62 62 62 ITEM CATEGORIES CONV ITEM CATEGORIES CONV ITEM CATEGORIES CONV ITEM CATEGORIES CONVERSION SCRIPT ERSION SCRIPT ERSION SCRIPT ERSION SCRIPT................................ ................................ ................................ ...................................................... ...................... ...................... ...................... 70 70 70 70 ITEM ATTACHMENTS CON ITEM ATTACHMENTS CON ITEM ATTACHMENTS CON ITEM ATTACHMENTS CONVERSION SCRIPT VERSION SCRIPT VERSION SCRIPT VERSION SCRIPT................................ ................................ ................................ ................................................. ................. ................. ................. 77 77 77 77 JOINS OF THE TABLES JOINS OF THE TABLES JOINS OF THE TABLES JOINS OF THE TABLES MODULE WISE MODULE WISE MODULE WISE MODULE WISE................................ ................................ ................................ ........................................................... ........................... ........................... ........................... 82 82 82 82 PURCHASE ORDER WORKF PURCHASE ORDER WORKF PURCHASE ORDER WORKF PURCHASE ORDER WORKFLOW LOW LOW LOW................................ ................................ ................................ ................................................................ ................................ ................................ .................................... .... .... .... 88 88 88 88 ORDER MANAGEMENT WOR ORDER MANAGEMENT WOR ORDER MANAGEMENT WOR ORDER MANAGEMENT WORKFLOW KFLOW KFLOW KFLOW................................ ................................ ................................ ................................................................ ................................ ................................ .................................. .. .. .. BOOKING ORDER BOOKING ORDER BOOKING ORDER BOOKING ORDER................................ ................................ ................................ ................................................................ ................................ ................................ ..................................................... ..................... ..................... ..................... 115 115 115 115 CREATING INVOICE CREATING INVOICE CREATING INVOICE CREATING INVOICE ................................ ................................ ................................ ................................................................ ................................ ................................ ................................................... ................... ................... ...................119 119 119 119 MAKING THE RECEIPT MAKING THE RECEIPT MAKING THE RECEIPT MAKING THE RECEIPT ................................ ................................ ................................ ................................................................ ................................ ................................ ............................................. ............. ............. ............. 121 121 121 121 TRANSFERING TO GL TRANSFERING TO GL TRANSFERING TO GL TRANSFERING TO GL................................ ................................ ................................ ................................................................ ................................ ................................ .............................................. .............. .............. .............. 122 122 122 122 RETURNING THE ORDER RETURNING THE ORDER RETURNING THE ORDER RETURNING THE ORDER................................ ................................ ................................ ................................................................ ................................ ................................ ......................................... ......... ......... ......... 123 123 123 123 OM FLOWDIAGRAM OM FLOWDIAGRAM OM FLOWDIAGRAM OM FLOWDIAGRAM................................ ................................ ................................ ................................................................ ................................ ................................ .................................................. .................. .................. .................. 126 126 126 126 OM TABLE RELATION DI OM TABLE RELATION DI OM TABLE RELATION DI OM TABLE RELATION DIAGRAM AGRAM AGRAM AGRAM................................ ................................ ................................ ............................................................. ............................. ............................. ............................. 128 128 128 128 FLOW HOW FLOW HOW FLOW HOW FLOW HOW TABLE EFFECTED WHILE TABLE EFFECTED WHILE TABLE EFFECTED WHILE TABLE EFFECTED WHILE BOOKING ORDER BOOKING ORDER BOOKING ORDER BOOKING ORDER ....................... ....................... ....................... ....................... 129 129 129 129 TRADING COMMUNITY AR TRADING COMMUNITY AR TRADING COMMUNITY AR TRADING COMMUNITY ARCHITECTURE(TCA) CHITECTURE(TCA) CHITECTURE(TCA) CHITECTURE(TCA)................................ ................................ ................................ ........................................ ........ ........ ........ 131 131 131 131 CREATION OF ITEM CREATION OF ITEM CREATION OF ITEM CREATION OF ITEM................................ ................................ ................................ ................................................................ ................................ ................................ ........................................................ ........................ ........................ ........................ 135 135 135 135 FREQUENTLY ASKED QUE FREQUENTLY ASKED QUE FREQUENTLY ASKED QUE FREQUENTLY ASKED QUERIES RIES RIES RIES................................ ................................ ................................ ................................................................ ................................ ................................ .................................... .... .... .... 140 140 140 140 Oracle Application 11.5.9 Bias Technologies 0 00 0 Oracle Application 11.5.9 Bias Technologies 1 11 1 SQL CONCEPTS Structured Query Language(SQL) is the standard language designed to access relational databases. SQL is pronounced either as the word Sequel or as the letters SQL. SQL uses simple syntax that is easy to learn and use there are five types of SQL statements given below. Query Statements: Allow you to retrieve the rows stored in the database tables. You write a query using the SQL SELECT statement. Data Manipulation Language (DML) Statements: Allows you to modify the contents of the tables. There are three DML statements. INSERT - Allows you to Insert row(s) into the Table. UPDATE - Allows you to change a Row. DELETE - Allows you delete the rows from the Table. Data Definition Language (DDL): Allows you to define the Data structures, such as tables that make up a database. There are five basic types of DDL statements. CREATE – Allows you to Create Database structure. Ex: Create Table – Used to create a Table in the Database. Create User – Used to create the database user. ALTER – Allows you to modify a database structure. DROP – Allows you to remove a database structure. RENAME – Allows you to change the name of the table. TRUNCATE – Allows you to delete the entire contents of the table. Transaction Control (TC) Statements: Allows you to permanently record the changes made to rows stored in a table or undo the changes. There are three TC Statements. COMMIT – Allows you to permanently record the changes made to the rows. ROLLBACK – Allows you to undo the changes made to the rows. SAVEPOINT – Allows you to set a SAVEPOINT to which you can rollback changes you made. Data Control Language (DCL): Allows you to change the permissions on the database structures. There are two DCL statements. GRANT – Allows you to give another user access to your database structures, such as tables. REVOKE – Allows you to prevent another user from accessing to your database structures, such as tables. Oracle Application 11.5.9 Bias Technologies 2 22 2 Tables: Table is a database object which holds the data and contains one or more columns associated with its datatypes Creating a Table: we use the create table statement to create a table. The simple syntax for the creation of table. Syntax: CREATE Table table_name (column_name type [CONSTRAINT constraint_def DEFAULT default_exp], column_name type [CONSTRAINT constraint_def DEFAULT default_exp], column_name type [CONSTRAINT constraint_def DEFAULT default_exp]… ) [ON COMMIT {DELETE | PRESERVE} ROWS] TABLESPACE tab_space; Ex: SQL> Create table hariha_0016(ename varchar2(10), Eno number unique); Table Created. Altering a Table: we can alter the table using the alter statement. The alter table statement perform such tasks given below. Add, modify, or drop a column. Add or drop a constraint. Enable or Disable a constraint. Ex: SQL> Alter table hariha_0016 Add address varchar2(10); Modifying a Column: Ex: SQL> Alter table hariha_0016 Modify address varchar2(20); Dropping a Column: Ex: SQL> Alter table hariha_0016 Drop address; Renaming a Table: If we want to change the name of the table then we use this RENAME statement. Ex: SQL> Rename table hariha_0016 To Hariha_0015; Truncating a Table: If we want to delete all the rows existing in the table then we use the TRUNCATE Statement. Ex: SQL> Truncate table hariha_0015; Dropping a Table: If we want to drop the total structure along with the records existing in the table we use this DROP statement. Ex: SQL> Drop table hariha_0015; Oracle Application 11.5.9 Bias Technologies 3 33 3 Views: A view is basically a predefined query on one or more tables. Retrieving information from the view is done in the same manner as retrieving from the table. Creating a View: by using the create view statement we can create a view. Syntax: Create [Or Replace] View view_name [(allias_name[,allias_name….])] AS subquery [WITH {CHECK OPTION | READ ONLY} CONSTRAINT Constraint_name]; Ex: SQL> Create view medha_0016_view AS Select ename, eno, address from Hariha_0016; View Created. Performing an Insert using a View: we can also perform DML operations using the views. Given below is the example for that. Ex: SQL> Insert into medha_0016_view( Ename, eno, address) Values (HARIHA, 0016, HYD); 1 Row Created. Modifying a View: we can modify the view using the REPLACE. If there any view existing with that name then it was modified with the current one. Ex: SQL> Create or Replace view medha_0016_view AS Select a.ename, a.eno, a.address, b.city from Hariha_0016 a, hariha_0011 b Where a.eno = b.eno; Dropping a View: when want to drop the view we use this statement. Only the view will be dropped from the database the table was not effected. Ex: SQL> Drop view hariha_0016_view; Sequence: A sequence is a database item that generates a sequence of integers. We create the sequence using the CREATE SEQUENCE statement. Syntax: Create Sequence Sequence_name [Start with Start_num] [Increment by increment_num] [ {MAXVALUE max_num | NOMAXVALUE} ] [ {MINVALUE min_num | NOMINVALUE} ] [ {CYCLE | NOCYCLE} ] [ {ORDER | NOORDER} ]; Oracle Application 11.5.9 Bias Technologies 4 44 4 Ex: SQL> Create Sequence medha_seq_0016 Start with 100 Increment by 1; Sequence Created. Using the Sequence: Ex: SQL> Select medha_seq_0016.currval ”Currval”, medha_seq_0016.nextval “Nextval” From Dual; Output: Currval Nextval --------- ---------- 101 101 Modifying the Sequence: If we want to modify the sequence by using the ALTER SEQUENCE we can do that. Ex: SQL> Alter Sequence medha_seq_0016 Start with 1000 Increment by 2; Sequence Altered. Dropping a Sequence: If we want to drop the sequence then we use this DROP STATEMENT. Ex: SQL> Drop Sequence medha_seq_0016; Sequence Dropped. Explain Plan: Explain plan gives the execution plan of the statement. PLAN_TABLE is necessary for explain plan. If there is no PLAN_TABLE in your system then go with UTLXPLAN.SQL from the SQL Prompt. Syntax: SQL> Explain plan Set statement_id = ‘hariha_0016’ [into PLAN_TABLE ] for select * from scott.emp where empno = 7369; Plan Explained. In TOAD(Tools for Oracle Application Design) write the SQL statement and press CTRL+E then it automatically shows the explain plan. It is the simple way to get the explain plan instead of writing the explain plan in SQL. Oracle Application 11.5.9 Bias Technologies 5 55 5 SQL Trace: SQL Trace gives a wide range of information & statistics that used to tune a group of SQL operations. We do the Sequel Trace at three levels. 1. SQL 2. Reports 3. Forms Trace the Sequel Statements. How much time it was taking, how many rows it was fetching, all the information was given from SQL Trace. Steps for generating Trace file: Enable the Trace. Run the DML statements. Disable the Trace. Get the Trace file. Convert the Trace File to Readable Format. The Trace file was generated with he extension .TRC. Oracle has give specified directory for trace files. To get the path use the query below. EX: SQL> Select value from V$PARAMETER Where name = ‘USER_DUMP_DEST’; To get the name of the Trace file also we have to use the Query. SQL> Select c.value || ‘\ORA’ || TO_CHAR(a.spid, ‘FM00000’) || ‘.TRC’ From V$PROCESS a, V$SESSION b, V$PARAMETER c Where a.addr = b.paddr and b.ausid = userenv(‘sessionid’) and c.name = ‘USER_DUMP_DEST’; TKPROF: Copy the trace file, which was generated earlier, and paste it in your custom directory. Syntax: CMD> TKPROF d:\siri_0016.trc siri_0016.txt The Hariha_0016.txt was created in the same drive where the Trace file was located. Ex: --Query to Print the Cumulative Salary of the Employee table order by DEPTNO SQL> Select deptno, ename, sal, sum(sal) over(partition by deptno order by deptno, ename) “CUM_SAL” from scott.emp; Oracle Application 11.5.9 Bias Technologies 6 66 6 PL/SQL CONCEPTS Oracle added a procedural programming language known, as PL/SQL (Procedural Language/SQL). PL/SQL is a third generation language and contains the standard programming constructs. Anonymous Block: An Unnamed block which will not store any where in the database is know as Anonymous block. Block Structure: PL/SQL programs are divided up into structures known as blocks, with each block containing the PL/SQL and SQL statements. The syntax for the structure is given below. Syntax: [DECLARE Variable declaration Begin Executable_statements [Exception Exception_handling_statements] End; Ex: SQL> SET SERVEROUT ON; SQL> Declare v_1 number; v_2 number; v_3 number; Begin v_1:=&v_1; v_2:=&v_2; v_3:=&v_3; if v_1 < v_2 and v_1 < v_3 then dbms_output.put_line('1st is small'); elsif v_2 < v_3 then dbms_output.put_line('2nd is small'); else dbms_output.put_line('3rd is small'); end if; Exception When zero_divide then DBMS_OUTPUT.PUT_LINE(‘Division by ZERO’); End; O/p: It will ask for the three input values and will display the smallest number in that. Difference between PL/SQL and SQL: In PL/SQL there is no buffer to hold the values so we pass into variables. Here in SQL there is buffer to hold the data temporarily. Ex: SQL> Select ename from emp where is empno = 7788; SQL> Declare V_name varchar2(10); Begin Select ename into v_name from emp where empno = 7788; End; Oracle Application 11.5.9 Bias Technologies 7 77 7 Cursors: Cursor is a private SQL area provided by the oracle engine. It is mainly used to retrieve the data from more than one column. There are two types of cursors they are given below. Implicit Cursors Explicit Cursors Implicit Cursors: Implicit cursor raises implicitly when we use INSERT, UPDATE, DELETE and SELECT..INTO statements. Because the Implicit cursor is opened and closed by the PL/SQL engine. Ex: SQL> declare v_edata emp%ROWTYPE; begin select * into v_edata from emp where empno=7788; if sql%notfound then dbms_output.put_line('Record Not Found'); else dbms_output.put_line('Record Found'); end if; end; Processing Explicit Cursors: The four PL/SQL steps necessary for explicit cursor processing are as follows. Declare the cursor. Open the cursor for a Query. Fetch the results into PL/SQL variables. Close the Cursor. Declaration of Cursor: The declaration of the cursor is associated with the select statement. The syntax for the cursor is given below. Syntax: CURSOR cursor_name IS select_statement; Ex: -- To print the Cumulative SAL of the Employee table order by empno SQL>declare v_sal number; v_dno number; l_count number; cursor test_cursor is select * from scott.emp order by empno; begin v_sal:=0; v_dno:=0; for i in test_cursor loop if(i.deptno!=v_dno) then v_sal:= 0; end if; v_sal:=v_sal+i.sal; dbms_output.put_line('Ename: ' || i.ename||' Sal: '|| i.sal || '_ Cum_sal: '|| v_sal || 'Deptno: ' || i.deptno); l_count:=test_cursor%rowcount; end loop; dbms_output.put_line(l_count||' Row(s) Fetched by the Cursor'); end test_cursor; Oracle Application 11.5.9 Bias Technologies 8 88 8 Cursor Attributes: There are four cursors available in PL/SQL that can be applied to cursors. Those are given below. %FOUND %NOTFOUND %ISOPEN %ROWCOUNT %FOUND: %FOUND is a Boolean attribute. It returns TRUE if the previous FETCH returned a row and FALSE if it didn’t. %NOTFOUND: %NOTFOUND is also a Boolean attribute. It returns FALSE if the previous FETCH returned a row and TRUE if it didn’t. It behaves opposite to the %FOUND. %ISOPEN: %ISOPEN is a Boolean attribute. It returns TRUE if the associated cursor is open other wise it will return FALSE. %ROWCOUNT: %ROWCOUNT is a Numeric attribute. It returns number of rows returned by the cursor so far. Declaring, Opening Fetching and Closing the Cursor: Ex: SQL> declare v_eno number; v_ename varchar2(20); l_count number; cursor razia_cursor is select empno,ename from scott.emp; begin open razia_cursor; loop fetch razia_cursor into v_eno, v_ename; exit when razia_cursor%notfound; l_count:=razia_cursor%rowcount; dbms_output.put_line('Ename: ' || v_ename||' ENUM: '|| v_eno); end loop; close razia_cursor; dbms_output.put_line(l_count||' Row(s) Fetched by the Cursor'); end; Ex: SQL> -- Example to print the odd rows in the Table EMP declare n number; l_count number; cursor razia_cursor is select empno,ename,rownum from scott.emp; begin for i in razia_cursor loop n:=mod(i.rownum,2); if (n>0) then dbms_output.put_line('Empno: ' || i.empno||' NAME: '|| i.ename||' ROWNUM: '|| i.Rownum); end if; l_count:=razia_cursor%rowcount; end loop; dbms_output.put_line(l_count||' Number of Row(s) Fetched by the Cursor'); end razia_cursor; Oracle Application 11.5.9 Bias Technologies 9 99 9 Exceptions: An Exception is a error handling statement. It is used when ever our program terminates abnormally by using the exception we can execute the program from abnormal termination to normal termination. There are mainly two types of exceptions they are given below. Predefined Exceptions. User defined Exceptions. Predefined Exceptions: Oracle has predefined several exceptions that correspond to the most common oracle errors. Some predefined exceptions are given below. LOGIN_DENIED NO_DATA_FOUND ZERO_DIVIDE TOO_MANY_ROWS STORAGE_ERROR ROWTYPE_MISMATCH INVALID_CURSOR CURSOR_ALREADY_OPEN Ex: SQL> declare cursor test_cursor is select e.ename, d.deptno, d. dname from scott.emp e, scott.dept d where e.deptno=20 and d.dname='RESEARCH'; begin for i in test_cursor loop dbms_output.put_line(i.ename || ' ' || i.deptno ||' '|| i.dname); end loop; exception when no_data_found then dbms_output.put_line('NO DATA FOUND EXCEPTION RAISED'); when others then dbms_output.put_line(' An Error Raised ' || sqlerrm); end test_cursor; User Defined Exceptions: A user defined exception is an error defined by the programmer. User defined exceptions are declared in the declarative section of the PL/SQL block just like variables. Syntax: DECLARE E_myexception EXCEPTION; Ex: SQL> create or replace procedure razia_proc(v_sal in number) as v_sl number; razia_excep exception; begin if(v_sal >= 5000) then raise razia_excep; else select sal into v_sl from emp order by deptno; end if; exception when razia_excep then dbms_output.put_line( 'YOU HAVE PERFORMED AN ILLEGAL OPERATION'); end razia_proc; Oracle Application 11.5.9 Bias Technologies 10 10 10 10 Procedures: Procedures are also known as subprograms. Given below is the syntax for the creation of the procedure. Syntax: CREATE [OR REPLACE] PROCEDURE procedure_name [(argument [{IN | OUT | IN OUT}] type, … [(argument [{IN | OUT | IN OUT}] type) ] {IS | AS} BEGIN procedure_body END procedure_name; Ex: SQL> create or replace procedure razia_proc as v_sal number; cursor razia_cursor is select * from emp order by deptno; begin v_sal := &v_s; for i in razia_cursor loop if(i.sal > v_sal) then dbms_output.put_line( 'Employee Name: ' || i.ename); end if; end loop; exception when others then dbms_output.put_line( 'YOU HAVE PERFORMED AN ILLEGAL OPERATION'); dbms_output.put_line( 'THE PROGRAM MAY TERMINATE NOW'); end razia_proc; Execution: exec razia_proc; Passing IN Parameter to the Procedures: Ex: SQL> create or replace procedure kanthi_proc(p_inpar in number) as v_name varchar2(30); begin select ename into v_name from emp where empno=p_inpar; dbms_output.put_line( 'Employee Name: ' || v_name); exception when others then dbms_output.put_line( 'YOU HAVE PERFORMED ILLEGAL OPERATION'); end kanthi_proc; Using IN and OUT parameters to Procedures: Ex: SQL> create or replace procedure shabbir_proc(p_outpar out varchar2,p_inpar in number) as begin select ename into p_outpar from emp where empno=p_inpar; end; --To Catch the Output variable out side the procedure in the SQL declare v_name varchar2(20); v_num number; begin mypro(v_name,&v_num); dbms_output.put_line( 'Employee Name: ' || v_name); end shabbir_proc; Oracle Application 11.5.9 Bias Technologies 11 11 11 11 Functions: Function is similar to a procedure except that a function must return a value to the statement from which it is called. The syntax for creating a function is given below. Syntax: SQL> CREATE [OR REPLACE] FUNCTION function_name [(parameter_name[IN | OUT | IN OUT] type [,….])] RETURN type; {IS | AS} BEGIN Function_body END function_name; Ex: create or replace function haritha_func(p_empno number) return varchar2 is v_ename varchar2(20); v_sal number; begin select ename,sal into v_ename, v_sal from emp where empno=p_empno; if v_sal>=6000 then return 'TRUE'; else return 'FALSE'; end if; end haritha_func; Execution: SQL> select haritha_func(7788) from dual; Ex: SQL> create or replace function haritha_fun(p_radius number) return number as v_pi number := 3.141; v_area number; begin v_area := v_pi * POWER(p_radius,2); return v_area; end haritha_fun; Execution: SQL> select haritha_fun(7) from dual; Dropping Function and Procedure: When we want to drop the function or procedure then we use this DROP statement the syntax for the DROP is given below. Syntax for Dropping Function: DROP FUNCTION function_name; Syntax for Dropping Procedure: DROP PROCEDURE procedure_name; Oracle Application 11.5.9 Bias Technologies 12 12 12 12 Packages: Package is declarative part of the functions and procedures which are stored in that package. There are two blocks in defining a package. Package Specification Package body Package Specification: The package specification contains information about the contents of the package. It does not contain code for any subprograms. Syntax: CREATE [OR REPLACE] PACKAGE package_name {IS | AS} Type_definition | Procedure_specification | Function_specification | Variable_declaration | Exception_declaration | Cursor_declaration | Pragma_declaration END [package_name]; Package Body: The package body is separate data dictionary object from the package header. It cannot be successfully compiled unless the package header is already been successfully compiled. Syntax: CREATE [OR REPLACE] PACKAGE BODY package_name {IS | AS} …. BEGIN Initialization_code; END package_name; Ex: SQL> create or replace package vamsi_pack as procedure razia_proc(mynum in number); end vamsi_pack; -- Declaration of Package Body and passing value to the procedure create or replace package body vamsi_pack as procedure razia_proc(mynum in number) as cursor mycursor is select ename,empno,sal from emp where empno=mynum; begin dbms_output.put_line(' NAME ' || ' NUMBER ' || ' SALARY '); for i in mycursor loop dbms_output.put_line(' '||i.ename||' '|| i.empno ||' '|| i.sal); end loop; exception when others then dbms_output.put_line('YOU HAVE DONE AN ILLEGAL OPERATION '); end myproc; end vamsi_pack; Execution: SQL> exec vamsi_pack.razia_proc(7788); Oracle Application 11.5.9 Bias Technologies 13 13 13 13 Triggers: A Trigger is a procedure that will fire automatically by the database. When a specified DML statement is run against the specified table. Triggers are useful for doing things like advanced auditing of changes made to a column values in a table. The syntax for creating the trigger is given below. Syntax: CREATE [OR REPLACE] TRIGGER trigger_name {BEFORE | AFTER | INSTEAD OF} trigger_event ON table_name [FOR EACH ROW [WHEN trigger_condition]] BEGIN Trigger_body; END; Ex: This example is when we insert into a table t1 then the same data has to be inserted into the table t2. For that we require two tables of one same column. SQL> CREATE TABLE t1( Eno number); SQL> CREATE TABLE t2( Eno number, Ins_date date); SQL> CREATE OR REPLACE TRIGGER razia_trigger BEFORE INSERT ON TABLE t1 FOR EACH ROW BEGIN INSERT INTO TABLE t2 VALUES(:new.eno,sysdate); END; Note: For every insert operation on t1 it will insert the eno col values to t2 along with the current sysdate in the other column. Disabling and Enabling Trigger: We can stop the trigger from firing by disabling the trigger by using the ALTER TRIGGER statement. The syntax for enabling the trigger and disabling the trigger is given below. Syntax: ALTER TRIGGER trigger_name DISABLE; ALTER TRIGGER trigger_name ENABLE; Dropping a Trigger: If we want to drop the trigger from the database then we have to use DROP TRIGGER statement. The syntax for dropping the trigger is given below. Syntax: DROP TRIGGER trigger_name; Oracle Application 11.5.9 Bias Technologies 14 14 14 14 ERP: Enterprise Resource Planning Here Resource means 5 m’s 1. Money 2. Man power 3. Machinery 4. Material and 5. Management ERP Purpose: Planning for proper utilization of resources for a business organization . ERP as a Product : all objects(i.e. forms, reports )and all other programs are developed and throwly tested and those will be provided with these ERP. Methodology : the process used to implement ERP Product for a business Organization. AIM (APPLICATION IMPLEMENTATION METHODOLOGY): Methodology for Oracle Apps is AIM(Applications Implementation Methodology) Phases in Aim Methodology: 1. Definition Phase 2. Operational Analysis Phase 3. Solution Design Phase 4. Build Phase 5. Transition Phase 6. Production Phase 1. Definition Phase: Here the functional consultants prepare the sample structure (Blue Print) for the real business by gathering the information. 2. Operational Analysis phase: In this the functional consultant prepare BR100 (Business Requirement). 3. Solution Design Phase: here the functional consultant will prepare MD50 by using BR100. MD50 is the functional document. 4. Build Phase: here the technical consultant converts MD50 to MD70. MD70 is the technical document. Then the technical consultant prepare the final object and go with testing, i.e. Unit Testing. 5. Transition Phase: here SIT(System Integration Testing) and UAT(User Acceptance Testing) is done. Functional consultant does SIT. After this the functional consultant will train the user in oracle apps product and user does UAT. If it is satisfied by the user, it is sign off and product will be given to the user. 6. Production phase: loading the project in the client place. Where the server of oracle apps in the client place. Oracle Application 11.5.9 Bias Technologies 15 15 15 15 Introduction: The Oracle Applications is an ERP, which was developed by the Oracle Corp and was used by the several companies to utilize several resources contained with them. Business Flow of Oracle Applications: Oracle Applications is designed for the Financial and Manufacturing clients. The categories in the modules are given below. Financial Modules: Account Payables, Account Receivables, General Ledger and Fixed Assets. Manufacturing Modules: Purchasing, Inventory, Bill Of Materials, Work in Progress and Order Management. In HRMS we maintain all the details of the employee as well as the organization details. Module: It is a collection of forms and reports which are related to particular business process. Purchase order module has the forms and reports which are related to the purchasing business process. It contains nearly 50,000 tables they are accessed by only purchase order module. Oracle Application 11.5.9 Bias Technologies 16 16 16 16 Oracle Applications Database Structure: Schema: Schema is a place in database which contains the database objects like tables, indexes, sequences, views and synonyms. In oracle applications database we have individual schemas for each module application. These schemas contain the database objects of only that particular module. When we connect any database schema we can access only that schema database objects. We can’t access other database objects. For data integrity purpose the oracle has deigned one more schema called Apps schema which contains only synonyms and this schema have the rights to access any other module database objects. Note: Apps Schema will not contain the tables it contain only synonyms. Projects in Oracle Applications: Implementation Projects: Implementation means we will develop the forms, reports from the scratch. In this project we will be work in the areas of the forms, reports, interface, customizations and interfaces. Customization Projects: In this we customize some standard reports. Migration / Up gradation Projects: This will be moving from the Old version to the New version. Support / Maintenance Projects: Solving the issues which are raised by the end user while entering the data. Post Implementation Projects: This will be done at free of cost. It’s a real time testing. Oracle Application 11.5.9 Bias Technologies 17 17 17 17 Types of Docs in Oracle Apps: MD 050 -- Module design by the functional consultant. MD 070 -- Technical Document designed by the technical consultant. MD 020 -- Technical document designed by the functional document. MD 0120 -- Migration and user training document by the technical consultant. CV 040 -- Conversion of the functional document by the functional consultant. CV 060 -- Conversion of the technical document by the technical consultant. Note: Conversion means moving the data from the legacy system to the apps system. Oracle Apps File Architecture: We will have Linux/Unix server for oracle apps we will be connecting to the server by using the FTP/TOAD/FILEZILLA/WINSEP3 File Architecture: The Server first top will be application top “Appl-top” we can change the name according to the client wish. Under that we have the product top. Each module has go it individual top. Oracle Application 11.5.9 Bias Technologies 18 18 18 18 Note: We will move the (download/upload) forms and reports from the local machine to the server always in binary mode. We save any information only on the server not in the local machine. Entering the Oracle Applications: First it will prompt for the username and password and then click on the connect button then it will give us responsibilities form. Select to which responsibility you want to login then you will enter to the oracle applications. We get the screen as given below when we enter into the system administrator responsibility. Oracle Application 11.5.9 Bias Technologies 19 19 19 19 User Creation: Connect to the oracle applications 11i as we shown above and enter into the system administrator responsibility. The navigation to create the user is Security User Define. The window is given below. Enter the username, password and assign responsibilities what ever you want and save the user will be created. Note: when ever we login next time we can enter the user name and password that what we created now. Steps to Register a Report: 1. Develop the report in 6i according to the client requirements. 2. Transfer the object from the local system to the server and placing that in the appropriate directory. 3. Creating the executable and set the execution method as oracle reports as we are registering the report. Set the executable file name as the object name which we modified or developed. 4. Create the concurrent program and set the executable to the concurrent program. If your program has any parameters then go with the parameters button and submit the parameter tokens. 5. Set the concurrent program to the request group and the request group to the responsibilities. 6. User having that responsibility will only can run that request or submit the request of the report. Note: Every form contains 3 types of fields those are 1. Yellow Colored fields --- Mandatory. With out entering these mandatory fields we can’t save the form. 2. Green Colored fields --- Read only. 3. White Colored fields --- Optional. 4. Blue colored indicates the form in the query mode. We enter into the query mode by pressing F11 and enter data which was already saved to retrieve the record press CTRL+F11. Oracle Application 11.5.9 Bias Technologies 20 20 20 20 Creating the Concurrent Program Executable: Before we start the registration process we have to create a report according to the client requirements and place the report in the appropriate directory (Custom top). The navigation for this form is Concurrent Program Executable. The given below is the executable window. Window help: Executable: Set the executable name as we like here we entered the name as per the program. Short Name: Set the short name of the executable as related to the executable because we have to remember them. Application: Select the Appropriate Application from the list of applications here we selected the Oracle Receivables because we saved our report (valueset.RDF) in the AR (Receivables) folder only. Oracle Application 11.5.9 Bias Technologies 21 21 21 21 Description: This field is not a mandatory field if we want to describe the concurrent program executable we use this field. Execution Method: There are eleven execution methods we can choose what ever we want as per the requirements. Those are stated below. Host: The execution file is a host script. When ever we have an UNIX scripting programs then we use this execution method. Immediate: The execution file is a program written to run as a subroutine of the concurrent manager. We recommend against defining new immediate concurrent programs, and suggest you use either a PL/SQL Stored Procedure or a Spawned C Program instead. Java Stored Procedure: The execution file is a Java stored procedure. Java Concurrent Program: The execution file is a program written in Java. Multi Language Function: The execution file is a function (MLS function) that supports running concurrent programs in multiple languages. Oracle Reports: The execution file is an Oracle Reports file. To register a report which we done in report6i we use this method. PL/SQL Stored Procedure: The execution file is a PL/SQL stored procedure. Spawned: The execution file is a C or Pro*C program. SQL * Loader: The execution file is a SQL script. SQL * Plus: The execution file is a SQL*Plus script. Note: 1. According to the requirement of the user and the type of the report we created the execution method will depend. Execution File Name: We have to set the executable filename as our report name. Here we create the report name as valueset so; we set the name as valueset. Subroutine Name: Only immediate programs or spawned programs using the Unified C API use the subroutine field. Staging function Parameters (Button): The Stage Function Parameters button opens a window that allows you to enter parameters for the Request Set Stage Function. This button is only enabled when you select Request Set Stage Function as your Execution Method. After entering all the fields save the form and go to the Concurrent Programs Form. The Navigation for this is Concurrent Program Define. Oracle Application 11.5.9 Bias Technologies 22 22 22 22 Window Help: Program: Enter the Program name as we like it is not standard we gave here as cs_value_prg as per our program. Enabled (Check Box): Disabled programs do not show up in users' lists, and do not appear in any concurrent manager queues. You cannot delete a concurrent program because its information helps to provide an audit trail. Short Name: The short name is also like the short name in the executable form. We have to give the name as per the program name. Application Name: Select the application name as Oracle Receivables. We have to select the application as what we select in the Executable form. Description: This field is not a mandatory field if we want to describe the concurrent program we use this field. Executable: Name: Set the executable name as the short name of the executable which we give in the previous Executable form. Method: when we enter the executable name there in the name field it was automatically set which we saved in the executable form. Priority: you can assign this program it own priority. The concurrent managers process requests for this program at the priority you assign here. Oracle Application 11.5.9 Bias Technologies 23 23 23 23 Request: Type: If you want to associate your program with a predefined request type, enter the name of the request type here. Incrementor: For use by Oracle Applications internal developers only. The Incrementor function is shown here. MLS Function: The Multilingual Concurrent Request feature allows a user to submit a request once to be run multiple times, each time in a different language. If this program utilizes this feature the MLS function determines which installed languages are needed for the request Use in SRS (Check Box): Check this box to indicate that users can submit a request to run this program from a Standard Request Submission window. Run Alone (Check Box): If you check the Use in SRS box, you can also check this box to allow a user to enter disabled or outdated values as parameter values. Enable Trace (Check Box): Turns on SQL tracing when program runs. Allow Disabled Values (Check Box): If you check the Use in SRS box, you can also check this box to allow a user to enter disabled or outdated values as parameter values. Restart on system failure Run Alone (Check Box): Use this option to indicate that this concurrent program should automatically be restarted when the concurrent manager is restored after a system failure. NLS Complaint (Check Box): This box is checked if the program allows for a user to submit a request of this program that will reflect a language and territory that are different from the language and territory that the users are operating in. Output: Format: There are several formats as per the requirements in the report we use this format here we use the TEXT format. Save (Check Box): Indicate whether to automatically save the output from this program to an operating system file when it is run. This value becomes the default for all requests submitted for this program. Print (Check Box): If you enter No, your concurrent program's output is never sent to the printer. Columns/Rows: Enter the minimum column and row length for this program's report output. Oracle Applications uses this information to determine which print styles can accommodate your report. Style: There are several styles which we can use A4, Landscape, BACS and other styles. Style Required (Check Box): If your program requires a specific print style (for example, a check writing report), use this check box to enforce that print style. Printer: If you want to restrict your program's output to a single printer, enter the name of the printer to which you want to send your output. Oracle Application 11.5.9 Bias Technologies 24 24 24 24 Buttons: Copy to (Button): Create another concurrent program using the same executable, request and report information as the current program. You can optionally copy the incompatibility and parameter details information as well. Session Control (Button): Use this window to specify options for the database session of the concurrent program when it is executed. Incompatibilities (Button): Identify programs that should not run simultaneously with your concurrent program because they might interfere with its execution. You can specify your program as being incompatible with itself. Parameters (Button): If there are any parameters for our report then we go with the parameters button. We get the window called parameters when we go with the button. Note: The window help of the Parameter window will be given in the next steps. Setting the Concurrent Program to the Request Group: To set the concurrent program to the request group we have to go to the responsibilities screen. The navigation is Security Responsibility Define. Then we get the window as shown below. Note: Here if we want we can create new responsibility or we can use the existing one. Here we use the existing one retrieved the existing responsibility name using query mode (F11) as we discussed earlier. Now copy the request group name and go to the navigation Security Responsibility Request. Then Request Groups window will be opened as shown below. By entering the query mode we have to paste the Request Group name at the Group field and press CTRL+F11. This form is case sensitive. After that click on new button and enter the concurrent program name at the name column and go with save button. Oracle Application 11.5.9 Bias Technologies 25 25 25 25 Submitting the Request: Now switch to the appropriate responsibility then only we can run the request. Here as per our example we have to enter into the Receivable Vision Operations. After enter into the responsibility go with the navigation. Menu View Requests then we get the window find request go with Submit a New Request button. It will prompt for the Single Request or Request Set. As our program is the single we go with the Single option. After that we get another window. Oracle Application 11.5.9 Bias Technologies 26 26 26 26 Enter the concurrent program name at the name field and go with the submit button. Then we get another window as shown below. To view the outputs of your program then go with the output button. To view any error messages you go with the View log button. Oracle Application 11.5.9 Bias Technologies 27 27 27 27 Process to Register a PL/SQL Stored Procedure: This is the PL/SQL Stored Procedure using the Table Valuesets. Creating the Procedure: EX: SQL> create or replace procedure chaitu_proc(errbuf out varchar2, retcode out varchar2, p_dno in number, p_dname in varchar2) as cursor test_cursor is select e.ename, d.deptno, d.dname from scott.emp e, scott.dept d where e.deptno=p_dno and d.dname=p_dname; begin for i in test_cursor loop dbms_output.put_line(i.ename || ' ' || i.deptno ||' '|| i.dname); end loop; end chaitu_proc; Procedure Created. Note: Here we have to use fnd_file.put_line to view the output in Oracle apps, because dbms_output.put_line will not work in Oracle Apps Here in the Procedure there are two mandatory out parameters those are errbuf and retcode. Errbuf: Used to write the error message to log or request file. Retcode: if the RETCODE is set to 0 - Then concurrent program will Completed NORMAL. 1 - Then concurrent program will Completed WARNINGS. 2 - Then concurrent program will Completed ERROR. Creating the Concurrent Program Executable: Before we start the registration process we have to create a package or Procedure according to the client requirements. The navigation for this form is Concurrent Program Executable. The given below is the Navigator window. Oracle Application 11.5.9 Bias Technologies 28 28 28 28 When we go with the above navigation the Executable form will be open then we have to enter the mandatory fields. Executable: Set the executable name as we like here we entered the name as per the program. Short Name: Set the short name of the executable as related to the executable because we have to remember them. Application: Select the application name from the list of applications here we selected the Oracle Receivables as per our requirements. Description: This field is not a mandatory field if we want to describe the program we use this field. Execution Method: We have to select the PL/SQL Stored Procedure as execution method to register the myproc1 procedure. Execution File Name: We have to set the executable filename as procedure name. Here we our procedure name is mrproc1 so; we set the name as myproc1. After entering all the fields save the form and go to the Concurrent Programs Form. The Navigation for this is Concurrent Program Define. Oracle Application 11.5.9 Bias Technologies 29 29 29 29 Enter all the mandatory fields and save the form. Program: Enter the Program name as we like it is not standard we gave here as cs_value_prg as per our program. Short Name: The short name is also like the short name in the executable form. We have to give the name as per the program name. Application Name: Select the application name as Oracle Receivables. We have to select the application as what we select in the Executable form. Executable Name: Set the executable name as the short name of the executable which we give in the previous Executable form. Format: There are several formats as per the requirements in the report we use this format here we use the TEXT format. Style: There are several styles which we can use A4, Landscape, BACS and other styles. Here we are having the two parameters go with Parameters button in the Screen. The Concurrent Program Parameters window will show below. Oracle Application 11.5.9 Bias Technologies 30 30 30 30 Note: There is no token required where we are working with the PL/SQL STORED PROCEDURE and observe that the token field in the above window is grayed it won’t allow any values into that field. Window Help: Seq: Choose the sequence numbers that specify the order in which your program receives parameter values from the concurrent manager. Parameter: We enter the parameter name that we are passing. Same was passed to the prompt when we press tab. Description: This is the optional field to describe the input parameter. Enabled (Check Box): Disabled parameters do not display at request submission time and are not passed to your execution file. Validation: Valueset: Enter the name of the value set you want your parameter to use for validation. You can only select from independent, table, and non-validated value sets. As per our example we defined two valuesets for two parameters and set the two valuesets respectively. Default Type: If you want to set a default value for this parameter, identify the type of value you need. Required (Check Box): If the program executable file requires an argument, you should require it for your concurrent program. Enable Security (Check Box): If the value set for this parameter does not allow security rules, then this field is display only. Otherwise you can elect to apply any security rules defined for this value set to affect your parameter list. Display: Display Size: Enter the field length in characters for this parameter. The user sees and fills in the field in the Parameters window of the Submit Requests window. Concatenated Description Size: Enter the display length in characters for the parameter value description. The user sees the parameter value in the Parameter Description field Oracle Application 11.5.9 Bias Technologies 31 31 31 31 of the Submit Requests and View Requests forms. The Parameter Description field concatenates all the parameter values for the concurrent program. Note: We recommend that you set the Concatenated Description Size for each of your parameters so that the total Concatenated Description Size for your program is 80 or less, since most video screens are 80 characters wide. Prompt: Enter the message that will prompt for the input at the submit request form. Token: For a parameter in an Oracle Reports program, the keyword or parameter appears here. The value is case insensitive. For other types of programs, you can skip this field. After modifying the parameter form, save the program. Now go the Request Group form and the set the concurrent program to the appropriate request group. The navigation for this is Security Responsibility Request. Then Request Groups form will open as shown below. Enter into Query mode by pressing F11 then enter the Request Group Name and press CTRL+F11. This form is case sensitive. After that click on new button and enter the concurrent program name at the name column and go with save button. Ex:-- Some Request Group Names For Receivables : Receivables All For Inventory : All Inclusive GUI For Order Management : OM Concurrent Programs For Purchase Order : All Reports If we don’t know the Request group name then we have to go for the navigation Security Responsibility Define we already explained in the above example. Oracle Application 11.5.9 Bias Technologies 32 32 32 32 Switch to the appropriate responsibility and run the request. When we enter the name of the program in the run request window then parameter window will be open. Then you will get the parameter screen enter the required parameters and go with ok button. After entering both the parameters then press ok and then submit the request. After that submit the request to and go with find button to view the status of the request. After it completed normal we can view the output from the output button. If the Status of the program completed error then go with View Log button. Oracle Application 11.5.9 Bias Technologies 33 33 33 33 Out Put: Oracle Application 11.5.9 Bias Technologies 34 34 34 34 XML Publisher Registration Steps: Purpose: For CFD(Customer Facing Document) 1. Develop a report according to the client requirements and register the concurrent program. Ex: The Concurrent program name is CS_XML_REP Note: The only difference is we have to set the format type as XML in the concurrent program window while registering 2. Create a Template with specified formats like rtf, pdf… using the appropriate tools. 3. Then go with the XML Publisher Administrator Responsibility and click on the Data definition. Oracle Application 11.5.9 Bias Technologies 35 35 35 35 4. Then you will get the screen now go with the Create Data definition button in the screen. 5. The Create Data Definition screen will appear enter all the fields and click on apply button. Window Help Name: This name is your data definition name, which you are going to create now. Application: We have to select the appropriate application, which our concurrent program has been registered Code: The code must match the concurrent program short name, which we registered earlier. Oracle Application 11.5.9 Bias Technologies 36 36 36 36 Start Date: It specifies the start date of your application. Description: To describe your Data Definition enter the data. 6. Now go with Template tab in the same screen. 7. Click on the Create template button then the following screen will appear. Window Help: Name: This is the Template Name, which we are going to create. Application: We have to select the appropriate application, which our concurrent program has been registered Type: Select the format type of your template, which you created earlier. Code: Enter the code for the template that is short name. Data Definition: Enter the data definition name, which was created earlier. Start Date: It specifies the start date of your application. Description: To describe your Template enter the data. File: Click on Browse and select the template file, which you have created. Language: Choose a specific language according to the Customer Specifications Territory: Territory specifies the language belongs to which nation. Then go with Apply button. Oracle Application 11.5.9 Bias Technologies 37 37 37 37 8. Now Switch to the appropriate responsibility and run the CS_XML_REP concurrent program, which we created earlier. 9. Then copy the Request_id in the Requests window. 10. Switch the responsibility to the XML Publisher Responsibility and run the XML Publisher Report. You will get the following Input Screen. Oracle Application 11.5.9 Bias Technologies 38 38 38 38 Output: After completion of the request go with view output window Button. Report Code: -- This code will appear on the After parameter form in our report function AfterReport return boolean is l_request number; l_appl NUMBER; begin SELECT FCP.APPLICATION_ID INTO l_appl FROM FND_CONCURRENT_PROGRAMS FCP,FND_CONCURRENT_REQUESTS R WHERE FCP.CONCURRENT_PROGRAM_ID = R.CONCURRENT_PROGRAM_ID AND R.REQUEST_ID = :P_CONC_REQUEST_ID; l_request := fnd_request.submit_request( 'XDO', 'XDOREPPB', null, null, FALSE, :P_CONC_REQUEST_ID,'xmlreporttemp',l_appl,'US','N',NULL,NULL,NULL,NULL, NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, NULL,NULL,NULL,NULL,NULL,NULL,NULL); srw.message(100, ' Request submitted ' || l_request); SRW.USER_EXIT('FND SRWEXIT'); return (TRUE); EXCEPTION WHEN OTHERS THEN RETURN NULL; end; Oracle Application 11.5.9 Bias Technologies 39 39 39 39 Table Registration in APPS: 1. Create a table . Ex: Sql> Crete table wip_item(ITEM VARCHAR2(15), ITEMDESCRIPTION VARCHAR2(100), ITEMCOST NUMBER(8), CATEGORYK VARCHAR2(100), CREATION_DATE DATE, CREATED_BY NUMBER(7), LAST_UPDATE_DATE DATE, LAST_UPDATED_BY NUMBER(7), ATTRIBUTE_CAT VARCHAR2(100), ATTRIBUTE1 VARCHAR2(100), ATTRIBUTE2 VARCHAR2(100), ATTRIBUTE3 VARCHAR2(100), ATTRIBUTE4 VARCHAR2(100), ATTRIBUTE5 VARCHAR2(100)); 2. If you are in different user for Ex: scott/tiger then you have to grant permission to APPS. Ex: Grant all on wip_item to apps; 3. Connect apps/apps@PROD. 4. Create synonym for the table which we are going to register in APPS. Ex: Create public synonym wip_item for wip.wip_item. 5. Registering the table by using AD_DD Package Syntax: Exec AD_DD.REGISTER_TABLE (p_appl_short_name, p_tab_name, --table name p_tab_type, p_next_extent, -- Enter the initial and next extent sizes in kilobytes for your table. You must enter values greater than 0. p_pct_free,--free storage. p_pct_used);-- used storage. EXEC AD_DD.REGISTER_TABLE('WIP','WIP_ITEM','T',8,10,90); Registering the Columns: Syntax: EXEC AD_DD.REGISTER_COLUMN p_appl_short_name, p_tab_name, p_col_name, p_col_seq, p_col_type, p_col_width, p_nullable, p_translate, p_precision default null, p_scale default null); Oracle Application 11.5.9 Bias Technologies 40 40 40 40 Ex: EXEC AD_DD.REGISTER_COLUMN('WIP','WIP_ITEM','ITEM',1,'VARCHAR2',15,'N','Y'); EXEC AD_DD.REGISTER_COLUMN('WIP','WIP_ITEM','ITEMDESCRIPTION',2,'VARCHAR2',100,'N','Y'); EXEC AD_DD.REGISTER_COLUMN('WIP','WIP_ITEM','ITEMCOST',3,'NUMBER',8,'N','Y'); EXEC AD_DD.REGISTER_COLUMN('WIP','WIP_ITEM','CATEGORYK',4,'VARCHAR2',100,'N','Y'); EXEC AD_DD.REGISTER_COLUMN('WIP','WIP_ITEM','CREATION_DATE',5,'DATE',11,'N','Y'); EXEC AD_DD.REGISTER_COLUMN('WIP','WIP_ITEM','CREATED_BY',6,'NUMBER',7,'N','Y'); EXEC AD_DD.REGISTER_COLUMN('WIP','WIP_ITEM','LAST_UPDATE_DATE',7,'DATE',11,'N','Y'); EXEC AD_DD.REGISTER_COLUMN('WIP','WIP_ITEM','LAST_UPDATED_BY',8,'NUMBER',7,'N','Y'); EXEC AD_DD.REGISTER_COLUMN('WIP','WIP_ITEM','ATTRIBUTE_CAT',9,'VARCHAR2',100,'N','Y'); EXEC AD_DD.REGISTER_COLUMN('WIP','WIP_ITEM','ATTRIBUTE1',10,'VARCHAR2',100,'N','Y'); EXEC AD_DD.REGISTER_COLUMN('WIP','WIP_ITEM','ATTRIBUTE2',11,'VARCHAR2',100,'N','Y'); EXEC AD_DD.REGISTER_COLUMN('WIP','WIP_ITEM','ATTRIBUTE3',12,'VARCHAR2',100,'N','Y'); EXEC AD_DD.REGISTER_COLUMN('WIP','WIP_ITEM','ATTRIBUTE4',13,'VARCHAR2',100,'N','Y'); EXEC AD_DD.REGISTER_COLUMN('WIP','WIP_ITEM','ATTRIBUTE5',14,'VARCHAR2',100,'N','Y'); 6. Check in APPS go to Application Developer Responsibility Application Database Table Then we will get Tables Screen as Shown below and press F11 then enter the table_name and press CTRL+F11 then we will get the data as shown below. Oracle Application 11.5.9 Bias Technologies 41 41 41 41 Valuesets: Valueset is nothing but the list of values with validation. We will be using the valuesets whenever the concurrent programs have parameters and while defining the flex fields we attach this flex fields. The given below are the types of valuesets. None Independent Dependent Table Translatable Dependent Translatable Independent Special and Pair. None: It is used whenever we want to apply some format condition like max.length, numbers, and capital letters so on. There wont be any list of values in none valueset. Independent: This valueset is used whenever we want to show some hard coded values to the end user that time we will create. Navigation to get the Valueset screen in Application Validation Set After that go with the Navigation Application Validation Values then we will get the screen given below. Enter the valueset name, which we created earlier. Oracle Application 11.5.9 Bias Technologies 42 42 42 42 Dependent: It is a list of values, which are depending on the Independent valueset. To create dependent valueset go with same process we mentioned above and set the validation type as Dependent and click on the Edit Information button then we will get the Dependent valueset information screen enter the mandatory fields like independent valueset name which we created earlier. Table: It will be used whenever we want to show the list of values from the table column name. When we select this option then the Edit Information in this window will become active. When we go with that Edit Information button we get the Validation information window. That is shown below. To define the valueset the Navigation is Application Validation Set. The Valueset form is shown below. Oracle Application 11.5.9 Bias Technologies 43 43 43 43 Window Help: Value Set Name: Define your own value set name. Format Type: Select the appropriate datatype that what we are passing as parameter through this valueset. This field is mandatory. Maximum Size: Enter the maximum size of the parameter that what we are passing to the report. This field is mandatory. Validation Type: Select validation type as Table and go with the edit information button. then the Validation table information window will be open. Enter the mandatory fields as required. Now go with the edit information button then we get the Validation Table Information window will appear as shown below. Table Name: Here we can enter the table name or we can write a query. Query must be written in braces only. Ex: (select distinct (empno) from scott.emp) Value: Enter the column name which we want to display in the parameter window. Meaning: Meaning is to provide the additional information along with the list of values. ID: To column is used to pass a value to the parameter. The scenario of using this id will be if we want to pass a value to the parameter, which is associated with, the list of values select by the user. Where/Order By: To incorporate any filters in the list of values we can do that in where clause and order by is used to sort the list of values in ascending or descending order. Additional Columns: when we want to display any other Additional columns in the output form we use this. We use these two as per the requirements. Syntax: Column name “Alias Name” (Width) Oracle Application 11.5.9 Bias Technologies 44 44 44 44 Note: When we are working with table valueset only the edit information button is active. For other valuesets it is not active. Using $FLEX$: $FLEX$ is used to hold the data which was selected by the previous valueset for that we have to define another table valueset with different name as per the above process. In the new valuset we used the $FLEX$ as given below screen. Note: Whenever you assign the valueset to any concurrent program then you are not allowed to modify the valueset. We have to remove from the valueset from the concurrent program to modify the valueset, which was already created. For more information you go to the example given below with detailed explanation of table valueset. When ever we select the validation type as table then the edit information button in the valuesets window will be enabled. It will be disabled for the other valuesets only for the table valueset. Translatable Dependent & Translatable Independent: These two valuesets are used whenever you are working with multi-lingual implementation. Special: Special valueset is used for display flexfields data as parameter values. Pair: This valueset is used to display parameters in pairs. EX: Date from & Date To…etc. (To specify a range in pair we use such type of valuesets). Oracle Application 11.5.9 Bias Technologies 45 45 45 45 Working with User Exits in Reports 6i: User Exits are 3GL programs used to transfer the control from the report builder to Oracle Applications or any and it will perform some actions and return to the report builder. There are five types of user exits those are given below. FND SRWINIT FND SRWEXIT FND FORMAT_CURRENCY FND FLEXSQL FND FLEXIDVAL FND SRWINIT: Used to write in before report trigger. It is used to fetch the concurrent request information and also used to set the profile options. FND SRWEXIT: We will write this in after report trigger. Used to free the memory which has been allocated by the other user exits FND FORMAT_CURRENCY: This is used to convert amounts or currency from one currency to other currency values and also used to display currency amounts in formats. EX: SRW.USER_EXIT(‘FND FORMAT_CURRENCY’, Code = ‘currency_code’, Display_width=’15’, Amount = ‘:cf_feb’, Display = ‘:cd_feb’); Return (:cd_feb); FND FLEXSQL: This is used to get the data from flex fields. We will use in formula columns. FND FLEXIDVAL: This is used to get the data from flex fields. We will use them in formula columns. Note: 1. We use the User Exits in the Report triggers like before report, after report, before parameter form, after parameter form. 2. We have to create a mandatory parameter called P_CONC_REQUEST_ID when we work with FND SRWINIT, FND SRWEXIT. 3. The user exits are case sensitive we have to write them in capital letters only otherwise they will raise an error. Oracle Application 11.5.9 Bias Technologies 46 46 46 46 Designing the Report: Create a new report manually. Go to data model and click on the SQL Query then a dialog box SQL Query Statement will open write your query in that. Data Model: Ex: SELECT E.EMPNO,E.ENAME,E.SAL,D.DNAME FROM SCOTT.EMP E,SCOTT.DEPT D WHERE D.DEPTNO=E.DEPTNO order by e.deptno Layout Model: Now go to the layout model and design your report view as per the requirements. See here in the below diagram we created P_CONC_REQUEST_ID in the user parameters. Oracle Application 11.5.9 Bias Technologies 47 47 47 47 Report Triggers: Report triggers execute PL/SQL functions at specific times during the execution and formatting of your report. The types of report triggers are given below. Before Parameter Form: If we want to pass any initial values to the parameter we use this trigger. After Parameter Form: This trigger will fire after the entering the parameter values. To validate the parameters and use to populate the lexical parameters, we use this trigger. Before Report: In oracle 11i we use this trigger to initialize profile values. Between Pages: This trigger is used to format the output and fires once per each page except for the first page. After Report: This trigger is used to free the memory or drop the temporary objects that are created in the begining of the report or to send the output as mail. Note: 1. In the report triggers we cant use any SQL statements directly there is package called srw(Standard Report Writer) using this we can write any SQL statements. Syntax: srw.do_sql(‘create sequence myseq Increment by 1 Start with 1’); 2. To display any message box in the triggers or at any stage in reports6i we use another procedure in srw package. Syntax: srw.message(1001,’Hai this is a Simple Message from CHAITU’); Go to the before report trigger and use the FND SRWINIT which is used to fetch the concurrent request information and also to set the profile options. Oracle Application 11.5.9 Bias Technologies 48 48 48 48 Ex: Code in the before report trigger function BeforeReport return boolean is begin SRW.USER_EXIT('FND SRWINIT'); return (TRUE); end; After writing the code then click on the compile button if there is no error then we will get the successfully compiled message at the down right corner. Now go after report trigger and write the code as given below and compile it after successfully completion then close the window. EX: function AfterReport return boolean is begin SRW.USER_EXIT('FND SRWEXIT'); SRW.message(100,'P_CONC_ID: '||:P_CONC_REQUEST_ID); return (TRUE); end; Note: Now our report is ready, save it and register the report in the oracle applications. Then we will get the output as given below. Output Window: Oracle Application 11.5.9 Bias Technologies 49 49 49 49 Profiles: Profiles are the changeable options which affect the way application runs. To get these profiles we use three API’s those are given below. 1. FND_PROFILE.GET(‘Name of the Profile’, variable name); 2. variable name := FND_PROFILE.VALUE(‘Name of the profile’); 3. FND_PROFILE.SET(‘Name of the profile’, value of the profile); The 1 st and 2 nd are same but, the only difference is FND_PROFILE.GET is the procedure and FND_PROFILE.VALUE is the function so, it return a value. The Profile values will be set in different levels those are given below. Site Application Responsibility User Server Organization Site: This field displays the current value, if set, for all users at the installation site. Application: This field displays the current value, if set, for all users working under responsibilities owned by the application identified in the Find Profile Values block. Responsibility: This field displays the current value, if set, for all users working under the responsibility identified in the Find Profile Values block. User: This field displays the current value, if set, for the application user identified in the Find Profile Values block. Profile: Enter the name of the profile option whose values you wish to display. You may search for profile options using character strings and the wildcard symbol (%). For example, to find all the profile options prefixed by "Concurrent:” you could enter "Conc%" and press the Find button. The navigation to get the system profile values information is Profile System. Oracle Application 11.5.9 Bias Technologies 50 50 50 50 The profiles are of two types those are given below. 1. System Profile and 2. User Profile. The above given window is the System Profile window and the user profile window is given below and the navigation is Profile Personal. Note: To view personal profiles enter into the query mode and enter the profile name which we have already then we get profile value details. Some important Profiles: ORG_ID MFG_ORGANIZATION_ID GL_SET_OF_BKS_ID USER_ID RESP_ID RESP_APPL_ID Note: To get the RESP_ID or RESP_APPL_ID…. Go with the following navigation. Menu Help Diagnostics Examine. Then it will prompt for the oracle password, enter that then we get the Examine and Variable Values window as shown below. In the same way we can get the ORG_ID, RESP_APPL_ID, USER_ID…., by entering what ever we want at the Field column in the above Examine window. Oracle Application 11.5.9 Bias Technologies 51 51 51 51 API’s To Register Concurrent Program: FND_PROGRAM.EXECUTABLE: To Create executable and set the appropriate execution method Syntax: FND_PROGRAM.EXECUTABLE(EXECUTABLE, APPLICATION, DESCRIPTION, EXECUTION_METHOD, EXECUTION_FILE_NAME); FND_PROGRAM.REGISTER: To create concurrent program Syntax: FND_PROGRAM.REGISTER(PROGRAM, APPLICATION, ENABLED, SHORT_NAME, DESCRIPTION,….); FND_PROGRAM.PARAMETERS: To set the parameter and to pass appropriate tokens through the concurrent program Syntax: FND_PROGRAM.PARAMETER(PARAMETERNAME, VAlUESET, TOKEN, PROMPT, SIZE); FND_PROGRAM.REQUEST_GROUP: To set the parameter and to pass appropriate tokens through the concurrent program Syntax: FND_PROGRAM.REQUEST_GROUP(REQUEST_GROUP_NAME, APPLICATION, CODE, DESCRIPTION,..); FND_GLOBAL_APPS_INITIALIZE: When ever we are working with profiles in PL/SQL and submitting through the SQL we need to use this API the syntax for this API is given below. Syntax: FND_GLOBAL_APPS_INITIALIZE(user_id, resp_id, resp_appl_id, [Security_group_id, server_id]); Note: In this FND_GLOBAL_APPS_INITIALIZE the parameters user_id… and others we have to get them manually from apps the process we discussed above see. The navigation is Menu Help Diagnostics Examine. EX: Declare i number; begin FND_GLOBAL_APPS_INITIALIZE(1007899,20420,1); i:=FND_PROFILE.VALUE(‘ORG_ID’); dbms_output.put_line(‘Operation ID: ‘|| i); end; O/p: Operation ID: 204 FND_CLIENT_INFO.SET_ORG_CONTEXT: This is the API used to set the ORG_ID value from the backend, so that system will retrieve the data from the database which is related to mention the organization. Syntax: Begin FND_CLIENT_INFO.SET_ORG_CONTEXT(ORG_ID); end; EX: Begin FND_CLIENT_INFO.SET_ORG_CONTEXT(204); end; Oracle Application 11.5.9 Bias Technologies 52 52 52 52 FND_REQUEST.SUBMIT_REQUEST: When ever we want to submit the request to the apps through the SQL we use this API. The syntax and a simple example were given below. Syntax: FND_REQUEST.SUBMIT_REQUEST( Application, we have to pass the short name of the application concurrent Program in which we registered (Ex: Oracle Receivables = AR). Program, Pass the short name of the concurrent program Description, description of the concurrent program Start-time, start time of the concurrent program Sub-request, if there any other request, pass true other wise false. Arg-1, - - These arg1 to arg100 are used to pass the parameters to the concurrent program. Arg100); Totally FND_REQUEST.SUBMIT_REQUEST API is having the 105 parameters. EX: Declare id number; begin FND_GLOBAL_APPS_INITIALIZE(1007899,20420,1); Id:=FND_REQUEST.SUBMIT_REQUEST(‘AR’,CSPROC,NULL, NULL, FALSE, 20, RESEARCH); dbms_output.put_line(‘Request ID:’ || id); commit; end; O/P: Request ID: 2725363 FND_FILE.PUT_LINE: This API is used to send messages to output file or log file while we are working with PL/SQL Stored procedures For sending messages to output file we use this syntax Syntax: FND_FILE.PUT_LINE(FND_FILE.OUTPUT,’OUTPUT MESSAGE’); For sending messages to log file we use this syntax Syntax: FND_FILE.PUT_LINE(FND_FILE.LOG,’LOG MESSAGE’); Difference between ORG_ID & ORGANIZATION_ID: ORG_ID will come under operating unit in Multiorg. ORGANIZATION_ID will come under inventory organization. ORG_ID is used to distinguish the data of different business organizations. ORGANIZATION_ID is used to identify the items belongs to which inventory organization it has assigned. Oracle Application 11.5.9 Bias Technologies 53 53 53 53 MULTI ORGANIZATION (MULTIORG): Multiorg is nothing but under single oracle application implementation maintaining multiple organizations and multiple set of books. We will have Multiorg tables (table which is ending with _ALL). When ever we enter the data, which will be stored in the Multiorg tables only. Ex: OE_ORDER_HEADERS_ALL OE_ORDER_LINES_ALL OE_ORDER_HOLDS_ALL PO_HEADER_ALL PO_LINES_ALL Multiorg Structure: Business Groups: The business groups represent the highest level in the organization structure like major divisions etc. business group secures human resources information for example when we request a list of employees we can see the employees assign to the business groups. Set of books: It is a financial reporting entity uses a particular chart of accounts functional currency and accounting calendar. Oracle GL secures transaction information like general entries balances by set of books. When we assign to the oracle GL responsibilities there will be a set of books assignment. We can see the information for that set of book only. The navigation in that responsibility is Setup Financials Books Define. Oracle Application 11.5.9 Bias Technologies 54 54 54 54 Legal Entities: It is a legal company for which we prepare physical or tax reports. We will assign tax identifiers and other legal information. Operating Units: It is one of the organizations where exactly company is being sales, purchasing payments and receiving and so on. It may be sales office or a division or a department. At operating unit level PO, AP, AR, OM modules will be implemented. Inventory Organization: It is an organization where we are going to maintain manufacturing information and items information. It captures inventory transactions, balances. Oracle inventory, WIP, BOM will be implemented at inventory organization level. Sub Inventory: Sub inventory is nothing but stocks or goudons or warehouses, which will be define under inventory organization. Locators: Stock Locators is nothing but the specific location inside the sub inventory where we will place the item. Note: • When ever we write a statement like SELECT * FROM OE_ORDER_HEADERS then it shows “NO ROWS RETURN” as an output. • When ever we are working with the Multiorg views if we want to get the data from those views we have to set the ORG_ID of which Operating unit it is belongs by using the API (FND_CLIENT_INFO.SET_ORG_CONTEXT(ORG_ID)). Then we get the required information from the view. • We found the list of ORG_ID’s in the HR_OPERATING_UNITS. • To find the system is in Multiorg or not the query is EX: SELECT MULTI_ORG_FLAG FROM FND_PRODUCT_GROUPS; O/p: Y If it is a Multiorg system otherwise it is N. Oracle Application 11.5.9 Bias Technologies 55 55 55 55 Flex Fields: A flex field is a flexible data field that your organization can customize to your business needs without programming. Oracle Applications uses two types of flexfields, those are given below. 1. Key flexfields(KFF) and 2. Descriptive flexfields(DFF). Key Flexfields: Key Flexfeilds are used to store the key information of data in segments. We can call these segments as intelligent keys. For KFF we define flexfeild qualifiers and segment qualifiers. The data of this key flexfeilds will store in segment cols in a table. EX: 1. Accounting Flexfeild (GL) 2. System Item(INV) 3. Item Catalog(INV) 4. Item Category(INV) 5. - - Descriptive Flexfields: The descriptive flexfeilds are used to add the additional information to the existing data. These DFF values will store in attributes column in table. There is no need to define Flexfeild qualifiers and Segment qualifiers in DFF. • The table FND_FLEX_VALUES will help us to retrieve the flexfields data in our programs. Existing DFF Customization: Go with the Application developer responsibility and in that go through the navigation Flexfeilds Descriptive Registers. Query the records as per the table name and retrieve. Copy the Title and go to the Segments form the navigation is Flexfeilds Descriptive Segments. Query the records as per the title. Uncheck the Check box Freeze Flexfeild Definition. Now go with the Segments button and attach new column and we can attach valueset. Click the open button and make that as field as required (or) optional by checking / unchecking Required box. Even we can select default value type. We can also change the size and save it. Now check the Freeze Field Definition. Click compile button. Save it and close. Note: When ever we click compile button system will submit Flexfield View Generator concurrent program internally to create descriptive flexfeild view. Oracle Application 11.5.9 Bias Technologies 56 56 56 56 INTERFACES: It is nothing but a program; it will be used to transfer the data from flat file to data base table or from data base table to flat file. Two types of interfaces given below. 1. Outbound Interface 2. Inbound Interface Outbound Interface: it will be used to transfer the data from oracle apps base table to legacy system flat file. We will develop a concurrent program, which is pl/sql procedure. Inside of that we will use UTL_FILE package to generate the flat file. UTL_FILE: it is one of the pl/sql package, which will be used to transfer the data from oracle data base table to flat files or from flat files to oracle data base tables. But we will use sql loader to transfer data from flat file to data base tables . By using following 3 functions we will generate flat file 1. Declare the file pointer to find out file location. UTL_FILE.FILE_TYPE; 2. To open or create file. UTL_FILE.FOPEN(‘PATH’,’FILENAME’,’W’); 3. To transfer data into file UTL_FILE.PUT_LINE(FILE POINTER, COLUMN NAME); 4. To close file UTL_FILE.FCLOSE(FILE POINTER); STEPS: 1. Develop the pl/sql program. 2. Define the cursor to get the data from the data base tables. 3. Open the cursor and open the file by using UTL_FILE package. 4. Transfer the data from cursor variable into flat files by using UTL_FILE. 5. Close the file by using UTL_FILE package. 6. Register the program as concurrent program. 7. This program is scheduled at SRS window. Ex: Create or replace procedure inventoryout (errbuf out varchar2, Retcode out varchar2) as Cursor cur_inv is select inventory_item_id,organization_id,segment1, description from mtl_system_items_b; Outpointer utl_file.file_type; Begin Outpointer:=utl_file.fopen('c:\temp','inventoryflat.txt','w'); -- To get the path: -- Select value from V$parameter where name like ‘utl_file_dir’; For c in cur_inv Oracle Application 11.5.9 Bias Technologies 57 57 57 57 loop Utl_file.put_line(outpointer,c.inventory_item_id||'-'||c.organization_id||'-'|| c.segment1 ||'-'||c.description); end loop; utl_file.fclose(Outpointer); exception when others then fnd_file.put_line(fnd_file.log,'error while generating flat file'); end inventoryout; UTL_FILE EXCEPTIONS: 1. UTL_FILE.INVALID_OPERATION 2. UTL_FILE.INVALID_PATH 3. UTL_FILE.INVALID_MODE 4. UTL_FILE.INVALID_FILEHANDLE 5. UTL_FILE.READ_ERROR 6. UTL_FILE.INTERNAL_ERROR INIT.ORA: This file contains the accessible directories list. Inbound Interface or Conversion: it will be used to upload the data from legacy system flat file to oracle apps base table. For this we will use SQL LOADER program and pl/sql program. Ex: -- To load data from flat file to Tables using SQLLDR -- Writing the Control File CS_CTL.CTL LOAD DATA INFILE ‘C:\CHAITU_CS.CSV’ BADFILE ‘CS_BAD.DAT’ -- Naming the BAD FILE DISFILE ‘CS_DISC.DAT’ -- Naming the DISCARD FILE INSERT INTO TABLE CS_0016 FIELDS TERMINATED BY ‘,’ TRAILING NULCOLS ( COL1, COL2, COL3 ) -- SQLLDR SYNTAX CMD> SQLLDR APPS/APPS@PROD CONTROL = CS_CTL Oracle Application 11.5.9 Bias Technologies 58 58 58 58 SQL Loader: This is a CUI (Character User Interface) Tool, which is used to load data from flat files to tables. We have to feed control file to the SQL Loader this control file contains information about the flat file and into which table needs to be loaded. Syntax: LOAD DATA INFILE <FILENAME> [INSERT / REPLACE / TRUNCATE / APPEND] INTO TABLE <TABLENAME> FIELDS TERMINATED BY ‘ , ’ OPTIONALLY ENCLOSED ‘ “ ‘ TRIALING NULLCOLLS WHERE ---[CONDITION] Filler Clause: The filler clause is used to skip one column data in the flat file. Ex: -- Example using all functions in the control file -- Create a Table ABC with 4 cols Create table ABC(Col1 number, Col2 varchar2(10) Col3 number, Col4 varchar2(10), Col5 varchar2(10), Col6 date); -- Table Created -- Create the Control File with the name mycontrol.ctl LOAD DATA INFILE ‘C:\NEW.CSV’ INSERT INTO TABLE ABC (COL1, Sequencename.nextval, getting the sequence number COL2, “upper(:col2)” COL3, constant ‘ABC’ it fills the each row with the constant value COL4, NULLIF COL4= ‘EX’ if there is no value then it is filled with the COL5, FILLER, to skip the column COL6, “to-date(:col4, ‘dd-mm-yyyy’)); to print the date. After completion of the control file save it as .ctl extension and to execute the control file go to the command prompt in UNIX or WINDOWS use the following syntax. Oracle Application 11.5.9 Bias Technologies 59 59 59 59 Syntax: Prompt> SQLLDR USERNAME/PASSWORD@HOSTNAME CONTROL = CONTROL FILE NAME [DIRECT = TRUE / FALSE [DEFAULT] SKIP = NUMBER ROWS = NUMBER ERRORS = NUMBER] Ex: -- Executing the control file mycontrol.ctl --Prompt> SQLLDR USERNAME/PASSWORD@HOSTNAME CONTROL = mycontrol.ctl In the execution there are more options, which are stated below. And those options we give after the CONTROL in the SQLLDR are optional according to our requirement we will use them. Conventional Path: It is the default path which will create insert statements and it will insert data into table method is very slow. Here the auto commit will be carried for every 64 records. Direct Path: This will be used when ever the volume of data is high. It will make the entire data into set of blocks and it will create one insert statement for each block and insert data into tables. This method is very fast also parallel loading will be working while working with direct path. By default it will be false. Skip: Used to skip the rows from flat file while loading the data into tables. Rows: In conventional path the commit will happen for every 64 records by default if we want to make it to 1000 EX: ROWS = 1000 Errors: This indicates that how many no of errors can be tolerated while loading data into tables. The default value is 50. As a part of the execution the SQLLDR creates three files according to the output type those are given below. 1. Bad File: Which will be created whenever there are records, which are rejected while inserting into the table from the flat file? 2. Discard File: It will be created whenever there are records which are not satisfying the filtering criteria specified in the where clause of the control file. 3. Log File: This file contains the complete information of data it will be created at all times when ever we fire SQLLDR. Oracle Application 11.5.9 Bias Technologies 60 60 60 60 Conversion: Conversion is a preimplementation load which will transfer the data from the legacy system to the oracle apps system. After the completion of load we will drop all the objects which we have used for the conversion. Conversion Process: 1. We will get the flat file to convert, based on the flat file we will generate the temporary file and by using SQLLDR we transfer data from flat file to temporary table. 2. Create staging table, which is replica of interface table provided by oracle. 3. Develop a package which have different program units for validation and moving to interface tables 4. Run the validation procedure to validate the data which has been loaded into staging table. Use extra cols in a staging table ERRFLAG and MESSAGETEXT that are used to identify valid and invalid records with respective error messages. 5. We transfer the successful records into interface table and change the ERRFLAG status from V(Validated) to M(Moved) • ERRFLAG E ERROR • ERRFLAG V VALIDATED • ERRFLAG M MOVED 6. As we are working with open interface we will run the import program provided by oracle used to pull the data from interface table and load into base table. 7. If any records got failed while importing these will exist under oracle defined errors tables. Conversion Process (Brief): 1. Based on the flat file provided write the control file to transfer the data into staging tables. 2. Validate the data that has been loaded into staging tables. 3. Insert the validated records into interface tables. 4. This is an open interface we run the import program to import the data into base tables. Interface: Interface is a post implementation load which will be helpful to import the data after golive. EX: ARLOCKBOX interface The object that we have developed for this interface will be registered in the oracle applications. Oracle Application 11.5.9 Bias Technologies 61 61 61 61 Types of Interfaces: There are two types of interfaces. 1. Open Interface. 2. Custom Interface. Open Interface: Open interface is nothing but it provides interface tables and import programs to import data into base tables. Customer Interface: Whenever oracle has not provided any import programs or API to import data into base tables we call it as a custom interface. Interface Process: 1. Based on the flat file w e will develop the control file and insert the data into staging table. Note: Place the control file in the bin directory of your custom application directory. 2. Register that in oracle 11i applications by taking execution method as SQL * LOADER we develop the packages which will be having procedures like validate the staging table, moving the validated data to the interface tables, run import program after that register that package in oracle 11i applications Note: While transferring the data into base tables we pass three extra cols those are given below. Process_flag (Number) Transaction_type (Varchar2) Set_process_id Process_flag: To check the status of the row which we fetched into the table. We pass different values that indicate the status of the row those are given below. 1 To be process 2 Import Success 3 Error 4 Validation Under Process 7 Validation Successful. Transaction_type: This is used to identify which transaction was done those are CREATE, UDATE. Set_process_id: It is used to split the no. of records to use memory correctly without getting any SGA MEMORY error. Note: We can’t load more than one organization records at a time. First we have to load the master organization and then child organization. Oracle Application 11.5.9 Bias Technologies 62 62 62 62 Item Conversion: 1. We transfer the data from flat file to the staging table. 2. Validate the data, which has been loaded into the staging table. Check the ITEM_NUMBER is existing or not. Check whether the ORG_CODE is existing or not. Description should not be NULL Template name should be validated from MTL_ITEM_TEMPLATES table. Validate the PLANNERS_CODE from MTL_PLANNERS table. Validate the HAZARDS_CLASS from PO_HAZARD_CLASSES table. 3. After doing the above validation if the record got successfully validated we will set the record status to ‘V’ else ‘E’ with appropriate error message. 4. Transfer the validated data from staging to interface table. (MTL_SYSTEMS_INTERFACE). 5. As we are working with open interface we will run the standard concurrent program to import the data from interface table to base table. Before running this import program we have to set the organization to which we are loading the items. The program will ask for six parameters. The navigation is Import Import Items in the Inventory responsibility. All Organizations: If we go with YES it will load the same item into all organizations else it will load into a specific organization. Oracle Application 11.5.9 Bias Technologies 63 63 63 63 Validate Items: If this is YES then import program revalidate the data existing in the interface table. Process Items: If this is YES after validation it will load the validated records into MTL_SYSTEM_ITEMS_B table. Delete Processed Rows: If this is yes the successfully imported records will be deleted from the interface table. Process Set(NULL for ALL): This is the only parameter which is not mandatory. What ever value will be provided compared with the SET_PROCESS_ID column in the MTL_SYSTEMS_ITEM_INTERFACE table. The main purpose of this table is to make or spread the data into batch which makes import easy. If we provide NULL for the irrespective of SET_PROCESS_ID then it will pull all the records for the process. Create or Update Items: If it is 1 it will check the records in the interface table whose transaction type is CREATE and pull those records for import. If we provide 2 it means we are trying to UPDATE the existing items. So it will pull the records whose transaction type is UPDATE. After the submission of the request and when it got completed to identify the load status of records check with the PROCESS_FLAG column in the MTL_SYSTEM_ITEMS_INTERFACE. We discuss the different status of the process flag in the above discussion. General Errors: The general error that occur when we are dealing with the Item Conversions that is Master-Child Conflict this error will occur when ever we are trying to load child org with out loading to the master. Items cannot have pick the components = “YES” when ever the MRP planning method is not defined. Note: To find the records which got erroredout and their proper messages oracle provided MTL_INTERFACE_ERRORS table. The join between this interface table and error table is TRANSACTION_ID. To set the master items to the child organizations also then we have to go with the Master Items then retrieve the item and go with the Organization Assignment button on the top left side. Oracle Application 11.5.9 Bias Technologies 64 64 64 64 Conversion Script for Item Load: /*------------------------------------------------------------------------------------------------- BIAS TECHNOLOGIES INC, INDIA File Name : CS_item_load_structures.sql Author : PHANI BHUSHAN REDDY Created Date : 03-june-06 Version : 1 Purpose : The Purpose of this script is to create the temporary table(s) Version Modified By Modified Date Purpose --------------------------------------------------------------------------------------------------- 1.1 -------------------------------------------------------------------------------------------------*/ -- Temporary Table DROP TABLE CS_ITEM_LOAD_TEMP; CREATE TABLE CS_ITEM_LOAD_TEMP ( ITEM_NUMBER VARCHAR2(30) ,DESCRIPTION VARCHAR2(240) ,TEMPLATE_NAME VARCHAR2(30) ,ORG_CODE VARCHAR2(10) ); -- Staging Table CREATE TABLE CS_ITEM_LOAD_STG AS SELECT * FROM MTL_SYSTEM_ITEMS_INTERFACE WHERE 1=0; ALTER TABLE CS_ITEM_LOAD_STG ADD (VALID_STATUS VARCHAR2(3) ,ERR_MSG VARCHAR2(4000) ); Oracle Application 11.5.9 Bias Technologies 65 65 65 65 /*------------------------------------------------------------------------------------------------- BIAS TECHNOLOGIES INC, INDIA File Name : CS_item_load.ctl Author : PHANI BHUSHAN REDDY Created Date : 03-june-06 Version : 1 Purpose : The Purpose of this control file is to import Data from flat file to table. Version Modified By Modified Date Purpose --------------------------------------------------------------------------------------------------- 1.1 -------------------------------------------------------------------------------------------------*/ LOAD DATA INFILE 'C:\ITEM_DATA.CSV' INSERT INTO TABLE CS_ITEM_LOAD_TEMP FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED '"' TRAILING NULLCOLS (ITEM_NUMBER, DESCRIPTION, TEMPLATE_NAME, ORGANIZATION_CODE ) Note: This is the Control file using the SQLLDR we execute the control file to move the data from flat file to staging table. Oracle Application 11.5.9 Bias Technologies 66 66 66 66 /* ------------------------------------------------------------------------------------------------ BIAS TECHNOLOGIES INC, INDIA File Name : CS_item_load_pkg.sql Author : PHANI BHUSHAN REDDY Created Date : 03-june-06 Version : 1 Purpose : the puruose of this package is to import items data. Move_to_staging this procedure is used to insert records from temp table into staging table Validate_staging This procedure is used to validate the date which has been moved to staging table. The valid records having the valid_status to 'V' other wise 'E'. Move_to_iface The record which through with the validations (valid_status ='V') will be transferred to interface table(MTL_SYSTEM_ITEMS_INTERFACE). Version Modified By Modified Date Purpose --------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------*/ --Package Specification CREATE OR REPLACE PACKAGE CS_item_load_pkg AS PROCEDURE move_to_staging; PROCDURE validate_staging; PROCEDURE move_to_iface; END CS_item_load_pkg; Oracle Application 11.5.9 Bias Technologies 67 67 67 67 --Package Body CREATE OR REPLACE PACKAGE BODY CS_item_load_pkg AS -- Procedure to move_to_staging PROCEDURE move_to_staging IS i number; BEGIN -- Inserting data into staging table INSERT INTO CS_item_load_stg ( segment1 -- item_number ,description -- description ,template_name -- template_name ,organization_code -- org_code ,set_process_id ) SELECT item_number ,description ,template_name ,org_code ,1 FROM CS_item_load_temp; DBMS_OUTPUT.PUT_LINE(' Total Reocrd(s) inserted '|| SQL%ROWCOUNT ); EXCEPTION WHEN OTHERS THEN DBMS_OUTPUT.PUT_LINE(' ERROR => ' || SQLERRM); END move_to_staging; --Procedure to validate the data PROCEDURE validate_staging AS l_err_flag number:=0; l_err_msg varchar2(1000); l_count number; CURSOR c is select a.rowid row_id , a.SEGMENT1, A.DESCRIPTION, a.template_name , a.organization_code from CS_item_load_stg a where nvl(VALID_STATUS,'T') in ('T','E'); BEGIN FOR c_rec in c LOOP BEGIN --- Initialize the variables l_err_flag := 0; l_err_msg := NULL; Oracle Application 11.5.9 Bias Technologies 68 68 68 68 --Validate the item number l_count := 0; select count(*) into l_count from MTL_SYSTEM_ITEMS_B where segment1 = c_rec.segment1; IF l_count > 0 THEN l_err_flag := 1; l_err_msg := '**Invalid Item number '; END IF; -- Validate the Description if c_rec.description is null then l_err_flag := 1; l_err_msg := l_err_msg || '**Invalid Description '; END IF; --Validate the Template Name l_count := 0; select count(1) into l_count from mtl_item_templates where template_name = c_rec.template_name; IF l_count = 0 then l_err_flag := 1; l_err_msg := l_err_msg || '**Invalid Template name '; END IF; --Validate the Organization Code l_count := 0; select count(1) into l_count from org_organization_definitions where organization_code = c_rec.organization_code; if l_count = 0 then l_err_flag := 1; l_err_msg := l_err_msg || '**Invalid Organization code '; end if; -- check the valid status to update the row status if l_err_flag = 1 then update CS_item_load_stg set valid_status ='E' ,err_msg = l_err_msg where rowid = c_rec.row_id; else update CS_item_load_stg set valid_status ='V' where Oracle Application 11.5.9 Bias Technologies 69 69 69 69 rowid = c_rec.row_id; end if; EXCEPTION WHEN OTHERS THEN NULL; END; END LOOP; dbms_output.put_line(' Validatin completed successfully '); END validate_staging; --PROCEDURE PROCEDURE move_to_iface AS i number; BEGIN insert into mtl_system_items_interface ( segment1 ,description ,template_name ,organization_code ,process_flag -- hard coding to 1 ,transaction_type -- hard code to CREATE ,set_process_id ) SELECT segment1 ,description ,template_name ,organization_code ,1 ,'CREATE' ,1 from CS_item_load_stg where valid_status ='V'; dbms_output.put_line(' Total Record(s) inserted ' || sql%rowcount); exception when others then dbms_output.put_line( ' Error => '|| sqlerrm); END move_to_iface; END CS_item_load_pkg; Oracle Application 11.5.9 Bias Technologies 70 70 70 70 Item Categories: 1. Convert the data from flat file to staging table. 2. Validate the data which has been loaded into staging. Validate the ITEM_NUMBER whether it exists or not from MTL_SYSTEM_ITEMS_B table. Validate the organization from ORG_ORGANIZATION_DEFINITIONS Validate the CATEGORY_SET from MTL_CATEGORY_SETS_B and MTL_CATEGORY_SET_TL. Validate the CATEGORY_CODE from MTL_ITEM_CATEGORIES_INTERFACE table. 3. As we are working with open interface we have to run this import ITEM_CATEGORY_ASSIGNMENTS program to import assignment data from interface table (MTL_ITEM_CATEGORIES). Transaction Types: Create: Create used to create new item category assignment. Delete: Delete used to delete the default category assignments. Update: This is a new transaction type come up with the 11.5.10 version of oracle applications. Instead of delete or create the new assignments we can update default category value or category code. Note: The validation process for the item categories script was given below as the step by step process. Customer Items: Customer items are the items how the customer will identify our items. Items Relationship: Item relationship which is used to maintain some relationships with item, with relationship types, with related substitute and service. Oracle Application 11.5.9 Bias Technologies 71 71 71 71 Conversion Script for Item Categories: /*------------------------------------------------------------------------------------------------- BIAS TECHNOLOGIES INC, INDIA File Name : CS_create_structures.sql Author : PHANI BHUSHAN REDDY Created Date : 03-june-06 Version : 1 Purpose : Used to create the table structures. Version Modified by Modified Date Purpose --------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------*/ DROP TABLE CS_ITEM_CAT_LOAD_TEMP; CREATE TABLE CS_ITEM_CAT_LOAD_TEMP ( ITEM_NUMBER VARCHAR2(30) ,ORG_CODE VARCHAR2(10) ,CAT_SET_NAME VARCHAR2(30) ,CAT_CODE VARCHAR2(20) ); DROP TABLE CS_ITEM_CAT_LOAD_STG; CREATE TABLE CS_ITEM_CAT_LOAD_STG AS SELECT * FROM MTL_ITEM_CATEGORIES_INTERFACE WHERE 1=0 ; ALTER TABLE CS_ITEM_CAT_LOAD_STG ADD ( VALID_STATUS VARCHAR2(10) , ERR_MSG VARCHAR2(2000) ); Oracle Application 11.5.9 Bias Technologies 72 72 72 72 /*------------------------------------------------------------------------------------------------- BIAS TECHNOLOGIES INC, INDIA File Name : CS_sqlldr.ctl Author : PHANI BHUSHAN REDDY Created Date : 03-june-06 Version : 1 Purpose : Used to create the table structures. Version Modified by Modified Date Purpose --------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------*/ LOAD DATA INFILE ‘C:\ITEM_CAT_DATA.CSV' INSERT INTO TABLE CS_ITEM_CAT_LOAD_TEMP FIELDS TERMINATED BY ',' ( ITEM_NUMBER ,ORG_CODE ,CAT_SET_NAME ,CAT_CODE ) Note: This is the Control file using the SQLLDR we execute the control file to move the data from flat file to staging table. Oracle Application 11.5.9 Bias Technologies 73 73 73 73 /*------------------------------------------------------------------------------------------------- BIAS TECHNOLOGIES INC, INDIA File Name : CS_ITEM_CAT_LOAD_PKG.pks Author : PHANI BHUSHAN REDDY Created Date : 03-june-06 Version : 1 Purpose : Package Specification -------------------------------------------------------------------------------------------------*/ CREATE OR REPLACE PACKAGE CS_ITEM_CAT_LOAD_PKG AS -- Procedure to transfer the data from Temp table to Staging table PROCEDURE move_to_staging; -- Procedure to validate the data PROCEDURE validate_data; -- Procedure to Transfer the validated data from staging to interface table PROCEDURE move_to_iface; END CS_ITEM_CAT_LOAD_PKG; --Package Body CREATE OR REPLACE PACKAGE BODY CS_ITEM_CAT_LOAD_PKG AS -- Procedure to transfer the data from Temp table to Staging table PROCEDURE move_to_staging IS BEGIN insert into CS_item_cat_load_stg (ITEM_NUMBER -- ITEM NUMBER ,ORGANIZATION_CODE -- ORG_CODE ,CATEGORY_SET_NAME -- CAT_SET_NAME ,CATEGORY_NAME -- CAT_CODE ,SET_PROCESS_ID -- HARDCODE TO 1 ) SELECT ITEM_NUMBER ,ORG_CODE ,CAT_SET_NAME ,CAT_CODE ,1 FROM CS_ITEM_CAT_LOAD_TEMP; DBMS_OUTPUT.PUT_LINE(' Total Number of Record(s) Inserted ' ||sql%rowcount); EXCEPTION WHEN OTHERS THEN DBMS_OUTPUT.PUT_LINE(' ERROR => '|| SQLERRM); END move_to_staging; Oracle Application 11.5.9 Bias Technologies 74 74 74 74 --Procedure to Validate the Data PROCEDURE validate_data IS l_err_flag number ; l_err_msg varchar2(2000); l_count number; Cursor c is select a.rowid row_id ,a.item_number ,a.category_set_name ,a.category_name ,a.organization_code from CS_item_cat_load_stg a where nvl(valid_status,'T') in ('T','E'); BEGIN FOR c_rec in C loop l_err_flag := 0; l_err_msg := NULL; l_count := 0; -- Validate the Item Number select count(1) into l_count from mtl_system_items_b msi, ORG_ORGANIZATION_DEFINITIONS ood where msi.organization_id = ood.organization_id and ood.organization_code = c_rec.organization_code and msi.segment1 = c_rec.item_number; if l_count = 0 then l_err_flag := 1; l_err_msg := ' ** Item not existed '; end if; -- Validate the category set name l_count := 0; select count(1) into l_count from mtl_category_sets where category_set_name = c_rec.category_set_name; if l_count = 0 then l_err_flag := 1; l_err_msg := l_err_msg || ' ** Category Set name is not valid '; end if; --Validate the Category Code l_count := 0; select count(1) into l_count from mtl_categories mc, mtl_category_sets mcs where mcs.category_set_name = c_rec.category_set_name and mc.segment1 = c_rec.category_name; if l_count = 0 then Oracle Application 11.5.9 Bias Technologies 75 75 75 75 l_err_flag := 1; l_err_msg := l_err_msg || ' ** Category name is not valid '; end if; if l_err_flag = 1 then update CS_item_cat_load_stg set err_msg = l_err_msg, valid_status = 'E' where rowid = c_rec.row_id; else update CS_item_cat_load_stg set valid_status ='V' where rowid = c_rec.row_id; end if; end loop; DBMS_OUTPUT.PUT_LINE(' Total Number of Record(s) Validated ' ||sql%rowcount); EXCEPTION WHEN OTHERS THEN DBMS_OUTPUT.PUT_LINE(' Error => '|| sqlerrm); END validate_data; -- Procedure to Transfer the validated data from staging to interface table PROCEDURE move_to_iface is begin insert into mtl_item_categories_interface ( item_number ,organization_code ,category_set_name ,category_name ,set_process_id ,process_flag ,transaction_type ) select item_number ,organization_code ,category_set_name ,category_name ,1 ,1 ,'CREATE' from CS_item_cat_load_stg where valid_status ='V'; DBMS_OUTPUT.PUT_LINE(' Total Record(s) inserted '|| Sql%rowcount); exception when others then dbms_output.put_line(' error => ' || sqlerrm); end move_to_iface; END CS_ITEM_CAT_LOAD_PKG; Oracle Application 11.5.9 Bias Technologies 76 76 76 76 Item Attachments: Flat file contains the data like item_number, organization_id, document_category, datatype, sequence, attachment. Validations: Validate the Item is exists with respective organization or not. Validate the document category from FND_DOCUMENT_CATEGORIES_TL. Validate the datatype from FND_DOCUMENT_DATATYPES. Validate the Sequence which should not be NULL As there are no interface tables we will load the validated data to the base tables directly. For that we have to write the procedure. Oracle Application 11.5.9 Bias Technologies 77 77 77 77 /*------------------------------------------------------------------------------------------------- BIAS TECHNOLOGIES INC, INDIA File Name : BIAS_ITEM_ATTCH.pks Author : PHANI BHUSHAN REDDY Created Date : 03-june-06 Version : 1 Purpose : Package Specification and Package Body. -------------------------------------------------------------------------------------------------*/ -- PACKAGE SPECIFICATIONS: BIAS_ITEM_ATTCH CREATE OR REPLACE PACKAGE BIAS_ITEM_ATTCH AS PROCEDURE MOVE_TO_STAGING; PROCEDURE VALIDATE_STAGING; PROCEDURE LOAD_TO_BASE; END BIAS_ITEM_ATTCH; -- PACKAGE BODY: BIAS_ITEM_ATTCH CREATE OR REPLACE PACKAGE BODY BIAS_ITEM_ATTCH AS --PROCEDURE MOVE_TO_STAGING PROCEDURE MOVE_TO_STAGING AS BEGIN INSERT INTO BIAS_ITEM_ATTCH_STG ( ITEM_NUMBER, ORGANIZATION, DOCUMENT_CATEGORY, DATA_TYPE, ATTACHMENT ) SELECT ITEM_NUMBER, ORGANIZATION, DOCUMENT_CATEGORY, DATA_TYPE, ATTACHMENT FROM BIAS_ITEM_ATTCH_TEMP A WHERE NOT EXISTS( SELECT 1 FROM BIAS_ITEM_ATTCH_STG B WHERE A.ITEM_NUMBER = B.ITEM_NUMBER AND A.ORGANIZATION = B.ORGANIZATION); Oracle Application 11.5.9 Bias Technologies 78 78 78 78 DBMS_OUTPUT.PUT_LINE('ROW(S) INSERTED'|| SQL%ROWCOUNT); COMMIT; EXCEPTION WHEN OTHERS THEN DBMS_OUTPUT.PUT_LINE('ERROR: '|| SQLERRM); END MOVE_TO_STAGING; -- PROCEDURE TO VALIDATE_STAGING PROCEDURE VALIDATE_STAGING AS L_VALID_ROW NUMBER; L_ERR_MSG VARCHAR2(1000); L_COUNT NUMBER; L_ITEM_ID NUMBER; L_ORG_ID NUMBER; L_CATEGORY_ID NUMBER; L_DATATYPE_ID NUMBER; CURSOR C1 IS SELECT A.ROWID ROW_ID, A.* FROM BIAS_ITEM_ATTCH_STG A WHERE NVL(A.STATUS,'T')='T'; BEGIN FOR C IN C1 LOOP L_VALID_ROW:=0; L_ERR_MSG:=NULL; -- VALIDATE ITEM TO ORGANIZATION BEGIN SELECT A.INVENTORY_ITEM_ID, B.ORGANIZATION_ID INTO L_ITEM_ID, L_ORG_ID FROM MTL_SYSTEM_ITEMS_B A, ORG_ORGANIZATION_DEFINITIONS B WHERE A.ORGANIZATION_ID =B.ORGANIZATION_ID AND B.SEGMENT1 = C.ITEM_NUMBER AND B.ORGANIZATION_CODE = C.ORGANIZATION; EXCEPTION WHEN OTHERS THEN L_VALID_ROW:=1; L_ERR_MSG:='INVALID ITEM NUMBER TO ORGANIZATION'; END; ---VALIDATE DOCUMENT_CATEGORY BEGIN SELECT CATEGORY_ID INTO L_CATEGORY_ID FROM FND_DOCUMENT_CATEGORIES_TL WHERE USER_NAME = C.DOCUMENT_CATEGORY; EXCEPTION WHEN OTHERS THEN L_VALID_ROW:=1; L_ERR_MSG:=L_ERR_MSG || ' INVALID DOCUMENT_CATEGORY'; END; Oracle Application 11.5.9 Bias Technologies 79 79 79 79 --VALIDATE DATATYPE BEGIN SELECT DATATYPE_ID INTO L_DATATYPE_ID FROM FND_DOCUMENT_DATATYPES WHERE USER_NAME=C.DATA_TYPE; EXCEPTION WHEN OTHERS THEN L_VALID_ROW:=1; L_ERR_MSG:=L_ERR_MSG || ' INVALID DATA_TYPE'; END; IF L_VALID_ROW=1 THEN UPDATE BIAS_ITEM_ATTCH_STG SET STATUS='E', ERR_MSG=L_ERR_MSG WHERE ROWID=C.ROW_ID; ELSE UPDATE BIAS_ITEM_ATTCH_STG SET STATUS='V', CATEGORY_ID=L_CATEGORY_ID, DATA_TYPE_ID=L_DATATYPE_ID, ITEM_ID=L_ITEM_ID, ORGANIZATION_ID=L_ORG_ID, WHERE ROWID=C.ROW_ID; END IF; END LOOP; EXCEPTION WHEN OTHERS THEN DBMS_OUTPUT.PUT_LINE('ERROR: ' || SQLERRM); END VALIDATE_STAGING; ---PROCEDURE LOAD_TO_BASE PROCEDURE LOAD_TO_BASE(P_ITEM_NUMBER IN VARCAHR2 DEFAULT NULL) AS CURSOR C1 IS SELECT A.ROWID ROW_ID, A.* FROM BIAS_ITEM_ATTCH_STG A WHERE STATUS='V' AND A.ITEM_NUMBER=NVL(P_ITEM_NUMBER,A.ITEM_NUMBER); L_DOC_ID NUMBER; L_ATT_DOC_ID NUMBER; L_MEDIA_ID NUMBER; L_ERR_MSG VARCHAR2(255); BEGIN FOR C IN C1 LOOP BEGIN SELECT FND_DOCUMENTS_S.NEXTVAL INTO L_DOC_ID FROM DUAL; INSERT INTO FND_DOCUMENTS ( DOCUMENT_ID, DATATYPE_ID, CATEGORY_ID, CREATION_DATE, CREATED_BY, LAST_UPDATED_DATE, LAST_UPDATED_BY, SECURITY_TYPE, Oracle Application 11.5.9 Bias Technologies 80 80 80 80 PUBLISH_FLAG, USAGE_TYPE ) VALUES ( L_DOC_ID, L_DATATYPE_ID, L_CATEGORY_ID, SYSDATE, 1007919, SYSDATE, 1007919, 1, 'Y', 'O' ); SELECT FND_DOCUMENTS_SHORT_TEXT_S.NEXTVAL INTO L_MEDIA_ID FROM DUAL; INSERT INTO FND_DOCUMENTS_TL ( DOCUMENT_ID, CREATION_DATE, LAST_UPDATE_DATE, LAST_UPDATED_BY, LAST_UPDATE_LOGIN, LANGUAGE, SOURCE_LANG, MEDIA_ID ) VALUES ( L_DOC_ID, SYSDATE, -1, SYSDATE, -1, -1, 'US', 'US', L_MEDIA_ID ); SELECT FND_ATTACHED_DOCUMENTS_S.NEXTVAL INTO L_ATT_DOC_ID FROM DUAL; INSERT INTO FND_ATTACHED_DOCUMENTS ( ATTACHED_DOCUMENT_ID, DOCUMENT_ID, CREATION_DATE, CREATED_BY, LAST_UPDATE_DATE, LAST_UPDATED_BY, LAST_UPDATE_LOGIN, SEQ_NUM, ENTITY_NAME, AUTOMATICALLY_ADDED_FLAG, PK1_VALUE, PK2_VALUE ) VALUES Oracle Application 11.5.9 Bias Technologies 81 81 81 81 ( L_ATT_DOC_ID, L_DOC_ID, SYSDATE, -1, SYSDATE, -1, -1, 2, 'MTL_SYSTEM_ITEMS', 'N', C.ORGANIZATION_ID, C.ITEM_ID ); INSERT INTO FND_DOCUMENTS_SHORT_TEXT ( MEDIA_ID, SHORT_TEXT ) VALUES ( L_MEDIA_ID, C.ATTACHEMENT ); COMMIT; UPDATE BIAS_ITEM_ATTCH_STG SET STATUS='P' WHERE ROWID=C.ROW_ID; EXCEPTION WHEN OTHERS THEN DBMS_OUTPUT.PUT_LINE('ERROR: ' || SQLERRM); ROLLBACK; L_ERR_MSG:='ERROR: '||SQLERRM; UPDATE BIAS_ITEM_ATTCH_STG SET STATUS='E', ERR_MSG=L_ERR_MSG WHERE ROWID=C.ROW_ID; END; END LOOP; EXCEPTION WHEN OTHERS THEN DBMS_OUTPUT.PUT_LINE('ERROR: ' || SQLERRM); END LOAD_TO_BASE; END BIAS_ITEM_ATTCH; Oracle Application 11.5.9 Bias Technologies 82 82 82 82 Some Important Tables in Different Modules: Inventory (INV) MTL_SYSTEM_ITEMS_B MTL_CATEGORY_SETS_B MTL_ITEM_CATEGORIES MTL_SECONDARY_LOCATORS MTL_RELATED_ITEMS MTL_ONHAND_QUANTITIES CST_ITEM_COST MTL_PARAMETERS Order Management (OM): OE_ORDER_HEADERS_ALL OE_ORDER_LINES_ALL OE_ORDER_HOLDS_ALL OE_TRANSACTION_TYPES_TL WSH_DELEVERY_DETAILS WSH_NEW_DELEVERIES WSH_DELEVERY_ASSIGNMENTS Account Receivables (AR): RA_CUSTOMER_TRX_ALL RA_CUSTOMER_TRX_LINES_ALL RA_CUSTOMER_TRX_TYPE_ALL RA_CUSTOMER_TRX_LINE_GL_DIST_ALL RA_CUSTOMERS RA_TERMS HZ_PARTIES HZ_PARTY_SITES HZ_CUST_ACCOUNTS HZ_CUST_ACCOUNT_SITES_ALL HZ_LOCATIONS HZ_CUST_SITE_USES_ALL HZ_CONTACT_POINTS HZ_CUST_CONTACT_POINTS Quality Pricing (QP): QP_LIST_HEADERS_ALL QP_LIST_LINES QP_PRICING_ATTRIBUTES QP_QUALIFIERS QP_PRICING_PHASES Purchase Order (PO): PO_REQUISITION_HEADERS_ALL PO_REQUISITION_LINES_ALL PO_REQ_DISTRIBUTIONS_ALL PO_HEADERS_ALL PO_LINES_ALL PO_DISTRIBUTIONS_ALL PO_VENDORS PO_VENDOR_SITES_ALL PO_VENDOR_CONTACTS PER_ALL_PEOPLE_F General Ledger(GL): GL_PERIODS GL_JE_BATCHES GL_INTERFACE GL_JESOURCES GL_JE_HEADERS GL_SET_OF_BOOKS GL_JE_LINES Note: These are some of the tables we use regularly in the modules and there are many more to view them all according to the module vise. Apply this query in SQL or TOAD. SQL> SELECT TABLE_NAME FROM ALL_TABLES WHERE TABLE_NAME LIKE ‘OE%ALL’ This query retrieves the tables from the OM module start with OE If we want to retrieve from the other modules apply the same query changing the where condition. Oracle Application 11.5.9 Bias Technologies 83 83 83 83 Oracle Application 11.5.9 Bias Technologies 84 84 84 84 Oracle Application 11.5.9 Bias Technologies 85 85 85 85 Oracle Application 11.5.9 Bias Technologies 86 86 86 86 Oracle Application 11.5.9 Bias Technologies 87 87 87 87 Oracle Application 11.5.9 Bias Technologies 88 88 88 88 Purchase Order Flow: Whenever employee requires materials he will create the requisition. After requisition is approval RFQ(Request For Quotation) will be created. This RFQ will be sent to multiple suppliers. After that we will receiving the quotation from supplier then company will do the quote analysis, one quotation will be selected as purchase order will send this PO to the supplier, as per PO terms & conditions supplier will supply the material while receiving the material we will create the document called the receipt. After the creation of receipt AP & Inventory Interfaces will be affected, which are going to update both AP & Inventory Modules. The given below is the representation of the PO Flow. Requisition: We have two types of requisitions Internal and Purchase Internal Requisition: Internal Requisition will be created whenever we are receiving the material from another organization in the company. Purchase Requisition: Purchase Requisition will be created whenever company is purchasing material from suppliers. Requisition information will be entered in 3 Levels 1. Headers 2. Lines and 3. Distributions Creating Requisition: The navigation for the Requisition screen is given below. 1. Go With Purchasing, Vision Operations(USA) Responsibility. 2. Go with Requisitions Requisitions Navigation. 3. Then we will get the screen as given below. Enter the fields item, quantity that represent how much you required to purchase and what you want to purchase. 4. This is one-to-many Relationships, after completion of the document, select Approve Button, then requisition will be sent for the approval. Oracle Application 11.5.9 Bias Technologies 89 89 89 89 Catalog Screen: By using this Catalog Button we can attach the predefined Requisition templates from the requisition template list. Select Catalog Button, select requisition template and Select Find Button and list of items which are required and click the button select. Oracle Application 11.5.9 Bias Technologies 90 90 90 90 Distributions: When ever we click on the Distributions button on the Requisitions window then we will get this distributions window Approval Screen: When we click on the Approve button on the Requisition Screen we will get this window. Here we will check the Submit for Approval check box then click on Ok button. 5. After Completion of the approval we will select form called Requisition Summary. Then we will get the alert box as our requisition has been submitted. Then click on ok. Oracle Application 11.5.9 Bias Technologies 91 91 91 91 Requisition Summary: To Check whether the requisition is approved or not we will go with the navigation Requisitions Requisitions Summary then we will get the screen given below enter the requisition number and press find button. Requisition Headers Summary: Whenever we press the find button we will get the window given below. Here our current requisitions number 5646 Approval status is approved. Note: Once the Requisition is approved then only we will go for RFQ. Oracle Application 11.5.9 Bias Technologies 92 92 92 92 If you want to cancel the requisition, then select Tools from menubar the navigation is Tools Control then select the option called Cancel Requisition and mentions the reason for canceling. Creating Requisition Number Manually: Go With navigation Set up Organizations Purchasing Options and go to Numbering Tab Oracle Application 11.5.9 Bias Technologies 93 93 93 93 The Tables that effect Requisitions are: 1. Header level Information -> PO_REQUISITION_HEADERS_ALL Select * from PO_REQUISITION_HEADERS_ALL where segment1=’5646’ --requisition_header_id=56635. Here segment1 is the Requisition Number. And REQUISITION_HEADER_ID. 2. Line Level Information-> PO_REQUISITION_LINES_ALL Select * from PO_REQUISITION_LINES_ALL where requisition_header_id=56635; --requisition_line_id = 60546 60547 3. Distribution Level Information -> PO_REQ_DISTRIBUTIONS_ALL select * from PO_REQ_DISTRIBUTIONS_ALL where requisition_line_id in(60546,60547); RFQ(Request For Quotation): Once the requisition has approved RFQ will be created and this RFQ will be sent to suppliers if suppliers are agreed with the terms & conditions, which we have specified in RFQ document, they will send the quotations to the company, we have 3 types of RFQ’s Bid Catalog Standard The navigation for the RFQ is RFQ’s and Quotations RFQ’s then we will get the RFQ Screen as shown below. Bid: BID RFQ will be created for the large & expensive items where you will not find any discount means no price breaks. Catalog: Catalog RFQ will be created for the items, which we are purchasing frequently where we can get the price breaks and terms & conditions. Standard: This will be created for the items, which we will purchase only once not very often. If we are sending Bid RFQ, to the suppliers then we will receive the bid quotation from the suppliers for the catalog RFQ’s we will be receiving quotations and for standard RFQ, standard quotation will be sent by the suppliers. RFQ information will be entered at 3 levels Headers Lines & Shipments Headers: In Header level we will specify RFQ number, type & ship_to, bill_to location Lines: In Line Level we will specify the items. Shipment: At Shipment level we will specify discount details. Oracle Application 11.5.9 Bias Technologies 94 94 94 94 RFQ(Request For Quotation): The table that effect this RFQ are 1. HEADER LEVEL: PO_HEADERS_ALL Select * from PO_HEADERS_ALL where segment1=’312’ and type_lookup_code=’RFQ’ -- Po_header_id=32560 2. LINE LEVEL : PO_LINES_ALL Select * from PO_LINES_ALL where po_header_id=32560 --po_line_id=37768 37769 3. SHIPMENT LEVEL (PRICE BREAKS): PO_LINE_LOCATIONS_ALL Select * from PO_LINE_LOCATIONS_ALL where po_line_id=37768 Currency: When we click on the Currency button in RFQ’s window we will get the window. The table for Currency Screen: FND_CURRENCIES Oracle Application 11.5.9 Bias Technologies 95 95 95 95 Terms and Conditions: When we click on the Terms button in RFQ’s window we will get the window. The table that affects this is AP_TERMS. Price Breaks: When we click on the Price Breaks button in RFQ’s window we will get the window. The table affects this PO_LINE_LOCATIONS. Oracle Application 11.5.9 Bias Technologies 96 96 96 96 Suppliers: When we click on the Suppliers button in RFQ’s window we will get the RFQ Suppliers window. THE TABLE AFFECT THIS SCREEN IS PO_VENDORS AND PO_VENDOR_SITES_ALL Auto Create: Through this auto create option we can directly create either RFQ’s or Purchase orders from the approved requisition. The navigation for auto create is in the Purchasing Vision Operations responsibility Auto Create will be there directly. Whenever we click on the Auto create then we will get the screen given below. Oracle Application 11.5.9 Bias Technologies 97 97 97 97 Enter the requisition number, which we created earlier and go with the find button. Then we will get the screen given below. PURCHASE ORDER: After receiving the quotations from supplier then we will create the purchase order. We will approve that purchase order will send po to the supplier. As per the po document terms and conditions supplier will supply the material. We have 4 types of Purchase Order 1. Standard PO 2. Planned PO 3. Blanket Purchase Agreement 4. Contract Purchase Agreement Purchase Order Type Summary: Standard PO Planned PO Blanket PA Contract PA 1. Terms & Conditions Known Yes Yes Yes Yes 2. Goods or Services Known Yes Yes Yes No 3. Pricing Known Yes Yes May be No 4. Quantity Known Yes Yes No No 5. Account Distributions Known Yes Yes No No 6. Delivery Schedule Known Yes May be No No 7. Can be Encumbered Yes Yes No No 8. Can encumber releases N/A Yes Yes N/A Oracle Application 11.5.9 Bias Technologies 98 98 98 98 Standard PO: For all the Purchase Orders we will use Standard PO as the PO type where we will specify terms & conditions items, price, quantity, delivery Schedule and so on. Planned PO: if delivery schedule is not confirmed then we will create planned PO Blanket Agreement: Supplier and Buyer will have the agreements where we will find terms & conditions and items price may or may not. Whenever buyer is required material he will release the order as per that supplier will supply material. Contract PA: we will have only terms and conditions buyer can purchase any item from the supplier. Purchase order Information will be entered at 4 Levels: 1. Header level 2. Line Level 3. Shipments 4. Distributions Purchase Order: 1. Go with Purchasing, Vision Operations(USA) Responsibility. 2. Go with Purchase Orders Purchase Orders. The table that affects this screen is 1. HEADER LEVEL: PO_HEADERS_ALL Select * from PO_HEADERS_ALL where segment1=4465 and type_lookup_code=’Standard’ -- po_header_id=32588 Oracle Application 11.5.9 Bias Technologies 99 99 99 99 2. LINE LEVE: PO_LINES_ALL Select * from PO_LINES_ALL where po_header_id=32588 –- po_line_id=37797 SHIPMENTS: When we click on the Shipments button in Purchase order window we will get this Shipments window. Here in the Shipments window we will click on more tab then we are going to select the match approval whether 2-Way or 3-Way or 4-Way. 3. SHIPMENT LEVEL: PO_LINE_LOCATIONS_ALL Select * from po_line_locations_all where po_line_id=37797 --line_location_id=72173 RECEIVING CONTROLS: When we click on the Receiving Controls button in Shipment window we will get this window. Oracle Application 11.5.9 Bias Technologies 100 100 100 100 DISTRIBUTIONS: When we click on the Distributions button in Shipment window we will get this window. 4. DISTRIBUTIONS LELVEL: PO_DISTRIBUTIONS_ALL Select * from PO_DISTRIBUTIONS_ALL where line_location_id=72174 --po_distribution_id SHIP TO BILL TO: HR_LOCATIONS APPROVING THE PO: Then click on the Approve Button on the PO screen then PO will be submitted for Approval. Oracle Application 11.5.9 Bias Technologies 101 101 101 101 After approving the PO, the Status will be changed to Approved. To view whether the purchase order is approved or not we will go with the navigation Purchase Orders Purchase Order Summary then we will get the screen given below. Enter the PO number and Select Find Button. Oracle Application 11.5.9 Bias Technologies 102 102 102 102 After entering the Po number then Click on the find button we will get the Purchase order Headers window. Go for Lines Button – it will display the line level details i.e items, price, quantity so on. If you want to cancel PO or if you want to keep the PO on hold. Then go with menubar the navigation is Tools Control you will get the following screen. Oracle Application 11.5.9 Bias Technologies 103 103 103 103 RECEIPTS: It is one of the purchasing document will be created while receiving the material from supplier. While creating the purchase order we will have the option called MATCH APPROVAL like 1. 2-way PO, Invoice 2. 3-way PO, Receipt, Invoice 3. 4-way Po, Receipt, Inspection, Invoice Receipt Types: 1. Standard Receipt (3 –Way). 2. Direct Delivery (2-Way) 3. Inspection Required (4 – Way) Navigation: 1. Go with Receiving Receipts. 2. Enter the PO number and go with Find Button. Oracle Application 11.5.9 Bias Technologies 104 104 104 104 Enter the purchase order number and click on find button. Then we will get the receipts window. Here in this window lines will be appear if we want receive that item(line) then we have to check the check box which was bolded in the below figure. If we want to get the headers screen then click on Headers button and drag on to the lines tab then we will get receipt header window as shown below. Oracle Application 11.5.9 Bias Technologies 105 105 105 105 Here in this window the receipt date should be in the open period. If you want to know the open period then go with the navigation Setup Financials Accounting Open and Close periods. Tables that affect these Receipts are 1. RCV_SHIPMENT_HEADERS 2. RCV_SHIPMENT_LINES 3. RCV_TRANSACTIONS AP(ACCOUNT PAYABLES): In this the company is paying amount to the supplier. In this we are having 3 steps 1. Creation of Invoice. Approve invoice 2. Make the payment. 3. Transfer to GL (General Ledger). Oracle Application 11.5.9 Bias Technologies 106 106 106 106 Invoice Types: 1. Standard Invoice: For supplier Standard payment will select this standard invoice, where we are going to create invoice with supplier name and supplier site name. 2. Credit Memo and Debit Memo: Both will come under negative amount. Credit Memo will be created if supplier is giving discount. Debit Memo will be created when buyer is going to deduct the amount. 3. Pre Payment Type: whenever suppler required advance payment that time we will select prepayment amount. 4. PO Default: we will give the PO Number as per the PO amount invoice will be generated. 5. Quick Match Invoice: we will match the invoice either with PO or invoice with receipt, as the matching payments will be done. 6. Expense Reports: fro employee expenses we will select the invoice type as expense reports. 7. Recurring Invoices: for fixed amount and fixed duration, we will select recurring invoices. Like rent accounts and so on. 8. Mixed Type Invoice: for company miscellaneous expenses we will create mixed type. 9. With Holding Tax: if suppler is not registered suppler on behalf of suppler, company will make the income tax to the government. Navigation: 1. Go with PAYABLES, VISION OPERATIONS(USA) Responsibility. 2. Go with Invoices Entry Invoices. 3. Open the invoice form Enter Supplier, Supplier num and site invoice amount. Oracle Application 11.5.9 Bias Technologies 107 107 107 107 4. Go with Distributions Button and Enter distribution details. The invoice total and distribution total is equal. Then save the form. 5. After that go with Match Button you are matching your invoice with your PO then go with Purchasing Order. Oracle Application 11.5.9 Bias Technologies 108 108 108 108 Go with Find Button then we will get the window given below. Go with Actions Button and check the check box Validate Oracle Application 11.5.9 Bias Technologies 109 109 109 109 After this the Invoice Status will be change to Validated. Again Go with Actions Button check the check box Create Accounting Oracle Application 11.5.9 Bias Technologies 110 110 110 110 It will create accounting transactions. We can see the account transactions from Go with the menu Tools View Accounting. The tables that affect Invoice are 1.AP_INVOICES_ALL –invoice_number, vendor_id, invoice_id Distributions: AP_INVOICE_DISTRIBUTIONS_ALL --invoice_id Accounting Transactions: 1. AP_AE_HEADERS_ALL 2. AP_AE_LINES_ALL Distribution Set: If we want to create distribution transactions by using the system then we will go for creation of distribution set. Navigation: Set upinvoicedistribution sets 1. Enter distribution set name, percentage and account transactions. 2. Attach this distribution set while creating invoice of header level. Oracle Application 11.5.9 Bias Technologies 111 111 111 111 Invoice Batches: If we want to create multiple invoices by specifying batch name, then we will select the option called invoice batches. Invoice Gateway: If we are retrieving invoice data from legacy system then we will use this invoice gateway option. PAYMENTS: 1. Go with Actions button check the check box Pay in full. 1. Select the payment type either 1. Manual 2. Quick 3. Refund 2. Enter bank accounts, document. System will automatically generate the document number (check number) and enter the supplier details. 3. Go with Enter/Adjust invoice button 4. Give the invoice number and save the transaction. 5. System will automatically generate payment transactions 6. Select payment overview button where we can find out complete payment details. Oracle Application 11.5.9 Bias Technologies 112 112 112 112 7. Select the bank button where we can find out bank information and bank accounts. Oracle Application 11.5.9 Bias Technologies 1 11 113 13 13 13 TABLES: 1. AP_INVOICE_PAYMENTS_ALL 2. AP_CHECKS_ALL 3. AP_BANK_ACCOUNTS 4. AP_BANK_BRANCHES 5. AP_CHECK_FORMATS AP TO GL TRANSFER: 1. Create invoice and approve it 2. Make payments and generate accounting transactions. 3. Go to SRS Window, select concurrent program called Payables Transfer to GL. Enter invoice date in from date and to date parameters, system will submit the program internally called Journal Import. 4. Copy the request id of journal import. 5. Go to the responsibility General Ledger Super user and go with the navigation Journals Enter , paste the request id of Journal Import in the batch field Oracle Application 11.5.9 Bias Technologies 114 114 114 114 Select find button it will shows the payment details. The table’s affects GL are 1. GL_JE_HEADERS 2. GL_JE_LINES 3. GL_JE_BATCHES Oracle Application 11.5.9 Bias Technologies 115 115 115 115 Order Management Flow: Booking Order: Go with the Navigation to open sales order window Orders, Returns Sales Orders. Then we will get the Sales Order – (NEW) Form as shown below. Note: When we open the sales order form the order is created and the status of the order is in Entered state after that we update the order only. Don’t think that the order is created when we click on the Book Order button. Enter the customer name which exists in the database here we take CDS, INC as example. In this form there are two mandatory fields those are bolded in the figure above. Here when we click save then we will get the Order_Number By moving to the Line-items tab we will get another view of the screen given below. Oracle Application 11.5.9 Bias Technologies 116 116 116 116 Now enter the Ordered Item and Quantity. To check weather the Ordered_item is existing then go with Availability button. if we book the order with out the availability of item then the backorder will be created automatically. The Availability window is shown below. In this window the ATP Details button is Available To Promise that means how many items can we give to the customer and Global Availability button is used for check weather there is availability of the item in any other ware house or not. By clicking on the Global Availability button we will get this dialog box. Here in this stage two tables will get affected. The complete header information will store in the OE_ORDER_HEADERS_ALL and line information will store in the OE_ORDER_LINES_ALL now the status of the line is awaiting shipping. Then go with Book Order button to book the Order then the status of your order is changed to BOOKED from the ENTERED state here WSH_DELIVERY_DETAILS table will be affected. Copy the Order_Number then close the Sales Order Form. Now go with navigation to pick Release the order. Shipping Release Sales Orders Release Sales Orders Then we will get another window “Release Sales Orders for Picking “ Oracle Application 11.5.9 Bias Technologies 117 117 117 117 Enter the Order Number which we created in the Sales Order form above and go with online button. Then we will get the message that Online completed successfully. Then go with the navigation. Here the status is in pick release the tables affected are MTL_RESERVATIONS and MTL_ONHAND_QUANTITIES. Shipping Transactions Then we will get the Query Manager form shown below in the form enter the Order Numbers fields Oracle Application 11.5.9 Bias Technologies 118 118 118 118 Then go with the find button we will get now Shipping Transactions Form as shown below. Go with Delivery tab and change the Actions to Ship Confirm and go with Go(B) Button then other dialog box will open. Now a document set will run to view the result go with view Requests. Here five programs will run those are Interface Trip Stop, Commercial Invoice, Packing Slip Report, Bill of Lading, Pick Slip Report. These all programs must be completed normal other wise our order go wrong. Oracle Application 11.5.9 Bias Technologies 119 119 119 119 Creating Invoice: To create the invoice after all the five programs completed normal we have to run manually a request named “Workflow Background Process”. After we submit the request Workflow Background Process then “Auto Invoice Import Program” will run automatically and the Invoice will generate based on the reference of the Order_Number. Here RA_CUSTOMER_TRX_ALL and RA_CUSTOMER_TRX_LINES_ALL will get affected. Oracle Application 11.5.9 Bias Technologies 120 120 120 120 After the auto invoice program status come to completed normal then go with the following navigation to view the invoice. Receivables Transactions Transactions Then we will get the Transactions(Vision Operations) Form as shown below. By this window we can retrieve the Invoice Number. Press F11 by enters into the query mode we have to enter the Order number in the Reference field. Press ctrl+F11 to retrieve the invoice number. To view the balance of the customer goes with balances button according to the requirements. The given below is the balances screen where the customer payment details are in this window. Based on the amount He pay we made a receipt for him. Here according to the below form the customer has to pay 100,000 we are making receipt for that amount only if he pay. Oracle Application 11.5.9 Bias Technologies 121 121 121 121 Making Receipts: After taking amount from the customer, we have to make a receipt. Copy the Invoice number and close the Transactions form. Now go with the following navigation. Receivables Receipts Receipts Then we get a Receipts form. Enter the Invoice number at the Receipt number field and Trans number which we round in the below figure observe that because based on the invoice number only we have to raise the receipt to the customer. After entering all the mandatory fields in the form then go with Applications button. Then we get Application window just save it then your receipt is generated based on the Invoice Number. Here in the Applications form there Chargebacks and Adjustments buttons. If there any Adjustments of any reductions in the amount then we go with Adjustments button. Oracle Application 11.5.9 Bias Technologies 122 122 122 122 Transfer to General Ledger: Run the request General Ledger Transfer Program to create a general in GL and also to post it. The navigation for this is Interfaces General Ledger in the Receivable Responsibility. Then it will ask for the Request, enter the request name as General Ledger Transfer Program then it will ask for the parameters the given below screen will appear. The mandatory parameters for this request are GL Posted Date and Post in Summary. By clicking on the OK button then the request will be submitted then go for menu view requests to view the status of the request which we submitted then the current created receipt will be submitted to the GL successfully. Oracle Application 11.5.9 Bias Technologies 123 123 123 123 Returning Order: Enter the company name and other details same like booking the order as we mentioned above. There is a change in the Line items tab. Change the line type as Return Receipt because we taking returns from the customer. Now go with Returns tab in the Line Items tab. The Returns view is shown below. Here the Return Reason is the mandatory column on what purpose they are returning the goods we have to enter here we take Damaged goods. Now go to the reference field here rounded in the figure. Oracle Application 11.5.9 Bias Technologies 124 124 124 124 Then another dialog box will open given below. Enter the field’s reference type as Customer PO or Invoice or Sales Order or Serial number. Here we take Customer PO as reference we have to enter the Customer PO when we book the sales order. At the same time when we choose the reference as Invoice or any other options we mentioned above also the same process. By Pressing ok here and click on the Book Order button then the Return order is booked successfully message will be displayed. Now go with the navigation Purchasing Receiving Receipts then we will ask for the choose the Organization here we will select M1 as we are working with M1 organization. Then another window Find Expected Receipts(M1) will open given below. Go to the Customer tab enter the order number which we create there for the sales return order. After entering the RMA Num (Return Order Number). Oracle Application 11.5.9 Bias Technologies 125 125 125 125 Go with the find button then another window Receipts(M1) will open. Check the rounded check box and enter the mandatory field Sub inventory and other if necessary then go with save button then automatically the receipt number will be generated. Click on the Header button then receipt header form will be open. Now the receipt number is generated then close the form. When the Receipt was generated then two Requests will run in the background automatically they are shown below in the Request window. Oracle Application 11.5.9 Bias Technologies 126 126 126 126 Order to Cash Flow with Order Management and Process Inventory Entering and managing orders is performed in Order Management. Shipping Execution allows you to plan and confirm your shipments. Inventory to satisfy your order requirements is allocated and picked in Process Inventory. The following diagram illustrates the components of the Order Management for Process flow and is described in the following steps. Note that this is a sample flow and can be modified. 1. Sales orders are entered and booked through Order Management. Reserving the order creates a high-level allocation in Process Inventory. 2. Before an order can be picked and shipped, it must be pick released. The Pick Release process can invoke automatic inventory allocation and creates a process move order. 3. Process move orders allow you to manually assign available Process Inventory to a move order or pick from a list of available lots. Lines that have been automatically allocated may be viewed and edited. Once an order line is allocated (detailed), it is pick confirmed. 4. Deliveries and trips are created in Shipping Execution. Containers can also be used. 5. Once you have verified the allocation of inventory to an order, it needs to be Pick Confirmed. This step can be automated or done through the process move orders form in Process Inventory. After the pick confirm, allocated inventory is marked as staged. 6. Ship confirm is the final process in Shipping Execution which records the actual shipped amounts and creates backorders, if necessary. At the completion of ship confirm, on hand inventory is decremented for the shipped quantity. 7. Auto Invoicing allows billing of confirmed shipments. This process can be setup to run automatically upon shipment of an order or be invoked manually. Invoicing and cash receipt are handled within Oracle Receivables. 8. The final step in the process is the running of the subsidiary ledger update to create the entries for Inventory and Cost of Goods Sold. Oracle Application 11.5.9 Bias Technologies 127 127 127 127 Diagrammatic Representation Oracle Application 11.5.9 Bias Technologies 128 128 128 128 Order Management Table Relation Diagram 1. User Parameters Item No From Item No To Customer From Customer To Order No From Order No To Customer Class from Customer Class To 2. HZ_CUST_ACCOUNTS Account_Number (Customer No) Party_id Customer_class_code cust_account_id 5.MTL_SYSTEM_ITEMS Organization_Id Inventory_Item_Id Segment1 (Item_Number) Description (Title) Inventory_item_status_code l. Inventory_Item_Id= si.Inventory_Item_Id l. Ship_from_org_id si.Organization_Id 3.OE_ORDER_HEADERS_ALL Order_number (Order No) Header_id 4.OE_ORDER_LINES_ALL Inventory_item_id Cust_Po_Number (Cust PO NO) Sold_to_org_id Line_id Open_Flag=’Y’ Party_id Sysdate-requested_date (Days Old) Ship_from_org_id Header_id Order_No 5. WSH_DELIVERY_DETAILS Organization_Id Line_Id Requested_Quantity (BO Qty) Release_Status = ‘B’ Requested_quantity*l.unit_selling_pr ice (BO Amt) Line_Id Organization_Id sold_to_org_id=hca.cust_account_id Customer Number Customer_cl ass OE_PRICE_ADJUSTMENTS Line_id List_header_id Line_id QP_LIST_HEADERS_B Attribute1=’DM’ List_header_id List_header_id List_header_id QP_LIST_HEADERS_TL List_header_id Name (Ad Key) MTL_ITEM_STATUS Inventory_item_status_code Description (Pb Status) Item no Inventory_item_status_code HZ_PARTIES Party_Name (Customer name) Party_id Party_Id OE_ORDER_HOLDS_ALL Released_flag='N' Hold_id Line_Id OE_HOLD_DEFINITIONS ATTRIBUTE1='YES' hold_id Line_id=line_id header_id=header_id OE_HOLD_SOURCES_ALL Hold_source_id Hold_id Hold_source_id= Hold_source_id Hold_id=hold_id Party_Id Oracle Application 11.5.9 Bias Technologies 129 129 129 129 Flow How the Tables Effected ENTERED: NAV-> ORDERS. RETURNS -> SALES ORDERS SELECT * FROM OE_ORDER_HEADERS_ALL WHERE ORDER_NUMBER = 56728 -- HEADER_ID = 94100 (FLOW_STATUS_CODE = ENTERED, OPEN_FLAG=Y, BOOKED_FLAG=N) SELECT * FROM OE_ORDER_LINES_ALL WHERE HEADER_ID = 94187 -- LINE_ID = 195947(FLOW_STATUS_CODE=ENTERED) NOTE: - If U have set the auto schedule option your order should have a schedule date at this point. BOOKED: NAV-> ORDERS. RETURNS -> SALES ORDERS -> HIT BOOKED TAB SELECT * FROM OE_ORDER_HEADERS_ALL WHERE ORDER_NUMBER = 56728 -- HEADER_ID = 94100 (FLOW_STATUS_CODE = BOOKED, OPEN_FLAG=Y, BOOKED_FLAG=Y) SELECT * FROM OE_ORDER_LINES_ALL WHERE HEADER_ID = 94100 -- LINE_ID = 195947(FLOW_STATUS_CODE=AWAITING_SHIPPING) SELECT * FROM WSH_DELIVERY_DETAILS WHERE SOURCE_HEADER_ID = 94100 -- (RELEASED_STATUS = R) PICK RELEASED: NAV-> SHIPPING -> RELEASE SALES ORDERS -> RELEASE SALES ORDERS SELECT “BASE ON RULE” AS –> STANDARD PROVIDE THE “ORDER NUMBER” THEN HIT “EXECUTE NOW” HERE U CAN CHECK THROUGH THE FRONT END IN LINE LEVEL STATUS WILL BE “PICKED”. SELECT * FROM WSH_DELIVERY_DETAILS WHERE SOURCE_HEADER_ID = 94100 -- (RELEASED_STATUS = Y) SELECT * FROM WSH_PICKING_BATCHES WHERE ORDER_HEADER_ID = 94100 SELECT * FROM WSH_NEW_DELIVERIES WHERE SOURCE_HEADER_ID = 94100 SHIP CONFIRMED: NAV-> SHIPPING -> TRANSACTIONS SELECT * FROM WSH_DELIVERY_DETAILS WHERE SOURCE_HEADER_ID = 94100 -- (RELEASED_STATUS = C) Oracle Application 11.5.9 Bias Technologies 130 130 130 130 EXAMPLE: select ooh.order_number, ooh.ORDERED_DATE, ooh.FLOW_STATUS_CODE, ool.line_number, msi.SEGMENT1, msi.DESCRIPTION, ool.ordered_quantity, ool.UNIT_SELLING_price, ool.UNIT_SELLING_price*ool.ordered_quantity total, ooh.sold_to_org_id, ooh.ship_to_org_id, ooh.invoice_to_org_id, ool.inventory_item_id from oe_order_headers_all ooh, oe_order_lines_all ool, hz_cust_accounts hca, mtl_system_items msi where ooh.header_id=ool.header_id and ooh.sold_to_org_id=hca.cust_account_id and msi.INVENTORY_ITEM_ID=ool.INVENTORY_ITEM_ID and msi.ORGANIZATION_ID=ool.SHIP_FROM_ORG_ID and ooh.order_number=56308 order by ool.line_number Oracle Application 11.5.9 Bias Technologies 131 131 131 131 TCA – Trading Community Architecture Parties are entities, of type Person, Organization, or Group, that can enter into business relationships. A relationship represents the way two entities interact with each other, based on the role that each entity takes with respect to the other. For example, the employment relationship between a person and an organization is defined by the role of the person as the employee and the organization as the employer. Relation ship type Each relationship phrase and role pair belongs to a relationship type, which categorizes the types of relationships that you can create. Relationship Group Relationship groups are used to determine which relationship roles and phrases are displayed in specific application user interfaces. Groups can also be used to categorize roles and phrases for other functional uses. TCA Registry The TCA Registry is the central repository of party and other information for all Oracle applications. The party information includes details about organizations and people, the relationships among the parties, and the places where the parties do business. Hz_parties – Party_id -- This table mainly stores the party_id, party_number, Party_type(Person/Organization) and the name(First Name/Last Name and Party_name(first-last name together)) of the party/customer. The first name or last name should be given to create a party. Hz_cust_accounts/Hz_cust_accounts_all – This has mainly the party_id and Cust_account_id -- (called as Customer_id) Account_number -- (called as Customer_number) (The hz_cust_accounts_all(till version 11.5.9), is not populating the org_id column. So this table is anyway meaning less for these versions. Not sure though there is a set up related to it which can enable this field.) This table can have multiple records pertaining to one party_id. This means a party can have multiple accounts. Ie; ,we can have multiple cust_account_ids created for a single party in hz_cust_account table. And also under each cust_account_id we can have multiple addresses, To create another customer_account(differenct cust_account_id), select the customer with the Name from the standard customer creation search screen,(Take care not to select the customer from LOV, since it directly selects the cust_account_id/account_number and once you press OK, you get only that cust_account_id/account number and not all the customer accounts. So enter manually the customer name, press OK and this takes you to the screen, Oracle Application 11.5.9 Bias Technologies 132 132 132 132 Select the top most records. Here we can see 4 records. 1 st is the Main Line, which needs to be selected for creating new customer accounts for this customer. We can see that there are 2 different customer numbers(account number, in this screen cust_account_ids won’t be shown) here(1441, and 1442). 1442 is repeating because that account is having 2 different sites(address sites). Hz_cust_acct_sites_all – HZ_CUST_ACCT_SITES_ALL stores information about customer sites. One customer account can have multiple sites. The physical address is maintained in HZ_LOCATIONS. Gives you all the sites or address defined pertaining to an account. (although the cust_account_id is same, the org_id's might be different.) [ If the records are related to an order, you can take the ship_to_org_id, which is nothing but the cust_account_id related to the Bill_to address and link it with the table, hz_cust_accounts (using cust_account_id) and then link it with the cust_account_id of hz_cust_acct_sites_all table like this, FROM OE_ORDER_HEADERS_ALL OH, HZ_CUST_ACCOUNTS HCA, HZ_CUST_ACCT_SITES_ALL HCAS, hz_cust_site_uses_all HCSU WHERE OH.SOLD_TO_ORG_ID = HCA.CUST_ACCOUNT_ID AND HCA.CUST_ACCOUNT_ID = HCAS.CUST_ACCOUNT_ID AND HCAS. CUST_ACCT_SITE_ID = HCSU.CUST_ACCT_SITE_ID AND HCAS.BILL_TO_FLAG = ‘P’ Hz_cust_site_uses_all -- HZ_CUST_SITE_USES_ALL stores information about site uses or business purposes. A single customer site can have multiple site uses, such as bill to or ship to, and each site use is stored as a record in this table. Link this table with hz_cust_account_site_all with the field, CUST_ACCT_SITE_ID. Here is where the and each address can have one(only one primary) Bill_to or Ship_to address. The primary bill_to, ship_to will be the ones which are normally used for ‘site use’ level transactions. For one cust_account_id with different addresses,(see it in Oracle Application 11.5.9 Bias Technologies 133 133 133 133 hz_cust_acct_sites_all table for these different address lines), we can make only one bill_to or ship_to as primary. If we get multiple records pertaining to an account, for a Bill_to, check for the field, BILL_TO_FLAG = 'P' (Means primary). IF we have multiple address/site for a particular cust_account_id, Only one bill_to address can be 'P', under a cust_account_id, although we can define multiple bill_to addresses(Note : one address/site can have only one bill_to)and all the transactions through the system will be done with the primary bill_to address. Hz_contact_points – This table stores the contact details of the customer. The contact details are stored against a site, if owner_table_name is equated against the hz_party_sites table. If it is equated against the hz_parties then the contacts are against the customer not against the customer site. If a contact point is created against a customer site(address). SELECT LTRIM(hcp.phone_country_code||'-'||hcp.phone_area_code||'- '||hcp.phone_number,'-') Home_Phone, hcp.PRIMARY_BY_PURPOSE,hcas.org_id, hcas.party_site_id,hca.cust_account_id,hcas.cust_acct_site_id, hcp.CONTACT_POINT_ID,hcp.CONTACT_POINT_TYPE,hcp.PHONE_LINE_TYPE, hcp.OBJECT_VERSION_NUMBER FROM hz_parties hp, hz_party_sites hps, hz_cust_accounts hca, hz_cust_acct_sites_all hcas, hz_contact_points hcp WHERE hp.party_id = hps.party_id AND hca.party_id = hp.party_id AND hp.party_type IN ('ORGANIZATION', 'PERSON') AND hp.status = 'A' AND hcas.party_site_id = hps.party_site_id AND hca.cust_account_id = hcas.cust_account_id AND hcp.contact_point_type = 'PHONE' AND (hcp.OWNER_TABLE_NAME = 'HZ_PARTY_SITES' AND hps.party_site_id = hcp.owner_table_id) AND hcp.phone_line_type = 'TELHOME' AND hcp.status = 'A' If a contact point is create against a customer. SELECT LTRIM(hcp.phone_country_code||'-'||hcp.phone_area_code||'- '||hcp.phone_number,'-') Home_Phone, hcp.PRIMARY_BY_PURPOSE, hca.cust_account_id,hcp.CONTACT_POINT_ID,hcp.CONTACT_POINT_TYPE,hcp.PHONE_L INE_TYPE,hcp.OBJECT_VERSION_NUMBER FROM hz_parties hp, hz_cust_accounts hca, hz_contact_points hcp WHERE hca.party_id = hp.party_id AND hp.party_type IN ('ORGANIZATION', 'PERSON') AND hp.status = 'A' AND hcp.contact_point_type = 'PHONE' AND (hcp.OWNER_TABLE_NAME = 'HZ_PARTIES' AND hp.party_id = hcp.owner_table_id) AND hcp.status = 'A' HZ_customer_profiles -- There will normally be a default profile attached against a customer as soon as the customer is created. Oracle Application 11.5.9 Bias Technologies 134 134 134 134 Since the default profile is attached against the customer(and not against the site_use level), when you query the hz_customer_profiles tables we can see that that site_use_id for this particular profile would be null. If the profile is created against the customer site_use level, then the corresponding site_use_id will be populated for this customer profile record in the hz_customer_profiles table. See the below query for reference, [ select hcp.CUST_ACCOUNT_PROFILE_ID, hcp.OBJECT_VERSION_NUMBER, hcp.cust_account_id, hcp.ATTRIBUTE1 LTV_Veh_sales, hcp.ATTRIBUTE2 LTV_Number_Of_Veh, hcp.ATTRIBUTE3 LTV_Service_Sales, hcp.attribute4 LTV_Service_In, hcp.attribute5 Cust_Cate_RFM_Veh, hcp.attribute6 Cust_Cate_RFM_Service_In, hcp.ATTRIBUTE7 Customer_Remark, hcp.ATTRIBUTE8 Latest_Vehicle_Sales_Date, hcp.ATTRIBUTE9 Latest_Service_In_date, hcp.ATTRIBUTE10 Latest_Contact_Date, hcp.ATTRIBUTE11 Expected_Contact_Date, hcp.ATTRIBUTE12 Expected_Sales_Date, hcp.ATTRIBUTE13 Expected_service_Date, hcp.ATTRIBUTE14 Hobby1, hcp.ATTRIBUTE15 Hobby2 FROM hz_customer_profiles hcp, hz_cust_acct_sites_all hcas, hz_cust_site_uses_all hcsu where hcas.cust_account_id = hcp.cust_account_id and hcas.cust_acct_site_id = hcsu.cust_acct_site_id and hcp.site_use_id = hcsu.site_use_id and hcp.status = 'A' ] Oracle Application 11.5.9 Bias Technologies 135 135 135 135 Process that how to Create an Item: Creating an Item: As the first step in creating the item go to the Inventory responsibility and in that master items screen. The navigation is Items Master Items. The given below is the Master items window. Note: Before you got the master items screen you will ask for the choose organization screen then you get this screen. Here we choose the “V1” so, the items was set to V1 by default as the master organization. If we want we can assign this item to any other child organizations see the process in the coming steps. Enter all the fields like item, description, Long Description such fields as per the requirement. After go to the Tools menu and in that go with Copy From option in that as we shown in the below figure. Then we get the Copy from window. Oracle Application 11.5.9 Bias Technologies 136 136 136 136 Enter the Template name from the list which we want to assign to the current item BAGS and go with the Apply after that Done. Then the template was copied to the current item. Then go with the Organization Assignment option as we round in the given below figure then the view of the window will be changed as below. Assign the item to the child organizations what ever you want. Then go with the save button then the item was created successfully. Now we have to set the price list for the item then only we can view the item in the sales order like that. Now go with the Order Management responsibility. The navigation for the price list setup is Pricing Price Lists Price List Setup. Then you get the Advanced Pricing window. Note: There are different price lists “Corporate” is default when we are creating the sales order so, we are adding our item to the “Corporate” price list. If we want we can create new price list as per the requirements. After getting the Pricelist window then go with F11 query mode gets the price list what ever you want and add the item and enter all the mandatory fields such as Product Context, Product Attribute, Product Value(Item Name), price, to it after that go with save button. Then the item was successfully added to the price list. Oracle Application 11.5.9 Bias Technologies 137 137 137 137 Enter all the details correctly before saving. Here in the form the rate of the item is described as value in that field we have to enter the rate of the item. Now at this stage the item was created and added to the price list was successful but the on hand quantity of the particular item is ZERO (0). That means we can’t book the orders on that item. To increase the on hand quantity of any particular item is given below. We have to go with the Inventory responsibility and the navigation is Transactions Miscellaneous Transaction. Then you will ask for the organization Oracle Application 11.5.9 Bias Technologies 138 138 138 138 then select the child organization which we have selected for the item created above. Then we get the window as below. Enter the mandatory fields and then go with the transaction lines. Then we get the window given below. Enter the item name, sub inventory, Amount and quantity as per the requirement. Here we entered 120 as ex. When we enter the tab position to the amount then we get the Operations Accounting window given below. Select the appropriate option from the list of options. Here we selected the Cash as per our Ex. After entering the amount field then go with the save button. Then the items quantity will be increased. Now we can go with the orders now. Oracle Application 11.5.9 Bias Technologies 139 139 139 139 To check the on-hand-quantity of any item we have to go with the Inventory responsibility and the navigation is On-Hand, Availability On-Hand Quantity. Then we get the Query Material window we have to enter the item name which we want to check the quantity and go with the find button below the screen. After that we get other window in that we get the details of the item on-hand and other. Here there is the Availability button when we go with that we get the same details in the short window. Oracle Application 11.5.9 Bias Technologies 140 140 140 140 SQL QUERY BANK 1. Difference between DCL and DML commands? DCL commands will commit implicitly where in DML commands we have to commit explicitly. 2. Table, Rowid, Rownum Table is a database object, which is having more than one column associated with its data type. Rowid is the unique binary address of the row in a table Rownum it is a temporary number in a memory and was assigned to each row selected by the statement. 3. Pseudo-Columns Columns that are not created explicitly by the user and can be used explicitly in queries. The pseudo-Columns are rowid, rownum, currval, nextval, sysdate, and level 4. What is a View? View is Virtual Table, which hold the data at runtime 5. Difference between ordinary view and complex view? Simple views can be modified easily and these cant hold the data where as complex views cant be modified directly and complex view can hold the data to modify a complex view we have to use INSTEAD OF TRIGGERS. 6. Forced view Creating a view on a table, which is not there in the database. 7. Inline view Inline view is basically a subquery with an alias that you can use like a view inside a SQL statement. 8. What is an INDEX and what are the types? INDEX is a database object used in oracle to provide quick access to rows. 9. Synonym Synonym is an alias name for any database object like tables, views, functions, procedures. 10. SELECT statement syntax? SELECT <Column name> From <table name> Where <condition> Having <statement> Group by <column name> Connect prior Oracle Application 11.5.9 Bias Technologies 141 141 141 141 11. What is Constraint? Different Constraints? Constraints are representators of the columns to enforce data entity and consistency. UNIQUE, NOT NULL, Primary key, foreign key, Check. 12. Difference between Primary key and Unique + Not Null constraints? Unique + Not Null is a combination of two constraints and we can use more than one Unique + Not Null in any table. Primary Key is a single constraint we can use only one time for a table. It can be a referential key for any column in any table. 13. What is NULL? Default Value. 14. Dual Table It is a one row, one column table with value X. 15. Difference between Truncate and Delete? Truncate will delete all the rows from the table with out any condition. It will commit automatically when it fires Where delete will delete all or specified rows based upon the condition here we have to commit explicitly. 16. Difference between Char and Varchar2? Varchar2 is similar to char but can store available number of characters and while querying the table varchar2 will trims the extra spaces and fetches the rows that exactly match the criteria. 17. Difference between LOB and LONG data types? The maximum size of an LOB is 4GB. It will support random access to data where in LONG maximum size is 2GB. It will support sequential access to data. 18. Single Row functions: It will work on single row and give result for all the rows. Ex: to_char, to_date etc. 19. Group Functions: It will work on group of rows in a table and gives a single row result. Ex: Sum(), Avg(), min(), max().. Etc. 20. String Handling Functions? Instr – it returns the position of the string where it occur according to the parameters. Instrb – instr and instrb returns same but in the form of bytes. Substr – It returns the portion of a string depending on the parameters from and to. Substrb – Substr and Substrb returns the same thing but Substrb returns in the form of bytes 21. Sign: Sign is a function it will take numbers, as inputs and it will give i. 1 for positive integer ii. -1 for negative integer iii. 0 for ZERO SQL> Select sign(-1234) from dual; O/P: -1 Oracle Application 11.5.9 Bias Technologies 142 142 142 142 22. Differences between UNION and UNION ALL? Union: The values of the first query are returned with the values of the second query eliminating the duplicates. Union All: The values of the first query are returned with the values of the second query including the duplicates. 23. Difference between NVL and NVL2 functions? NVL is used to fill a NULL value to known value. NVL2 will identify the NULL values and Filled values it returns exp3 if it is null otherwise it returns exp2. We have to pass 3 parameters for NVL2 and 2 parameters for NVL. 24. How can we compare range of values with out using the CASE? By using Decode with in Decode. 25. Can we Decode with in a Decode? YES 26. Decode and Case Difference? Case compares a Range of values and Decode will work as if else statement. 27. Difference between Replace and Translate? Replace is used to replace the whole string and we can pass null values in replace. Translate is used to translate character-by-character here we have to pass the three parameters. 28. Difference between where and having clause? Where used to specify condition and used to restrict the data. Having used to specify the condition on grouped results and used to filter the data. 29. Difference between IN and EXISTS clause? EXISTS gives the status of the inner query. If the inner query is success then it returns true other wise it returns false and IN will compare the list of values. 30. Difference between subquery and correlated subquery? Query with in a query is subquery. Inner query will executes first and based on the result the outer query will be displayed. Correlated subquery outer query will executes first and then inner query will be executed. 31. What is EXPLAIN PLAN? Syntax? Explain plan gives the execution plan of the statement. For using this explain plan we have the plan_table in the database. Syntax: SQL> Explain plan Set statemet_id = ‘xyx’ [Into plan_table] for DML STATEMENTS; Oracle Application 11.5.9 Bias Technologies 143 143 143 143 32. SQL TRACE Definition, Process and Query to get the Trace file path? SQL trace gives the wide range of information and statistics that used to tune a group of SQL operations. To get the trace file we have to follow some steps Enable the Trace. Run DML statements. Disable the Trace. Convert the Trace file into readable format using the TKPROF. Trace file Path: SQL> select value from v$parameter Where Name = ‘user_dump_dest’; 33. PL/SQL Block structure? DECLARE Variable declarations; BEGIN Statements; Exception Exception block; END; 34. Anonymous Block? It is a PL/SQL block with no name and set of statements and cannot be stored in the database. 35. Procedure and Function Differences? The procedure may or may not return a value. It will return the values by its own name and function must and should return a value and it will return values with function name. 36. Package procedure and Procedure differences? The package procedure is faster than the ordinary procedure because if we call the package in a procedure it will load into the SGA memory and then it starts functioning. The ordinary procedures use this SGA memory at runtime only. 37. Global Variable? Declaring the variable in the package specification is the Global variable. 38. Triggers and Procedures differences? Triggers is a database object which will fire implicitly when the event occur and TCL command will not work in the triggers by using the PRAGMA AUTONOMOUS TRANSACTION only we can use the TCL commands in triggers. Procedure is a database object where we have to raise explicitly and TCL commands will work in the Procedures. Oracle Application 11.5.9 Bias Technologies 144 144 144 144 39. Dynamic SQL? If we want to do DML and DDL operations in the PL/SQL block we use this dynamic SQL. Two types are there in the Dynamic SQL DBMS_SQL Execute immediate 40. Difference between DBMS_SQL and execute immediate? DBMS_SQL is slower process when compare to execute immediate because in the DBMS_SQL we have to open, parse, fetch and execute to do the DML operations. It is the version of 7.3. Execute immediate is earlier version 9i it is a one step process used to execute fastly. 41. Define a Cursor, Types and its attributes? Cursor is a private SQL area provided by the oracle engine its main use is to fetch more than one row. Implicit Explicit Implicit cursor rises whenever we use DML statements in the PL/SQL block. User does not have control over it Explicit cursor used to process select statement, which is used to retrieve more than one row. We have to open, fetch, close the cursor manually. User has control over it. Cursor Attributes: %ROWCOUNT – It returns the integer that how many rows that previous fetch returns. %FOUND – It returns TRUE if the previous fetch returns a row otherwise FALSE. %NOTFOUND – It returns FALSE if the previous fetch returns a row otherwise TRUE. %ISOPEN – It returns TRUE if the named cursor is open otherwise FALSE. 42. PL/SQL Tables It is an object type table and is used to hold the data at runtime and the size of the PL/TABLE is dynamic. 43. VARRAYS and PL/SQL Table Differences? VARRAYS size is fixed and PL/SQL table size is dynamic. 44. Difference between PL/SQL table and Cursor? Cursor will not use index to fetch the fifth row it has to fetch all the five rows to give the fifth row. Cursor will not work on multiple tables. Oracle Application 11.5.9 Bias Technologies 145 145 145 145 PL/SQL table will use the index. By using the index we can directly fetch whatever row we want in the table PL/SQL table can work on multiple tables. 45. What is Pragma? Pragma is a precompiler directive, which directs the compiler before compilation of the program. 46. Pragma Autonomous Transaction Used to split the whole transaction into two parts parent and child, which run parallely and both have the relation ship Ex: ITEM ATTCHMENTS CONVERSION 47. Pragma Exception_Init? Used to associate a user-defined exception with oracle-defined error. Ex: Bank Account Min Balance 48. Raise_Application_Error? It is used to create our own error messages, which can be more descriptive than named exceptions. Syn: RAISE_APPLICATION_ERROR (error_number, error_message, [Keep_errors]); Where error_number is between –20,000 and –20,999, error_message is the text associated with this error, and keep_errors is a Boolean value. 49. Mutating Error, Mutating table? It will occur whenever we try to do DML operations on a table, which is effected by a trigger. The table, which is affected by trigger, is known as Mutating Error. 50. Difference between Package Procedure and Procedure? Whenever we create a procedure in the package it will compile at that time. When we call it will execute directly. Where in the ordinary procedure each and every time it compiles and execute. The main difference is package procedure better in performance. Oracle Application 11.5.9 Bias Technologies 146 146 146 146 SQL QUERY BANK 1. Query for retrieving N highest paid employees FROM each Department. I 2. Query that will display the total no. of employees, and of that total the number who were hired in 1980, 1981, 1982, and 1983. II 3. Query for listing Deptno, ename, sal, SUM(sal in that dept). III 4. Matrix query to display the job, the salary for that job based on department number, and the total salary for that job for all departments. IV 5. Nth Top Salary of all the employees. V 6. Retrieving the Nth row FROM a table. VI 7. Tree Query. VII 8. Eliminate duplicates rows in a table. VIII 9. Displaying EVERY Nth row in a table. IX 10. Top N rows FROM a table. X 11. COUNT/SUM RANGES of data values in a column. XI 12. For equal size ranges it might be easier to calculate it with DECODE(TRUNC(value/range), 0, rate_0, 1, rate_1, ...). XII 13. Count different data values in a column. XIII 14. Query to get the product of all the values of a column. XIV 15. Query to display only the duplicate records in a table. XV 16. Query for getting the following output as many number of rows in the table. XVI 17. Function for getting the Balance Value. XVII 18. Function for getting the Element Value. XVIII 19. SELECT Query for counting No of words. XIX 20. Function to check for a leap year. XX 21. Query for removing all non-numeric. XXI 22. Query for translating a column values to INITCAP. XXII 23. Function for displaying Rupees in Words. XXIII 24. Query for deleting alternate even rows FROM a table. XXIV 25. Query for deleting alternate odd rows FROM a table. XXV 26. Procedure for sending Email. XXVI 27. Alternate Query for DECODE function. XXVII 28. Create table adding Constraint to a date field to SYSDATE or 3 months later. XXVIII 29. To list all the suppliers who r supplying all the parts supplied by supplier 'S2'. XXIX 30. Query to get the last Sunday of any month. XXX 31. Query to get all those who have no children themselves. XXXI 32. Query to SELECT last N rows FROM a table. XXXII 33. SELECT with variables. XXXIII Oracle Application 11.5.9 Bias Technologies 147 147 147 147 34. Query to get the DB Name. XXXIV 35. Getting the current default schema. XXXV 36. Query to get all the column names of a particular table. XXXVI 37. Spool only the query result to a file in SQLPLUS. XXXVII 38. Query for getting the current SessionID. XXXVIII 39. Query to display rows FROM m to n. XXXIX 40. Query to count no. Of columns in a table. XXXX 41. Procedure to increase the buffer length. XXXXI 42. Inserting an & symbol in a Varchar2 column. XXXXII 43. Create Query to restrict the user to a single row. XXXXIII 44. Query to get the first inserted record FROM a table. XXXXIV 45. Concatenate a column value with multiple rows. XXXXV 46. Query to delete all the tables at once. XXXXVI 47. SQL Query for getting Orphan Records. XXXXVII 48. Removing Trailing blanks in a spooled file. XXXXVIII 49. Samples for executing Dynamic SQL Statements. XXXXIX 50. Differences between SQL and MS-Access. XXXXX 51. Query to display all the children, sub children of a parent. XXXXXI 52. Procedure to read/write data from/to a text file. XXXXXII 53. Query to display random number between any two given numbers. XXXXXIII 54. Time difference between two date columns. XXXXXIV 55. Display the Nth Max Sal of the Employee where Salary must be Distinct. XXXXXV 56. Display the Current username, which you have logged on. XXXXXVI 57. Will this query work if it works then what will be the output? XXXXXVII 58. Display the Count that how many columns existing in the Table? XXXXXVIII Oracle Application 11.5.9 Bias Technologies 148 148 148 148 I. The following query retrieves "2" highest paid employees FROM each Department: SELECT deptno, empno, sal FROM emp e WHERE 2 > ( SELECT COUNT(e1.sal) FROM emp e1 WHERE e.deptno = e1.deptno AND e.sal < e1.sal ) ORDER BY 1,3 DESC; II. Query that will display the total no. Of employees, and of that total the number who were hired in 1980, 1981, 1982, and 1983. Give appropriate column headings. I am looking at the following output. We need to stick to this format. Total 1980 1981 1982 1983 ----------- ------------ ------------ ------------- ----------- 14 1 10 2 1 SELECT COUNT (*), COUNT(DECODE(TO_CHAR (hiredate, 'YYYY'),'1980', empno)) "1980", COUNT (DECODE (TO_CHAR (hiredate, 'YYYY'), '1981', empno)) "1981", COUNT (DECODE (TO_CHAR (hiredate, 'YYYY'), '1982', empno)) "1982", COUNT (DECODE (TO_CHAR (hiredate, 'YYYY'), '1983', empno)) "1983" FROM emp; III. Query for listing Deptno, ename, sal, SUM(sal in that dept) : SELECT adaptor, ename, sal, (SELECT SUM(sal) FROM emp b WHERE a.deptno = b.deptno) FROM emp a ORDER BY a.deptno; OUTPUT: ======= DEPTNO ENAME SAL SUM (SAL) ========= ======= ==== ========= 10 KING 5000 11725 30 BLAKE 2850 10900 10 CLARK 2450 11725 10 JONES 2975 11725 30 MARTIN 1250 10900 30 ALLEN 1600 10900 30 TURNER 1500 10900 30 JAMES 950 10900 30 WARD 2750 10900 20 SMITH 8000 33000 20 SCOTT 3000 33000 20 MILLER 20000 33000 Oracle Application 11.5.9 Bias Technologies 149 149 149 149 IV. Create a matrix query to display the job, the salary for that job based on department number, and the total salary for that job for all departments, giving each column an appropriate heading. The output is as follows - we need to stick to this format: Job Dept 10 Dept 20 Dept 30 Total ---------- --------------- ------------- ------------- --------- ANALYST 6000 6000 CLERK 1300 1900 950 4150 MANAGER 2450 2975 2850 8275 PRESIDENT 5000 5000 SALESMAN 5600 5600 SELECT job "Job", SUM (DECODE (deptno, 10, sal)) "Dept 10", SUM (DECODE (deptno, 20, sal)) "Dept 20", SUM (DECODE (deptno, 30, sal)) "Dept 30", SUM (sal) "Total" FROM emp GROUP BY job ; V. 4 th Top Salary of all the employees: SELECT DEPTNO, ENAME, SAL FROM EMP A WHERE 3 = (SELECT COUNT(B.SAL) FROM EMP B WHERE A.SAL < B.SAL) ORDER BY SAL DESC; VI. Retrieving the 5th row FROM a table : 1. SELECT DEPTNO, ENAME, SAL FROM EMP WHERE ROWID = (SELECT ROWID FROM EMP WHERE ROWNUM <= 5 MINUS SELECT ROWID FROM EMP WHERE ROWNUM < 5) 2. SELECT * FROM EMP A WHERE &N = (SELECT COUNT(ROWID) FROM EMP B WHERE A.ROWID >= B.ROWID); VII. Tree Query : Name Null? Type ------------------------------------------------------------------- SUB NOT NULL VARCHAR2(4) SUPER VARCHAR2(4) PRICE NUMBER(6,2) SELECT sub, super FROM parts CONNECT BY PRIOR sub = super START WITH sub = 'p1'; Oracle Application 11.5.9 Bias Technologies 150 150 150 150 VIII. Eliminate duplicates rows in a table : DELETE FROM table_name A WHERE ROWID > ( SELECT min(ROWID) FROM table_name B WHERE A.col = B.col); IX. Displaying EVERY 4th row in a table : (If a table has 14 rows, 4,8,12 rows will be selected) SELECT * FROM emp WHERE (ROWID,0) IN (SELECT ROWID, MOD(ROWNUM,4) FROM emp); X. Top N rows FROM a table : (Displays top 9 salaried people) SELECT ename, deptno, sal FROM (SELECT * FROM emp ORDER BY sal DESC) WHERE ROWNUM < 10; XI. How does one count/sum RANGES of data values in a column? A value x will be between values y and z if GREATEST(x, y) = LEAST(x, z). SELECT f2, COUNT(DECODE(greatest(f1,59), least(f1,100), 1, 0)) "Range 60-100", COUNT(DECODE(greatest(f1,30), least(f1, 59), 1, 0)) "Range 30-59", COUNT(DECODE(greatest(f1,29), least(f1, 0), 1, 0)) "Range 00-29" FROM my_table GROUP BY f2; XII. For equal size ranges it migth be easier to calculate it with DECODE(TRUNC(value/range), 0, rate_0, 1, rate_1, ...). SELECT ename "Name", sal "Salary", DECODE( TRUNC(sal/1000, 0), 0, 0.0, 1, 0.1, 2, 0.2, 3, 0.3) "Tax rate" FROM emp; XIII. How does one count different data values in a column? COL NAME DATATYPE ---------------------------------------- DNO NUMBER SEX CHAR SELECT dno, SUM(DECODE(sex,'M',1,0)) MALE, SUM(DECODE(sex,'F',1,0)) FEMALE, COUNT(DECODE(sex,'M',1,'F',1)) TOTAL FROM t1 GROUP BY dno; XIV. Query to get the product of all the values of a column : SELECT EXP(SUM(LN(col1))) FROM bias_table; Oracle Application 11.5.9 Bias Technologies 151 151 151 151 XV. Query to display only the duplicate records in a table: SELECT num FROM satyam GROUP BY num HAVING COUNT(*) > 1; XVI. Query for getting the following output as many number of rows in the table : * ** *** **** ***** SELECT RPAD(DECODE(temp,temp,'*'),ROWNUM,'*') FROM bias_table1; XVII. Function for getting the Balance Value : FUNCTION F_BALANCE_VALUE (p_business_group_id number, p_payroll_action_id number, p_balance_name varchar2, p_dimension_name varchar2) RETURN NUMBER IS l_bal number; l_defined_bal_id number; l_assignment_action_id number; BEGIN SELECT assignment_action_id INTO l_assignment_action_id FROM pay_assignment_actions WHERE assignment_id = :p_assignment_id AND payroll_action_id = p_payroll_action_id; SELECT defined_balance_id INTO l_defined_bal_id FROM pay_balance_types pbt, pay_defined_balances pdb, pay_balance_dimensions pbd WHERE pbt.business_group_id = p_business_group_id AND UPPER(pbt.balance_name) = UPPER(p_balance_name) AND pbt.business_group_id = pdb.business_group_id AND pbt.balance_type_id = pdb.balance_type_id AND UPPER(pbd.dimension_name) = UPPER(p_dimension_name) AND pdb.balance_dimension_id = pbd.balance_dimension_id; l_bal := pay_balance_pkg.get_value(l_defined_bal_id,l_assignment_action_id); RETURN (l_bal); Oracle Application 11.5.9 Bias Technologies 152 152 152 152 exception WHEN no_data_found THEN RETURN 0; END; XVIII. Function for getting the Element Value : FUNCTION f_element_value( p_classification_name in varchar2, p_element_name in varchar2, p_business_group_id in number, p_input_value_name in varchar2, p_payroll_action_id in number, p_assignment_id in number ) RETURN number IS l_element_value number(14,2) default 0; l_input_value_id pay_input_values_f.input_value_id%type; l_element_type_id pay_element_types_f.element_type_id%type; BEGIN SELECT DISTINCT element_type_id INTO l_element_type_id FROM pay_element_types_f pet, pay_element_classifications pec WHERE pet.classification_id = pec.classification_id AND upper(classification_name) = upper(p_classification_name) AND upper(element_name) = upper(p_element_name) AND pet.business_group_id = p_business_group_id; SELECT input_value_id INTO l_input_value_id FROM pay_input_values_f WHERE upper(name) = upper(p_input_value_name) AND element_type_id = l_element_type_id; SELECT NVL(prrv.result_value,0) INTO l_element_value FROM pay_run_result_values prrv, pay_run_results prr, pay_assignment_actions paa WHERE prrv.run_result_id = prr.run_result_id AND prr.assignment_ACTION_ID = paa.assignment_action_id AND paa.assignment_id = p_assignment_id AND input_value_id = l_input_value_id AND paa.payroll_action_id = p_payroll_action_id; RETURN (l_element_value); exception WHEN no_data_found THEN RETURN 0; END; XIX. SELECT Query for counting No of words : SELECT ename, Oracle Application 11.5.9 Bias Technologies 153 153 153 153 NVL(LENGTH(REPLACE(TRANSLATE(UPPER(RTRIM(ename)),'ABCDEFGHIJKLMNOPQRSTU VWXYZ'' ',' @'),' ',''))+1,1) word_length FROM emp; Explanation : TRANSLATE(UPPER(RTRIM(ename)),'ABCDEFGHIJKLMNOPQRSTUVWXYZ'' ',' @') -- This will translate all the characters FROM A-Z including a single quote to a space. It will also translate a space to a @. REPLACE(TRANSLATE(UPPER(RTRIM(ename)),'ABCDEFGHIJKLMNOPQRSTUVWXYZ'' ',' @'),' ','') -- This will replace every space with nothing in the above result. LENGTH(REPLACE(TRANSLATE(UPPER(RTRIM(ename)),'ABCDEFGHIJKLMNOPQRSTUVWX YZ'' ',' @'),' ',''))+1 -- This will give u the count of @ characters in the above result. XX. Function to check for a leap year : CREATE OR REPLACE FUNCTION is_leap_year (p_date IN DATE) RETURN VARCHAR2 AS v_test DATE; BEGIN v_test := TO_DATE ('29-Feb-' || TO_CHAR (p_date,'YYYY'),'DD-Mon-YYYY'); RETURN 'Y'; EXCEPTION WHEN OTHERS THEN RETURN 'N'; END is_leap_year; SQL> SELECT hiredate, TO_CHAR (hiredate, 'Day') weekday FROM emp WHERE is_leap_year (hiredate) = 'Y'; XXI. Query for removing all non-numeric : SELECT TRANSLATE(LOWER(ssn),'abcdefghijklmnopqrstuvwxyz- ','') FROM DUAL; XXII. Query for translating a column values to INITCAP: SELECT TRANSLATE(INITCAP(temp), SUBSTR(temp, INSTR(temp,'''')+1,1), LOWER(SUBSTR(temp, INSTR(temp,'''')+1))) FROM bias_table1; XXIII. Function for displaying Rupees in Words : CREATE OR REPLACE FUNCTION to_word_i (amount IN NUMBER) RETURN VARCHAR2 AS v_length INTEGER := 0; v_num2 VARCHAR2 (50) := NULL; v_amount VARCHAR2 (50) := TO_CHAR (TRUNC (amount)); Oracle Application 11.5.9 Bias Technologies 154 154 154 154 v_word VARCHAR2 (4000) := NULL; v_word1 VARCHAR2 (4000) := NULL; TYPE myarray IS TABLE OF VARCHAR2 (255); v_str myarray := myarray (' Thousand ', ' Lakh ', ' Crore '); BEGIN IF ((amount = 0) OR (amount IS NULL)) THEN v_word := 'zero'; ELSIF (TO_CHAR (amount) LIKE '%.%') THEN IF (SUBSTR (amount, INSTR (amount, '.') + 1) > 0) THEN v_num2 := SUBSTR (amount, INSTR (amount, '.') + 1); IF (LENGTH (v_num2) < 2) THEN v_num2 := v_num2 * 10; END IF; v_word1 := ' AND ' || (TO_CHAR (TO_DATE (SUBSTR (v_num2, LENGTH (v_num2) - 1,2), 'J'), 'JSP' ))|| ' paise '; v_amount := SUBSTR(amount,1,INSTR (amount, '.')-1); v_word := TO_CHAR (TO_DATE (SUBSTR (v_amount, LENGTH (v_amount) - 2,3), 'J'), 'Jsp' ) || v_word; v_amount := SUBSTR (v_amount, 1, LENGTH (v_amount) - 3); FOR i in 1 .. v_str.COUNT LOOP EXIT WHEN (v_amount IS NULL); v_word := TO_CHAR (TO_DATE (SUBSTR (v_amount, LENGTH (v_amount) - 1,2), 'J'), 'Jsp' ) || v_str (i) || v_word; v_amount := SUBSTR (v_amount, 1, LENGTH (v_amount) - 2); END LOOP; END IF; ELSE v_word := TO_CHAR ( TO_DATE ( TO_CHAR ( amount, '999999999') , 'J'), 'JSP'); END IF; v_word := v_word || ' ' || v_word1 || ' only '; v_word := REPLACE (RTRIM (v_word), ' ', ' '); v_word := REPLACE (RTRIM (v_word), '-', ' '); RETURN INITCAP (v_word); END to_word_i; XXIV. Query for deleting alternate even rows FROM a table : DELETE FROM bias_table WHERE (ROWID,0) IN (SELECT ROWID, MOD(ROWNUM,2) FROM bias_table); XXV. Query for deleting alternate odd rows FROM a table : DELETE FROM bias_table WHERE (ROWID,1) IN (SELECT ROWID, MOD(ROWNUM,2) FROM bias_table); Oracle Application 11.5.9 Bias Technologies 155 155 155 155 XXVI. Procedure for sending Email : CREATE OR REPLACE PROCEDURE Send_Mail IS sender VARCHAR2(50) := '
[email protected]'; recipient VARCHAR2(50) := '
[email protected]'; subject VARCHAR2(100) := 'Test Message'; message VARCHAR2(1000) := 'This is a sample mail ....'; lv_mailhost VARCHAR2(30) := 'HOTNT002'; l_mail_conn utl_smtp.connection; lv_crlf VARCHAR2(2):= CHR( 13 ) || CHR( 10 ); BEGIN l_mail_conn := utl_smtp.open_connection (lv_mailhost, 80); utl_smtp.helo ( l_mail_conn, lv_mailhost); utl_smtp.mail ( l_mail_conn, sender); utl_smtp.rcpt ( l_mail_conn, recipient); utl_smtp.open_data (l_mail_conn); utl_smtp.write_data ( l_mail_conn, 'FROM: ' || sender || lv_crlf); utl_smtp.write_data ( l_mail_conn, 'To: ' || recipient || lv_crlf); utl_smtp.write_data ( l_mail_conn, 'Subject:' || subject || lv_crlf); utl_smtp.write_data ( l_mail_conn, lv_crlf || message); utl_smtp.close_data(l_mail_conn); utl_smtp.quit(l_mail_conn); EXCEPTION WHEN OTHERS THEN DBMS_OUTPUT.PUT_LINE('Error'); END; XXVII. Alternate Query for DECODE function : SELECT case WHEN sex = 'm' THEN 'male' WHEN sex = 'f' THEN 'female' ELSE 'unknown' END FROM mytable; XXVIII. Create table adding Constraint to a date field to SYSDATE or 3 months later: CREATE TABLE bias_table(dt1 date DEFAULT SYSDATE, dt2 date, CONSTRAINT check_dt2 CHECK ((dt2 >= dt1) AND (dt2 <= ADD_MONTHS(SYSDATE,3))); XXIX. Query to list all the suppliers who supply all the parts supplied by supplier 'S2' : SELECT DISTINCT a.SUPP FROM ORDERS a WHERE a.supp != 'S2' AND a.parts IN (SELECT DISTINCT PARTS FROM ORDERS WHERE supp = 'S2') GROUP BY a.SUPP HAVING COUNT(DISTINCT a.PARTS) >= (SELECT COUNT(DISTINCT PARTS) FROM ORDERS WHERE supp = 'S2'); Table : orders Oracle Application 11.5.9 Bias Technologies 156 156 156 156 SUPP PARTS -------------------- ------- S1 P1 S1 P2 S1 P3 S1 P4 S1 P5 S1 P6 S2 P1 S2 P2 S3 P2 S4 P2 S4 P4 S4 P5 XXX. Query to get the last Sunday of any month : SELECT NEXT_DAY(LAST_DAY(TO_DATE('26-10-2001','DD-MM-YYYY')) - 7,'sunday') FROM DUAL; XXXI. Query to get all those who have no children themselves : table data : id name parent_id ------------------------------- 1 a NULL - the top level entry 2 b 1 - a child of 1 3 c 1 4 d 2 - a child of 2 5 e 2 6 f 3 7 g 3 8 h 4 9 i 8 10 j 9 SELECT ID FROM MY_TABlE WHERE PARENT_ID IS NOT NULL MINUS SELECT PARENT_ID FROM MY_TABlE; XXXII. Query to SELECT last N rows FROM a table : SELECT empno FROM emp WHERE ROWID in (SELECT ROWID FROM emp MINUS SELECT ROWID FROM emp WHERE ROWNUM <= (SELECT COUNT(*)-5 FROM emp)); XXXIII. SELECT with variables: CREATE OR REPLACE PROCEDURE disp AS xTableName varchar2(25):='emp'; xFieldName varchar2(25):='ename'; Oracle Application 11.5.9 Bias Technologies 157 157 157 157 xValue NUMBER; xQuery varchar2(100); name varchar2(10) := 'CLARK'; BEGIN xQuery := 'SELECT SAL FROM ' || xTableName || ' WHERE ' || xFieldName || ' = ''' || name || ''''; DBMS_OUTPUT.PUT_LINE(xQuery); EXECUTE IMMEDIATE xQuery INTO xValue; DBMS_OUTPUT.PUT_LINE(xValue); END; XXXIV. Query to get the DB Name: SELECT name FROM v$database; XXXV. Getting the current default schema : SELECT SYS_CONTEXT('USERENV','CURRENT_SCHEMA') FROM DUAL; XXXVI. Query to get all the column names of a particular table : SELECT column_name FROM all_tab_columns WHERE TABLE_NAME = 'ORDERS'; XXXVII. How do I spool only the query result to a file in SQLPLUS : Place the following lines of code in a file and execute the file in SQLPLUS : set heading off set feedback off set colsep ' ' set termout off set verify off spool c:\chaitu.txt SELECT empno,ename FROM emp; /* Write your Query here */ spool off / XXXVIII. Query for getting the current SessionID : SELECT SYS_CONTEXT('USERENV','SESSIONID') Session_ID FROM DUAL; XXXIX. Query to display rows FROM m to n : To display rows 5 to 7 : SELECT DEPTNO, ENAME, SAL FROM EMP WHERE ROWID IN (SELECT ROWID FROM EMP WHERE ROWNUM <= 7 MINUS SELECT ROWID FROM EMP WHERE ROWNUM < 5); Oracle Application 11.5.9 Bias Technologies 158 158 158 158 OR SELECT ename FROM emp GROUP BY ROWNUM, ename HAVING ROWNUM > 1 and ROWNUM < 3; XXXX. Query to count no. Of columns in a table: SELECT COUNT(column_name) FROM user_tab_columns WHERE table_name = 'MYTABLE'; XXXXI. Procedure to increase the buffer length : dbms_output.enable(4000); /*allows the output buffer to be increased to the specified number of bytes */ DECLARE BEGIN dbms_output.enable(4000); FOR i IN 1..400 LOOP DBMS_OUTPUT.PUT_LINE(i); END LOOP; END; / XXXXII. Inserting an & symbol in a Varchar2 column : Set the following to some other character. By default it is &. set define '~' XXXXIII. Create Query to restrict the user to a single row : CREATE OR REPLACE TRIGGER TRIG_N BEFORE UPDATE OR DELETE ON EMP FOR EACH ROW WHEN(OLD.EMPNO=7788) BEGIN RAISE_APPLICATION_ERROR('-20001' ,'CANT DO ANY OPERATION ON THIS ROW'); END; SQL> UPDATE EMP SET SAL=SAL+1 WHERE EMPNO=7788; XXXXIV. Query to get the first inserted record FROM a table : SELECT * FROM T_N WHERE ROWNUM=1; XXXXV. How to concatenate a column value with multiple rows : Oracle Application 11.5.9 Bias Technologies 159 159 159 159 XXXXVI. Query to delete all the tables at once : XXXXVII. SQL Query for getting Orphan Records : XXXXVIII. How do you remove Trailing blanks in a spooled file : Change the Environment Options Like this : set trimspool on set trimout on XXXXIX. Samples for executing Dynamic SQL Statements : Sample :1 CREATE OR REPLACE PROCEDURE CNT(P_TABLE_NAME IN VARCHAR2) AS SqlString VARCHAR2(200); tot number; BEGIN SqlString:='SELECT COUNT(*) FROM '|| P_TABLE_NAME; EXECUTE IMMEDIATE SqlString INTO tot; DBMS_OUTPUT.PUT_LINE('Total No.Of Records In ' || P_TABLE_NAME || ' ARE=' || tot); END; Sample :2 DECLARE sql_stmt VARCHAR2(200); plsql_block VARCHAR2(500); emp_id NUMBER(4) := 7566; salary NUMBER(7,2); dept_id NUMBER(2) := 50; dept_name VARCHAR2(14) := ’PERSONNEL’; location VARCHAR2(13) := ’DALLAS’; emp_rec emp%ROWTYPE; BEGIN EXECUTE IMMEDIATE 'CREATE TABLE bonus (id NUMBER, amt NUMBER)'; sql_stmt := 'INSERT INTO dept VALUES (:1, :2, :3)'; EXECUTE IMMEDIATE sql_stmt USING dept_id, dept_name, location; sql_stmt := 'SELECT * FROM emp WHERE empno = :id'; EXECUTE IMMEDIATE sql_stmt INTO emp_rec USING emp_id; plsql_block := 'BEGIN emp_pkg.raise_salary(:id, :amt); END;'; EXECUTE IMMEDIATE plsql_block USING 7788, 500; sql_stmt := 'UPDATE emp SET sal = 2000 WHERE empno = :1 RETURNING sal INTO :2'; EXECUTE IMMEDIATE sql_stmt USING emp_id RETURNING INTO salary; EXECUTE IMMEDIATE 'DELETE FROM dept WHERE deptno = :num' USING dept_id; EXECUTE IMMEDIATE ’ALTER SESSION SET SQL_TRACE TRUE’; END; Oracle Application 11.5.9 Bias Technologies 160 160 160 160 Sample 3 CREATE OR REPLACE PROCEDURE DEPARTMENTS(NO IN DEPT.DEPTNO%TYPE) AS v_cursor integer; v_dname char(20); v_rows integer; BEGIN v_cursor := DBMS_SQL.OPEN_CURSOR; DBMS_SQL.PARSE(v_cursor, 'select dname from dept where deptno > :x', DBMS_SQL.V7); DBMS_SQL.BIND_VARIABLE(v_cursor, ':x', no); DBMS_SQL.DEFINE_COLUMN_CHAR(v_cursor, 1, v_dname, 20); v_rows := DBMS_SQL.EXECUTE(v_cursor); LOOP IF DBMS_SQL.FETCH_ROWS(v_cursor) = 0 THEN EXIT; END IF; DBMS_SQL.COLUMN_VALUE_CHAR(v_cursor, 1, v_dname); DBMS_OUTPUT.PUT_LINE('Deptartment name: '||v_dname); END LOOP; DBMS_SQL.CLOSE_CURSOR(v_cursor); EXCEPTION WHEN OTHERS THEN DBMS_SQL.CLOSE_CURSOR(v_cursor); raise_application_error(-20000, 'Unknown Exception Raised: '||sqlcode||' '||sqlerrm); END; XXXXX. Differences between SQL and MS-Access : Difference 1: Oracle : select name from table1 where name like 'k%'; Access: select name from table1 where name like 'k*'; Difference 2: Access: SELECT TOP 2 name FROM Table1; Oracle : will not work there is no such TOP key word. XXXXXI. Query to display all the children, sub children of a parent : SELECT organization_id,name FROM hr_all_organization_units WHERE organization_id in ( SELECT ORGANIZATION_ID_CHILD FROM PER_ORG_STRUCTURE_ELEMENTS CONNECT BY PRIOR ORGANIZATION_ID_CHILD = ORGANIZATION_ID_PARENT START WITH ORGANIZATION_ID_CHILD = (SELECT organization_id FROM hr_all_organization_units WHERE name = 'EBG Corporate Group')); XXXXXII. Procedure to read/write data from a text file : CREATE OR REPLACE PROCEDURE read_data AS c_path varchar2(100) := '/usr/tmp'; c_file_name varchar2(20) := 'EKGSEP01.CSV'; v_file_id utl_file.file_type; Oracle Application 11.5.9 Bias Technologies 161 161 161 161 v_buffer varchar2(1022) := This is a sample text’; BEGIN v_file_id := UTL_FILE.FOPEN(c_path,c_file_name,'w'); UTL_FILE.PUT_LINE(v_file_id, v_buffer); UTL_FILE.FCLOSE(v_file_id); v_file_id := UTL_FILE.FOPEN(c_path,c_file_name,'r'); UTL_FILE.GET_LINE(v_file_id, v_buffer); DBMS_OUTPUT.PUT_LINE(v_buffer); UTL_FILE.FCLOSE(v_file_id); END; XXXXXIII. Query to display random number between any two given numbers : SELECT DBMS_RANDOM.VALUE (1,2) FROM DUAL; XXXXXIV. How can I get the time difference between two date columns : SELECT FLOOR((date1-date2)*24*60*60)/3600) || ' HOURS ' || FLOOR((((date1-date2)*24*60*60) - FLOOR(((date1-date2)*24*60*60)/3600)*3600)/60) || ' MINUTES ' || ROUND((((date1-date2)*24*60*60) - FLOOR(((date1-date2)*24*60*60)/3600)*3600 - (FLOOR((((date1-date2)*24*60*60) - FLOOR(((date1-date2)*24*60*60)/3600)*3600)/60)*60))) || ' SECS ' time_difference FROM my_table; XXXXXV. Display Nth MAX Sal of Employee where Salary must be Distinct: SELECT * FROM EMP WHERE SAL=(SELECT SAL FROM (SELECT DISTINCT(SAL) FROM EMP ORDER BY SAL DESC) HAVING ROWNUM=4 GROUP BY ROWNUM, SAL) XXXXXVI. Display Current Username which you have logged in: 1. SELECT USER FROM DUAL; 2. SELECT S.USERNAME FROM V$PROCESS P, V$SESSION S WHERE P.ADDR = S.PADDR AND S.AUDSID = USERENV('SESSIONID') XXXXXVII. Will This Query Works and What will be the output: 1. SELECT 'A ''WRONG'' word.' FROM DUAL; 2. SELECT DISTINCT * FROM EMP; 3. SELECT ROWID ROWNUM, ENAME, SAL FROM EMP; XXXXXVIII. Count the Columns in the table name: SELECT COUNT(*) FROM USER_TAB_COLUMNS WHERE TABLE_NAME LIKE 'EMP' Oracle Application 11.5.9 Bias Technologies 162 162 162 162 ERP QUERY BOOK 1. Can we give extensions in executable file name? a) No, because it wont allow periods and spaces in execution file name. 2. How many colors are there in forms? b) Yellow - Mandatory White - Optional Blue - Query Mode Grey - Read Only 3. What is the PRIORITY field in the Concurrent Program? a) According to user priority the concurrent program will run. 4. What are the mandatory columns in Executable? a) Executable Short name Applications Executtion Method Execution file name 5. What is the Application in Executable? a) It will give the location of the object. 6. What is the Range function in the concurrent program parameter window? a) It will give low and high values. 7. What is Copy to Button in concurrent program window? a) It is used to get the new copy of existing concurrent program with parameters and Incompatibilities. 8. What is a Session Control button in concurrent program window? a) If we have bulk of inserts and updates when we want to rollback those we will use It has three parametes Consumer group Rollback Segment Optimizer mode 9. What are the types of incompatibilities concurrent program window? a) Two types Domain Global 10. What are the types of Output formats in concurrent program window? a) There are 6 types of Output formats HTML PDF PCL TEXT XML POST SCRIPT Oracle Application 11.5.9 Bias Technologies 163 163 163 163 11. What are the Styles in concurrent program window? > A4 - 80×66 > landscape - 132×66 > landwide - 180×66 > Bacs - 2000×66 12. What is Application Top? What are the types and Purpose? a) When we connect to the server we will find the top called application top. Its Types. Product top Custom top Product top is the default top built by the manufacturer and Custom top is used to select the Client for his business purposes. Customizations are done with the Custom top. 13. What is US folder in the Custom Top? It is a language specific folder used to store the G.U.I like reports and forms. 14. what are mandatory parameters of Procedures and what the use of those? a) Errorbuf: It is used to returns the error messeges and sent it to the log file. b) Retcode: It is used to show the status of the Procedure with 0,1,2 0 for Completed Normal 1 for Completed Warning 2 for Completed Error 15. What is Apps Schema and Schema? a) Schema: Schema is the location in database contains database objects like views, tables, synonyms. Apps Schema: It is used to connect the all schemas to get the information from The database. 16. Token a) Use to transfer values to report builder and it is not case sensitive. 17. AOL Objects? a) The objects which reside under the FND tables are AOL Objects. 18. Difference between FORM, Function and Menu? a) A menu is a hierarchical arrangement of functions and menus. Each responsibility has a menu assigned to it. A function is a part of an application that is registered under a unique name for the purpose of assigning it to be including it from a menu. 19. Valueset Definition? a) Valueset is nothing but a list of values with validation. 20. Naming Conventions of Valuset? a) While defining the Valueset we have to follow some naming conventions No Spaces it will allow, It will Allow periods, Special Characters, and it is Case sensitive. Oracle Application 11.5.9 Bias Technologies 164 164 164 164 1) What is ERP? Architecture of apps? A packaged business software system that lets a company automate and integrate the majority of its business processes; share common data and practices across the enterprise; [and] produce and access information in a real-time environment. 2) Tell me some thing about SQL-LOADER. Sql * loader is a bulk loader utility used for moving data from external files into the oracle database. Sql * loader supports various load formats, selective loading, and multi-tables loads. 1) Conventional --The conventional path loader essentially loads the data by using standard ‘insert’ statement. 2) Direct -- the direct path loader (direct = true) by possess of logic involved with that, and loads directly in to the oracle data files. EX:- My data.csv file 1001, “scott tiger”,1000,40 1002,”gvreddy”,2345,50 Load data Infile ‘c:\data\mydata.csv’ Into table emp Fields terminated by “,” optionally enclosed by ‘”’ (empno, empname,sal,deptno) >sqlldr scott/tiger@vis control=loader.ctl log= gvlog.log bad=gvbad.bad discard=gvdis.dsc . 3) how do u dump data from pl/sql block to flat files? Using utl_file package, we can dump data from pl/sql block to flat file. PRE-REQUIREMENTS for UTL_FILE is specify the accessible directories for the UTL_FILE function in the initialization file (INIT.ORA) Using the UTL_FILE_DIR parameters. Ex: UTL_FILE_DIR = <Directory name> EX:- --remember to update INITSID.ORA, --utl_file_dir = ‘c:\oradata’ Declare Fp utl_file.file_type; Begin Fp := utl_file.fopen(c:\oradata’,tab1.txt’,’w’); Utl_file.putf(fp,’%s %s \n ‘text field’, 55); Oracle Application 11.5.9 Bias Technologies 165 165 165 165 Utl_file.fclose(fp); End; 4) What is SET-OF-BOOKS? Collection of Chart of Accounts and Currency and Calendars is called SOB 5) What is the interface? Interface Table is a table which is used as medium for transfer of data between two systems. 6) What is invoice? Send you a request for payment 7) What is INBOUND and OUT BOUND? (Different types of interfaces) Inbound Interface: For inbound interfaces, where these products are the destination, interface tables as well as supporting validation, processing, and maintenance programs are provided. Outbound Interface: For outbound interfaces, where these products are the source, database views are provided and the destination application should provide the validation, processing, and maintenance programs 8) Tell me what r the Base tables in the AR? hz_parties (party_id) (store info about org, groups and people) HZ_PARTIES stores information about parties such as organizations, people, and groups, including the identifying address information for the party. hz_cust_accounts (cust_account_id) HZ_CUST_ACCOUNTS stores information about customer relationships. If a party becomes a customer, information about the customer account is stored in this table. You can establish multiplecustomer relationships with a single party, so each party can have multiple customer account records in this table. hz_cust_acct_sites_all (cust_acct_site_id) HZ_CUST_ACCT_SITES_ALL stores information about customer sites.One customer account can have multiple sites. The address is maintained in HZ_LOCATIONS. hz_cust_site_uses_all (site_use_id) HZ_CUST_SITE_USES_ALL stores information about site uses or business purposes. A single customer site can have multiple site uses, such as bill to or ship to, and each site use is stored as a record in this table. hz_party_sites (party_site_id) HZ_PARTY_SITES stores information about the relationship between Parties and Locations. The same party can have multiple party sites.Physical addresses are stored in HZ_LOCATIONS. hz_locations (location_id) HZ_LOCATIONS stores information about physical locations. Oracle Application 11.5.9 Bias Technologies 166 166 166 166 hz_Person_Profiles (person_profile_id) HZ_PERSON_PROFILES stores detail information about people. hz_Organization_Profiles (organization_profile_id) HZ_ORGANIZATION_PROFILES stores credit rating, financial statistics, socioeconomic and corporate linkage information for business sites. The primary key for this table is ORGANIZATION_PROFILE_ID. 9) What r the table’s interface tables in the customer interface tables? 1) Ra_customers_interface_all This table stores customer, address, and business purpose information. You do not have to enter values in this table if you do not want to import customers, addresses, or business purposes. ADDRESS1 through 4 Enter the address for your customer in these four columns. You can enter up to four lines of an address. Validation: If you enter a value in ORIG_SYSTEM_ADDRESS_REF, you must enter a value in ADDRESS1. For multiple rows with the same address reference, insert values in address 1–4. Destination: HZ_LOCATIONS.ADDRESS1, HZ_LOCATIONS.ADDRESS2, HZ_LOCATIONS.ADDRESS3, HZ_LOCATIONS.ADDRESS4 2) Ra_customer_profile_int_all A customer level profile must exist in A_CUSTOMER_PROFILES_INTERFACE for new customers and each bill–to business purpose. 3) Ra_contact_phones_int_all This table stores telephone numbers for customers, addresses and contacts as well as contacts for customers and addresses. 4) Ra_customer_banks_int_all This table stores bank information for a customer or for a specific Bill–To address, you must enter a bank account for this customer, 5) Ra_cust_paymethod_int_all To import payment methods for customers and bill–to business purposes, 10) What r the staging tables in the customer interface? Ra_customers_stg Ra_customers_address_stg Ra_customers_point_stg Ra_customers_contact points_stg Ra_customers_relate_stg Ra_customer_error. Oracle Application 11.5.9 Bias Technologies 167 167 167 167 11) Tell me some mandatory columns in the customer interface tables? a) Ra_customers_interface_all 1) Orig_system_customer_ref 2) insert_update_flag 3) customer_number 4) customer_status 5)last_updated_by 6) last_updated_date 7)created_by 8) creation_date. b) Ra_customer_profile_int_all 1) customer_profile_class_name c) Ra_contact_phones_int_all 1)orig_system_telephone_ref 2)telephone 3) telephone_type d) Ra_customer_banks_int_all 1) bank_a/c_name 2)bank_a/c_no 3)bank_a/c_currency_code e) Ra_cust_paymethod_int_all 1) payment_method_name 12) Tell me the Navigation for customer interface? Receivables Interface Customers Oracle Application 11.5.9 Bias Technologies 168 168 168 168 1. What tables cannot be updated through customer interface? No updates will be allowed to be made through customer interface for Following tables. RA_SITE_USES_ALL RA_CUSTOMER_RELATIONSHIPS_ALL RA_CUST_RECEIPT_METHODS AP_BANK_BRANCHES AP_BANK_ACCOUNTS_ALL AP_BANK_ACCOUNT_USES_ALL 2. How to send additional customer and address information through customer interafce Here is where attribute columns are used. * Additional Customer data can be populated in RA_CUSTOMERS_INTERFACE_ALL.customer_attribute1 to 15 This will go into RA_CUSTOMERS.attribute1 to 15 * Additional address information can be populated in RA_CUSTOMERS_INTERFACE_ALL.address_attribute1 to 15 This will go into RA_ADDRESSES_ALL.attribute1 to 15 And so on. 5. What should be the batch size (number of customer records) general guidelines for optimal performance About 10,000 records per bacth is ideal, it is suggested to keep the batch size small. 6. Why does customer interface error out if there is mismatch in address information? Because the code validates against these mismatches. arplscin.sql and arplbcin.sql It validates the address being inserted or updated with respect to the tax location flexfeild structure. For each row being inserted or updated in RA_CUSTOMERS_INTERFACE, and that has not already been marked in error, the set_location_ccid function is called to return either an existing ccid for the address entered or to create a new entry in AR_LOCATION_VALUES for this new address. The RA_CUSTOMERS_INTERFACE record is then updated with the value of the ccid returned. 7. How do you send records at customer level profile and address/site level profile? For every customer record in RA_CUSTOMERS_INTERFACE_ALL, insert two records in table RA_CUSTOMER_PROFILES_INT_ALL. (Refer Note: 1070800.6 ) 8. Does Customer Interface import salesperson data? No, Refer Enhancement Bug: 147495 Oracle Application 11.5.9 Bias Technologies 169 169 169 169 9. Customer Interface process can be used for updating the customer information How does the UPDATE work? Current functionality of Customer Interface is to update all the data. You cannot run Customer Interface to update only changed data. (Refer Bug: 879121 for the intended functinality) 10. What are some of the important fields that Customer Interface does not load? Not all fields in RA_CUSTOMERS are being loaded by the interface. SIC_CODE GSA_INDICATOR FOB_POINT SALES_CHANNEL_CODE FREIGHT_TERM WAREHOUSE_ID PRICE LIST SHIP_PARTIAL PAYMENT_TERM_ID in RA_SITE_USES.PAYMENT_TERM_ID (Refer Enhancement Request Bug: 245300) 11. New TCA/Customer Model, how to load customer as PERSON or ORGANIZATION through Customer Interface? a) Populate ra_customers_interface_all . person_flag = 'Y' Run Customer Interface process will load this record as PERSON b) Populate ra_customers_interface_all . person_flag = 'N' ( or NULL ) Run Customer Interface process will load this record as ORGANIZATION 12) Tell me what is the procedure to develop an interface? a. First we will get the Requirement document. b. We will create control file based on that plot file. c. Then the control files which loads the data into staging tables. d. Through pl/sql programs we will mapping and validate the data and then dump into the interface tables. e. Through the standard programs we will push the data from interface tables to Base tables. 13) What validations u did in the customer interface? f. customer name : the same customer reference can’t have different customer names with in this table HZ_PARTIES.PARTY_NAME Oracle Application 11.5.9 Bias Technologies 170 170 170 170 g. customer number : must be null if your r using automatic customer numbering, must exit if you are not using automatic customer numbering. This value much be unique with in HZ_PARTIES h. customer status : must be ‘A’ for active or ‘I’ for inactive HZ_PARTIES_STATUS i. bank account num or bank account currency code : if the bank a/c already exist do not enter a value if the bank a/c does not exist you must enter a value j. bank a/c name : it must exist in AP_BANK_ACCOUNTS or if it does not exist values must exist for BANK_A/C_CURRENCY_CODE BANK_A/C_NUM BANK_NAME BANK_BRANCH_NAME Note : every interface table has two error msg 1) Error code. 2) Error msg. 14) How can u call a standard interface program from sql or pl/sql code? FND_REQUEST.SUBMIT_REQUEST (‘PO’,’EXECUTABLE NAME’,,,,PARAMETERS) 15) API’s FOR CUSTOMER INTERFACE? HZ_CUST_A/C_VZPUB.UPDATE_CUST_A/C HZ_CUST_A/C_VZPUB.CREATE_CUST_A/C FND_PROFILES FND_APPLICATIONS FND_GLOBAL FND-FILE FND_CONCSUB(can submit conc program in host invironment) 16) Tell me some API? FND_FILE.PUTLINE(FND_FILE.LOG) FND_FILE.PUTLINE(FND_FILE.OUTPUT) Is the Program exits, delete conc program and its executables. IF FND_PROGRAM.PROGRAM_EXITS(‘EMP’,APPLICATION_NAME_IN) THEN FND_PROGRAM.DELETE_PROGRAM(‘EMP’,APPLICATION_NAME_IN) FND_PROGRAM.DELETE_EXECUTABLE(‘EMP’,APPLICATION_NAME_IN) END; 17) What are profile options? Is the Functional and Technical behavior of Oracle Applications Package. EX: - I want to assign the user3 responsibility to p4 printer then System Administrator Profile System (FND_PROFILE_OPTIONS) Oracle Application 11.5.9 Bias Technologies 171 171 171 171 18) Oracle E-Business suite? Oracle apps + analytical components software. (Oracle discover) (Oracle sales analyzer) (Oracle financial analyzer) (Oracle marketing analyzer) 19) What is multi org? “Legal entity has more than one operating unit is called as multi org” a) Business group --- Human resources information is secured by Business group b) Legal entity. --- inter-company and fiscal/tax reporting. Security responsibility operating unit. c) Operating unit --- secures AR, OE, AP, PA and PO Information. d) Organizations --- is a specialize unit of work at particular locations 20) What are the User PARAMETERS in the Reports? P_CONC_REQUEST_ID P_FLEX_VALUE 21) FND USER EXITS:- FND SRWINIT sets your profile option values, multiple organizations and allows Oracle Application Object Library user exits to detect that they have been called by an Oracle Reports program. FND SRWEXIT ensures that all the memory allocated for AOL user exits have been freed up properly. FND FLEXIDVAL are used to display flex field information like prompt, value etc FND FLEXSQL these user exits allow you to use flex fields in your reports FND FORMAT_CURRENCY is used to print currency in various formats by using formula column 22) PL/SQL stored procedure parameters? (or) what are the two parameters that are mandatory for pl/sql type concurrent program? Procedure/function (ERRBUF OUT RETCODE OUT ………………….) ERRBUF :- Used to write the error message to log or request file. RETCODE :- Populate log request file with program submission details info. 23) What is Value Set? --The value set is a collection (or) container of values. --When ever the value set associated with any report parameters. It provides list of values to the end user to accept one of the values as report parameter value. -- If the list of values needed to be dynamic and ever changing and define a table based values set. Oracle Application 11.5.9 Bias Technologies 172 172 172 172 24) What r the validation types? 1) None -------- validation is minimal. 2) Independent ------input must exist on previously defined list of values 3) Dependent ------input is checked against a subset of values based on a prior value. 3) Table ----- input is checked against values in an application table 4) Special ------values set uses a flex field itself. 5) Pair ------ two flex fields together specify a range of valid values. 6) Translatable independent ----- input must exist on previously defined list of values; translated values can be used. 7) Translatable dependent ------- input is checked against a subset of values based on a prior values; translated value can be used. 25) Form development process? a) open template form b) Save as <your form>.fmb c) Change the form module name as form name. d) Delete the default blocks, window, and canvas e) Create a window. f) Assign the window property class to window g) Create a canvas (subclass info) h) Assign canvas property class to the canvas I) assign the window to the canvas and canvas to the window j) Create a data block k) Modify the form level properties. (sub class item Text item) l) Modify the app_cusom package. In the program unit. m) Modify the pre-form trigger (form level) n) Modify the module level properties ((console window, First navigation p) Save and compile the form. Place the .fmx in the server directory. 25.a) Register in the AOL APPLICATION FORM APPLICATION FUNCTION APPLICATION MENU Oracle Application 11.5.9 Bias Technologies 173 173 173 173 26) How does u customize the Reports? a. Identify the Short name of the standard report in which module we have to customize Ex: - if u wants to customize in the AR module path is Appl top\ar\11.5.0\reports\US\ .rdf b. Open the .rdf file in Report builder and change the name of the module. c. Open the data module and modify the query (what is client requirements) assign the columns to the attributes. d. Go to report wizard and select, what r the newly created columns. e. Then Compile it. Then u will get a .rep file in the specified module. If it is not in the specified directory then we have to put in the server directory. f. Then Register in the AOL Concurrent Executable. Concurrent Program. g. Go to system administrator Security Responsibility request. h. Add and assign a concurrent program to a request group 27) Registering parametric report? Any applications will have two parameters, 1) from-period 2) to-period a) Go to object navigator and create the parameters. User parameters from_no, to_no (data type char and width 30) b) Open the report layout and write the query(we have to reg the table in AOL) Select empno,ename,from g_emp where empno between :from_no and to_no c) Compile and put the .RDP file in the server directory. d) Registering in AOL. Concurrent executable Concurrent program then go to “PARAMETERS” e) Go to Application validation set. then go to “EDIT INTO” After entering the VALUE SETS (1) And TOKENS (2) f) Go to Administrations Sequrity responsibility Request h) Add and assign a concurrent program to a request group 28) Tell me some report names and their table names in GL, AP, AR, and PO? 1) ra_customer_trx_all customer_trx_id trx_number (invoice no, debit memo no, credit memo no) cust_trx_type_id 2) ra_customer_lines_all (details of invoice) cutomer_trx_id 3) ar_payment_schdules_all Oracle Application 11.5.9 Bias Technologies 174 174 174 174 check_id This table stores all transactions except adjustments and miscellaneous cash receipts. Oracle Receivables updates this table when activity occurs against an invoice, debit memo, chargeback, credit memo, on account credit, or receipt. 4) ra_cust_trx_types_all (invoice types) cust_trx_type_id 5) ra_batches_all Batch_id This table stores information about each receipt batch that you create in Oracle Receivables. Each row includes information about a specific batch such as batch source, status, batch type, control count, and control amount 6) ra_receivable_application_all 7) ra_adjustments_all This table stores information about your invoice adjustments. Each row includes general information about the adjustment you are making such as activity name, amount, accounting information, reason, and type of adjustment. You need one row for each adjustment you are making to an invoice. 8) ra_cash_receiots_all Cash_receipt_id This table stores one record for each receipt that you enter. Oracle Receivables creates records concurrently in the AR_CASH_RECEIPT_HISTORY_ALL, AR_PAYMENT_SCHEDULES_ALL, and AR_RECEIVABLE_APPLICATIONS tables for invoice– related receipts. 1) ap_invoice_all invoice_amount, base_amount, payment_status_flag(‘y’ –fully paid ‘n’—unpaid ‘p’ –partially paid) 2) ap_invoice_payments_all invoice_id, 3) ap_invoice_distibutions_All amount, base_amount, dist_code_combination_id, line_type_lookup_code 4) ap_payment_schdules payment_status_flag(“ ‘’’’’”) 5) ap_payment_dustributions_all 6) ap_checks_all check_id, AP_CHECKS_ALL stores information about payments issued to suppliers or refunds received from suppliers. You need one row for each payment you issue to a supplier or refund received from a supplier. Your Oracle Payables application uses this information to record payments you make to suppliers or refunds you receive from suppliers. 7) ap_accounting_events_all 8) ap_bank_accounts_all AP_BANK_ACCOUNTS_ALL contains information about your bank accounts. You need one row for each bank account you define. Each bank account must be affiliated with one bank branch. When you initiate an automatic payment batch, enter a Oracle Application 11.5.9 Bias Technologies 175 175 175 175 manual check, or create a Quick payment, you can select a bank account that you define in this table. 9) ap_bank_accounts_uses_all AP_BANK_ACCOUNT_USES_ALL stores information for the internal and external bank accounts you define in Oracle Payables and Oracle Receivables applications. 1) po_vendors_all 2) po_vendors_sites_all 3) po_headers_all po_header_id 4) po_lines_all po_line_id 5) po_line_locations_All 6) po_distributions_all po_distribution_id, 1) Gl_code_combinations GL_CODE_COMBINATIONS stores valid account combinations for each Accounting Flexfield structure within your Oracle General Ledger application. Associated with each account are certain codes and flags, including whether the account is enabled, whether detail posting or detail budgeting is allowed, and others. 2) Gl_je_batches. GL_JE_BATCHES stores journal entry batches. 3) Gl_je_headers GL_JE_HEADERS stores journal entries. There is a one–to–many relationship between journal entry batches and journal entries. Each row in this table includes the associated batch ID, the journal entry name and description, and other information about the journal entry. This table corresponds to the Journals window of the Enter Journals form. STATUS is ’U’ for unposted, ’P’ for posted. Other statuses indicate that an error condition was found. A complete list is below. 4) Gl_je_lines. GL_JE_LINES stores the journal entry lines that you enter in the Enter Journals form. There is a one–to–many relationship between journal entries and journal entry lines. Each row in this table stores the associated journal entry header ID, the line number, the associated code combination ID, and the debits or credits associated with the journal line. STATUS is ’U’ for unposted or ’P’ for posted 5) Gl_set of books GL_SETS_OF_BOOKS stores information about the sets of books you define in your Oracle General Ledger application. Each row includes the set of books name, description, functional currency, and other information. This table corresponds to the Set of Books form. 6) Gl_periods GL_PERIODS stores information about the accounting periods you define using the Accounting Calendar form. Each row includes the start date and end date of the period, the period type, the fiscal year, the period number, and other information. There is a one–to–many relationship between a row in the GL_PERIOD_SETS table and rows in this table. Oracle Application 11.5.9 Bias Technologies 176 176 176 176 1) OPEN-DEBIT MEMO REPORT? This report shows all the open-debit memo transactions, based on customer number and dates. Columns :- type, customer_no, trx_no, amt_due, remaining. Parameter :- type, customer, from_date, to_date. 2) GENERATING POSITIVE PAY FILE FOR BANK REPORT? Basically this report generates a flat file of all the payments in order to send in to the bank. 3) UPDATE POSITIVEPAY CHECKS REPORT? This report which updates the data into the (AP) account payables system from the plot file, the file which is sent by bank 4) UPDATE POSITIVEPAY OUT STANDING CHECKS? This report which shows the out standing checks 5) CUSTOMER PAYMENT DETAILS REPORT? Which shows each customer original amount, amount pay and due amount based on transaction type (books, pens) Transaction types in AR Credit memo transaction types Invoice, debit memo, and charge back transaction types Commitment transaction types 30) HOW DO YOU RECTIFY THE ERRORS IN INTERFACE TABLES? Depending on the naming convention used, errors appear in either alphabetical order or by error code number. 31) How do u identity its name of report? System administrator concurrent program define System administrator concurrent program executable 32) Who information’s? 1) Created by 2) Creation date 3) Last _updated by 4) last_update_date 5) last_update_value 33) FLEX FIELDS? Used to capture the additional business information. DFF KFF Additional Unique Info, Mandatory Captured in attribute prefixed columns Segment prefixed Not reported on standard reports Is reported on standard reports To provide expansion space on your form With the help of []. [] Represents descriptive Flex field. FLEX FILED : DESCRIPTIVE : REGISTER Used for entering and displaying key information For example Oracle General uses a key Flex field called Accounting Flex field to uniquely identifies a general account. FLEX FILED : KEY : REGISTER Oracle Application 11.5.9 Bias Technologies 177 177 177 177 Oracle Applications KEY FLEX FIELDS 1) GL :- ACCOUNTING 2) AR :- SALES TAX LOCATION, TERRITORY, 3) AP :- BANK DETAILS, COST ALLOCATION, PEOPLE GROUP Oracle Applications DESCRIPTIVE FLEX FIELDS (Partial) 1) GL :- daily rates 2) AR :- credit history, information 3) PA :- bank branch, payment terms, site address, 34) What are the requests groups? a) Single request: - this allows you to submit an individual request. b) Request set : - this allows you to submit a pre-defined set of requests. 35) Sys Admin Module? a) Define Custom Users, b) Define Login Users, c) Register oracle DB users, d) Define Concurrent Programs, e) Register Concurrent Executables, f) Setting Profile Option Values, g) Define Request Types. 36) AOL? a) Registering tables. b) Registering views c) Registering db sequences d) Registering profile options e) Registering lookups and lookup codes f) Registering forms g) Registering Form and Non-Form functions i) registering Menus and sub-menus. j) Registering DFF and KFF. k) Libraries 37) What r the type Models in the system parameters of the report? 1) Bit map 2) Character mode 38) .What is SRW Package? (Sql Report Writer) The Report builder Built in package know as SRW Package This package extends reports ,Control report execution, output message at runtime, Initialize layout fields, Perform DDL statements used to create or Drop temporary table, Call User Exist, to format width of the columns, to page break the column, to set the colors Ex: SRW.DO_SQL, It’s like DDL command, we can create table, views, etc. SRW.SET_FIELD_NUM SRW. SET_FILED_CHAR SRW. SET FILED _DATE 39) Difference between Bind and Lexical parameters? BIND VARIABLE: -- are used to replace a single value in sql, pl/sql -- bind variable may be used to replace expressions in select, where, group, order by, having, connect by, start with cause of queries. -- bind reference may not be referenced in FROM clause (or) in place of reserved words or clauses. LEXICAL REFERENCE: -- You can use lexical reference to replace the clauses appearing AFTER select, from, group by, having, connect by, start with. -- You can’t make lexical reference in pl/sql statements. 40) Matrix Report: Simple, Group above, Nested Simple Matrix Report: 4 groups 1. Cross Product Group 2. Row and Column Group 3. Cell Group Oracle Application 11.5.9 Bias Technologies 178 178 178 178 4. Cell column is the source of a cross product summary that becomes the cell content. Frames: 1. Repeating frame for rows(down direction) 2. Repeating frame for columns(Across ) 3. Matrix object the intersection of the two repeating frames 41) what is Flex mode and Confine mode? Confine mode On: child objects cannot be moved outside their enclosing parent objects. Off: child objects can be moved outside their enclosing parent objects. Flex mode: On: parent borders "stretch" when child objects are moved against them. Off: parent borders remain fixed when child objects are moved against them. 42) What is Place holder Columns? A placeholder is a column is an empty container at design time. The placeholder can hold a value at run time has been calculated and placed in to It by pl/sql code from anther object. You can set the value of a placeholder column is in a Before Report trigger. Store a Temporary value for future reference. EX. Store the current max salary as records are retrieved. 43) What is Formula Column? A formula column performs a user-defined computation on another column(s) data, including placeholder columns. 44) What is Summary columns? A summary column performs a computation on another column's data. Using the Report Wizard or Data Wizard, you can create the following summaries: sum, average, count, minimum, maximum, % total. You can also create a summary column manually in the Data Model view, and use the Property Palette to create the following additional summaries: first, last, standard deviation, variance. 45) What is cursor? A Cursor is a pointer, which works on active set, I.e. which points to only one row at a time in the context area’s ACTIVE SET. A cursor is a construct of pl/sql, used to process multiple rows using a pl/sql block. 46) Types of cursors? 1) Implicit: declared for all DML and pl/sql statements. By default it selects one row only. 2) Explicit: Declared and named by the programmer. Use explicit cursor to individually process each row returned by a multiple statements, is called ACTIVE SET. Allows the programmer to manually control explicit cursor in the Pl/sql block a) declare: create a named sql area b) Open: identify the active set. c) Fetch: load the current row in to variables. d) Close: release the active set. CURSOR ATTRIBUTES a) %is open: evaluates to true if the cursor is open. b) %not found: evaluates to true if the most recent fetch does not return a row Oracle Application 11.5.9 Bias Technologies 179 179 179 179 c) %found: evaluates to true if the most recent fetch returns a row. d) %row count: evaluates to the total number of rows returned to far. Example for cursor: 1) Declare Vno emp.empno%type; Vname emp.ename %type; Cursor emp_cursor is Select empno,ename From emp; Begin Open cursor; For I in 1..10 loop Fetch emp_cursor into vno,vname; Dbms_output.putline(to_char(vno) ||’ ‘||vname); End if; End; 2) Begin Open emp_cursor; Loop Fetch when emp_cursor % rowcount >10 or Emp_curor % not found; Bdms_output_put_line(to_char(vno)||’ ‘|| vname); End loop; Close emp_cursor; End; CURSOR FOR LOOP A) cursor for loop is a short cut to process explicit cursors B) it has higher performance C) cursor for loop requires only the declaration of the cursor, remaining things like opening, fetching and close are automatically take by the cursor for loop Example: 1) Declare Cursor emp_cursor is Select empno,ename From emp; Begin For emp_record in emp_cursor loop Dbms_output.putline(emp_record.empno); Dbms_output.putline(emp_record.ename) End loop End; Can we create a cursor without declaring it? Yes – by using cursor for loop using subqueries. BEGIN Oracle Application 11.5.9 Bias Technologies 180 180 180 180 FOR emp_record IN ( SELECT empno, ename FROM emp) LOOP -- implicit open and implicit fetch occur IF emp_record.empno = 7839 THEN ... END LOOP; -- implicit close occurs END; a) for update clause: 1) use explicit locking to deny access for the duration of a transaction 2) lock the rows before update or delete Ex : select ……. From……. For update[ of column ref] [no_wait] b) where current of clause? 1) use cursor to update or delete the current row Where current of < column ref> 47) Attribute data types? 1) %type 2) %row type. 48) Exception Handling? Is a mechanism provided by pl/sql to detect runtime errors and process them with out halting the program abnormally 1) pre-defined 2) user-defined. PRE-DEFINED: 1) cursor_already_open--------attempted to open an already open cursor. 2) Dup_val_on_index --------attempted to insert a duplicate values. 3) Invalid_cursor -------- illegal cursor operation occurred. 4) Invalid_number -------- conversion of character string to number fails. 5) Login_denied ---------loging on to oracle with an invalid user name and password. 6) program_error -------- pl/sql has an internal problem. 7) storage_error -------- pl/sql ran out of memory or memory is corrupted. 8) to_many_row ---------single row select returned more than one row. 9) value_error -------- arithmetic,conversion,truncation or size constraint error occurred. 10) zero_devided -------- attempted to divided by zero. USER-DEFINED: Declare : name the exception Raise : explicitly raise the exception by using the raise statements Reference: exception handing section. The Raise_Application_Error_Procedure: You can use this procedure to issue user-defined error messages from stored sub programs. You can report errors to your applications and avoid returning unhandled exceptions. Raise_Application_Error(error_number,message[,{true/false}] Error number between -20000 to -20999 Oracle Application 11.5.9 Bias Technologies 181 181 181 181 pragma exception_init? It tells the compiler to associate an exception with an oracle error. To get an error message of a specific oracle error. Ex: pragma exception_init(exception name, oracle error number) Example for Exceptions? 1) Check the record is exist or not? Declare E emp% rowtype Begin e.empno := &empno; select * into e from emp where empno =e.empno; Dbms_output.putline(‘empno’ || e.empno); Exception When no_data_found then Dbms_output.putline(e.empno ||’doest exist’); End; 2) User defined exceptions? Define p_dept_desc =’gvreddy’ Define p_dept_number =1236 Declare E_invalid_dept exception; Begin Update departments Set dept_name=’&p_dept_desc’ Where dept_id =’&p_dept_number’; If sql% not found then Raise e_invalid_departments; End if; Commit; Exception When e_invalid_departments then Dbms_output.putline(‘no such dept’); End; 49) What is REF Cursor? To execute a multi-row query, oracle opens an unnamed work area that stores processing information, to access the information, an explicit, which names the work area or, a cursor variable, which points to the work area. where as a cursor always refers to the same query work area, a cursor variable can refer to a different work areas, cursor variable area like ‘c’ or ‘pascal’ pointers, which hold the memory location(address) of some object instead of the object itself. So, declaring a cursor variable creates a pointers, not an object. 50) Can u define exceptions twice in same block? No 51) Can you have two functions with the same name in a pl/sql block? Yes 52) Can you have two stored functions with in the same name? Yes 53) Can function be overload? Yes Oracle Application 11.5.9 Bias Technologies 182 182 182 182 54) What is the maximum number of statements that can be specified in a trigger statement? One. 55) Stored procedure? Stored procedure is a sequence of statements that perform specific function. 56) What is procedure? ---- is a named pl/sql block to perform a specific task. ---- A procedure may have DML statements. ---- It may or may not return a value. ---- Procedure can return more than one value. Example for procedure 1) To accept the year as a parameter and list emp belong to the year? Create or replace Procedure empy(y number) is Cursor emp_cursor is Select * from emp where to_char(hiredate,’yyyy’)=’y’; Emp_record emp%rowtype; Begin For emp_record in emp_cursor loop Print (emp_record.empno); Print (emp_record.ename); Print (emp_record.sal); End loop; End; Output : var empx number; Begin :empx := ‘1234’; End; Exec empy(:empx); Print empy; 57) What is function? ---- is a named pl/sql block to perform a specific task, is mainly used for calculation purpose. ---- A function is called as part of an exception. ---- Every function should return a value Example for function Create or replace Function get_sal(p_id in emp.emp_no% type) Return number Is v_sal emp.sal%type :=0; Begin Select salary into v_salary From emp Where emp_no = p_id; Return v_salary End get_sal; End; Oracle Application 11.5.9 Bias Technologies 183 183 183 183 Output : var g_sal number; Exec :g_sal := get_sal(99); Print g_salary; 58) Can functions be overloaded ? Yes. 59) Can 2 functions have same name & input parameters but differ only by return datatype No. 60) What is the package? ---- Group logically related pl/sql types, items and subprograms. 1) package specification 2) package body Advantages of a package: • Modularity • Easier Application Design • Information Hiding • Overloading You cannot overload: •Two subprograms if their formal parameters differ only in name or parameter mode. (datatype and their total number is same). •Two subprograms if their formal parameters differ only in datatype and the different datatypes are in the same family (number and decimal belong to the same family) •Two subprograms if their formal parameters differ only in subtype and the different subtypes are based on types in the same family (VARCHAR and STRING are subtypes of VARCHAR2) •Two functions that differ only in return type, even if the types are in different families. 61) What is FORWARD DECLARATION in Packages? PL/SQL allows for a special subprogram declaration called a forward declaration. It consists of the subprogram specification in the package body terminated by a semicolon. You can use forward declarations to do the following: • Define subprograms in logical or alphabetical order. • Define mutually recursive subprograms.(both calling each other). • Group subprograms in a package Example of forward Declaration: CREATE OR REPLACE PACKAGE BODY forward_pack IS PROCEDURE calc_rating(. . .); -- forward declaration PROCEDURE award_bonus(. . .) IS -- subprograms defined BEGIN -- in alphabetical order calc_rating(. . .); . . . END; PROCEDURE calc_rating(. . .) IS Oracle Application 11.5.9 Bias Technologies 184 184 184 184 BEGIN . . . END; END forward_pack; 62) What are triggers? ---- triggers are similar to procedures, in that they are the named pl/sql blocks with declarative, executable and exception-handling sections, how ever a procedure is executed explicitly from another block via a procedure call, which can also pass arguments. ---- A trigger is executed implicitly when ever a particular event task places. And is nothing but a event. ---- The triggering event is a DML (insert, update, delete) operations on a data base table ----- fires whenever a data event(such as DML) or system event(such as login or shutdown) occurs on a schema or database Trigger timing : 1) before 2) after 3) instead of ( this is used for views) Triggering events : 1) insert 2)update 3) delete Trigger type : 1) statement level 3) row level. Firing sequence of database triggers 1) before statement trigger 2) before row trigger 3) after row trigger 4) after statement trigger Ex: - 1) Create or replace trigger secure_emp Before Insert on emp Begin If (to_char(sysdate,’dy’) in(‘sat’,’sun’)) or To_char(sysdate,’hh24:mi’) Not between ’08:00’ and ’18:00’) Then raise_application_error(-20500,’u can insert in the office timings’) End if; End; Ex :- 2) write a program to all transitions with name smith? Create or replace Trigger trigger_name Before insert or update or delete On emp For each row When (old.ename =’smith’ or New.ename =’smith’) Begin Raise_application_error(-20003,’smith’); End; Oracle Application 11.5.9 Bias Technologies 185 185 185 185 63) Difference between triggers and procedures? Defined with create trigger Defined with create procedure The data dictionary contains source code in the user_triggers. Data dictionary contains source code in user_source Implicitly invoked Explicitly invoked Commit, save point and rollback are not allowed(TCL) Those are allowed 64) LOCKS? -- Is to reduce concurrency 1) share lock ---it allows the other users for only reading not to insert or update or delete. 2) exclusive lock --- only one user can have the privileges of insert or update and delete of particular object --- others can only read. 3) update lock ----multiple user can read, update delete Lock levels : 1) table level 2) table space 3) data base level. 65) What is template? a) The TEMPLATE form is the required starting point for all development of new Forms. b) The TEMPLATE form includes platform–independent attachments of several Libraries. APPSCORE :- It contains package and procedures that are required of all forms to support the MENUS ,TOOLBARS. APPSDAYPK :- It contains packages that control the oracle applications CALENDER FEATURES. FNDSQF :- it contains packages and procedures for MESSAGE DICTONARY, FLEX FIELDS, PROFILES AND CONCURRENT PROCESSING. CUSTOM :- it allows extension of oracle applications forms with out modification of oracle application code, you can use the custom library for customization such as zoom ( such as moving to another form and querying up specific records) 66) What are ad-hoc reports? Ans.: Ad-hoc Report is made to meet one-time reporting needs. Concerned with or formed for a particular purpose. For example, ad hoc tax codes or an ad hoc database query 67) What is responsibility? Is collection of menus, request security groups and data groups Menus: collection of forms is nothing but menus Request security groups: collection of programs. Data groups: is a group of modules to be made accessible by the user through Responsibility System admin security define. Security user define. 68) What are different execution methods of executables? FlexRpt The execution file is wrnitten using the FlexReport API. FlexSql The execution file is written using the FlexSql API. Oracle Application 11.5.9 Bias Technologies 186 186 186 186 Host The execution file is a host script. Oracle Reports The execution file is an Oracle Reports file. PL/SQL Stored Procedure The execution file is a stored procedure. SQL*Loader The execution file is a SQL script. SQL*Plus The execution file is a SQL*Plus script. SQL*Report The execution file is a SQL*Report script. Spawned The execution file is a C or Pro*C program. Immediate The execution file is a program written to run as a subroutine of the concurrent manager. We recommend against defining new immediate concurrent programs, and suggest you use either a PL/SQL Stored Procedure or a Spawned C Program instead. Composite Datatypes : – PL/SQL TABLES – PL/SQL RECORDS - Nested TABLE - VARRAY 69) What is the sequence of functions – group by,having,orderby in a select statements ? Select….. Group by… Having… Orderby.. Difference between User and Super User? User : login user or front end user Super user : it has full access of particular module Oracle Application 11.5.9 Bias Technologies 187 187 187 187 1. Execution methods? Ans. a. Host b. Immediate c. Java Stored Procedure d. Java Concurrent Program e. Multi Language Function f. Oracle Reports g. PL/SQL Stored Procedure h. Request Set Stage Function i. Spawned j. SQL*Loader k. SQL*Plus 2. What is TCA (Trading Community Architecture)? Ans. Oracle Trading Community Architecture (TCA) is a data model that allows you to manage complex information about the parties, or customers, who belong to your commercial community, including organizations, locations, and the network of hierarchical relationships among them. This information is maintained in the TCA Registry, which is the single source of trading community information for Oracle E-Business Suite applications. 3. Difference between Application Developer and System Administrator? Ans. Role of Technical Consultant: a. Designing New Forms, Programs and Reports b. Forms and Reports customization c. Developing Interfaces d. Developing PL/SQL stored procedures e. Workflow automations Role of System Administrator: a. Define Logon Users b. Define New/Custom Responsibility c. Define Data Groups d. Define Concurrent Managers e. Define Printers f. Test Network Preferences g. Define/Add new Modules Role of an Apps DBA: a. Installing of Application b. Upgradation c. Migration d. Patches e. Routing maintenance of QA f. Cloning of OA 4. What are Flexfields? Ans. A Flexfield is a customizable field that opens in a window from a regular Oracle Applications window. Defining flexfields enables you to tailor Oracle Applications to your own business needs. By using flexfields, you can: (a) Structure certain identifiers required by oracle applications according to your own business environment. (b) Collect and display additional information for your business as needed. Key Flexfields: You use key flexfields to define your own structure for many of the identifiers required by Oracle Applications. Profile – ‘Flexfields:Open Key Window’ (FND_ID_FLEXS) Oracle Application 11.5.9 Bias Technologies 188 188 188 188 Descriptive Flexfield: You use descriptive flexfields to gather additional information about your business entities beyong the information required by Oracle Applications. Profile – Flexfields: Open Descr Window’ (FND_DESCRIPTIVE_FLEXS) 5. Report registration process? Ans. 1. Create the report using the report builder. 2. Place the report definition file in the module specific reports directory. 3. Create an executable for the report definition file. 4. Create a concurrent program to that executable. 5. Associate the concurrent program to a request group. 6. User exits in Reports? Ans. USER EXITS are used in Oracle APPS to access user profile values and perform proper calculation. Ex. of Other AOL User exits available in Reports are given below. FND SRWINIT - This is a User Exit which sets your profile option values and allows Oracle AOL user exits to detect that they have been called by oracle repots. Can be used in BEFORE-REPORT Trigger. FND_SRWEXIT - This user exit ensures that all the memory allocated for AOL user exits has been freed up properly. Can be used in AFTER- REPORT Trigger FND FORMAT_CURRENCY - To format the currency amount dynamically depending upon the precision of the actual currency value, standard precision, users profile values and location (country) of the site. FND FLEXSQL - This user exits allows you to use Flex fields in Reports FND FLEXIDVAL - This user exits allows you to use Flex fields in Reports 7. Request Set and Where do you define it ? Ans. Request sets allow you to submit multiple requests together using multiple execution path. A request set is a collection of reports and /or programs that are grouped together. A stage is a component of a request set used to group requests within the set. All of the requests in a given stage are executed in parallel. Advantages of stages are the ability to execute several requests in parallel and then move sequentially to the next stage. Responsibility: System Administrator Nav: Concurrent -> Set 7(A). Define Request Group? Ans. A request security group is the collection of requests, request sets, and concurrent programs that a user, operating under a given responsibility, can select from the Submit Requests window. 8. Registration of PL/SQL with parameters? Ans. 1. Create the procedure in the module specific schema. 2. Create a public synonym for that procedure in the Apps schema. 3. Create the executable for that procedure. 4. Create a concurrent program. 5. Attach the concurrent program to that procedure. Note: There are two mandatory parameters 1. Errbuf 2. Retcode. Any parameter which are to be passed should be succeeded with these two parameters and have to be registered. When calling the procedure, these two parameters are not mentioned. Oracle Application 11.5.9 Bias Technologies 189 189 189 189 9. How many groups in Matrix Report? Ans. The minimum of groups required for a matrix report are 4. 10. Lexical Parameters and Bind Parameters? Ans. Lexical references are placeholders for text that you embed in a SELECT statement. You can use lexical references to replace the clauses appearing after SELECT, FROM, WHERE, GROUP BY, ORDER BY, HAVING, CONNECT BY, and START WITH. You create a lexical reference by entering an ampersand (&) followed immediately by the column or parameter name. Bind references (or bind variables) are used to replace a single value in SQL or PL/SQL, such as a character string, number, or date. Specifically, bind references may be used to replace expressions in SELECT, WHERE, GROUP BY, ORDER BY, HAVING, CONNECT BY, and START WITH clauses of queries. Bind references may not be referenced in FROM clauses or in place of reserved words or clauses. You create a bind reference by entering a colon (:) followed immediately by the column or parameter name. 11. Value Sets? Ans. Oracle Application Object Library uses values, value sets and validation tables as important components of key flexfields, descriptive flexfields, FlexBuilder, and Standard Request Submission. When you first define your flexfields, you choose how many segments you want to use and what order you want them to appear. You also choose how you want to validate each of your segments. The decisions you make affect how you define your value sets and your values. You define your value sets first, either before or while you define your flexfield segment structures. You typically define your individual values only after your flexfield has been completely defined (and frozen and compiled). Depending on what type of value set you use, you may not need to predefine individual values at all before you can use your flexfield. You can share value sets among segments in different flexfields, segments in different structures of the same flexfield, and even segments within the same flexfield structure. You can share value sets across key and descriptive flexfields. You can also use value sets for report parameters for your reports that use the Standard Report Submission feature. Navigation Path: Login – Application Developer -> Application -> Validation -> Set 11(A). Value Validation Types? Ans. 1. Dependant 2. Independent 3. None 4. Pair 5. Special 6. Table 7. Translate Independent 8. Translate Dependent 11(B). How to define a value set depending on other value set? Ans. Navigation Path: Login -> AOL -> Application -> Validation -> Set Select the validation type as “Dependant” and click on ‘Edit Information’ button. In Dependant value set information screen mention the Independent value set name. Oracle Application 11.5.9 Bias Technologies 190 190 190 190 12. Incompatibility in report registration and Run Alone? Ans. Identify programs that should not run simultaneously with your concurrent program because they might interfere with its execution. You can specify your program as being incompatible with itself. Application: Although the default for this field is the application of your concurrent program, you can enter any valid application name. Name: The program name and application you specify must uniquely identify a concurrent program. Your list displays the user-friendly name of the program, the short name, and the description of the program. Scope: Enter Set or Program Only to specify whether your concurrent program is incompatible with this program and all its child requests (Set) or only with this program (Program Only). Run Alone: Indicate whether your program should run alone relative to all other programs in the same logical database. If the execution of your program interferes with the execution of all other programs in the same logical database (in other words, if your program is incompatible with all programs in its logical database, including itself), it should run alone. 13. AR-Invoices (Class)? Ans. 1. Chargeback 2. Credit Memo 3. Debit Memo 4. Deposit 5. Guarantee 14. AP-Invoice types? Ans. 1. Standard 2. Credit Memo 3. Debit Memo 4. Expense Report 5. PO Default 6. Prepayment 7. Quick match 8. Withholding Tax 9. Mixed 15. Customer Interface? Ans. Use Customer Interface to import and validate current or historical customer information from other systems into Receivables. Once customer information is imported into Oracle Receivables, you can use Customer Interface to import additional data for that customer (such as additional contacts or addresses) and to update existing information. You can also manually update and enter new information using the Customer windows. The following diagram shows how customer information is imported into the Oracle Receivables tables. Error! Unknown switch argument. Oracle Application 11.5.9 Bias Technologies 191 191 191 191 16. Multi Org? Ans. Business Group (each one own Set of Books) Legal Entity (Post to a Set of Books) Operating Units Inventory Organizations Manufacturing Modules (Order Entry, Purchasing, MRP etc.) Financial Modules 17. What are Profiles? Ans. A user profile is a set of changeable options that affect the way your application looks and behaves. As System Administrator, you control how Oracle Applications operate by setting user profile options to the values you want. You can set user profile options at four different levels: site, application, responsibility, and user. Your settings affect users as soon as they sign on or change responsibility. Navigation Path: Login – System Administrator -> Profile -> System Examples: Signon Password Hard to Guess Signon Password Length Set of Books Name Flexfields: Autoskip 18. Employee Details? Ans. Enter employee records. Either your Human Resources department enters employee information in the People window (if HRMS is installed), or the appropriate department enters employee information in the Enter Person window. To ensure that Payables can create a supplier record during Invoice Import, the following are requirements for each employee record: • the employee name is unique • reimbursement address for either Home or Office exists • address lines 1-3 for the home address do not exceed 35 characters • City/State/Country does not exceed 25 characters • Zip Code for the home address does not exceed 20 characters 19. What is the Multi Org and what is it used for? Ans. Multi Org or Multiple Organizations Architecture allows multiple operating units and their relationships to be defined within a single installation of Oracle Applications. This keeps each operating unit's transaction data separate and secure. Use the following query to determine if Muli Org is intalled: “select multi_org_flag from fnd_product_groups;” 20. AR Invoice Tables? Ans. When you enter an invoice either through the Transaction window or through the AutoInvoice program, Receivables uses the following tables to store your invoice information: RA_CUSTOMER_TRX RA_CUSTOMER_TRX_LINES RA_CUST_TRX_LINE_GL_DIST AR_PAYMENT_SCHEDULES Oracle Application 11.5.9 Bias Technologies 192 192 192 192 21. Bitmap Report? Ans. Bitmapped reports are output as PostScript files. The PostScript file is a set of instructions telling the printer exactly what to print and how to print it. To get a landscape report, the Post Script file must be generated as landscape. If you want a landscape bitmapped report, specify this either in the Reports Designer or in the execution options of your concurrent program. When printing bitmapped reports, a print style is still needed to determine the printer driver used. To avoid confusion, create a special print style for bitmapped reports and make that the required style for all bitmapped reports in the Define Concurrent Programs form. 22. Difference between character and bitmap report? Ans. Bitmap vs. Character-Mode Report Design Here is an example to help explain how Oracle Reports are designed and printed in both the bitmap and character-mode environments. Assume you wish to print "Cc" where "C" is a different font and a larger point size than "c" and is in boldface type (where "c" is not). In Oracle Reports Designer, bitmap mode, you can make "C" bold and in a different font and point size than "c". This is because you are generating postscript output. Postscript is a universal printer language and any postscript printer is able to interpret your different design instructions. In Oracle Reports Designer, character mode, the APPLICATIONS STANDARDS REQUIRE the report to be designed in ONE FONT/ ONE CHARACTER SIZE. Character mode reports generate ASCII output. In ASCII you cannot dynamically change the font and character size. The standard is in effect so a report prints as identically as possible from both conventional and postscript printers. Bitmap vs. Character-Mode Report Printing These sequences contrast the two printing environments. In postscript, "C" can be in a different font and point size than "c". Both or either could also be bold, for example. In ASCII, "C" must be in the same font and character size as "c". Both or either could also be bold, for example. 23. What is difference between .rdf and .rep? Ans. Report definition file <report name>.rdf Report runfile <report name>.rep 24. Module related Flex fields? Ans. Key Flexfields Descriptive Flex fields General Ledger - Accounting Flex field Daily Rates Assets - Asset Category Flexfield Bonus Rates Receivables - Sales Tax Location Credit History Information Territory Flex field 25. Difference between Global segments and Context-Sensitive segments? Ans. Gobal Segments: Global segments are segments that appear regardless of context. Columns used for global segments cannot hold an context-sensitive segments. Context-Sensitive segments: Context-Sensitive segments occur depending on the context. 26. Data conversion Vendor data effected tables? Ans. 1. PO_VENDORS 2. PO_VENDOR_SITES_ALL 3. PO_VENDOR_CONTACTS Oracle Application 11.5.9 Bias Technologies 193 193 193 193 27. Data conversion Customer data effected tables? Ans. 1. RA_CUSTOMERS_INTERFACE_ALL 2. RA_CUSTOMER_PROFILES_INT_ALL 28. AP Invoice conversion data effected tables? Ans. 1. AP_INVOICES_INTERFACE 2. AP_INVOICE_LINES_INTERFACE 29. Report Triggers? Ans. 1. BEFORE PARAMETER FORM 2. AFTER PARAMETER FORM 3. BEFORE REPORT 4. BETWEEN PAGES 5. AFTER REPORT The order of events when a report is executed is as follows: 1 Before Parameter Form trigger is fired. 2 Runtime Parameter Form appears (if not suppressed). 3 After Parameter Form trigger is fired (unless the user cancels from the Runtime Parameter Form). 4 Report is "compiled." 5 Queries are parsed. 6 Before Report trigger is fired. 7 SET TRANSACTION READONLY is executed (if specified via the READONLY argument or setting). 8 The report is executed and the Between Pages trigger fires for each page except the last one. (Note that data can be fetched at any time while the report is being formatted.) COMMITs can occur during this time due to any of the following-- user exit with DDL, SRW.DO_SQL with DDL, or if ONFAILURE=COMMIT, and the report fails. 9 COMMIT is executed (if READONLY is specified) to end the transaction. 10 After Report trigger is fired. 11 COMMIT/ROLLBACK/NOACTION is executed based on what was specified via the ONSUCCESS argument or setting. 30. Define Alerts in Apps? Ans. Oracle Alerts are used to monitor unusual or critical activity within a designated database. The flexibility of ALERTS allows a database administrator the ability to monitor activities from tablespace sizing to activities associated with particular applications (i.e. AP, GL, FA). Alerts can be created to monitor a process in the database and to notify a specific individual of the status of the process. There are 2 types of alerts: Event Alerts and Periodic Alerts a) EVENT ALERTS are triggered when an event or change is made to a table in the database. b) PERIODIC ALERTS are activated on a scheduled basis to monitor database activities or changes. 31. Steps to Create a Bit Map Report? Ans. 1.Build the query 2.Draw the layout 3. Close the Layout Editor window. Under Data Model, open up the 'System Parameters' Oracle Application 11.5.9 Bias Technologies 194 194 194 194 4.Right Click on 'MODE' and select 'Properties' Enter 'BITMAP' as the 'Initial Value' and click OK. Save the report - call it 'first.rdf'. 5. Copy the report file in the appropriate directory. 6. Set the FORMAT to POSTSCRIPT and style as A4. in the concurrent program. 32. What is Token and used for? Ans. Token in Concurrent Program creation : For a parameter in an Oracle Reports program, the keyword or parameter appears here. The value is case insensitive. For other types of programs, you can skip this field. Procedure: Defines an error token and substitutes it with a value. Calls to TOKEN( ) and RAISE( ) raise predefined errors for Oracle Workflow that are stored in the WF_RESOURCES table. The error messages contain tokens that need to be replaced with relevant values when the error message is raised. This is an alternative to raising PL/SQL standard exceptions or custom-defined exceptions. Syntax procedure TOKEN (token_name in varchar2, token_value in varchar2); 33. Difference between function and procedure? Ans. Procedures and functions consists of set of PL/SQL statements that are grouped together as a unit of solve a specific problem or perform set of related tasks. Procedures do not return values which functions return one One Value. Packages: Packages provide a method of encapsulating and storing related procedures, functions, variables and other package contents. 34. Form registration setps? Ans. 1. Create the form using the form builder. 2. Generate the executable code (.fmx) 3. Place the .fmb file in AU_TOP forms directory 4. Place the .fmx file in Module specific top forms directory. 5. Register the form with AOL 6. Associate a form function for the form 7. Attach the form function to a menu 35. Interface Tables details? Ans. 1. General Ledger : GL_INTERFACE GL_INTERFACE_CONTROL GL_INTERFACE_HISTORY GL_BUDGET_INTERFACE GL_DAILY_RATES_INTERFACE 2. Account Receivables: AR_PAYMENTS_INTERFACE_ALL AR_TAX_INTERFACE HZ_PARTY_INTERFACE HZ_PARTY_INTERFACE_ERRORS RA_CUSTOMER_INTERFACE_ALL RA_INTERFACE_DISTRIBUTIONS_ALL RA_INTERFACE_ERROR_ALL RA_INTERFACE_LINES_ALL RA_INTERFACEA_SALESCREDITS_ALL 3. Account Payables: AP_INTERFACE_CONTROL AP_INTERFACE_REJECTION Oracle Application 11.5.9 Bias Technologies 195 195 195 195 AP_INVOICES_INTERFACE AP_INVOICE_LINES_INTERFACE 4. Purchasing: PO_DISTRIBUTIONS_INTERFACE PO_HEADER_INTERFACE PO_LINES_INTERFACE PO_INTERFACE_ERROR PO_REQUISITIONS_INTERFACE_ALL 36. Explain Tkprof? Ans. TKProf converts the raw trace files into a more readable format SYNTAX: TKProf tracefile outputfile [sort=option][explain=username/password] Ex. TKProf a12345.trc mytrace.out explain scott/tiger Tracefile The name of the trace statistics file, which is found in the user_dump_dest directory (Normally $ORACLE_HOME/rdbms/log) Outputfile The name of the output file Sort= [option1,option2,….] sorts the SQL statements in the output file Explain=username/password instructs the TKProf to run explai on the SQL statement in order to explain the access path. This is essential for performance investigation Sys=no TKProf skips recursive SQL and statements run as the SYS user. Used rarely. 37. Adhoc Report? Ans. You can define ad hoc financial reports as necessary to meet special reporting needs. An ad hoc report is one you define at the time you run financial reports. You do not assign a name to an ad hoc report. Instead, General Ledger automatically names ad hoc reports as follows: FSG-AD HOC-<Sequence Generated Number>. Suggestion: We recommend that you delete ad hoc reports periodically to improve system performance. Prerequisite : 1. Define a row set. 2. Define a column set. To define and run an ad hoc financial report: 1. Navigate to the Run Financial Reports window. 2. Choose the Define Ad Hoc Report button. 3. Enter a name for your report Title. If this field is empty, the report title will default to the Row Set Description. If Row Set Description is empty, the report title will default to Row Set Name. 4. Enter the Row Set and Column Set to use for the report. 5. Enter any additional report information, including Budget, Encumbrance, and Currency control values. 6. Choose OK to return to the Run Financial Reports window. 38. Call_Form, Open_Form and New_Form Definitions? Ans. CALL_FORM: Runs an indicated form while keeping the parent form active. Form Builder runs the called form with the same Runform preferences as the parent form. When the called form is exited Form Builder processing resumes in the calling form at the point from which you initiated the call to CALL_FORM. OPEN_FORM: Opens the indicated form. Use OPEN_FORM to create multiple-form applications, that is, applications that open more than one form at the same time. NEW_FORM: Exits the current form and enters the indicated form. The calling form is terminated as the parent form. If the calling form had been called by a higher form, Form Builder keeps the higher call active and treats it as a call to the new form. Form Builder releases memory (such as database cursors) that the terminated form was using. Form Builder runs the new form with the same Runform options as the parent form. If the parent form was a called form, Form Builder runs the new form with the same options as the parent form. Oracle Application 11.5.9 Bias Technologies 196 196 196 196 39. Form and Non-Form function? Ans. Form (Form Function): A form function (form) invokes an Oracle Forms form. Form functions have the unique property that you may navigate to them using the Navigate window. Subfunction (Non-Form Function): A non-form function (subfunction) is a securable subset of a form's functionality: in other words, a function executed from within a form. Statement Printing AR Source files : ARXGSP internally calling ARXSGPO Tables Effected: TEMP_ARSHR - AR_STATEMENT_HEADERS TEMP_ARSLC - AR_STATEMENT_LINE_CLUSTERS TEMP_ADJ - AR_ADJUSTMENT HZ_CUST_ACCOUNTS HZ_PARTIES HZ_LOCATIONS HZ_CUST_ACCT_SITES HZ_PARTY_SITES FND_TERRITORIES Lookup Tables: AR_LOOKUPS AR_PAYMENT_SCHEDULES Style – Group Above Groups – Header Level Call FND_CLIENT_INFO in Before Report Trigger Landscape – 66 / 80 - Height / Width AR Invoice Printing Source File : RAXINV_SEL Tables: AR_INVOICE_HEADERS_V AR_INVOICE_LINES_V AR_TAX_LINES_V Call FND_CLIENT_INFO in Before Report Trigger FND_CLIENT_INFO.SET_ORG_CONTEXT(81); Purchase Order Report Source File : POXPRPOP 1) On Plane paper 2) Logo on Top Left 3) Move Address to center 4) Border for some fields Tables: PO_HEADERS_PRINT PO_LINES_PRINT Lookup Objects: PO_LINE_LOCATIONS_PRINT PO_VENDOR_CONTACTS PO_DISTRIBUTIONS_ALL HR_EMPLOYEES HR_LOCATIONS Oracle Application 11.5.9 Bias Technologies 197 197 197 197 Check Printing Source : APXPBFEL 1) Company Logo 2) No Check number 3) Stationary 8.5 X 11 Positive Pay Source : APXPOPAY Statement for bank Date Check Numbers Amount Description 1-10 11 – 22 23 – 30 31 – 70 MM/DD/YY Number Number 9,2 Alpha Number Left Right Left Left General Report Modifications a. Pre printed stationary b. Portrait format c. Header level changes d. Line level changes e. Decode usage f. Zero ‘0’ suppressing g. Plan paper - logo and address and borders >>>>>>>C>>>>>>TEAM WORK MEANS MORE THAN WE<<<<<<<S<<<<<< >>>>>>>C>>>>>>>FACE INTERVIEWS CONFIDENTLY<<<<<<<<S<<<<<< >>>>>>>C>>>>>>>>>>>>>>Good Luck<<<<<<<<<<<<<<<<S<<<<<<