Monday, May 23, 2016

How to trigger a Request set from backend

How to submit / launch a concurrent request set from backend
submit concurrent request set from backend
I always had a doubt as how to call a concurrent request set from backend. I got this useful material while googling. So taught of sharing with you ppl. Hope you will enjoy.


When programmatically launching a request set, base it on the following skeleton code. Couple of points to note first:
  1. When a concurrent program has parameters, you must pass a value (or null) for each parameter that is on the Concurrent Program Definition - it is NOT the parameters that you see in the Request Set Definition as ones that are not displayed cannot be seen there, but pro-grammatically are required.
  2. Default values that are set up in the concurrent program definition, or the request set definition are not calculated for you - you must pass them in pro-grammatically.
  3. ALL stages of the request set must be pro grammatically dealt with - failure to do so will prevent the request set from running and you will not see ANY of it (the request set is effectively rolled back).
  4. The values of the parameters that you pass must correspond to the values seen in the Parameters field in the Requests Windows, when you manually launch the job.

APIs that are required to identify the Request set and set the over all context:
  
FND_SUBMIT.SET_MODE

      Syntax:

         function FND_SUBMIT.SET_MODE( db_trigger IN boolean)
         return boolean;


      Description:

         Call this function before calling FND_SUBMIT.SET_REQUEST_SET
         from a database trigger. Note that a failure in the database
         trigger call of FND_SUBMIT.SUBMIT_SET does not rollback changes.

      Arguments:

         db_trigger       Set to TRUE if request set is submitted from a
                          database trigger.


  FND_SUBMIT.SET_REL_CLASS_OPTIONS

      Syntax:    function FND_SUBMIT.SET_REL_CLASS_OPTIONS
                 (application     IN varchar2 default NULL,
                  class_name      IN varchar2 default NULL,
                  cancel_or_hold  IN varchar2 default 'H',
                  stale_date      IN varchar2 default NULL)
                 return boolean;

      Description:

         Call this function before calling FND_SUBMIT.SET_REQUEST_SET
         to use the advanced scheduling. If both set_rel_class_options
         and set_repeat_options were set then set_rel_class_options will
         take the percedence. Returns TRUE on succesful completion, and
         FALSE otherwise.


      Arguments:

         application      Short name of the application associated with
                          the   release class.
         class_name       Developer name of the release class.
         cancel_or_hold   cancel or hold flag.
         stale_date       Cancel this request on or after this time if
                          the request not run.

   
  FND_SUBMIT.SET_REPEAT_OPTIONS

      Syntax:  function FND_SUBMIT.SET_REPEAT_OPTIONS
                        (repeat_time        IN varchar2 default NULL,
                         repeat_interval    IN number   default NULL,
                         repeat_unit        IN varchar2 default 'DAYS',
                         repeat_type        IN varchar2 default 'START',
                         repeat_end_time    IN varchar2 default NULL)
               return boolean;

      Description:

         Optionally call before submitting a concurrent request set to
         set repeat options. If both set_rel_class_options and
         set_repeat_options were set then set_rel_class_options will
         take the percedence.Returns TRUE on succesful
         completion, and FALSE otherwise.


      Arguments:

         repeat_time         - Time of day at which it has to be repeated  
         repeat_interval     - Frequency at which it has to be repeated.
                               This will be used/applied only when
                               repeat_time is NULL
         repeat_unit         - Unit for repeat interval. Default is
                               DAYS. MONTHS/DAYS/HOURS/MINUTES
         repeat_type         - Apply repeat interval from START or
                               END of request default is START. START/END
         repeat_end_time     - Time at which the repetition should be
                               stopped


  FND_SUBMIT.SET_REQUEST_SET *

      Syntax:   function FND_SUBMIT.SET_REQUEST_SET
                         (application                IN VARCHAR2,
                          request_set                IN VARCHAR2)
                return  boolean;

      Description:

         This function will set the request set context. Call this
         function at very beginning of the submission of a concurrent
         request set transaction. Call this function after calling the
         optional functions SET_MODE, SET_REL_CLASS_OPTIONS,
         SET_REPEAT_OPTIONS. It returns TRUE on sucessful completion,
         and FALSE otherwise.

      Arguments:

         request_set           The short name of the request set
                               (developer name of the request set)
         application           The short name of the application that owns
                               the request set.


