Tuesday, August 22, 2017

Query to find current running SQL for given Concurrent Program

SELECT a.address,
  s.status,
  s.username,
  s.osuser,
  a.sql_text,
  s.SID
FROM v$sql a,
  v$session s
WHERE s.sql_address = a.address
AND s.SID          IN
  (SELECT d.SID
  FROM apps.fnd_concurrent_requests a,
    apps.fnd_concurrent_processes b,
    v$process c,
    v$session d
    --v$sql e
  WHERE a.controlling_manager = b.concurrent_process_id
  AND c.pid                   = b.oracle_process_id
  AND d.paddr                 = c.addr
    --AND d.sql_address = e.address
  AND a.request_id = 10803707 (provide the actual request id)
  and a.PHASE_CODE = 'R'
  )

Query to find Indexed Column names in table

SELECT c.index_name, i.uniqueness, c.column_name
FROM   user_indexes i, user_ind_columns c
WHERE  i.index_name = c.index_name
  AND  i.table_name = UPPER(:P_TABLE_NAME)
ORDER  BY c.index_name, c.column_position;

Tuesday, November 1, 2016

What is hold in OM ? What are the types of Holds in Order Management.

A Hold is to stop an order, return, order line, or return line from continuing to progress through its life cycle.
A Hold can be applied manually to a specific order by querying the order and then selecting the apply holds screen or can be applied automatically based on set of  criteria defined by the user (Hold source setup). User can define as many different Holds based on the business needs of the user/ company.
User can not apply a hold if the order has been pick released.
Types of Holds in Order Management
Credit Check Hold
    Order Entry performs an automatic credit check on the active customers, based on credit rules and credit limits defined by the user in your system. You can set credit limits for a total of all the customer's orders and of individual order amounts.
General Services Administration (GSA) Violation Hold
       The GSA hold ensures that a specific group of customers always receives the best pricing.
Configurations Holds
    If the configuration is invalid this hold will be applied on the order to prevent further processing.





Sunday, September 20, 2015

How to progress Errored workflow using back end api

DECLARE
   CURSOR c1
   IS
     SELECT c.INSTANCE_LABEL,a.line_id
        FROM oe_order_lines_all a,
        apps.wf_item_activity_statuses b,
        apps.wf_process_activities c
       WHERE header_id = 602953547
       and b.item_key = to_char(a.line_id)
       and b.item_type ='OEOL'
       and b.activity_status='ERROR'
       and b.process_activity = c.instance_id;

BEGIN
   FOR c1_rec IN c1
   LOOP
      wf_engine.handleerror (
         'OEOL',
         TO_CHAR (c1_rec.line_id),
         C1_REC.INSTANCE_LABEL,
         'RETRY',
         NULL
      );
   END LOOP;
   commit;
EXCEPTION
   WHEN OTHERS
   THEN
      DBMS_OUTPUT.put_line (SQLERRM);
END;

Wednesday, July 22, 2015

How to release the Hold automatically when it reaches the hold until date

If any of the user enters the Hold Until date while applying the Hold then the hold should be released automatically when it reaches to the Hold Until Date. 

The below concurrent program should be scheduled based on the requirement. So that the program will check are there any holds which are reached hold until date and ready to release the holds. 

Concurrent Program Name : Release Expired Hold

Friday, March 13, 2015

How to raise business event manually using script

DECLARE
   l_event_name             VARCHAR2 (240)
                                  := 'oracle.apps.ont.genesis.outbound.update';
   l_event_parameter_list   wf_parameter_list_t := wf_parameter_list_t ();

BEGIN
      wf_event.addparametertolist (
         p_name=> 'HEADER_ID',
         p_value=> '96567456745',
         p_parameterlist=> l_event_parameter_list
      );
      wf_event.addparametertolist (
         p_name=> 'LINE_ID',
         p_value=> '865875768',
         p_parameterlist=> l_event_parameter_list
      );
      wf_event.addparametertolist (
         p_name=> 'HOLD_SOURCE_ID',
         p_value=>'54326456',
         p_parameterlist=> l_event_parameter_list
      );
      wf_event.addparametertolist (
         p_name=> 'CHANGE_TYPE',
         p_value=> 'APPLY',
         p_parameterlist=> l_event_parameter_list
      );

      BEGIN
         wf_event.RAISE (
            p_event_name=> l_event_name,
            p_event_key=> SYS_GUID (),
            p_parameters=> l_event_parameter_list
         );
      EXCEPTION
         WHEN OTHERS
         THEN
            DBMS_OUTPUT.put_line (
                  ' Unexpected Error  : '
               || SUBSTR (SQLERRM, 1, 250)
            );
      END;


   COMMIT;
   l_event_parameter_list.DELETE;
