Thursday, 24 March 2016

Delete XML Publisher Data Definition and Template

Delete XML Publisher Data Definition and Template

The Problem:

In XML Publisher Administrator responsibility, both Data Definition and Template page don’t provide an option to delete data definition or template. Once created, you can’t even change the following:
  • Data Definition Code
  • Data Definition Application
  • Template Code
  • Template Application
  • Template Type
Due to some typo error or to give some more meaningful name as per the standards, you can’t change those fields later. Also you can’t delete them too. Oracle recommends to disable them by giving an end date. But many developers don’t like to leave the wrong stuff in the system. They better like to delete them and freshly recreate them.

Why Oracle has done that way?

The reason is that: concurrent program with XML output matches the Short Name with the template Code to find out which XML Publisher template to use for post processing. If you delete this template, the Post Processor cannot find the template, and then give errors. So it is always better not to give an option to update or delete.

The Workaround:

It is always recommended to go for this workaround in development instances and NOT in any production or UAT instance. After making the Data Definition and Template perfect in dev instance, you can always migrate them to production via FNDLOAD and XDOLOADER utilities.
Before the workaround, let’s look at the main tables that store the information of the Data Definitions and Templates.
  • XDO_DS_DEFINITIONS_B: table for storing data source definition represented by XML Schema Definition (XSD). Each data source has one or more elements, and this information are stored in XDO_DS_ELEMENTS_B.
  • XDO_DS_DEFINITIONS_TL: translation table for XDO_DS_DEFINITIONS_B.
  • XDO_LOBS: This table is used for storing locale (language and territory) sensitive binary and text files. It is mainly used for storing language layout templates.
  • XDO_CONFIG_VALUES: stores the values of XML Publisher configuration properties entered from the Oracle Applications interface.
  • XDO_TEMPLATES_B: table for template information. Each template has a corresponding data source definition stored in the XDO_DS_DEFINITIONS_B. Each translation of a certain template, not each template, has a corresponding physical template file. The physical template file information is stored in the XDO_LOBS.
  • XDO_TEMPLATES_TL: translation table for XDO_TEMPLATES_B. 
Queries for Data Definitions:

SELECT *
  FROM XDO_DS_DEFINITIONS_B
WHERE DATA_SOURCE_CODE = 'XX_DATA_DEF_CODE';
 
SELECT *
  FROM XDO_DS_DEFINITIONS_TL
WHERE DATA_SOURCE_CODE = 'XX_DATA_DEF_CODE';
 
SELECT *
  FROM XDO_LOBS
WHERE LOB_CODE = 'XX_DATA_DEF_CODE';
 
SELECT *
  FROM XDO_CONFIG_VALUES
WHERE DATA_SOURCE_CODE = 'XX_DATA_DEF_CODE';
 
Delete the Data Definitions:
 
-- API to delete Data Definition from XDO_DS_DEFINITIONS_B  and XDO_DS_DEFINITIONS_TL table
BEGIN
XDO_DS_DEFINITIONS_PKG.DELETE_ROW (<DATA_DEF_APP_NAME>,<DATA_DEF_CODE>);
COMMIT;
END;
 
-- Delete Data Templates, xml schema etc. from XDO_LOBS table (There is no API)
 
DELETE FROM XDO_LOBS
         WHERE LOB_CODE = <DATA_DEF_CODE>
            AND APPLICATION_SHORT_NAME = <DATA_DEF_APP_NAME>
            AND LOB_TYPE IN
                   ('XML_SCHEMA',
                    'DATA_TEMPLATE',
                    'XML_SAMPLE',
                    'BURSTING_FILE');
 
-- Delete from XDO_CONFIG_VALUES (if required)
DELETE FROM XDO_CONFIG_VALUES
      WHERE APPLICATION_SHORT_NAME = <DATA_DEF_APP_NAME>
            AND DATA_SOURCE_CODE = <DATA_DEF_CODE>;
 
Queries for the Templates:
 
SELECT *
  FROM XDO_TEMPLATES_B
WHERE TEMPLATE_CODE = 'XX_TEMPLATE_CODE';
 
SELECT *
  FROM XDO_TEMPLATES_TL
WHERE TEMPLATE_CODE = 'XX_TEMPLATE_CODE';
 
SELECT *
  FROM XDO_LOBS
WHERE LOB_CODE = 'XX_TEMPLATE_CODE';
 
SELECT *
  FROM XDO_CONFIG_VALUES
WHERE TEMPLATE_CODE = 'XX_TEMPLATE_CODE';
 
Delete the templates:


-- API to delete Data Definition from XDO_TEMPLATES_B and XDO_TEMPLATES_TL table
BEGIN
XDO_TEMPLATES_PKG.DELETE_ROW (<TEMPLATE_APP_NAME>, <TEMPLATE_CODE>);
COMMIT;
END;

-- Delete the Templates from XDO_LOBS table (There is no API)
DELETE FROM XDO_LOBS
WHERE LOB_CODE = <TEMPLATE_CODE>
AND APPLICATION_SHORT_NAME = <TEMPLATE_APP_NAME>
AND LOB_TYPE IN ('TEMPLATE_SOURCE', 'TEMPLATE');

-- Delete from XDO_CONFIG_VALUES (if required)
DELETE FROM XDO_CONFIG_VALUES
WHERE APPLICATION_SHORT_NAME = <TEMPLATE_APP_NAME>
AND TEMPLATE_CODE = <TEMPLATE_CODE>
AND DATA_SOURCE_CODE = <DATA_DEF_CODE>;

Thursday, 10 March 2016

Procure To Pay Cycle with Tables joins