APIs to set Request set programs and their attributes:


  FND_SUBMIT.SET_PRINT_OPTIONS

      Syntax:    function FND_SUBMIT.SET_PRINT_OPTIONS
                          (printer           IN varchar2  default NULL,
                           style             IN varchar2  default NULL,
                           copies            IN number    default NULL,
                           save_output       IN boolean   default TRUE,
                           print_together    IN varchar2  default 'N')
                 return boolean;

      Description:

         Called before submitting request if the printing of output
         has to be controlled with specific printer/style/copies etc.,
         Optionally call for each program in the request set. Returns
         TRUE on sucessful completion, and FALSE otherwise.


      Arguments:

         printer        - Printer name where the request o/p should be sent
         style          - Print style that needs to be used for printing
         copies         - Number of copies to print
         save_output    - Should the output file be saved after printing
                          Default is TRUE.TRUE/FALSE
         print_together - Applies only for sub requests. If 'Y',
                          output will not be printed until all the sub
                          requests complete. Default is 'N'. ( Y/N )
   

  FND_SUBMIT.ADD_PRINTER

      Syntax: function FND_SUBMIT.ADD_PRINTER
                       (printer IN varchar2 default null,
                        copies  IN number   default null)
              return boolean;

      Description:

         Called after set print options to add a printer to the print
         list.Optionally call for each program in the request set.
         Returns TRUE on sucessful completion, and FALSE otherwise


      Arguments:

         printer     -  Printer name where the request o/p should be sent
         copies      -  Number of copies to print


  FND_SUBMIT.ADD_NOTIFICATION

      Syntax: function FND_SUBMIT.ADD_NOTIFICATION (user IN varchar2)
              return boolean;

      Description:

         Called before submission to add a user to the notify list.
         Optionally call for each program in the reques set. Returns
         TRUE on sucessful completion, and FALSE otherwise.


      Arguments:

         User                  -            User name.
   

  FND_SUBMIT.SET_NLS_OPTIONS

      Syntax: function FND_SUBMIT.SET_NLS_OPTIONS
                       (language  IN varchar2 default NULL,
                        territory IN varchar2 default NULL)
              return boolean;

      Description:

         Called before submitting request to set request attributes.
         Optionally call for each program in the request set. Returns
         TRUE on sucessful completion, and FALSE otherwise.


      Arguments:

         implicit    - nature of the request to be submitted
                       NO/YES/ERROR/WARNING
         protected   - Is the request protected against updates YES/NO
                       Default is NO
         language    - NLS language
         territory   - Language territory
   

  FND_SUBMIT.SUBMIT_PROGRAM *

      Syntax:    function FND_SUBMIT.SUBMIT_PROGRAM
                          (application            IN varchar2,
                           program              IN varchar2,
                           stage                   IN varchar2,
                           argument1, ....argument100)
                 return boolean;

      Description:

         Call FND_SUBMIT.SET_REQUEST_SET function before calling this
         function to set the context for the report set submission.
         Before calling this function you may want to call the optional
         functions SET_PRINT_OPTIONS, ADD_PRINTER, ADD_NOTIFICATION,
         SET_NLS_OPTIONS. Call this (submit_program) function for each
         program (report) in the request set. You must call
         set_request_set before calling this function. You have to call
         set_request_set only once for all the submit_program
         calls for that request set.

         This function returns TRUE on successful completion, and FALSE
         otherwise.

      Arguments:

         application     Short name of the application associated with
                         the program with in a report set
         program         Name of the program with in the report set.
         stage           Name of the stage that the program belongs to
                         (developer name of the stage).
         argument1..100  Arguments for the program.


API to submit Request Set:


  FND_SUBMIT.SUBMIT_SET *

      Syntax:    function FND_SUBMIT.SUBMIT_SET
                          (start_time     IN varchar2 default null,
                           sub_request   IN boolean default FALSE)
                 return integer;

      Description:

         Call this function to submit the request set which is set by
         using the SET_REQUEST_SET.  If the Request set submission is
         successfully, this function returns the concurrent request ID;
         otherwise; it returns 0.


      Arguments:

         start_time   Time at which the request should start running,
                      formated as HH24:MI or HH24:MI:SS.
         sub_request  Set to TRUE if the request is submitted from
                      another request and should be treated as a sub-request.


         Call this function before calling FND_SUBMIT.SET_REQUEST_SET
         from a database trigger. Note that a failure in the database
         trigger call of FND_SUBMIT.SUBMIT_SET does not rollback changes.

      Arguments:

         db_trigger       Set to TRUE if request set is submitted from a
                          database trigger.