EXCEPTION
   WHEN OTHERS
   THEN
      DBMS_OUTPUT.put_line (
            ' Unexpected Error in main  block  : '
         || SUBSTR (SQLERRM, 1, 250)
      );
END;

Thursday, January 8, 2015

Concurrent Request Status Codes

Concurrent Request Status Codes:

SELECT LOOKUP_CODE STATUS_CODE, MEANING
 FROM FND_LOOKUP_VALUES
 WHERE LOOKUP_TYPE = 
'CP_STATUS_CODE'
   AND ENABLED_FLAG = 
'Y'
   AND VIEW_APPLICATION_ID = 
0
ORDER BY LOOKUP_CODE;

STATUS_CODE
MEANING
A
Waiting
B
Resuming
C
Normal
D
Cancelled
E
Error
G
Warning
H
On Hold
I
 Normal
M
No Manager
P
Scheduled
Q
Standby
R
  Normal
S
Suspended
T
Terminating
U
Disabled
W
Paused
X
Terminated
Z
 Waiting

Concurrent Request Phase Codes:

SELECT LOOKUP_CODE PHASE_CODE, MEANING
 FROM FND_LOOKUP_VALUES
 WHERE LOOKUP_TYPE = 
'CP_PHASE_CODE'
   AND ENABLED_FLAG = 
'Y'
   AND VIEW_APPLICATION_ID = 
0
ORDER BY PHASE_CODE;

STATUS_CODE
MEANING
C
Completed
I
Inactive
P
Pending
R
Running

Monday, December 15, 2014

How to find the inbound and out bound mailer details

SELECT b.component_name,
c.parameter_name,
a.parameter_value
FROM apps.fnd_svc_comp_param_vals a,
apps.fnd_svc_components b,
apps.fnd_svc_comp_params_b c
WHERE b.component_id = a.component_id
AND b.component_type = c.component_type
AND c.parameter_id = a.parameter_id
AND c.encrypted_flag = 'N'
AND b.component_name like '%Mailer%'
AND c.parameter_name in ('INBOUND_SERVER','OUTBOUND_SERVER', 'REPLYTO')
ORDER BY c.parameter_name;

Sunday, November 23, 2014

Concurrent Request Status and Phase Codes

Concurrent Request Status and Phase Codes

Concurrent Request Status Codes:

SELECT LOOKUP_CODE STATUS_CODE, MEANING
 FROM FND_LOOKUP_VALUES
 WHERE LOOKUP_TYPE = 
'CP_STATUS_CODE'
   AND ENABLED_FLAG = 
'Y'
   AND VIEW_APPLICATION_ID = 
0
ORDER BY LOOKUP_CODE;

STATUS_CODE
MEANING
A
Waiting
B
Resuming
C
Normal
D
Cancelled
E
Error
G
Warning
H
On Hold
I
 Normal
M
No Manager
P
Scheduled
Q
Standby
R
  Normal
S
Suspended
T
Terminating
U
Disabled
W
Paused
X
Terminated
Z
 Waiting

Concurrent Request Phase Codes:

SELECT LOOKUP_CODE PHASE_CODE, MEANING
 FROM FND_LOOKUP_VALUES
 WHERE LOOKUP_TYPE = 
'CP_PHASE_CODE'
   AND ENABLED_FLAG = 
'Y'
   AND VIEW_APPLICATION_ID = 
0
ORDER BY PHASE_CODE;

STATUS_CODE
MEANING
C
Completed
I
Inactive
P
Pending
R
Running

Tuesday, November 4, 2014

checking the Environment Variable from back end query

SELECT variable_name,
  VALUE
FROM apps.fnd_env_context
WHERE concurrent_process_id =
  (SELECT MAX(concurrent_process_id) FROM apps.fnd_env_context
  )
ORDER BY variable_name;