1) Create Requisition:
Requisition is nothing but a formal request to buy something (like Inventory material, office supplies etc) needed for the enterprise. Only an employee can create one. There are two types of requisitions:
Internal Requisition: Internal requisitions provide the mechanism for requesting and transferring material from one inventory to other inventory.
Purchase requisition: Unlike Internal requisitions, Purchase requisitions are used for requesting material from suppliers.
Once the requistion is created, the status of the requisition will be “Incomplete”. And now the Approve button is highlighted. The requisition needs to be approved first before proceeding further by the concerned authority. Submit this requisition for Approval by clicking on the Approve button. The status will now be updated to “In Process”. The workflow then will send an Approval notification to the concerned person (derived based on hierarchy used - Position or Supervisor hierarchy) using which he can Approve or Reject the requisition.


Tables  - 

 PO_REQUISITION_HEADERS_ALL
 PO_REQUISITION_LINES_ALL 
 PO_REQ_DISTRIBUTIONS_ALL

Requisition_header_id is the link between PO_REQUISITION_HEADERS_ALL and PO_REQUISITION_LINES_ALL tables.
Requisition_line_id is the link between PO_REQUISITION_LINES_ALL and  PO_REQ_DISTRIBUTIONS_ALL tables.

2) Create Purchase Order:

Create Purchase order  by entering Header, Line and Shipment details. There can be multiple distributions for each shipment. Requisition Number is entered in More tab of Shipment Distributions window


Underlying Tables:


PO_HEADERS_ALL
PO_LINES_ALL
PO_LINE_LOCATIONS_ALL
PO_DISTRIBUTIONS_ALL

PO_header_id is link between PO_HEADERS_ALL and PO_LINES_ALL tables.
PO_line_id is link between PO_LINES_ALL and PO_LINE_LOCATIONS_ALL tables.
PO_header_id and PO_line_id both are available into PO_LINE_LOCATIONS_ALL

Distribution_id  (PO_REQ_DISTRIBUTION_ALL)  and po_distribution_id (PO_DISTRIBUTIONS_ALL) are joined in requisition and purchase order tables.

Calling One Form through another Form with Parameter

1. Create .fmb file with parameter  - Called Form

Your are calling this form into another form  ,here XXINV00013 (Called Form)

2. Creating parameter in .fmb file

Form Module ==> Parameter ==>  Click on + Button

P_ISN - parameter name






















3. Go to When New Form Instance  Trigger  (Form Level Triggers)

Write below Code

BEGIN
IF :PARAMETER.P_ISN IS NOT NULL THEN
--SET_BLOCK_PROPERTY('XXFM_PC_HEADER_DECODE_DTL_V',DEFAULT_WHERE,'ISN='||:PARAMETER.P_ISN);
go_block('XXFM_PC_HEADER_DECODE_DTL_V');
do_key('EXECUTE_QUERY');
END IF;
END;

Here P_ISN - Parameter Name

'XXFM_PC_HEADER_DECODE_DTL_V  - Block name where ISN field is available.

4. Go To PRE_QUERY Trigger (Form Level Trigger)

Begin
IF :PARAMETER.P_ISN IS NOT NULL THEN
:XXFM_PC_HEADER_DECODE_DTL_V.ISN :=:PARAMETER.P_ISN;
END IF;
END;

Here P_ISN - Parameter Name

'XXFM_PC_HEADER_DECODE_DTL_V  - Block name where ISN field is available.

Here we are assigning parameter value to Block.

5. For Form refistration purpose . We create Form Function.

So while creating Funtion assign parameter value in Form Tab



& save the changes.

6. Now Go to calling form . On the below we have to call new custom form. (XXINV00013)

Do personalization to add menu and create respond to that Menu.


Here ISN is field from calling form .means using ISN field we are calling the another form .
ISN is act  as parameter here to call another form. 

7. Create personalization to add Tool Menu.


8. Action code for tool menu



Seq - 10 
Type - Menu
Menu Entry - Menu5 : Decode Details Form
Menu Label - Decode Details Form

9. Now create response to Tool menu


Condition 

Trigger Event  - Menu5
Processing mode - NOT in Enter-Query Mode

10. Now action code to your response to tool menu.


Seq -10 
Type - Builtin
Built Type - launch a Function
Function Code - Function Code of called Form (XXFMINV00013)
Function Name - Function Code of Called Form (XXFMINV00013_Fun)
Parameter  - 'P_ISN='|| ${item.Q_RES.DISPLAY1.value}

Use same code - here Q_RES is block name calling form.
DISPLAY1 is field name of calling form 

Data DISPALY field match with P_ISN parameter data and fetch data and display.


Now you are able to call you custom XXFMINV00013.fmb form from calling form


Form will open.


Thanks !!!


Monday, 7 March 2016

Steps to Create Dependent Value Set in Oracle Apps

$FLEX$.<Independent Value Set Name> is the syntax to reference the parent value set.
Creating First value Set (Independent Value set)
This is a category value set. It is taking values from a custom view CATL_OBJ_PARENT_CATGRY_V. It shows all master categories defined in OLM.

Independent Value Set in Oracle Apps
Creating Second Value Set (Dependent Value Set)


This is definition of independent value set. This is based on View CATL_OBJ_SUB_CATGRY_V. In this value set, we are passing the value of master category Id which is selected by user in above value set.
In this way, this value set will show only the sub categories relevant to main category. Main category Id is referenced through syntax $FLEX$.<Independent Value Set Name>
Dependent Value Set in Oracle Apps
In my next article, i shall share the technique to know about profile value and how to get the possible values in Oracle Apps. If you have liked contents in this post and you think it can be helpful to others, please share it at least once in your circle, in this way, you will join me in my cause to Learn Share and Grow. Come on, Lets Grow Together.