Examples for Request Set submission:

l_action := 'Launching Request Set';
DBMS_OUTPUT.PUT_LINE(l_action);
l_ok := fnd_submit.set_request_set
(application => 'XX'
,request_set => 'XX_SAMPLE'
);
-- ------------------------------------
-- Stage 1 with 2 requests in the stage
-- -----------------------------------
IF l_ok AND l_success = 0 THEN
-- ----------------------------------------------------
-- SQL*Load the Ship To Addresses
-- ----------------------------------------------------
l_action := '1st job - 1st stage 1st request';
DBMS_OUTPUT.PUT_LINE(l_action);
l_ok := fnd_submit.submit_program
(application => 'XX'
,program => 'XX_CONC_PROG1'
,stage => 'RS_STAGE_10'
,argument1 => 'conc prog params here'
); 
ELSE
l_success := -100;
END IF;
IF l_ok AND l_success = 0 THEN
-- ----------------------------------------------------
-- SQL*Load the Invoices
-- ----------------------------------------------------
l_action := '2nd job - 1st stage 2nd request';
DBMS_OUTPUT.PUT_LINE(l_action);
l_ok := fnd_submit.submit_program
(application => 'XX'
,program => 'XX_CONC_PROG2'
,stage => 'RS_STAGE_10'
,argument1 => 'conc prog params here'
); 
ELSE
l_success := -110;
END IF;
-- --------------------------------------
-- New stage with 1 request
-- --------------------------------------
IF l_ok AND l_success = 0 THEN
l_action := '3rd job - 2nd stage 1st request';
DBMS_OUTPUT.PUT_LINE(l_action);
l_ok := fnd_submit.submit_program
(application => 'XX'
,program => 'XX_CONC_PROG3'
,stage => 'RS_STAGE_20'
,argument1 => 'conc prog params here'
); 
ELSE
l_success := -120;
END IF;
-- --------------------------------------
-- New stage with 1 request with LOTS of
-- parameters
-- --------------------------------------
IF l_ok AND l_success = 0 THEN
l_action := '4th job - 3rd stage 1st request';
DBMS_OUTPUT.PUT_LINE(l_action);
l_ok := fnd_submit.submit_program
(application => 'AR'
,program => 'RAXMTR'
,stage => 'INV_INTERIM_60'
,argument1 => '1'
,argument2 => TO_CHAR(l_batch_source_id)
,argument3 => 'MP KRYTON'
,argument4 => TO_CHAR(TRUNC((SYSDATE - 0.5)),'RRRR/MM/DD HH24:MI:SS')
,argument5 => NULL
,argument6 => NULL
,argument7 => NULL
,argument8 => NULL
,argument9 => NULL
,argument10 => NULL
,argument11 => NULL
,argument12 => NULL
,argument13 => NULL
,argument14 => NULL
,argument15 => NULL
,argument16 => NULL
,argument17 => NULL
,argument18 => NULL
,argument19 => NULL
,argument20 => NULL
,argument21 => NULL
,argument22 => NULL
,argument23 => NULL
,argument24 => NULL
,argument25 => 'Y'
,argument26 => NULL
,argument27 => fnd_profile.VALUE('ORG_ID')
); 
ELSE
l_success := -145;
END IF;
-- -----------------------------------------------
-- All requests in the set have been submitted now
-- -----------------------------------------------
IF l_ok AND l_success = 0 THEN
-- ----------------------------------------------------
-- Run the job and then wait until all requests
-- have completed processing - we have to wait because
-- when we exit here the file is moved to a different
-- directory.
-- ----------------------------------------------------
l_request_id := fnd_submit.submit_set(NULL,FALSE);
DBMS_OUTPUT.PUT_LINE('Request_id = '||l_request_id);
COMMIT;
l_complete := fnd_concurrent.wait_for_request 
(request_id => l_request_id
,INTERVAL => 2
,max_wait => 120
,phase => l_phase
,status => l_status
,dev_phase => l_dev_phase
,dev_status => l_dev_status
,message => l_message
);
ELSE
l_success := -150;
END IF;
IF l_success = 0 THEN
p_success := l_request_id; 
ELSE
DBMS_OUTPUT.PUT_LINE('Error: '||l_success||' - Problem with '||l_action);
p_success := l_success;
END IF;

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

 XML report publisher concurrent program from backend.
