Thursday, September 1, 2022

How to creating DFF in a Custom Form

 Introduction

This Post Is To Creating DFF in a Custom Form.

QUERY TO CREATE DFF IN CUSTOMER FORM.

1. Go to Application Developer -> Flex Fields -> Descriptive -> Register
Enter all the details and click on Columns.
Enable the columns and save.
2. Now go to Segments menu.
Search for the created DFF.
Select the Global Data Elements and click on Segments.
Create the new segments and save
3. Now the DFF is ready to use in the Form builder.
4. Create a Text Item
SubClass Information : TEXT_ITEM_DESC_FLEX
LOV: ENABLE_LIST_LAMP
Validate from List: No
Database Item: No
5. Now create a package in Program Units section as

PACKAGE BODY <package> IS
procedure <procedure>(Event in varchar2) is
BEGIN
IF EVENT = ‘WHEN-NEW-FORM-INSTANCE’ THEN
FND_DESCR_FLEX.DEFINE(BLOCK => <Data Block Name>,
FIELD => <DFF Field Name>,
APPL_SHORT_NAME => ‘SQLAP’,
DESC_FLEX_NAME => <DFF Name registered in the Application> );
END IF;
END;
END;
6. Create below triggers:
WHEN-NEW-FORM-INSTANCE – > package.procedure(‘WHEN-NEW-FORM-INSTANCE’);
WHEN-NEW-ITEM-INSTANCE -> FND_FLEX.EVENT(‘WHEN-NEW-ITEM-INSTANCE’);

Oracle apps provides the API named, FND_FLEX, for Descriptive flexfield events. You can write all the block level triggers to have consistent normal behavior of the descriptive flexfield.

WHEN-VALIDATE-ITEM -> FND_FLEX.EVENT(‘WHEN-VALIDATE-ITEM ‘);
PRE-QUERY -> FND_FLEX.EVENT(‘PRE-QUERY’);
POST-QUERY -> FND_FLEX.EVENT(‘POST-QUERY’);
WHEN-VALIDATE-ITEM -> FND_FLEX.EVENT(‘WHEN-VALIDATE-RECORD’);
PRE-INSERT -> FND_FLEX.EVENT(‘PRE-INSERT’);
PRE-UPDATE -> FND_FLEX.EVENT(‘PRE-UPDATE’);

Wednesday, May 25, 2022

Concurrent request put on menu

Form:  "Run Reports"

Parameter:

    1. REQUEST_GROUP_CODE="AR_CREATE_ACCOUNTING" REQUEST_GROUP_APPL_SHORT_NAME="AR" TITLE="AR:AR_ACCT_EXEC"

    2. CONCURRENT_PROGRAM_NAME ="RACUST" PROGRAM_APPL_SHORT_NAME="AR" TITLE="AR:AR_SRS_TITLE_CUST_INTERFACE"

    3.TITLE="CMI:CMI_LAUNCH_SIM_GPA_LOAD"  USE_ORG="N"  CONCURRENT_PROGRAM_NAME="CMIGPASLOAD"    PROGRAM_APPL_SHORT_NAME="CMI"



Friday, March 11, 2022

FND_PROFILE & FND_GLOBAL usage

FND_PROFILE

Use of the API FND_PROFILE
It is used to perform various actions related to profile values through PL/SQL. Some of the important ones are listed below
1. FND_PROFILE.GET(‘Name of the Profile’, variable name);
Example
SELECT fnd_profile.value('PROFILEOPTION')
,fnd_profile.value('MFG_ORGANIZATION_ID')
,fnd_profile.value('ORG_ID')
,fnd_profile.value('LOGIN_ID')
,fnd_profile.value('USER_ID')
,fnd_profile.value('USERNAME')
,fnd_profile.value('CONCURRENT_REQUEST_ID')
,fnd_profile.value('GL_SET_OF_BKS_ID')
,fnd_profile.value('SO_ORGANIZATION_ID')
,fnd_profile.value('APPL_SHRT_NAME')
,fnd_profile.value('RESP_NAME')
,fnd_profile.value('RESP_ID')
FROM DUAL;



FND_GLOBAL