XML report publisher
At times you might need to take the xml output of an existing program and apply an XML Publisher / BI Publisher Template to

it. The standard use case is if the output is generated by pro*c code/ a spawned or host concurrent program. The XML Report

Publisher concurrent program can help achieve this.

The Report takes the Concurrent request id, template application id, template name, template locale, template type and

output type as parameters.

A sample piece of code is shown below.

DECLARE
  l_req_id NUMBER;
BEGIN
  fnd_global.apps_initialize(6087,
                             20420,
                             1,
                             0);
  l_req_id := fnd_request.submit_request('XDO',
                                         'XDOREPPB',
                                         NULL,
                                         NULL,
                                         FALSE,
                                         FND_GLOBAL.CONC_REQUEST_ID,
                                         1919318,
                                         20003, -- Receivables
                                         'XXGILGMDWOPICKLIST', -- Statement Generate
                                         'en-US', -- English
                                         'N',
                                         'RTF',
                                         'PDF');
  dbms_output.put_line(l_req_id);
     commit;
END;



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

 Submitting Concurrent Program from Back-end
We first need to initialize oracle applications session using:

fnd_global.apps_initialize(user_id,responsibility_id,application_responsibility_id)
and then run fnd_request.submit_request

If you are directly running from the database using the TOAD, SQL NAVIGATOR or SQL*PLUS etc. Then you need to initialize

the Apps. In this case use the above API to Initialize the APPS.

DECLARE
  l_request_id NUMBER(30);

BEGIN


 FND_GLOBAL.APPS_INITIALIZE (user_id => 1318, resp_id => 59966, resp_appl_id => 20064);

  l_request_id:= FND_REQUEST.SUBMIT_REQUEST
('XXMZ' --Application Short name,
 'VENDOR_FORM'-- Concurrent Program Short Name );
                       
  DBMS_OUTPUT.PUT_LINE(l_request_id);
  commit;
END;

**************************************************************
If you are using same code in some procedure and running directly from application then you don't need to initialize. Then

you can comment the fnd_global.apps_initialize API.

DECLARE
l_success NUMBER;
BEGIN
BEGIN

fnd_global.apps_initialize( user_id => 2572694, resp_id => 50407, resp_appl_id => 20003);

l_success :=
fnd_request.submit_request
('XXAPP', -- Application Short name of the Concurrent Program.
'XXPRO_RPT', -- Program Short Name.
'Program For testing the backend Report', -- Description of the Program.
SYSDATE, -- Submitted date. Always give the SYSDATE.
FALSE, -- Always give the FLASE.
'1234' -- Passing the Value to the First Parameter of the report.
);
COMMIT;

-- Note:- In the above request Run, I have created the Report, which has one parameter.

IF l_success = 0
THEN
-- fnd_file.put_line (fnd_file.LOG, 'Request submission For this store FAILED' );
DBMS_OUTPUT.PUT_LINE( 'Request submission For this store FAILED' );
ELSE
-- fnd_file.put_line (fnd_file.LOG, 'Request submission for this store SUCCESSFUL');
DBMS_OUTPUT.PUT_LINE( 'Request submission For this store SUCCESSFUL' );
END IF;

END;

Note: If you are running directly from database, use DBMS API to display. If you are running directly from application,

then Use the fnd_file API to write the message in the log file.

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

 How to submit a concurrent program from pl sql
How to submit a concurrent program from backend:
Using FND_REQUEST.SUBMIT_REQUEST function & by passing the required parameters to it we can submit a concurrent program

from backend.
But before doing so, we have to set the environment of the user submitting the request.

We have to initialize the following parameters using FND_GLOBAL.APPS_INITIALIZE procedure:
           ·                                 USER_ID
           ·                                 RESPONSIBILITY_ID
           ·                                 RESPONSIBILITY_APPLICATION_ID


Syntax:
FND_GLOBAL.APPS_INITIALIZE:
procedure APPS_INITIALIZE(user_id in number,
                                      resp_id in number,
                                      resp_appl_id in number);


FND_REQUEST.SUBMIT_REQUEST:
REQ_ID := FND_REQUEST.SUBMIT_REQUEST ( application => 'Application Name', program => 'Program Name', description => NULL,

start_time => NULL, sub_request => FALSE, argument1 => 1 argument2 => ....argument n );

Where, REQ_ID is the concurrent request ID upon successful completion.
And concurrent request ID returns 0 for any submission problems.

Example:
First get the USER_ID and RESPONSIBILITY_ID by which we have to submit the program:

SELECT USER_ID,
RESPONSIBILITY_ID,
RESPONSIBILITY_APPLICATION_ID,
SECURITY_GROUP_ID
FROM FND_USER_RESP_GROUPS
WHERE USER_ID = (SELECT USER_ID
                             FROM FND_USER
                             WHERE USER_NAME = '&user_name')
AND RESPONSIBILITY_ID = (SELECT RESPONSIBILITY_ID
                                      FROM FND_RESPONSIBILITY_VL
                                      WHERE RESPONSIBILITY_NAME = '&resp_name');


Now create this procedure
CREATE OR REPLACE PROCEDURE APPS.CALL_RACUST (p_return_code OUT NUMBER,
                                                                         p_org_id NUMBER, -- This is required in R12
                                                                         p_return_msg OUT VARCHAR2)
IS
v_request_id VARCHAR2(100) ;
p_create_reciprocal_flag varchar2(1) := 'N'; -- This is value of create reciprocal customer
                                                  -- Accounts parameter, defaulted to N
BEGIN


-- First set the environment of the user submitting the request by submitting
-- Fnd_global.apps_initialize().
-- The procedure requires three parameters
-- Fnd_Global.apps_initialize(userId, responsibilityId, applicationId)
-- Replace the following code with correct value as get from sql above

Fnd_Global.apps_initialize(10081, 5559, 220);

v_request_id := APPS.FND_REQUEST.SUBMIT_REQUEST('AR','RACUST','',
                                                       '',FALSE,p_create_reciprocal_flag,p_org_id,
                                                        chr(0) -- End of parameters);

p_return_msg := 'Request submitted. ID = ' || v_request_id;
p_return_code := 0; commit ;


EXCEPTION

when others then
          p_return_msg := 'Request set submission failed - unknown error: ' || sqlerrm;
          p_return_code := 2;
END;


Output:
DECLARE
V_RETURN_CODE NUMBER;
V_RETURN_MSG VARCHAR2(200);
V_ORG_ID NUMBER := 204;
BEGIN
CALL_RACUST(
P_RETURN_CODE => V_RETURN_CODE,
P_ORG_Id => V_ORG_ID,
P_RETURN_MSG => V_RETURN_MSG
);
DBMS_OUTPUT.PUT_LINE('V_RETURN_CODE = ' || V_RETURN_CODE);
DBMS_OUTPUT.PUT_LINE('V_RETURN_MSG = ' || V_RETURN_MSG);
END;


If Return Code is 0(zero) then it has submitted the Customer Interface program successfully and the request id will appear

in Return Message as :
V_RETURN_CODE = 0
V_RETURN_MSG = Request submitted. ID = 455789


How to submit xml reports concurrent Request set from backend?
As per my knowledge when publishing this post xml templates are not attaching when a xml report is triggered via a request set from back end, even though add_layout is added before call to the xml publisher report .

As per Oracle meta link id # Doc ID 756452.1 patch needs to be applied to fix this . 
and works fine for the below version , but how far this will work i am not sure This is under investigation , will keep you posted once i get the info .

  • Oracle E-Business Suite 11i:
    • FNDRSRUN.fmb 115.172
  • Oracle E-Business Suite Release 12.0:
    • FNDRSRUN.fmb 120.29.12000000.6





How to find Oracle Apps form(fmb/fmx) version?

Question:
How to find Oracle Apps form (.fmb / .fmx) version?

Answer:
1. Goto the respective Product TOP (Eg. FND_TOP, AP_TOP etc.)
2. Navigate to forms/US
3. Use following command. Replace <form_name> with respective form name
strings -a <form_name> | grep Header

For example, if i want the form version of FNDRSRUN.fmx, then
$ cd $FND_TOP/forms/US