The server-side package FND_GLOBAL returns the values of system globals, such as the login/signon or “session” type of values. You should not use FND_GLOBAL routines in your forms (that is on the client side). On the client side, most of the procedures in the FND_GLOBAL package are replaced by a user profile option with the same (or a similar) name. You should use FND_PROFILE routines in your forms instead.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
fnd_global.USER_ID 
fnd_global.USER_NAME 
fnd_global.RESP_ID 
fnd_global.RESP_NAME 
fnd_global.APPLICATION_NAME 
fnd_global.APPLICATION_SHORT_NAME 
fnd_global.RESP_APPL_ID 
fnd_global.BASE_LANGUAGE 
fnd_global.CONC_LOGIN_ID 
fnd_global.CONC_PRIORITY_REQUEST 
fnd_global.CONC_PROCESS_ID 
fnd_global.CONC_PROGRAM_ID 
fnd_global.CONC_QUEUE_ID 
fnd_global.CONC_REQUEST_ID 
fnd_global.CURRENT_LANGUAGE 
fnd_global.CUSTOMER_ID 
fnd_global.EMPLOYEE_ID 
fnd_global.FORM_APPL_ID 
fnd_global.FORM_ID 
fnd_global.GET_SESSION_CONTEXT 
fnd_global.LANGUAGE_COUNT 
fnd_global.LOGIN_ID 
fnd_global.NEWLINE 
fnd_global.NLS_DATE_FORMAT 
fnd_global.NLS_DATE_LANGUAGE 
fnd_global.NLS_LANGUAGE 
fnd_global.NLS_NUMERIC_CHARACTERS 
fnd_global.NLS_SORT 
fnd_global.NLS_TERRITORY 
fnd_global.ORG_ID 
fnd_global.ORG_NAME 
fnd_global.PARTY_ID 
fnd_global.PER_BUSINESS_GROUP_ID 
fnd_global.PER_SECURITY_PROFILE_ID 
fnd_global.PROG_APPL_ID 
fnd_global.QUEUE_APPL_ID 
fnd_global.RT_TEST_ID 
fnd_global.SECURITY_GROUP_ID 
fnd_global.SERVER_ID 
fnd_global.SESSION_ID 
fnd_global.SUPPLIER_ID 
fnd_global.TAB

Thursday, March 10, 2022

EBS information for table begin with all*

1)  select table_name from all_tables

2)  select view_name from all_views


3)  select distinct type from all_source 

    where name = 'CUX_SEND_MAIL_PKG' 

    and type = 'PACKAGE BODY'

    order by line;

TYPE:

PACKAGE BODY

TYPE BODY

TRIGGER

PACKAGE

PROCEDURE

FUNCTION

LIBRARY

TYPE

JAVA SOURCE

Wednesday, March 9, 2022

How to get CCID

1) Fnd_Flex_ext.get_ccid

 

--return CCID or 0 when flexfield segment ACCOUNT does not exist in the value set TTI_ACCOUN

 

DECLARE

    p_ccid    NUMBER;

BEGIN

    p_ccid := Fnd_Flex_ext.get_ccid(application_short_name => 'SQLGL',

                                         key_flex_code          => 'GL#',

                                         structure_number       => 50190,

                                         validation_date        => to_char(SYSDATE,

                                                                           'YYYY/MM/DD HH24:MI:SS'),

                                         concatenated_segments  => 'B1.21399.00.6733.000000.00000000.11.00.0000.000');

    IF p_ccid <> '0' THEN

        DBMS_OUTPUT.PUT_LINE( p_ccid);

    ELSE

        DBMS_OUTPUT.PUT_LINE( FND_FLEX_EXT.GET_MESSAGE) ;

    END IF;

END;

 

====================================================================

 

2) fnd_flex_keyval.validate_segs

 

--return true or false & get ccid by FND_FLEX_KEYVAL.COMBINATION_ID()

 

BEGIN

    IF fnd_flex_keyval.validate_segs(

        operation        => 'CREATE_COMBINATION' -- CHECK_COMBINATION, FIND_COMBINATION

        , appl_short_name  => 'SQLGL' -- 請根據情況自行修改

        , key_flex_code    => 'GL#' -- 請根據情況自行修改

        , structure_number => 50190 -- 請根據情況自行修改

        , concat_segments  => 'B1.21299.00.6733.000000.00000000.11.00.0000.000') THEN

        DBMS_OUTPUT.PUT_LINE( (FND_FLEX_KEYVAL.COMBINATION_ID()));

--.concatenated_descriptions());

    ELSE

        DBMS_OUTPUT.PUT_LINE( FND_FLEX_KEYVAL.ERROR_MESSAGE) ;

    END IF;

END; 





1、Check Combination:

IF (NOT fnd_flex_keyval.validate_segs(operation => 'CHECK_COMBINATION',

                                      appl_short_name => 'SQLGL',

                                      key_flex_code => 'GL#',

                                      structure_number => 50394,

                                      concat_segments => '0.0.530101.0.0.1006001.0.0',

                                      validation_date => sysdate)) THEN

  -- return the error message

  RETURN fnd_flex_keyval.error_message;

END IF;