$ strings -a FNDRSRUN.fmx | grep Header
@$Header: FNDRSRUN.fmb 115.130 2004/09/22 07:13  jtoruno ship

Friday, April 29, 2016

Oracle Workflow Basics





Oracle Workflow is unique in providing a workflow solution for both internal processes and business process coordination between applications. It automates and streamlines business processes both within and beyond our  enterprise, supporting traditional applications based workflow as well as e-business integration workflow. This technology enables modeling, automation, and continuous improvement of business processes, routing information of any type according to user-defined business rules. Oracle Workflow can route supporting information to each decision maker in a business process, including people both inside and outside our enterprise.

Oracle Workflow Builder is a graphical tool that help us  create, view, or modify a business process with simple drag and drop operations. Using the Workflow Builder,we can create and modify all workflow objects, including activities, item types, and messages etc.

Workflow Components
Depending on the Business process logic we may need to create/modify some or all of the of the following workflow process components.


Item Type
Item Type is a name/identifier of a workflow business process. Any component that we create for a workflow business process must be associated with a particular item type.
when we save our workflow process definition is database it takes the item type as its name. Opening an item type from databse automatically retrieves all the attributes, messages, lookups, notifications, functions and processes associated with that item type.

Example:- Here “Test Leave Workflow” is name of the Leave Approval business process .

Item Attribute
Item Attribute is nothing but global variable that can be accessed/ referenced by any activity within the itemtype. An item attribute often provides/stores information about an item that is necessary for the workflow process to complete. It also help us to share information with the stakeholders of a business process.
There are different types of item attribute:-



a)    Text:- The attribute value is a string of text
Note:- Oracle Workflow does not permit HTML content to be passed in attributes of type text. If Oracle Workflow encounters HTML tags in a text attribute, escape characters will be applied to display the content as plain text rather than executing the HTML.
b)    Number:- The attribute value is a number
c)    Date     :- The attribute value is a date
d)    Lookup : -The attribute value is one of the lookup code values in a specified lookup type.
e)    Form    :- The attribute value is an Oracle Applications internal form function.
f)     URL    :-  The attribute value is a Universal Resource Locator (URL) to a network location. If we  reference a URL attribute in message attribute, the
                     notification, when viewed from the Notification Details Web page or as an HTML-formatted e-mail, displays a link to the URL specified by the
                     URL attribute.
g)    Document:- Document attribute is mainly used to attach document in notification and help stakeholder to see the information. This attribute mainly
                         used for external document integration purpose.The following document types can be used  :-       
                                                            >>  PL/SQL document
                                                            >>  PL/SQL CLOB Document
                                                            >>  PL/SQL BLOB Document


Message & Notification Activity
In our daily life, when we plan to send a letter to anybody, first we write a letter and then we put that inside an envelope, which contain the address of the recipient.

In oracle workflow, Message can be compared with a letter and notification can be compared with envelope. In oracle workflow a message is attached with a notification.




Recipient of the message is known as performer. Here performer needs to be added at notification level, so that workflow engine can understand to whom the notification needs to be delivered.In performer field we need to add  a value(may be dynamic by adding item attribute),so that workflow uniquely identify the  recipient from database.(Username of FND_USER table).




Each message is associated with a particular item type. This allows the message to reference the item type's attributes for token replacement at runtime when the message is delivered. We can create a message with context-sensitive content (dynamic message body) by including message attribute tokens in the message subject and body that reference item type attributes.

Note:- Unlike the real life envelope-letter analogy, here we can attach only a single message(letter) to a notification(envelope).


Function Activity
Function Activity is defined by Pl/SQL stored procedure or other external procedure.Our discussion in oracle workflow will be restricted to Pl/SQL stored procedure only.Function activity helps us to embed our custom business logic applicable to workflow business process.

Example:- We need to examine whether the person has applied for a leave for more than 10 days or less than equal to 10 days.

Conclusion:-
The Key features of Oracle Workflow are
i)The Workflow Engine embedded in the Oracle Database implements process definitions at runtime
ii) oracle uses the Business Event System which is an application service that uses the Oracle Advanced Queuing (AQ) infrastructure to communicate business
    events between systems.
iii)The Workflow Definitions Loader is a utility program tightly integrated with the workflow builder and oracle application. This helps us to download workflow
   definition from database to flat file and upload it to database
iv)Oracle Workflow lets us include our own PL/SQL procedures or external functions as activities in our workflows. Without modifying our application code, you can
    have our own program run whenever the Workflow Engine detects that our program's prerequisites are satisfied.
v)The Notification System sends notifications to and processes responses from users in a workflow. Electronic notifications are routed to a role, which can be an
   individual user or a group of users. Any user associated with that role can act on the notification.
vi)Electronic mail (e-mail) users can receive notifications of outstanding work items and can respond to those notifications using their e-mail application of choice.
   An e-mail notification can include an attachment that provides another means of responding to the notification.
vii)Web users can access a Notification Web page to see their outstanding work items, then navigate to additional pages to see more details or provide a response.


.





Thursday, March 31, 2016

How to retain block position after a query -oracle forms

ISSUE#

On the form I have a scroll bar and a 'delete' button. When an item in the data block is selected, and the 'delete' button is pressed, it deletes the selected item from the database and then executes the data_block query.
By default, this returns the user to the top of the list.
I am trying to navigate to the record just before the one that is deleted from the list.
This can be done using the GO_RECORD(number) Built in Function(BIF) (assuming number is the saved value of :System.cursor_record).
And this is where I run into a problem. The GO_RECORD BIF will bring the record to the top or bottom of the displayed list of items. This can cause the list to shift up 20 items without warning.
i.e. For example Records 23 - 47 from the data_block are being displayed, and record 33 is selected. If record 33 is deleted and we use the function GO_RECORD(32), then the records diplayed will be 32-56 (effectively shifting the list down 9 records).

Solution #
Add this piece of code 
l_top_rec:= GET_BLOCK_PROPERTY('EXP_DETAIL_BLK', TOP_RECORD);
 l_cur_rec:= :SYSTEM.CURSOR_RECORD;

Your code--------------------------
go_block(block_name);
--
first_record;
loop
  exit when GET_BLOCK_PROPERTY(block_name, TOP_RECORD) = l_top_rec;
  next_record;
end loop;
go_record(l_top_rec);
--
loop
  exit when :SYSTEM.CURSOR_RECORD = l_cur_rec or :SYSTEM.LAST_RECORD = 'TRUE';
  next_record;
end loop; 

Wednesday, February 17, 2016

Oracle WMS Setup Navigations

Define Profile Options
Define Mobile User ID

Navigation:
System Administration>Security>User>Define

Define Warehouse

Navigation:
Setup>Warehouse Configuration>Warehouses>Define Warehouses

Define Warehouse Parameters

Enable WMS attribute
  • Serial Control
  • Lot Control
  • LPN Control
  • Crossdocking Information
  • Time Zone
  • Default Cycle Count Header
  • Default Picking Rule
  • Default Put away rule
  • Cartonization Options
  • Default pick task type
  • Default replenishment task type
  • Default Move Order Transaction Type
  • Default Move Order issue Task Type
Navigation:
Setup>Warehouse Configuration>Warehouses>Warehouse Parameter

Receiving Options

Navigation:
Setup>Warehouse Configuration>Warehouses>Receiving Parameters

Define Subinventory Attributes

Navigation:
Setup>Warehouse Configuration>Warehouses>Receiving Parameters

Define Stock Locators Attributes

Units, volume, weight, Dimansions, coordinates

Navigation:
Setup>Warehouse Configuration>Warehouses>Stock Locators

Define Dock Door to Staging Lane Relationships

Navigation:
Setup>Warehouse Configuration>Warehouses>Dock Door to Staging Lane Assignments

Define Shipping Networks

Define the required shipping networks between different warehouses also attach the shipping method if needed

Navigation:
Setup>Warehouse Configuration>Warehouses>Shipping Networks

Define Item Attributes for WMS

Lot, Lot Expiration,Serial controlled, Physical attributes and Material Status

Navigation:
Setup>Material Setup>Items>Master Items

Define Material Statuses

You use this form to setup material status codes that enable you to control the movement and usage of material for portions of on-hand inventory that might have distinct differences

Navigation:
Setup>Transaction Setup>Inventory Transactions>Material Status

Define Lot and Serial Attributes

Navigation:
Setup>Material Setup>Lot/Serial Attributes>Lot/Serial Attributes Descriptive Flexfield>Segments

Define Warehouse Resources