2. Create Combination:

    1) fnd_flex_ext.get_ccid(application_short_name => 'SQLGL',  

                                                 key_flex_code          => 'GL#',  

                                                 structure_number       => l_id_flex_num,  

                                                 validation_date        => to_char(SYSDATE,  

                                                                                   apps.fnd_flex_ext.DATE_FORMAT),  

                                                 concatenated_segments  => x_concatenated_seg);

    2: fnd_flex_keyval.validate_segs('CREATE_COMBINATION' --'CREATE_COMB_NO_AT'

                                       ,'SQLGL'

                                        ,'GL#'

                                        ,lv_chart_of_accounts_id

                                        ,lv_concatenated_segments);



FND_KEY_FLEX.Define() 定义弹性域
FND_FLEX_EXT.GET_SEGS() 获取科目节段组合
fnd_flex_ext.get_ccid() 获取ID
FND_FLEX_KEYVAL.validate_ccid验证ccid的有效性
FND_FLEX_KEYVAL.concatenated_descriptions 得到ccid的描述
FND_KEY_FLEX.Update_Definition()

Thursday, April 22, 2021

Startup and Shutdown modes in Oracle

 

Startup and Shutdown modes in Oracle 

In this article we will discuss different STARTUP and SHUTDOWN MODES.

Startup Modes :

  • Startup nomount
  • Startup mount
  • Open 
  • Startup restrict
  • Startup force
  • Startup suspend 

 

Before reading article please check below image

 

Startup Nomount :

  • Oracle open and reads spfile or pfile
  • Instance gets created (SGA+BP)
  • We can create a database
  • We can recreate controlfile
  • Based on the values from pfile or spfile  oracle will allocate the sga in the RAM and start the background processes.

 

How to open in nomount state

STARTUP MOUNT :

  • Oracle opens and read control file
  • We can perform recovery’s
  • We can enable ALM(Archive log  mode)
  • We can enable FDBD(Flashback database)

 

Note : Mount is also known as “’Maintenance state” .

To mount a database directly from shutdown state we issue

To mount a database from a started state (nomount state)

1.The mount state is used to recover a database that has crashed due to media failure.

2.The mount state is also used by the dba to enable archiver process.
3.it is also used by the dba to create a standby controlfile for configuring a standby database using dataguard.

 

OPEN STATE :

  • Database completely opens , where end users connect and perform all transactions
  • While moving from mount state to open state Oracle perform “SANITY CHECKING ”
  • According to the controlfile information oracle check for physical existence of files and checks for the synchronization SCN#(SYSTEM CHANGE NUMBER) Which is known as “Sanity checking”

 

  • Incase the scns are not matched that means that the database is in an inconsistent state due to improper shutdown previously.
    In this case oracle will try to recover the database with automatic crash recovery, if that also fails then oracle will ask the dba to manually recover the datbase using media recovery methods.

 

We can open an already mounted database by below command.

We can directly go from a shut database to an open database by typing below command.

Startup Restrict:

If we start an oracle database in restricted mode then only those users who have restricted session privilege will be able to connect to the database.

Suspending a database:

If we want to suspend all i/o operations.

Startup mount restrict:

This mode has been introduced from oracle 10g onwards. If we want to drop the database then we mount the db it in this mode.

*the nomount state is used by the dba to create a new oracle database.
*the mount state is used by the dba to perform recovery
*the open state is used by the dba and programmers to work with the database in a normal way.

 

Shutdown modes in oracle:

  • Shutdown /shut/shutdown normal 
  • Shutdown Transnational
  • Shutdown immediate 
  • Shutdown abort  

 

Shutdown /shut/shutdown normal  :

  • New connections are not allowed 
  • Connected user can perform ongoing transaction
  • Idle sessions will not  disconnected 
  • When connected users’s logout manually then the database gets shutdown.
  • It is also graceful shutdown, So it doesn’t require ICR in next startup. 
  • A common scn number will be updated to controlfiles and datafiles before the database shutdown.

 

Shutdown Transnational :

  • New connections are not allowed 
  • Connected user can perform ongoing transaction
  • Idle sessions will be  disconnected 
  • The database gets shutdown once ongoing tx’s gets completed(commit/rollback)
  • Hence, It is also graceful shutdown, So it doesn’t require ICR in next startup.

 

Shutdown immediate :

  • New connections are not allowed 
  • Connected uses can’t perform ongoing transaction
  • Idle sessions will be  disconnected 
  • Oracle performs rollback’s the ongoing tx’s(uncommitted)  and database gets shutdown.
  • A common scn number will be updated to controlfiles and datafiles before the database shutdown.
  • Hence, It is also graceful shutdown, So it doesn’t require ICR in next startup.

 

Shutdown  Abort :

  • New connections are not allowed 
  • Connected uses can’t perform ongoing transaction
  • Idle sessions will be  disconnected 
  • Db gets shutdown abruptly(NO Commit /No Rollback)
  • Hence, It is abrupt  shutdown, So its  require ICR in next startup.

 

STARTUP FORCE :

Startup force is a combination  of shutdown (abort + startup).