Define all resources here Human, Equipment, etc so that accordingly you can assign tasks to these resources

Navigation:
Setup>Warehouse Configuration>Resources>Resources

Define Equipment Items

Equipment, such as forklifts, pallet jacks, and so on are used to perform tasks in a warehouse.  In WMS, you set up equipment as a serialized item and a resource.  
Users sign on to the serial number of the equipment and are dispatched tasks appropriate to that equipment.
  • Define the equipment as an item
  • Define the item as an equipment type 
  • Specify the equipment as serial controlled (predefined)
  • Enter the equipment capacity (optional)
  • Generate serial numbers for the individual pieces of equipment

Navigation:
Setup>Material Setup>Items>Master Items
Setup>Warehouse Configuration>Resources>Equipment

Define Equipment Serial Numbers

Navigation:
Setup>Inventory Management>Material Maintenance>Generate Serial Numbers

Define Departments

Navigation:
Setup>Warehouse Configuration>Departments & Resources>Departments

Define Transaction Reasons

Navigation:
Setup>Transaction Setup>Inventory Transactions>Transaction Reasons

Define Label Formats

You are setting up the data fields that you want the system to include on a particular label

Navigation:
Setup>Warehouse Configuration>Printing>Define Label Formats

Define Associate Label Formats to Business Flows

Navigation:
Setup> Warehouse Configuration>Printing>Assign Label Types to Business Flows

Assign Labels to Printers

Navigation:
Setup> Warehouse Configuration>Printing>Assign Printers to Documents

Define Cost Groups

Navigation:
Setup>Material Setup>Costs>Cost Groups

Define Account Alias

Navigation:
Setup>Transaction Setup>Inventory Transactions>Define Account Aliases

Define Pick Sliationp Grouping Rules

Setup pick slip grouping rules to specify different ways in which a warehouse might choose to fulfill a group of orders

Navigation:
Setup>Warehouse Configuration>Rules>Pick Wave>Pick Slip Grouping

Define Release Sequence Rules

Navigation:
Setup>Warehouse Configuration>Rules>Pick Wave>Release Sequence

Define Release Rules

Navigation:
Setup>Warehouse Configuration>Rules>Pick Wave>Release Rules

Define Container Types

Before you set up cartonization and container items, you should verify that the appropriate container types exist.  Container types represent the codes that you assign to various containers, such as boxes, bins and pallets.  The WMS system comes pre-seeded with a variety of container types but the system also enables you to set up your own

Navigation:
Setup>Material Setup>Items>Container Types

Define Container Items

Containers can be defined as item
Navigation:
Setup>Material Setup>Items>Master Items

Define Cartonization Groups

Inventory class categories can be defined for this
Navigation:
Setup>Material Setup>Items>Categories>Category Codes

Define Cartonization Category Sets

Navigation:
Setup>Material Setup>Items>Categories>Category Sets

Define Container Item Relationship

Navigation:
Setup>Material Setup>Items>Define Container Item Relationship

Define Shipping Parameters

Navigation:
Setup>Warehouse Configuration>Warehouses>Shipping Parameters

Define Task Types

For each unique combination of human and equipment resourses, a new task type should have been defined.

Navigation:
Setup>Warehouse Configuration>Tasks>Standard Task Types

Define Task Type Assignment Rules

To define rules for Cost Group Assignments, Label Format, Pick, Put Away and Task Type assignments.

Navigation:
Setup>Warehouse Configuration>Rules>Warehouse Execution>Rules

Define Warehouse Strategy

A strategy is an ordered sequence of rules that the system uses to fulfill complex business demands. The rules strategy are selected in sequence until the put away or picking task is fully allocated, or until a cost group that meets the restriction is found. When you define strategies, you also specify the date or range of dates on which the strategy is effective. You also specify whether you want the system to execute a strategy, if it can only successfully execute part of that strategy.

Navigation:
Setup>Warehouse Configuration>Rules>Warehouse Execution>Strategies

Define Warehouse Rules Workbench

Add the strategies here in a sequence with required parameter values to execute in required sequence.

Navigation:
Setup>Warehouse Configuration>Rules>Warehouse Execution>Rules Workbench

Define MWA Personalization Framework

To customize any mobile pages, any fileds in there, you can use this to customize
Navigation:
Setup>MWA Personalization Framework