<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Dinesh Nair&#039;s Oracle EBS Blog</title>
	<atom:link href="http://dineshnair.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://dineshnair.wordpress.com</link>
	<description>*.........This Blog has been moved to www.theinfos.com .........* *......&#34;Experience a new world of Oracle with THEINFOS&#34;......*</description>
	<lastBuildDate>Thu, 26 Jan 2012 05:00:01 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='dineshnair.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Dinesh Nair&#039;s Oracle EBS Blog</title>
		<link>http://dineshnair.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://dineshnair.wordpress.com/osd.xml" title="Dinesh Nair&#039;s Oracle EBS Blog" />
	<atom:link rel='hub' href='http://dineshnair.wordpress.com/?pushpress=hub'/>
		<item>
		<title>2010 in review</title>
		<link>http://dineshnair.wordpress.com/2011/01/02/2010-in-review/</link>
		<comments>http://dineshnair.wordpress.com/2011/01/02/2010-in-review/#comments</comments>
		<pubDate>Sun, 02 Jan 2011 17:50:05 +0000</pubDate>
		<dc:creator>Dinesh Nair</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://dineshnair.wordpress.com/?p=218</guid>
		<description><![CDATA[The stats helper monkeys at WordPress.com mulled over how this blog did in 2010, and here&#8217;s a high level summary of its overall blog health: The Blog-Health-o-Meter™ reads This blog is doing awesome!. Crunchy numbers A Boeing 747-400 passenger jet can hold 416 passengers. This blog was viewed about 5,000 times in 2010. That&#8217;s about [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dineshnair.wordpress.com&amp;blog=7549997&amp;post=218&amp;subd=dineshnair&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The stats helper monkeys at WordPress.com mulled over how this blog did in 2010, and here&#8217;s a high level summary of its overall blog health:</p>
<p><img style="border:1px solid #ddd;background:#f5f5f5;padding:20px;" src="http://s0.wp.com/i/annual-recap/meter-healthy2.gif" alt="Healthy blog!" width="250" height="183" /></p>
<p>The <em>Blog-Health-o-Meter™</em> reads This blog is doing awesome!.</p>
<h2>Crunchy numbers</h2>
<p><a href="http://dineshnair.files.wordpress.com/2009/05/31.jpg"><img style="max-height:230px;float:right;border:1px solid #ddd;background:#fff;margin:0 0 1em 1em;padding:6px;" src="http://dineshnair.files.wordpress.com/2009/05/31.jpg?w=288" alt="Featured image" /></a></p>
<p>A Boeing 747-400 passenger jet can hold 416 passengers. This blog was viewed about <strong>5,000</strong> times in 2010. That&#8217;s about 12 full 747s.</p>
<p>In 2010, there was <strong>1</strong> new post, growing the total archive of this blog to 14 posts.</p>
<p>The busiest day of the year was April 30th with <strong>102</strong> views. The most popular post that day was <a style="color:#08c;" href="http://dineshnair.wordpress.com/2009/05/04/release-12-advanced-global-intercompany-setup-part-3/">Release 12- Advanced Global Intercompany Setup &#8211; Part 3</a>.</p>
<h2>Where did they come from?</h2>
<p>The top referring sites in 2010 were <strong>en.wordpress.com</strong>, <strong>forums.oracle.com</strong>, <strong>google.com</strong>, <strong>google.co.in</strong>, and <strong>kr.forums.oracle.com</strong>.</p>
<p>Some visitors came searching, mostly for <strong>mo_global.set_org_access</strong>, <strong>fnd_profile.value_specific</strong>, <strong>xla_mo_security_profile_level</strong>, <strong>templatehelper.processtemplate</strong>, and <strong>am.invokemethod</strong>.</p>
<h2>Attractions in 2010</h2>
<p>These are the posts and pages that got the most views in 2010.</p>
<div style="clear:left;float:left;font-size:24pt;line-height:1em;margin:-5px 10px 20px 0;">1</div>
<p><a style="margin-right:10px;" href="http://dineshnair.wordpress.com/2009/05/04/release-12-advanced-global-intercompany-setup-part-3/">Release 12- Advanced Global Intercompany Setup &#8211; Part 3</a> <span style="color:#999;font-size:8pt;">May 2009</span><br />
3 comments</p>
<div style="clear:left;float:left;font-size:24pt;line-height:1em;margin:-5px 10px 20px 0;">2</div>
<p><a style="margin-right:10px;" href="http://dineshnair.wordpress.com/2009/06/02/integration-of-xml-publisher-with-oafgenerating-output-in-pdf-msword-msexcel-and-html-format/">Integrating XML Publisher and OAF:Generating output in PDF, MSWord, MSExcel and HTML Format</a> <span style="color:#999;font-size:8pt;">June 2009</span></p>
<div style="clear:left;float:left;font-size:24pt;line-height:1em;margin:-5px 10px 20px 0;">3</div>
<p><a style="margin-right:10px;" href="http://dineshnair.wordpress.com/2009/05/05/sql-queries-and-multi-org-architecture-in-release-12/">SQL Queries and Multi-Org Architecture in Release 12</a> <span style="color:#999;font-size:8pt;">May 2009</span><br />
1 comment</p>
<div style="clear:left;float:left;font-size:24pt;line-height:1em;margin:-5px 10px 20px 0;">4</div>
<p><a style="margin-right:10px;" href="http://dineshnair.wordpress.com/2009/05/29/how-to-call-application-module-methods-from-controller-class/">OA Framework &#8211; How to call Application Module Methods from Controller class</a> <span style="color:#999;font-size:8pt;">May 2009</span></p>
<div style="clear:left;float:left;font-size:24pt;line-height:1em;margin:-5px 10px 20px 0;">5</div>
<p><a style="margin-right:10px;" href="http://dineshnair.wordpress.com/2009/05/05/multi-organization-access-control/">Multi-Organization Access Control &#8211; Release 12</a> <span style="color:#999;font-size:8pt;">May 2009</span><br />
3 comments</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dineshnair.wordpress.com/218/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dineshnair.wordpress.com/218/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dineshnair.wordpress.com/218/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dineshnair.wordpress.com/218/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/dineshnair.wordpress.com/218/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/dineshnair.wordpress.com/218/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/dineshnair.wordpress.com/218/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/dineshnair.wordpress.com/218/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dineshnair.wordpress.com/218/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dineshnair.wordpress.com/218/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dineshnair.wordpress.com/218/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dineshnair.wordpress.com/218/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dineshnair.wordpress.com/218/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dineshnair.wordpress.com/218/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dineshnair.wordpress.com&amp;blog=7549997&amp;post=218&amp;subd=dineshnair&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dineshnair.wordpress.com/2011/01/02/2010-in-review/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/58f134fe6c9e30ac137f0169cf87b4ab?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dineshnair</media:title>
		</media:content>

		<media:content url="http://s0.wp.com/i/annual-recap/meter-healthy2.gif" medium="image">
			<media:title type="html">Healthy blog!</media:title>
		</media:content>

		<media:content url="http://dineshnair.files.wordpress.com/2009/05/31.jpg?w=288" medium="image">
			<media:title type="html">Featured image</media:title>
		</media:content>
	</item>
		<item>
		<title>Welcome to the world of infos</title>
		<link>http://dineshnair.wordpress.com/2010/03/02/welcome-to-the-world-of-infos/</link>
		<comments>http://dineshnair.wordpress.com/2010/03/02/welcome-to-the-world-of-infos/#comments</comments>
		<pubDate>Tue, 02 Mar 2010 14:34:03 +0000</pubDate>
		<dc:creator>Dinesh Nair</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://dineshnair.wordpress.com/?p=211</guid>
		<description><![CDATA[Welcome to the infos world! The infos is a technical website. The primary focus of this website is into technologies like Oracle EBS and Web Designing. Our users can find technical articles on Oracle technologies like BI Publisher, Discoverer, OA Framework, HRMS, Oracle Reports and on various areas of Web designing. If there are particular [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dineshnair.wordpress.com&amp;blog=7549997&amp;post=211&amp;subd=dineshnair&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<table>
<tbody>
<tr>
<td width="100%"><strong>Welcome to the infos world!</strong></td>
</tr>
</tbody>
</table>
<table>
<tbody>
<tr>
<td colspan="2" valign="top">
<div>
<p>The infos is a technical website. The primary focus of this website is into technologies like Oracle EBS and Web Designing. Our users can find technical articles on Oracle technologies like BI Publisher, Discoverer, OA Framework, HRMS, Oracle Reports and on various areas of Web designing.</p>
<p>If there are particular topics that you would like us to cover let us know. It’s our pleasure to serve you. We are pleased to offer our users with technical articles on latest technologies in our domine areas. In addition “The Infos” also provides space for discussion on general topics.</p>
<p>We offer free “Ask our experts” services, you can send your technical query to us. The Infos experts will help you with an appropriate solution.</p>
<p>Register with us now on <a href="http://www.theinfos.com" target="_blank">http://www.theinfos.com</a> , we will update you with the latest technologies, events and news. Hurry Up Its time to upgrade.</p>
</div>
</td>
</tr>
</tbody>
</table>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dineshnair.wordpress.com/211/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dineshnair.wordpress.com/211/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dineshnair.wordpress.com/211/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dineshnair.wordpress.com/211/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/dineshnair.wordpress.com/211/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/dineshnair.wordpress.com/211/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/dineshnair.wordpress.com/211/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/dineshnair.wordpress.com/211/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dineshnair.wordpress.com/211/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dineshnair.wordpress.com/211/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dineshnair.wordpress.com/211/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dineshnair.wordpress.com/211/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dineshnair.wordpress.com/211/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dineshnair.wordpress.com/211/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dineshnair.wordpress.com&amp;blog=7549997&amp;post=211&amp;subd=dineshnair&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dineshnair.wordpress.com/2010/03/02/welcome-to-the-world-of-infos/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/58f134fe6c9e30ac137f0169cf87b4ab?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dineshnair</media:title>
		</media:content>
	</item>
		<item>
		<title>Submitting XML Report using FND_REQUEST Package</title>
		<link>http://dineshnair.wordpress.com/2009/11/09/submitting-xml-report-using-fnd_request-package/</link>
		<comments>http://dineshnair.wordpress.com/2009/11/09/submitting-xml-report-using-fnd_request-package/#comments</comments>
		<pubDate>Mon, 09 Nov 2009 11:20:16 +0000</pubDate>
		<dc:creator>Dinesh Nair</dc:creator>
				<category><![CDATA[XML Publisher]]></category>

		<guid isPermaLink="false">http://dineshnair.wordpress.com/?p=200</guid>
		<description><![CDATA[1.  If you submit the concurrent Program (XML Report) through back and  as  normal way using “FND_REQUEST. SUBMIT_REQUEST”, it will not take Attached Template(Layout) to the Concurrent Program. This we can observe in SRS Window -&#62; View Details -&#62; Options below Screen will appear.  2.  If you want to appear Template to the Concurrent Program, we need to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dineshnair.wordpress.com&amp;blog=7549997&amp;post=200&amp;subd=dineshnair&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>1.  If you submit the concurrent Program (XML Report) through back and  as  normal way using “FND_REQUEST. SUBMIT_REQUEST”, it will not take Attached Template(Layout) to the Concurrent Program. This we can observe in SRS Window -&gt; View Details -&gt; Options below Screen will appear.</p>
<p><a href="http://dineshnair.files.wordpress.com/2009/11/1.jpg"><img class="aligncenter size-full wp-image-201" title="1" src="http://dineshnair.files.wordpress.com/2009/11/1.jpg?w=500&#038;h=361" alt="1" width="500" height="361" /></a></p>
<p> 2.  If you want to appear Template to the Concurrent Program, we need to add Layout Explicitly using “FND_REQUEST.ADD_LAYOUT” Packaged Procedure. Before submitting the Concurrent Program (XML Report). (See given example code below)</p>
<p><span style="font-size:x-small;font-family:Courier;">3. After Completion of Point 2, Template details we can see in SRS</span><span style="font-size:x-small;font-family:Wingdings;">à</span><span style="font-size:x-small;font-family:Courier;">View Details </span><span style="font-size:x-small;font-family:Wingdings;">à</span><span style="font-size:x-small;font-family:Courier;"> Options in below Screen.</span></p>
<p><a href="http://dineshnair.files.wordpress.com/2009/11/2.jpg"><img class="aligncenter size-full wp-image-202" title="2" src="http://dineshnair.files.wordpress.com/2009/11/2.jpg?w=500&#038;h=361" alt="2" width="500" height="361" /></a></p>
<p>Example Script:</p>
<p><a href="http://dineshnair.files.wordpress.com/2009/11/click-here-for-sample-code.doc">Click here for sample code</a><a href="http://dineshnair.files.wordpress.com/2009/11/example.doc"></a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dineshnair.wordpress.com/200/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dineshnair.wordpress.com/200/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dineshnair.wordpress.com/200/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dineshnair.wordpress.com/200/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/dineshnair.wordpress.com/200/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/dineshnair.wordpress.com/200/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/dineshnair.wordpress.com/200/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/dineshnair.wordpress.com/200/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dineshnair.wordpress.com/200/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dineshnair.wordpress.com/200/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dineshnair.wordpress.com/200/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dineshnair.wordpress.com/200/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dineshnair.wordpress.com/200/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dineshnair.wordpress.com/200/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dineshnair.wordpress.com&amp;blog=7549997&amp;post=200&amp;subd=dineshnair&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dineshnair.wordpress.com/2009/11/09/submitting-xml-report-using-fnd_request-package/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/58f134fe6c9e30ac137f0169cf87b4ab?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dineshnair</media:title>
		</media:content>

		<media:content url="http://dineshnair.files.wordpress.com/2009/11/1.jpg" medium="image">
			<media:title type="html">1</media:title>
		</media:content>

		<media:content url="http://dineshnair.files.wordpress.com/2009/11/2.jpg" medium="image">
			<media:title type="html">2</media:title>
		</media:content>
	</item>
		<item>
		<title>Concurrent Program Details including Template Details if exists</title>
		<link>http://dineshnair.wordpress.com/2009/11/09/concurrent-program-details-including-template-details-if-exists/</link>
		<comments>http://dineshnair.wordpress.com/2009/11/09/concurrent-program-details-including-template-details-if-exists/#comments</comments>
		<pubDate>Mon, 09 Nov 2009 09:59:33 +0000</pubDate>
		<dc:creator>Dinesh Nair</dc:creator>
				<category><![CDATA[Oracle Tips]]></category>

		<guid isPermaLink="false">http://dineshnair.wordpress.com/?p=197</guid>
		<description><![CDATA[A Query to get concurrent program details and template details if attached any.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dineshnair.wordpress.com&amp;blog=7549997&amp;post=197&amp;subd=dineshnair&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>SELECT ROWNUM</p>
<p>,fat.application_name application_name</p>
<p>,fat.application_short_name appl_short_name</p>
<p>,fcpt.user_concurrent_program_name concurrent_program_name</p>
<p>,fcp.concurrent_program_name concurrent_program_short_name</p>
<p>,fcp.output_file_type output_type</p>
<p>, fe.executable_name executable_name</p>
<p>,flv.meaning execution_method_type</p>
<p>,fat1.application_name executable_application_name</p>
<p>,fat1.application_short_name executable_appl_short_name</p>
<p>,xddt.data_source_name data_definition_name</p>
<p>,xtb.template_code template_code</p>
<p>, xtb.template_type_code template_type</p>
<p>,xl.file_content_type file_content</p>
<p>, xl.file_name rtf_file_name</p>
<p>, (SELECT user_name</p>
<p>     FROM fnd_user</p>
<p>     WHERE user_id = xtb.created_by) creation_user</p>
<p>  FROM fnd_concurrent_programs_tl fcpt,</p>
<p>       fnd_concurrent_programs fcp,</p>
<p>       fnd_executables fe,</p>
<p>       fnd_application_vl fat,</p>
<p>       fnd_application_vl fat1,</p>
<p>       fnd_lookup_values flv,</p>
<p>       xdo_ds_definitions_tl xddt,</p>
<p>       xdo_templates_b xtb,</p>
<p>       xdo_lobs xl</p>
<p> WHERE fcp.concurrent_program_id = fcpt.concurrent_program_id</p>
<p>   AND fat.application_id = fcpt.application_id</p>
<p>   AND fcp.executable_id = fe.executable_id</p>
<p>   AND fcp.executable_application_id = fe.application_id</p>
<p>   AND fat1.application_id = fe.application_id</p>
<p>   AND xddt.data_source_code(+) = fcp.concurrent_program_name</p>
<p>   AND flv.lookup_type(+) = &#8216;CP_EXECUTION_METHOD_CODE&#8217;</p>
<p>   AND flv.lookup_code(+) = fe.execution_method_code</p>
<p>   AND xtb.data_source_code(+) = xddt.data_source_code</p>
<p>   AND xl.lob_code(+) = xtb.template_code</p>
<p>   AND xl.lob_type(+) = &#8216;TEMPLATE_SOURCE&#8217;</p>
<p>   AND flv.enabled_flag = &#8216;Y&#8217;</p>
<p>   <em>&#8211;AND fcp.output_file_type=&#8217;XML&#8217;</em></p>
<p>   AND fcp.enabled_flag=&#8217;Y&#8217;</p>
<p>   AND NVL (flv.end_date_active, SYSDATE) &gt;= SYSDATE </p>
<p>   AND fcpt.user_concurrent_program_name=:p_concurrent_program_name</p>
<p>&nbsp;</p>
<p> 2) To find out previous, current and next years first date and last date</p>
<p>           SELECT TRUNC</p>
<p>          (LAST_DAY (ADD_MONTHS (SYSDATE,</p>
<p>                                 -TO_NUMBER (TO_CHAR (SYSDATE, &#8216;mm&#8217;)))),</p>
<p>           &#8216;YEAR&#8217;</p>
<p>          ) privious_year_first_date,</p>
<p>       TRUNC</p>
<p>          (LAST_DAY (ADD_MONTHS (SYSDATE,</p>
<p>                                 -TO_NUMBER (TO_CHAR (SYSDATE, &#8216;mm&#8217;))))</p>
<p>          ) privious_year_last_date,</p>
<p>       TRUNC</p>
<p>          (LAST_DAY (ADD_MONTHS (SYSDATE,</p>
<p>                                 12 &#8211; TO_NUMBER (TO_CHAR (SYSDATE, &#8216;mm&#8217;))</p>
<p>                                )</p>
<p>                    ),</p>
<p>           &#8216;YEAR&#8217;</p>
<p>          ) current_year_first_date,</p>
<p>       TRUNC</p>
<p>          (LAST_DAY (ADD_MONTHS (SYSDATE,</p>
<p>                                 12 &#8211; TO_NUMBER (TO_CHAR (SYSDATE, &#8216;mm&#8217;))</p>
<p>                                )</p>
<p>                    )</p>
<p>          ) current_year_last_date,</p>
<p>       TRUNC</p>
<p>          (LAST_DAY (ADD_MONTHS (SYSDATE,</p>
<p>                                 24 &#8211; TO_NUMBER (TO_CHAR (SYSDATE, &#8216;mm&#8217;))</p>
<p>                                )</p>
<p>                    ),</p>
<p>           &#8216;YEAR&#8217;</p>
<p>          ) next_year_first_date,</p>
<p>       TRUNC</p>
<p>          (LAST_DAY (ADD_MONTHS (SYSDATE,</p>
<p>                                 24 &#8211; TO_NUMBER (TO_CHAR (SYSDATE, &#8216;mm&#8217;))</p>
<p>                                )</p>
<p>                    )</p>
<p>          ) next_year_last_date</p>
<p>  FROM DUAL</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dineshnair.wordpress.com/197/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dineshnair.wordpress.com/197/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dineshnair.wordpress.com/197/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dineshnair.wordpress.com/197/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/dineshnair.wordpress.com/197/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/dineshnair.wordpress.com/197/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/dineshnair.wordpress.com/197/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/dineshnair.wordpress.com/197/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dineshnair.wordpress.com/197/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dineshnair.wordpress.com/197/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dineshnair.wordpress.com/197/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dineshnair.wordpress.com/197/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dineshnair.wordpress.com/197/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dineshnair.wordpress.com/197/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dineshnair.wordpress.com&amp;blog=7549997&amp;post=197&amp;subd=dineshnair&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dineshnair.wordpress.com/2009/11/09/concurrent-program-details-including-template-details-if-exists/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/58f134fe6c9e30ac137f0169cf87b4ab?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dineshnair</media:title>
		</media:content>
	</item>
		<item>
		<title>Integrating Workflow and OAF</title>
		<link>http://dineshnair.wordpress.com/2009/06/02/integrating-workflow-and-oaf/</link>
		<comments>http://dineshnair.wordpress.com/2009/06/02/integrating-workflow-and-oaf/#comments</comments>
		<pubDate>Tue, 02 Jun 2009 11:21:20 +0000</pubDate>
		<dc:creator>Ritesh</dc:creator>
				<category><![CDATA[OA Framework]]></category>

		<guid isPermaLink="false">http://dineshnair.wordpress.com/?p=185</guid>
		<description><![CDATA[Oracle Workflow is tightly integrated with Oracle Apps and it is very common to invoke workflow from OAF Pages too. The class oracle.apps.fnd.framework.webui.OANavigation provides Java wrappers for Oracle Workflow Engine&#8217;s PL/SQL APIs.  It is very simple to invoke Workflow using OAF, again there are two options first using Java wrappers and second through calling PL/SQL [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dineshnair.wordpress.com&amp;blog=7549997&amp;post=185&amp;subd=dineshnair&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Oracle Workflow is tightly integrated with Oracle Apps and it is very common to invoke workflow from OAF Pages too.</p>
<p>The class <strong>oracle.apps.fnd.framework.webui.OANavigation</strong> provides Java wrappers for Oracle Workflow Engine&#8217;s PL/SQL APIs.</p>
<p> It is very simple to invoke Workflow using OAF, again there are two options first using Java wrappers and second through calling PL/SQL procedures but the later approach you can use if you are converting some Oracle Form into OAF form and all the code for Workflow is already ready and tested but if it is new workflow then you should use Java wrappers:</p>
<p> Following piece of code invokes the Workflow from OAF:</p>
<p> <em>import oracle.apps.fnd.framework.webui.OANavigation;</em></p>
<p><em> </em><em>public void launchWorkFlowFromOAF(OAPageContext pageContext)</em></p>
<p><em>{</em></p>
<p><em>String wfItemType = &#8220;&#8216;XXSR&#8217;&#8221;;</em></p>
<p><em>String wfProcess = &#8220;&#8216;SR_MAIN_PROCESS&#8217;&#8221;;</em></p>
<p><em>OADBTransaction transaction = getOADBTransaction();</em></p>
<p><em>String Sr_No ;</em></p>
<p><em>String wfItemKey = &#8221; &#8220;;</em></p>
<p><em>Sr_No = pageContext.getParameter(“sr_no”);</em></p>
<p><em>wfItemKey = Sr_No+ transaction.getSequenceValue(&#8220;xxsr_key_s.NEXTVAL&#8221;).toString();</em></p>
<p><em>OANavigation wfClass = new OANavigation();</em></p>
<p><em>// Create Workflow Process</em></p>
<p><em>wfClass.createProcess(pageContext, wfItemType, wfProcess, wfItemKey);</em></p>
<p><em>// Set Number Attribute: SR_NO</em></p>
<p><em>wfClass.setItemAttrNumber(</em><em> pageContext,</em></p>
<p><em>                                       wfItemType,</em></p>
<p><em>                                       wfItemKey,</em></p>
<p><em>                                       &#8221;SR_NO&#8221;,</em></p>
<p><em>                                       Sr_No</em><em>      );</em></p>
<p><em>// Start Workflow Process</em></p>
<p><em>wfClass.startProcess(pageContext, wfItemType, wfProcess, wfItemKey);</em></p>
<p><em>}</em></p>
<p><strong>If you want to invoke this workflow using callable statement then you have to write code like this:</strong></p>
<p><strong><span style="text-decoration:underline;">OAF code:</span></strong></p>
<p> <em>if(pageContext.getParameter(&#8220;btnSubmit&#8221;)!=null)</em></p>
<pre><em>{</em>
<em>String sql = "BEGIN xx_sr_notf_pkg.invoke_wf (:1); END;";</em>
<em>String status = null;</em>
<em>OracleCallableStatement cs = (OracleCallableStatement)</em>
<em>am.getOADBTransaction().createCallableStatement(sql,1);</em>
<em>try</em>
<em>{</em>
<em>cs.setString(1,srNo);</em>
<em>cs.execute();</em>
<em>cs.close();</em>
<em>}</em>
<em>catch (Exception ex)</em>
<em>{</em>
<em>throw new OAException(ex.getMessage().toString(),</em>
<em>OAException.ERROR);</em>
<em>}</em>
<em>throw new OAException("SR "+srNo+" has been submitted",</em>
<em>OAException.CONFIRMATION);</em>
<em>} </em>
<strong>PL/SQL Code to Invoke Workflow:</strong>
   <em>PROCEDURE invoke_wf (p_sr_doc_number IN VARCHAR2)</em>
<em>   IS</em>
<em>      l_item_key             VARCHAR2 (50);</em>
<em>   BEGIN</em>
<em>        SELECT p_sr_doc_number ||  xxegasr_key_s.NEXTVAL</em>
<em>        INTO l_item_key</em>
<em>        FROM DUAL;</em>
<em>wf_engine.createprocess ('XXSR', l_item_key, 'SR_MAIN_PROCESS');</em>
<em>wf_engine.setitemattrnumber(itemtype      =&gt; 'XXSR',</em>
<em>                            itemkey       =&gt; l_item_key,</em>
<em>                            aname         =&gt; 'P_SR_DOC_NO',</em>
<em>                            avalue        =&gt; p_sr_doc_number</em>
<em>                           );</em><em>      </em>
<em>      wf_engine.startprocess ('XXSR', l_item_key);</em>
<em>      COMMIT;</em>
<em>   END invoke_wf;</em>
 </pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dineshnair.wordpress.com/185/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dineshnair.wordpress.com/185/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dineshnair.wordpress.com/185/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dineshnair.wordpress.com/185/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/dineshnair.wordpress.com/185/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/dineshnair.wordpress.com/185/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/dineshnair.wordpress.com/185/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/dineshnair.wordpress.com/185/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dineshnair.wordpress.com/185/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dineshnair.wordpress.com/185/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dineshnair.wordpress.com/185/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dineshnair.wordpress.com/185/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dineshnair.wordpress.com/185/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dineshnair.wordpress.com/185/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dineshnair.wordpress.com&amp;blog=7549997&amp;post=185&amp;subd=dineshnair&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dineshnair.wordpress.com/2009/06/02/integrating-workflow-and-oaf/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/68a709059c63efb5168d130216afb023?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Ritesh</media:title>
		</media:content>
	</item>
		<item>
		<title>How to call Java stored procedures/Classes from PL/SQL</title>
		<link>http://dineshnair.wordpress.com/2009/06/02/how-to-call-java-stored-proceduresclasses-from-plsql/</link>
		<comments>http://dineshnair.wordpress.com/2009/06/02/how-to-call-java-stored-proceduresclasses-from-plsql/#comments</comments>
		<pubDate>Tue, 02 Jun 2009 07:14:49 +0000</pubDate>
		<dc:creator>Ritesh</dc:creator>
				<category><![CDATA[PL/SQL Tips]]></category>

		<guid isPermaLink="false">http://dineshnair.wordpress.com/?p=167</guid>
		<description><![CDATA[There is lot of requirements where we need to use Java like zipping the files stored in database, deleting files from server.  Oracle provides the way to access Java stored Procedure and classes from PL/SQL, we can use according to our need Following steps are required: Create Java class according to your requirement Compile and [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dineshnair.wordpress.com&amp;blog=7549997&amp;post=167&amp;subd=dineshnair&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>There is lot of requirements<strong> </strong>where we need to use Java like zipping the files stored in database, deleting files from server.</p>
<p> Oracle provides the way to access Java stored Procedure and classes from PL/SQL, we can use according to our need</p>
<p><strong>Following steps are required:</strong></p>
<ol>
<li>Create Java class according to your requirement</li>
<li>Compile and load it into database</li>
<li>Write one PL/SQL Wrapper Program to call this.</li>
</ol>
<p><strong>Simple Demonstration:</strong></p>
<p><strong>Requirement: To delete file from server, file name will be provided as input parameter</strong></p>
<p><strong>Steps to achieve this:</strong></p>
<p>1<strong>. </strong>Write Java class to delete the file and compile it.<strong> </strong></p>
<p><strong> </strong>public class TestDelete {</p>
<pre>   public static int delete ...
<strong>   public static void main (String args[]) {</strong>
<strong>      System.out.println (</strong>
<strong>         delete (args[0])</strong>
<strong>         );</strong>
<strong>    }</strong>
}
2. Load java class into database
 
C:\oracle9i\bin&gt;loadjava -user scott/tiger -oci8 -resolve
TestDelete.class
 
3. Write PL/SQL Wrapper Program:
CREATE OR REPLACE FUNCTION fDelete (
   file IN VARCHAR2)
   RETURN NUMBER
<strong>AS LANGUAGE JAVA</strong>
<strong>   NAME 'TestDelete.delete (</strong>
<strong>            java.lang.String) </strong>
<strong>            return int'</strong>;
 
LoadJava utility: The <em>loadjava</em> utility (Oracle 8.1.5 and up) loads
Java source and class files into the database.When class files are
created in a conventional manner, outside the database,
<em>loadjava</em> is used to get them into the database.
<h4>Figure 1: Loading Java elements into Oracle</h4>

 

<a href="http://dineshnair.files.wordpress.com/2009/06/12.jpg"><img class="aligncenter size-full wp-image-176" title="1" src="http://dineshnair.files.wordpress.com/2009/06/12.jpg?w=500&#038;h=190" alt="1" width="500" height="190" /></a></pre>
<p>Here is the syntax:</p>
<pre>loadjava {-user | -u} <em>username/password</em>[<em>@database]</em>
  [<em>-option_name</em> [<em>-option_name</em>] ...] <em>filename </em>[<em>filename</em> ]...</pre>
<p>where <em>option_name</em> stands for the following syntax:</p>
<pre>{  {andresolve | a}
 | debug
 | {definer | d}
 | {encoding | e} encoding_scheme_name
 | {force | f}
 | {grant | g} {username | role_name}[,{username | role_name}]...
 | {oci8 | o}
 | oracleresolver
 | {resolve | r}
 | {resolver | R} "resolver_spec"
 | {schema | S} schema_name
 | {synonym | s}
 | {thin | t}
 | {verbose | v} }</pre>
<p><em>loadjava</em> requires two database privileges to load java objects into your own schema: CREATE PROCEDURE and CREATE TABLE.  To load Java objects into a schema other than the currently connected user, CREATE ANY PROCEDURE and CREATE ANY TABLE privileges are required.</p>
<p>This example will use a simple Java program that will be compiled outside of Oracle and then loaded into the database.</p>
<p> public class SimpleJava {</p>
<p>   public void main(String[] args) {</p>
<p>      System.out.println(&#8220;Here we are&#8221;);</p>
<p>   }</p>
<p>From DOS or  UNIX :</p>
<p>C:\oracle9i\bin&gt;javac SimpleJava.java</p>
<p>C:\oracle9i\bin&gt;loadjava -user scott/tiger SimpleJava.class</p>
<p>The class file is now loaded into the database and visible from the <em>dba_objects</em> view with an object type of JAVA CLASS.</p>
<p>From SQL*Plus, create the PL/SQL wrapper to invoke the newly loaded Java class:</p>
<p>SQL&gt; create or replace procedure call_simplejava</p>
<p>  2  as language java</p>
<p>  3  name &#8216;SimpleJava.showMessage()&#8217;;</p>
<p>  4  /</p>
<p>Execute the code from SQL*Plus:</p>
<p>SQL&gt; set serveroutput on;</p>
<p>SQL&gt; call dbms_java.set_output(50);</p>
<p>Call completed.</p>
<p>SQL&gt; execute call_simplejava;</p>
<p>Here we are</p>
<p>PL/SQL procedure successfully completed.</p>
<p>In this example, the Java class file was loaded into the database.  The Java source file can also be loaded.  But, both the source and class files cannot be loaded at the same time.</p>
<p> C:\oracle9i\bin&gt;loadjava -user scott/tiger SimpleJava.java</p>
<p>If loading many Java class files at one time, it is advisable to put them in a JAR file and load them into the database at one time, since the <em>loadjava</em> program will also load JAR files.   A JAR file is a group of Java class files lumped into one file, a format similar to TAR (on <em> </em>UNIX<em> </em>) and WinZip (on Windows).   The contents of a JAR file can be viewed using these popular utilities.  Java developers prefer to distribute a few JAR files rather than many individual Java class files.</p>
<p>Oracle8<em>i</em> has created two new roles to support Java security. For many Java-based operations within the database, you will not have to work with these roles. If, on the other hand, you want to interact with the operating system (to access or modify operating system files, for example), you need to be granted one of the following roles:</p>
<pre>JAVASYSPRIV
JAVAUSERPRIV</pre>
<p>You grant these roles as you would any other database role. For example, if I want to allow SCOTT to perform any kind of Java-related operation, I would issue this command from a SYSDBA account:</p>
<pre>GRANT JAVASYSPRIV TO SCOTT;</pre>
<p>If I want to place some restrictions on what the user can do with Java, I might execute this grant instead:</p>
<pre>GRANT JAVAUSERPRIV TO SCOTT;
To access Java class methods from within Oracle, you must take the following steps:</pre>
<ol>
<li>Create the Java code elements. You can do this in Oracle&#8217;s JDeveloper, or in any other Java Integrated Development Environment. Load the Java class(es) into Oracle using the loadjava command-line utility or the CREATE JAVA statement.</li>
<li>Publish the Java class methods inside PL/SQL by writing wrapper programs in PL/SQL around the Java code.</li>
<li>Grant privileges as required on the PL/SQL wrapper programs and the Java class referenced by the PL/SQL wrapper.</li>
<li>Call the PL/SQL programs from any one of a number of environmentsOracle8<em>i</em> offers a variety of components and commands to work with Java following table summarizes these different elements:</li>
</ol>
<table border="1" cellpadding="0" width="511">
<thead>
<tr>
<td colspan="2">
<p align="center">Table 1: Oracle Components and Commands for Java</p>
</td>
</tr>
<tr>
<td valign="top"><strong>Component</strong></td>
<td valign="top"><strong>Description</strong></td>
</tr>
</thead>
<tbody>
<tr>
<td valign="top">Aurora JVM</td>
<td valign="top">The Java Virtual Machine (JVM) that Oracle implemented in its database server</td>
</tr>
<tr>
<td valign="top">loadjava</td>
<td valign="top">An operating system command-line utility that loads your Java code elements (classes, <em>.jar</em> files, etc.) into the Oracle database</td>
</tr>
<tr>
<td valign="top">dropjava</td>
<td valign="top">An operating system command-line utility that drops your Java code elements (classes, <em>.jar</em> files, etc.) from the Oracle database</td>
</tr>
<tr>
<td valign="top">CREATE JAVA</p>
<p>DROP JAVA</p>
<p>ALTER JAVA</td>
<td valign="top">New DDL statements that perform some of the same tasks as loadjava and dropjava</td>
</tr>
<tr>
<td valign="top">DBMS_JAVA</td>
<td valign="top">A built-in package that offers a number of utilities to set options and other aspects of the JVM</td>
</tr>
<tr>
<td valign="top">DBMS_JAVA_TEST</td>
<td valign="top">A built-in package you can use to more easily test your JSPs</td>
</tr>
<tr>
<td valign="top">JPublisher</td>
<td valign="top">A utility used to build Java classes around object types and REFs defined in the Oracle database</td>
</tr>
</tbody>
</table>
<p> </p>
<h4><a name="ch09-29427">Figure 9.1: Accessing JSPs from within the Oracle database</a></h4>
<p><a href="http://dineshnair.files.wordpress.com/2009/06/21.jpg"><img class="aligncenter size-full wp-image-179" title="2" src="http://dineshnair.files.wordpress.com/2009/06/21.jpg?w=500&#038;h=368" alt="2" width="500" height="368" /></a></p>
<p><strong>Data Type Mapping Between Java and SQL:</strong></p>
<table border="1" cellpadding="0">
<thead>
<tr>
<td width="202" valign="top"><strong>SQL Type </strong></td>
<td width="281" valign="top"><strong>Java Class </strong></td>
</tr>
</thead>
<tbody>
<tr>
<td width="202" valign="top">CHAR, NCHAR, LONG, VARCHAR2, NVARCHAR2</td>
<td width="281" valign="top">
<pre>oracle.sql.CHAR
java.lang.String
java.sql.Date
java.sql.Time
java.sql.Timestamp
java.lang.Byte
java.lang.Short
java.lang.Integer
java.lang.Long
java.lang.Float
java.lang.Double
java.math.BigDecimal
byte, short, int, long, float, double</pre>
</td>
</tr>
<tr>
<td width="202" valign="top">DATE</td>
<td width="281" valign="top">
<pre>oracle.sql.DATE
java.sql.Date
java.sql.Time
java.sql.Timestamp
java.lang.String</pre>
</td>
</tr>
<tr>
<td width="202" valign="top">NUMBER</td>
<td width="281" valign="top">
<pre>oracle.sql.NUMBER
java.lang.Byte
java.lang.Short
java.lang.Integer
java.lang.Long
java.lang.Float
java.lang.Double
java.math.BigDecimal
byte, short, int, long, float, double</pre>
</td>
</tr>
<tr>
<td width="202" valign="top">RAW, LONG RAW</td>
<td width="281" valign="top">
<pre>oracle.sql.RAW
byte[]</pre>
</td>
</tr>
<tr>
<td width="202" valign="top">ROWID</td>
<td width="281" valign="top">
<pre>oracle.sql.CHAR
oracle.sql.ROWID
java.lang.String</pre>
</td>
</tr>
<tr>
<td width="202" valign="top">BFILE</td>
<td width="281" valign="top">
<pre>oracle.sql.BFILE</pre>
</td>
</tr>
<tr>
<td width="202" valign="top">BLOB</td>
<td width="281" valign="top">
<pre>oracle.sql.BLOB
oracle.jdbc2.Blob</pre>
</td>
</tr>
<tr>
<td width="202" valign="top">CLOB, NCLOB</td>
<td width="281" valign="top">
<pre>oracle.sql.CLOB
oracle.jdbc2.Clob<em> </em></pre>
</td>
</tr>
<tr>
<td width="202" valign="top">OBJECT</td>
<td width="281" valign="top">
<pre>oracle.sql.STRUCT
oracle.SqljData
oracle.jdbc2.Struct<em> </em></pre>
</td>
</tr>
<tr>
<td width="202" valign="top">REF</td>
<td width="281" valign="top">
<pre>oracle.sql.REF
oracle.jdbc2.Ref<em> </em></pre>
</td>
</tr>
<tr>
<td width="202" valign="top">TABLE, VARRAY</td>
<td width="281" valign="top">
<pre>oracle.sql.ARRAY
oracle.jdbc2.Array<em> </em></pre>
</td>
</tr>
<tr>
<td width="202" valign="top">Any of the above SQL types</td>
<td width="281" valign="top">
<pre>oracle.sql.CustomDatum
oracle.sql.Datum<em> </em></pre>
</td>
</tr>
</tbody>
</table>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dineshnair.wordpress.com/167/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dineshnair.wordpress.com/167/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dineshnair.wordpress.com/167/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dineshnair.wordpress.com/167/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/dineshnair.wordpress.com/167/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/dineshnair.wordpress.com/167/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/dineshnair.wordpress.com/167/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/dineshnair.wordpress.com/167/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dineshnair.wordpress.com/167/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dineshnair.wordpress.com/167/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dineshnair.wordpress.com/167/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dineshnair.wordpress.com/167/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dineshnair.wordpress.com/167/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dineshnair.wordpress.com/167/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dineshnair.wordpress.com&amp;blog=7549997&amp;post=167&amp;subd=dineshnair&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dineshnair.wordpress.com/2009/06/02/how-to-call-java-stored-proceduresclasses-from-plsql/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/68a709059c63efb5168d130216afb023?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Ritesh</media:title>
		</media:content>

		<media:content url="http://dineshnair.files.wordpress.com/2009/06/12.jpg" medium="image">
			<media:title type="html">1</media:title>
		</media:content>

		<media:content url="http://dineshnair.files.wordpress.com/2009/06/21.jpg" medium="image">
			<media:title type="html">2</media:title>
		</media:content>
	</item>
		<item>
		<title>Integrating XML Publisher and OAF:Generating output in PDF, MSWord, MSExcel and HTML Format</title>
		<link>http://dineshnair.wordpress.com/2009/06/02/integration-of-xml-publisher-with-oafgenerating-output-in-pdf-msword-msexcel-and-html-format/</link>
		<comments>http://dineshnair.wordpress.com/2009/06/02/integration-of-xml-publisher-with-oafgenerating-output-in-pdf-msword-msexcel-and-html-format/#comments</comments>
		<pubDate>Tue, 02 Jun 2009 06:05:44 +0000</pubDate>
		<dc:creator>Ritesh</dc:creator>
				<category><![CDATA[OA Framework]]></category>

		<guid isPermaLink="false">http://dineshnair.wordpress.com/?p=151</guid>
		<description><![CDATA[It is a very common requirement where we want to generate reports in PDF, MSWord, MS Excel and HTML format from an OAF page itself without submitting any concurrent program.  To generate the output in PDF or other formats we need the following: XML Data Definition, registered with Apps Template, registered with Apps XML Publisher [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dineshnair.wordpress.com&amp;blog=7549997&amp;post=151&amp;subd=dineshnair&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>It is a very common requirement where we want to generate reports in PDF, MSWord, MS Excel and HTML format from an OAF page itself without submitting any concurrent program. </p>
<p>To generate the output in PDF or other formats we need the following:</p>
<ul>
<li>XML Data Definition, registered with Apps</li>
<li>Template, registered with Apps</li>
<li>XML Publisher APIs to process the template and generate the output in required format.</li>
</ul>
<p>As we are going to generate the output from OAF, we need to generate the XML data using view object, View Object is having inbuilt functionality to read and write data in XML format. View Object is having one method called <strong>writeXML </strong>which will generate the data in XML format. We can use it for two purposes:</p>
<ol>
<li>To generate XML Data in Jdeveloper Embedded OC4J Sever Log (It will give XML Definition of data; we can use it for designing our Template and register this as Data definition).</li>
<li>To generate XML data for actual template processing.</li>
</ol>
<p><strong>Steps to Generate the Output in required format</strong>:</p>
<p><strong>Step 1</strong>: Create OAWorkspace, Project, packages, VO and AM (I hope you are already familiar with these)</p>
<p><strong>Step 2</strong>: Import following Packages in AM and Controller:</p>
<p><em>import java.io.ByteArrayInputStream;</em></p>
<p><em>import java.io.ByteArrayOutputStream;</em></p>
<p><em>import javax.servlet.ServletOutputStream;</em></p>
<p><em>import javax.servlet.http.HttpServletResponse;</em></p>
<p><em>import oracle.apps.fnd.framework.webui.beans.table.OAAdvancedTableBean;</em></p>
<p><em>import oracle.apps.xdo.oa.schema.server.TemplateHelper;</em></p>
<p><em>import oracle.jbo.XMLInterface;</em></p>
<p><strong>Step 3:</strong> Create one method in your AM to generate XML output, call this method from your processRequest mathod and get it printed on Jdeveloper console:</p>
<p>Your code for should look like this:</p>
<p><em>public void getPrintDataXML()</em></p>
<p><em>{</em></p>
<p><em> try</em></p>
<p><em> {</em></p>
<p><em>   ByteArrayOutputStream outputStream = new ByteArrayOutputStream();</em></p>
<p><em>   <strong>OAViewObject vo = (OAViewObject)am.findViewObject(&#8220;XXEGASRPrintPageVO1&#8243;);</strong></em></p>
<p><em><strong>   ((XMLNode) vo.writeXML(4, XMLInterface.XML_OPT_ALL_ROWS)).print(outputStream);</strong></em></p>
<p><em>   System.out.println(outputStream.toString());</em></p>
<p><em>  }</em></p>
<p><em> catch(Exception e)</em></p>
<p><em> {</em></p>
<p><em>  throw new OAException (e.getMessage());</em></p>
<p><em> }</em></p>
<p><em>}  </em></p>
<p>Statements highlighted(BOLD) will print the XML data generated by your view object to Jdeveloper console.</p>
<p>In first line <strong>vo.writeXML</strong> will generate the XML for VO and print method will write the XML data in outputstream that can further be used to print XML data on Jdeveloper console using println method.</p>
<p><img class="aligncenter size-full wp-image-154" title="1" src="http://dineshnair.files.wordpress.com/2009/06/1.jpg?w=500&#038;h=426" alt="1" width="500" height="426" /></p>
<p>You can copy this output and save with some meaningful name and use it to register as data definition and to design your template(copy only XML data). </p>
<p><strong>Step 4:</strong> Design your template</p>
<p><strong>Step 5:</strong> Register your Template and data Definition in Oracle Apps</p>
<p><img class="aligncenter size-full wp-image-156" title="2" src="http://dineshnair.files.wordpress.com/2009/06/2.jpg?w=500&#038;h=141" alt="2" width="500" height="141" /></p>
<p><strong>Step 5:</strong> Register your Template and data Definition in Oracle Apps</p>
<p><img class="aligncenter size-full wp-image-158" title="3" src="http://dineshnair.files.wordpress.com/2009/06/3.jpg?w=500&#038;h=202" alt="3" width="500" height="202" /></p>
<p>Click on “Create Data Definition” button</p>
<p><img class="aligncenter size-full wp-image-159" title="4" src="http://dineshnair.files.wordpress.com/2009/06/4.jpg?w=500&#038;h=256" alt="4" width="500" height="256" /></p>
<p>Fill in all the mandatory columns and give a short code for your data definition and clink on “Apply” button</p>
<p>now click on “Template” Tab</p>
<p><img class="aligncenter size-full wp-image-160" title="5" src="http://dineshnair.files.wordpress.com/2009/06/5.jpg?w=500&#038;h=210" alt="5" width="500" height="210" /></p>
<p> Click on “Create Template” button</p>
<p><img class="aligncenter size-full wp-image-162" title="6" src="http://dineshnair.files.wordpress.com/2009/06/6.jpg?w=500" alt="6"   /></p>
<p>Fill in all the mandatory columns and give a short code (It will be used by XML Publisher APIs to process the template) for your template and clink on “Apply” button</p>
<p> <strong>Step 6:</strong> Generate output, using XML publisher APIs</p>
<p>    <strong>Step 6.1</strong>: Create a submit button to Generate the output say “Print”</p>
<p>     <strong>Step 6.2:</strong> Add following method to your AM Impl class</p>
<p>  <em>public XMLNode getPrintDataXML()//XMLNode</em></p>
<p><em>  {</em></p>
<p><em>   OAViewObject vo = (OAViewObject)findViewObject(&#8220;EmpVO1&#8243;);</em></p>
<p><em>   ByteArrayOutputStream outputStream = new ByteArrayOutputStream();</em></p>
<p><em>   XMLNode xmlNode = (XMLNode) vo.writeXML(4, XMLInterface.XML_OPT_ALL_ROWS);</em></p>
<p><em>   return xmlNode;</em></p>
<p><em>  }</em></p>
<p>     <strong>Step 6.3:</strong> Handle the event for “Print” button:</p>
<p> <em>/*</em></p>
<p><em> * Handles functionality of Print button</em></p>
<p><em> */</em></p>
<p><em> if(pageContext.getParameter(&#8220;btnPrint&#8221;)!=null)</em></p>
<p><em>               {</em></p>
<p><em>// Get the HttpServletResponse object from the PageContext. The report output is written to HttpServletResponse.</em></p>
<p><em>DataObject sessionDictionary = (DataObject)pageContext.getNamedDataObject(&#8220;_SessionParameters&#8221;);</em></p>
<p><em> HttpServletResponse response = (HttpServletResponse)sessionDictionary.selectValue(null,&#8221;HttpServletResponse&#8221;);</em></p>
<p><em>                         try {</em></p>
<p><em>                          ServletOutputStream os = response.getOutputStream();</em></p>
<p><em>                           // Set the Output Report File Name and Content Type</em></p>
<p><em>                           <strong>String contentDisposition = &#8220;attachment;filename=PrintPage.pdf&#8221;;</strong></em></p>
<p><em>                           response.setHeader(&#8220;Content-Disposition&#8221;,contentDisposition);</em></p>
<p><em>                           <strong>response.setContentType(&#8220;application/pdf&#8221;);</strong></em></p>
<p><em>                           // Get the Data XML File as the XMLNode</em></p>
<p><em>                           XMLNode xmlNode = (XMLNode) am.invokeMethod(&#8220;getPrintDataXML&#8221;);</em></p>
<p><em>            ByteArrayOutputStream outputStream = new ByteArrayOutputStream();</em></p>
<p><em>            ByteArrayInputStream inputStream = new ByteArrayInputStream(outputStream.toByteArray());</em></p>
<p><em>            ByteArrayOutputStream pdfFile = new ByteArrayOutputStream();</em></p>
<p><em>            //Generate the PDF Report.</em></p>
<p><em>            //Process Template</em></p>
<p><em>            TemplateHelper.processTemplate(</em></p>
<p><em>            ((OADBTransactionImpl)pageContext.getApplicationModule(webBean).getOADBTransaction()).getAppsContext(),</em></p>
<p><em>            “AK”,//APPLICATION SHORT NAME</em></p>
<p><em>            “Print Template TMP”, //TEMPLATE_SHORT_CODE</em></p>
<p><em>            ((OADBTransactionImpl)pageContext.getApplicationModule(webBean).getOADBTransaction()).getUserLocale().getLanguage(),</em></p>
<p><em>            ((OADBTransactionImpl)pageContext.getApplicationModule(webBean).getOADBTransaction()).getUserLocale().getCountry(),</em></p>
<p><em>            inputStream,</em></p>
<p><em>            <strong>TemplateHelper.OUTPUT_TYPE_PDF,</strong></em></p>
<p><em>            null,</em></p>
<p><em>            pdfFile);</em></p>
<p><em>              //TemplateHelper.</em></p>
<p><em>            // Write the PDF Report to the HttpServletResponse object and flush.</em></p>
<p><em>            byte[] b = pdfFile.toByteArray();</em></p>
<p><em>            response.setContentLength(b.length);</em></p>
<p><em>            os.write(b, 0, b.length);</em></p>
<p><em>            os.flush();</em></p>
<p><em>            os.close();</em></p>
<p><em>    pdfFile.flush();</em></p>
<p><em>    pdfFile.close();</em></p>
<p><em>            }</em></p>
<p><em>            catch(Exception e)</em></p>
<p><em>            {</em></p>
<p><em>            response.setContentType(&#8220;text/html&#8221;);</em></p>
<p><em>            throw new OAException(e.getMessage(), OAException.ERROR);</em></p>
<p><em>            }</em></p>
<p><em>            pageContext.setDocumentRendered(true);</em></p>
<p><em>            } </em></p>
<p>Now run your page and click on Print button:</p>
<p><img class="aligncenter size-medium wp-image-163" title="7" src="http://dineshnair.files.wordpress.com/2009/06/7.jpg?w=300&#038;h=170" alt="7" width="300" height="170" /></p>
<p>In this manner we can generate the output in Excel, Word and HTML format also but we need to modify our code a bit, few statements in above code are in BOLD… </p>
<p>The statements in <strong>BOLD</strong> need to be modified:</p>
<p><strong><span style="text-decoration:underline;">First file name in following statement :</span></strong></p>
<p>String contentDisposition = <strong>&#8220;attachment;filename=PrintPage.pdf&#8221;;</strong></p>
<p>In above statement <strong>PrintPage.pdf</strong>  can be  replaced with <em>&lt;userdefined_filename&gt;.doc/.xls/.htm</em></p>
<p><span style="text-decoration:underline;"><strong>Second is file MIME Type needs to be changed:</strong></span></p>
<p>response.<strong>setContentType(&#8220;application/pdf&#8221;);</strong></p>
<p>Here <strong>application/pdf</strong> can be replaced with <em>valid MIME type for Excel/Word and HTML</em> </p>
<p>Third, <strong>TemplateHelper.OUTPUT_TYPE_PDF</strong>, in this <strong>OUTPUT_TYPE_PDF</strong> can be replaced by <em>OUTPUT_TYPE_HTML/ OUTPUT_TYPE_EXCEL/ OUTPUT_TYPE_RTF.</em></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dineshnair.wordpress.com/151/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dineshnair.wordpress.com/151/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dineshnair.wordpress.com/151/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dineshnair.wordpress.com/151/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/dineshnair.wordpress.com/151/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/dineshnair.wordpress.com/151/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/dineshnair.wordpress.com/151/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/dineshnair.wordpress.com/151/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dineshnair.wordpress.com/151/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dineshnair.wordpress.com/151/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dineshnair.wordpress.com/151/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dineshnair.wordpress.com/151/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dineshnair.wordpress.com/151/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dineshnair.wordpress.com/151/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dineshnair.wordpress.com&amp;blog=7549997&amp;post=151&amp;subd=dineshnair&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dineshnair.wordpress.com/2009/06/02/integration-of-xml-publisher-with-oafgenerating-output-in-pdf-msword-msexcel-and-html-format/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/68a709059c63efb5168d130216afb023?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Ritesh</media:title>
		</media:content>

		<media:content url="http://dineshnair.files.wordpress.com/2009/06/1.jpg" medium="image">
			<media:title type="html">1</media:title>
		</media:content>

		<media:content url="http://dineshnair.files.wordpress.com/2009/06/2.jpg" medium="image">
			<media:title type="html">2</media:title>
		</media:content>

		<media:content url="http://dineshnair.files.wordpress.com/2009/06/3.jpg" medium="image">
			<media:title type="html">3</media:title>
		</media:content>

		<media:content url="http://dineshnair.files.wordpress.com/2009/06/4.jpg" medium="image">
			<media:title type="html">4</media:title>
		</media:content>

		<media:content url="http://dineshnair.files.wordpress.com/2009/06/5.jpg" medium="image">
			<media:title type="html">5</media:title>
		</media:content>

		<media:content url="http://dineshnair.files.wordpress.com/2009/06/6.jpg" medium="image">
			<media:title type="html">6</media:title>
		</media:content>

		<media:content url="http://dineshnair.files.wordpress.com/2009/06/7.jpg?w=300" medium="image">
			<media:title type="html">7</media:title>
		</media:content>
	</item>
		<item>
		<title>OA Framework &#8211; How to call Application Module Methods from Controller class</title>
		<link>http://dineshnair.wordpress.com/2009/05/29/how-to-call-application-module-methods-from-controller-class/</link>
		<comments>http://dineshnair.wordpress.com/2009/05/29/how-to-call-application-module-methods-from-controller-class/#comments</comments>
		<pubDate>Fri, 29 May 2009 12:26:48 +0000</pubDate>
		<dc:creator>Ritesh</dc:creator>
				<category><![CDATA[OA Framework]]></category>

		<guid isPermaLink="false">http://dineshnair.wordpress.com/?p=136</guid>
		<description><![CDATA[If we want to call any method of Application Module from Controller class in OA Framework there are two ways to achieve this: Using invokeMethod: invokeMethod is the method of OAApplicationModule class it takes three parameters: Method Name- Data Type String Parameters(Optional)- array of type Serializable paramTypes(Optional)- array of datatypes, one to one mapping with [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dineshnair.wordpress.com&amp;blog=7549997&amp;post=136&amp;subd=dineshnair&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>If we want to call any method of Application Module from Controller class in OA Framework there are two ways to achieve this:</p>
<ol>
<li>Using invokeMethod: invokeMethod is the method of OAApplicationModule class it takes three parameters:
<ul>
<li>Method Name- Data Type String</li>
<li>Parameters(Optional)- array of type Serializable</li>
<li>paramTypes(Optional)- array of datatypes, one to one mapping with parameters.</li>
</ul>
</li>
</ol>
<p> <strong>Example:</strong></p>
<p><strong> </strong>OAApplicationModule am = pageContext.getApplicationModule(webBean);</p>
<p>Boolean executeQuery = BooleanUtils.getBoolean(false);</p>
<p>String s3 = pageContext.getParameter(&#8220;auctionHeaderId&#8221;);</p>
<p>Serializable parameters[] = {s3, executeQuery};</p>
<p>Class paramTypes[] = {String.class, Boolean.class};</p>
<p>am.invokeMethod(&#8220;initSummary&#8221;, parameters, paramTypes);<strong> </strong></p>
<ol>
<li>Creating an Interface of Application Module: This method is useful if we have to pass serializable parameters to AM. In this case first we need to create an interface for Application module:</li>
</ol>
<p>Following are the steps to create Interface of Application Module:<strong> </strong></p>
<p><strong>Step 1:</strong> Select required AM, right click, from context menu select edit &lt;AMName&gt;</p>
<p><strong>Step 2: </strong>Select Client Method option<strong> </strong></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:small;font-family:Times New Roman;">If we want to call any method of Application Module from Controller class there are two ways to achieve this:</span></p>
<ol style="margin-top:0;" type="1">
<li class="MsoNormal"><span style="font-size:small;font-family:Times New Roman;">Using invokeMethod: invokeMethod is the method of OAApplicationModule class it takes three parameters:</span>
<ul style="margin-top:0;" type="disc">
<li class="MsoNormal"><span style="font-size:small;font-family:Times New Roman;">Method Name- Data Type String</span></li>
<li class="MsoNormal"><span style="font-size:small;font-family:Times New Roman;">Parameters(Optional)- array of type Serializable</span></li>
<li class="MsoNormal"><span style="font-size:small;font-family:Times New Roman;">paramTypes(Optional)- array of datatypes, one to one mapping with parameters.</span></li>
</ul>
</li>
</ol>
<p class="MsoNormal" style="text-indent:.5in;margin:0 0 0 .25in;"><strong><span style="font-size:small;"><span style="font-family:Times New Roman;">Example:</span></span></strong></p>
<p class="MsoNormal" style="text-indent:.5in;margin:0 0 0 .25in;"><strong><span style="font-size:small;font-family:Times New Roman;"> </span></strong></p>
<p class="MsoNormal" style="text-indent:.5in;margin:0 0 0 .25in;"><span style="font-size:small;font-family:Times New Roman;">OAApplicationModule am = pageContext.getApplicationModule(webBean);</span></p>
<p class="MsoNormal" style="text-indent:.5in;margin:0 0 0 .25in;"><span style="font-size:small;font-family:Times New Roman;">Boolean executeQuery = BooleanUtils.getBoolean(false);</span></p>
<p class="MsoNormal" style="text-indent:.5in;margin:0 0 0 .25in;"><span style="font-size:small;font-family:Times New Roman;">String s3 = pageContext.getParameter(&#8220;auctionHeaderId&#8221;);</span></p>
<p class="MsoNormal" style="text-indent:.5in;margin:0 0 0 .25in;"><span style="font-size:small;"><span style="font-family:Times New Roman;"><span style="background:yellow;">Serializable parameters[]</span> = {s3, executeQuery};</span></span></p>
<p class="MsoNormal" style="text-indent:.5in;margin:0 0 0 .25in;"><span style="font-size:small;"><span style="font-family:Times New Roman;"><span style="background:yellow;">Class paramTypes[]</span> = {String.class, Boolean.class};</span></span></p>
<p class="MsoNormal" style="text-indent:.5in;margin:0 0 0 .25in;"><span style="font-size:small;"><span style="font-family:Times New Roman;">am.<span style="background:yellow;">invokeMethod(&#8220;initSummary&#8221;, parameters, paramTypes);</span></span></span></p>
<p class="MsoNormal" style="margin:0 0 0 .25in;"><strong><span style="font-size:small;font-family:Times New Roman;"> </span></strong></p>
<ol style="margin-top:0;" type="1">
<li class="MsoNormal"><span style="font-size:small;font-family:Times New Roman;">Creating an Interface of Application Module: This method is useful if we have to pass serializable parameters to AM. In this case first we need to create an interface for Application module</span></li>
</ol>
<p class="MsoNormal" style="margin:0 0 0 .5in;"><span style="font-size:small;font-family:Times New Roman;">Following are the steps to create Interface of Application Module:</span></p>
<p class="MsoNormal" style="margin:0 0 0 .5in;"><strong><span style="font-size:12pt;font-family:'Times New Roman';">Step 1:</span></strong><span style="font-size:12pt;font-family:'Times New Roman';"> Select required AM, right click, from context menu select edit &lt;AMName&gt;</span></p>
<p class="MsoNormal" style="margin:0 0 0 .5in;"><span style="font-size:12pt;font-family:'Times New Roman';"> </span></p>
<p class="MsoNormal" style="margin:0 0 0 .5in;"><span style="font-size:12pt;font-family:'Times New Roman';"><img class="aligncenter size-full wp-image-144" title="1" src="http://dineshnair.files.wordpress.com/2009/05/11.jpg?w=500" alt="1"   /></span></p>
<p class="MsoNormal" style="margin:0 0 0 .5in;"><span style="font-size:12pt;font-family:'Times New Roman';"> </span> </p>
<p class="MsoNormal" style="margin:0 0 0 .5in;"><span style="font-size:12pt;font-family:'Times New Roman';"> </span></p>
<p class="MsoNormal" style="margin:0 0 0 .5in;"><span style="font-size:12pt;font-family:'Times New Roman';"> </span> <strong>Step 2: </strong>Select Client Method option</p>
<p><strong><img class="aligncenter size-full wp-image-139" title="2" src="http://dineshnair.files.wordpress.com/2009/05/2.jpg?w=500&#038;h=388" alt="2" width="500" height="388" /></strong></p>
<p> </p>
<p><strong>Step 3</strong>: In above figure you are able to see methods under available select required methods (methods you want to call without using invokeMethod) and move those to right side and click on Apply and OK.</p>
<p><img class="aligncenter size-full wp-image-141" title="3" src="http://dineshnair.files.wordpress.com/2009/05/3.jpg?w=500&#038;h=387" alt="3" width="500" height="387" /></p>
<p>After this step, Jdeveloper will create one java file name of AM, you can see this Object Navigator:</p>
<p><img class="aligncenter size-full wp-image-142" title="4" src="http://dineshnair.files.wordpress.com/2009/05/4.jpg?w=500" alt="4"   /></p>
<p><strong>Contents of that file will be:</strong></p>
<p>package xxbc.oracle.apps.icx;</p>
<p>import oracle.jbo.ApplicationModule;</p>
<p>//  &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>//  &#8212;    File generated by Oracle Business Components for Java.</p>
<p>//  &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>/**</p>
<p> *</p>
<p> * Generated interface. Do not modify.</p>
<p> */</p>
<p>public interface EmpAM extends ApplicationModule</p>
<p>{</p>
<p>  void deleteEmpMethod(String pEmpId);</p>
<p>  void createEmpMethod();</p>
<p>  void createEmp();</p>
<p>  void updateEmpMethod(String pEmpId);</p>
<p>  void saveEmpToDatabase();</p>
<p>  void rollbackToDatabase();</p>
<p>}</p>
<p>Now to call these methods from your controller you need to add following things to your controller class:</p>
<ul>
<li>Import package which contains your Application Module definition to controller class e.g.</li>
</ul>
<p>           Import xxx.oracle.apps.xxx.server;</p>
<ul>
<li>Create an object of your Application module</li>
</ul>
<p>XXEGAAwardByQuoteAM xxegaawardbyquoteam = (XXEGAAwardByQuoteAMImpl)pageContext.getApplicationModule(webBean);</p>
<p>Where XXEGAAwardByQuoteAM is Interface class of Application module XXEGAAwardByQuoteAM.</p>
<ul>
<li>Call your method like:</li>
</ul>
<p>&lt;AMObject&gt;.&lt;method&gt;</p>
<p>Example:</p>
<p>Import XXEGA.oracle.apps.pon.awardbyqt.server.XXEGAAwardByQuoteAMImpl;</p>
<p>…</p>
<p>processFormRequest(….)</p>
<p>{</p>
<p>XXEGAAwardByQuoteAMImpl xxegaawardbyquoteam = (XXEGAAwardByQuoteAMImpl)pageContext.getApplicationModule(webBean);</p>
<p>Number s5 = xxegaawardbyquoteam.get_msgCount();</p>
<p>}<span> </span></p>
<p class="MsoNormal" style="margin:0 0 0 .75in;"><span style="font-size:10pt;"><span style="font-family:Times New Roman;"><strong>Contents of that file will be:</strong></span></span></p>
<p class="MsoNormal" style="margin:0 0 0 .75in;"><span style="font-size:10pt;"><span style="font-family:Times New Roman;"> </span></span></p>
<p class="MsoNormal" style="margin:0 0 0 .75in;"><span style="font-size:10pt;"><span style="font-family:Times New Roman;">package xxbc.oracle.apps.icx;</span></span></p>
<p class="MsoNormal" style="margin:0 0 0 .75in;"><span style="font-size:10pt;"><span style="font-family:Times New Roman;">import oracle.jbo.ApplicationModule;</span></span></p>
<p class="MsoNormal" style="margin:0 0 0 .75in;"><span style="font-size:10pt;"><span style="font-family:Times New Roman;">//<span>  </span>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</span></span></p>
<p class="MsoNormal" style="margin:0 0 0 .75in;"><span style="font-size:10pt;"><span style="font-family:Times New Roman;">//<span>  </span>&#8212;<span>    </span>File generated by Oracle Business Components for Java.</span></span></p>
<p class="MsoNormal" style="margin:0 0 0 .75in;"><span style="font-size:10pt;"><span style="font-family:Times New Roman;">//<span>  </span>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</span></span></p>
<p class="MsoNormal" style="margin:0 0 0 .75in;"><span style="font-size:10pt;"><span style="font-family:Times New Roman;">/**</span></span></p>
<p class="MsoNormal" style="margin:0 0 0 .75in;"><span style="font-size:10pt;"><span style="font-family:Times New Roman;"><span> </span>* </span></span></p>
<p class="MsoNormal" style="margin:0 0 0 .75in;"><span style="font-size:10pt;"><span style="font-family:Times New Roman;"><span> </span>* Generated interface. Do not modify.</span></span></p>
<p class="MsoNormal" style="margin:0 0 0 .75in;"><span style="font-size:10pt;"><span style="font-family:Times New Roman;"><span> </span>*/</span></span></p>
<p class="MsoNormal" style="margin:0 0 0 .75in;"><span style="font-size:10pt;"><span style="font-family:Times New Roman;"> </span></span></p>
<p class="MsoNormal" style="margin:0 0 0 .75in;"><span style="font-size:10pt;"><span style="font-family:Times New Roman;">public interface EmpAM extends ApplicationModule </span></span></p>
<p class="MsoNormal" style="margin:0 0 0 .75in;"><span style="font-size:10pt;"><span style="font-family:Times New Roman;">{</span></span></p>
<p class="MsoNormal" style="margin:0 0 0 .75in;"><span style="font-size:10pt;"><span style="font-family:Times New Roman;"><span>  </span>void deleteEmpMethod(String pEmpId);</span></span></p>
<p class="MsoNormal" style="margin:0 0 0 .75in;"><span style="font-size:10pt;"></span></p>
<p class="MsoNormal" style="margin:0 0 0 .75in;"><span style="font-size:10pt;"><span style="font-family:Times New Roman;"><span>  </span>void createEmpMethod();</span></span></p>
<p class="MsoNormal" style="margin:0 0 0 .75in;"><span style="font-size:10pt;"></span></p>
<p class="MsoNormal" style="margin:0 0 0 .75in;"><span style="font-size:10pt;"><span style="font-family:Times New Roman;"><span>  </span>void createEmp();</span></span></p>
<p class="MsoNormal" style="margin:0 0 0 .75in;"><span style="font-size:10pt;"></span></p>
<p class="MsoNormal" style="margin:0 0 0 .75in;"><span style="font-size:10pt;"><span style="font-family:Times New Roman;"><span>  </span>void updateEmpMethod(String pEmpId);</span></span><span style="font-size:10pt;"><span style="font-family:Times New Roman;"> </span></span></p>
<p class="MsoNormal" style="margin:0 0 0 .75in;"><span style="font-size:10pt;"><span style="font-family:Times New Roman;"><span>  </span>void saveEmpToDatabase();</span></span></p>
<p class="MsoNormal" style="margin:0 0 0 .75in;"><span style="font-size:10pt;"></span></p>
<p class="MsoNormal" style="margin:0 0 0 .75in;"><span style="font-size:10pt;"><span style="font-family:Times New Roman;"><span>  </span>void rollbackToDatabase();</span></span></p>
<p class="MsoNormal" style="margin:0 0 0 .75in;"><span style="font-size:10pt;"></span></p>
<p class="MsoNormal" style="margin:0 0 0 .75in;"><span style="font-size:10pt;"><span style="font-family:Times New Roman;">}</span></span></p>
<p class="MsoNormal" style="margin:0 0 0 .75in;"><span style="font-size:small;font-family:Times New Roman;">Now to call these methods from your controller you need to add following things to your controller class:</span></p>
<p class="MsoNormal" style="text-indent:-.25in;margin:0 0 0 1.25in;"><span style="font-family:Symbol;"><span><span style="font-size:small;">·</span><span style="font:7pt 'Times New Roman';">        </span></span></span><span style="font-size:small;font-family:Times New Roman;">Import package which contains your Application Module definition to controller class e.g.</span></p>
<p class="MsoNormal" style="margin:0 0 0 1in;"><span style="font-size:small;"><span style="font-family:Times New Roman;"><span>           </span>Import xxx.oracle.apps.xxx.server;</span></span></p>
<p class="MsoNormal" style="margin:0 0 0 1in;"><span style="font-size:small;font-family:Times New Roman;"> </span></p>
<p class="MsoNormal" style="text-indent:-.25in;margin:0 0 0 1.25in;"><span style="font-family:Symbol;"><span><span style="font-size:small;">·</span><span style="font:7pt 'Times New Roman';">        </span></span></span><span style="font-size:small;font-family:Times New Roman;">Create an object of your Application module</span></p>
<p class="MsoNormal" style="margin:0 0 0 87pt;"><span style="font-size:small;font-family:Times New Roman;">XXEGAAwardByQuoteAM xxegaawardbyquoteam = (XXEGAAwardByQuoteAMImpl)pageContext.getApplicationModule(webBean);</span></p>
<p class="MsoNormal" style="margin:0 0 0 87pt;"><span style="font-size:small;font-family:Times New Roman;">Where XXEGAAwardByQuoteAM is Interface class of Application module XXEGAAwardByQuoteAM.</span></p>
<p class="MsoNormal" style="margin:0 0 0 1in;"><span style="font-size:small;font-family:Times New Roman;"> </span></p>
<p class="MsoNormal" style="text-indent:-.25in;margin:0 0 0 1.25in;"><span style="font-family:Symbol;"><span><span style="font-size:small;">·</span><span style="font:7pt 'Times New Roman';">        </span></span></span><span style="font-size:small;font-family:Times New Roman;">Call your method like:</span></p>
<p class="MsoNormal" style="margin:0 0 0 1.25in;"><span style="font-size:small;font-family:Times New Roman;">&lt;AMObject&gt;.&lt;method&gt;</span></p>
<p class="MsoNormal" style="margin:0 0 0 1.25in;"><span style="font-size:small;font-family:Times New Roman;">Example:</span></p>
<p class="MsoNormal" style="margin:0 0 0 1.25in;"><span style="font-size:small;font-family:Times New Roman;">Import XXEGA.oracle.apps.pon.awardbyqt.server.XXEGAAwardByQuoteAMImpl;</span></p>
<p class="MsoNormal" style="margin:0 0 0 1.25in;"><span style="font-size:small;font-family:Times New Roman;">…</span></p>
<p class="MsoNormal" style="margin:0 0 0 1.25in;"><span style="font-size:small;font-family:Times New Roman;">processFormRequest(….)</span></p>
<p class="MsoNormal" style="margin:0 0 0 1.25in;"><span style="font-size:small;font-family:Times New Roman;">{</span></p>
<p class="MsoNormal" style="margin:0 0 0 1.25in;"><span style="font-size:small;font-family:Times New Roman;">XXEGAAwardByQuoteAMImpl xxegaawardbyquoteam = (XXEGAAwardByQuoteAMImpl)pageContext.getApplicationModule(webBean);</span></p>
<p class="MsoNormal" style="margin:0 0 0 1.25in;"><span style="font-size:small;font-family:Times New Roman;">Number s5 = xxegaawardbyquoteam.get_msgCount();</span></p>
<p><span style="font-size:12pt;font-family:'Times New Roman';">}</span></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dineshnair.wordpress.com/136/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dineshnair.wordpress.com/136/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dineshnair.wordpress.com/136/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dineshnair.wordpress.com/136/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/dineshnair.wordpress.com/136/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/dineshnair.wordpress.com/136/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/dineshnair.wordpress.com/136/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/dineshnair.wordpress.com/136/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dineshnair.wordpress.com/136/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dineshnair.wordpress.com/136/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dineshnair.wordpress.com/136/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dineshnair.wordpress.com/136/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dineshnair.wordpress.com/136/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dineshnair.wordpress.com/136/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dineshnair.wordpress.com&amp;blog=7549997&amp;post=136&amp;subd=dineshnair&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dineshnair.wordpress.com/2009/05/29/how-to-call-application-module-methods-from-controller-class/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/68a709059c63efb5168d130216afb023?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Ritesh</media:title>
		</media:content>

		<media:content url="http://dineshnair.files.wordpress.com/2009/05/11.jpg" medium="image">
			<media:title type="html">1</media:title>
		</media:content>

		<media:content url="http://dineshnair.files.wordpress.com/2009/05/2.jpg" medium="image">
			<media:title type="html">2</media:title>
		</media:content>

		<media:content url="http://dineshnair.files.wordpress.com/2009/05/3.jpg" medium="image">
			<media:title type="html">3</media:title>
		</media:content>

		<media:content url="http://dineshnair.files.wordpress.com/2009/05/4.jpg" medium="image">
			<media:title type="html">4</media:title>
		</media:content>
	</item>
		<item>
		<title>SQL Queries and Multi-Org Architecture in Release 12</title>
		<link>http://dineshnair.wordpress.com/2009/05/05/sql-queries-and-multi-org-architecture-in-release-12/</link>
		<comments>http://dineshnair.wordpress.com/2009/05/05/sql-queries-and-multi-org-architecture-in-release-12/#comments</comments>
		<pubDate>Tue, 05 May 2009 11:08:18 +0000</pubDate>
		<dc:creator>Dinesh Nair</dc:creator>
				<category><![CDATA[Multi Org - Tips and Queries]]></category>

		<guid isPermaLink="false">http://dineshnair.wordpress.com/?p=132</guid>
		<description><![CDATA[In Release 12, the architecture of multi-org and the way in which data is partitioned by operating unit has changed significantly. As a result the ways in which data are stored and accessed has changed. In Previous Releases data was restricted to a single operating unit using views which striped base table data based on [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dineshnair.wordpress.com&amp;blog=7549997&amp;post=132&amp;subd=dineshnair&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>In Release 12, the architecture of multi-org and the way in which data is partitioned by operating unit has changed significantly. As a result the ways in which data are stored and accessed has changed.</p>
<p>In Previous Releases data was restricted to a single operating unit using views which striped base table data based on the current operating unit setting. </p>
<p>Base tables (generally named with ‘_ALL’, e.g. MY_TABLE_ALL) contained data for all operating units. Each such table contained a column named ORG_ID to indicate what operating unit a particular row belonged to.Data was then restricted by using restricted views (e.g. MY_TABLE) which would only return rows which corresponded to the current operating unit’s organization ID. The current operating unit was stored in the first 10 characters of the database Application Context variable CLIENT_INFO. When logging into the applications, the CLIENT_INFO value was set to the appropriate operating unit organization ID for the session based on the profile option setting for “MO: Operating Unit”. In SQL*Plus, CLIENT_INFO could be set to point to a particular operating unit using execute dbms_application_info.set_client_info(‘’);</p>
<p>In Release 12 a more flexible architecture has been put in place to support Multi-Org Access Control (MOAC). This architecture allows users to define security profiles so that users may access data for more than one operating unit within a single responsibility.</p>
<p>To accomplish this</p>
<p>Multi-org views have been removed, and replaced with synonyms. For example, MY_TABLE would no longer be a view defined on MY_TABLE_ALL, but rather a synonym which points to MY_TABLE_ALL<br />
The data restriction is accomplished by assigning a virtual private database (VPD) policy to the synonym. This policy allows the system to dynamically generate restricting conditions when queries are run against the synonym.</p>
<p>For example: In release 12 in the APPS schema, PA_PROJECTS and PA_PROJECTS_ALL are both synonyms which point to the table PA.PA_PROJECTS_ALL. However, the view PA_PROJECTS_ALL is unrestricted, whereas, PA_PROJECTS will only display data for the user’s current operating unit(s) because of the VPD policy that has been assigned to it.</p>
<p>Data relating to defined VPD policies is viewable in the data dictionary view DBA_POLICIES. These policies associate a function with an object, and when the object is accessed, this function can return additional restrictions on the object to restrict the data returned. The particular policy used to implement Multi-Org in release 12 is:</p>
<p>Policy_name: ORG_SEC<br />
Policy_group: SYS_DEFAULT<br />
Package: MO_GLOBAL<br />
Function: ORG_SECURITY<br />
The function (MO_GLOBAL.ORG_SECURITY) is called with the following parameters:<br />
obj_schema &#8211; the object schema, in this case APPS<br />
obj_name – the object name (e.g., MY_TABLE) </p>
<p>The function then returns additional where clause conditions to restrict the data accessible from the object. The structure of this function will dynamically generate conditions which will either:</p>
<p> Restrict the data to a single operating unit if the access mode is Single<br />
 Restrict the data to multiple operating units if the access mode is Multiple<br />
 Restrict the data to eliminate only seed data rows is the access mode is All<br />
 Restrict the data to not return any rows if the access mode is None<br />
The conditions returned in each case are as follows:</p>
<p>Single OU Access</p>
<p>org_id = sys_context(&#8216;multi_org2&#8242;,&#8217;current_org_id&#8217;)</p>
<p>Only data for the current operating unit is accessible. The value of sys_context(&#8216;multi_org2&#8242;,&#8217;current_org_id&#8217;) would have to be set to the current operating unit as described below.</p>
<p>Multiple OU Access<br />
EXISTS (SELECT 1<br />
FROM mo_glob_org_access_tmp oa<br />
WHERE oa.organization_id = org_id)<br />
The user will be able to access data for any org_id which has been populated into mo_glob_org_access_tmp. When a session is initialized in the applications, values will be populated into mo_glob_org_access_tmp for each of the operating units the user has access to based on their &#8220;MO: Security Profile&#8221; setting.</p>
<p>All OU Access<br />
org_id  -3113<br />
Seed template records, which are used to create new seed data when a new operating unit is created. are created with an org_id of –3113. So in this mode, only these template records, which do not correspond to any actual operating unit, will be filtered out. </p>
<p>No OU Access<br />
1 = 2<br />
The condition is never satisfied. No data will be returned from the object.</p>
<p>Multi-Org Session Context<br />
The database utility DBMS_SESSION.SET_CONTEXT(, , ) is used to initialize and set the Multi-Org context information for a user’s session. The utility SYS_CONTEXT(, ) is used to retrieve this data. The key context items are:</p>
<p>Namespace Namespace Value<br />
multi_org access_mode S=Single, M=Multiple, A=All, X=None<br />
multi_org2 current_org_id Operating unit org id, only applicable if access mode is Single </p>
<p>For example: The following example shows how you could set the access mode or determine the current setting:</p>
<p>dbms_session.set_context(&#8216;multi_org&#8217;,'access_mode&#8217;,'S&#8217;);</p>
<p>myvar := sys_context(&#8216;multi_org&#8217;,'access_mode&#8217;);<br />
dbms_output.put_line(&#8216;Access Mode: &#8216;||myvar);</p>
<p>However, it is generally preferable to use the following wrapper functions from MO_GLOBAL which will call the appropriate utilities to maintain the various elements of the multi-org context:</p>
<p>Procedure: SET_POLICY_CONTEXT(p_access_mode varchar2, p_org_id number)<br />
This procedure will set the access mode, and when applicable the current operating unit context. </p>
<p>Procedure: SET_ORG_ACCESS(p_org_id_char varchar2, p_sp_id_char varchar2, p_appl_short_name varchar2)<br />
This procedure determines if the application specified has multi-org access control enabled, by querying FND_MO_PRODUCT_INIT for the application short name. If this is enabled, and a security profile is specified (p_sp_id_char), then all orgs the user has access to will be populated in MO_GLOB_ORG_ACCESS_TMP. If there are more than one such org, the access method will be set to &#8220;Multiple&#8221;. Otherwise if no security profile id is specified, it will use the value of p_org_id to set the current operating unit value and set the access mode to &#8220;Single&#8221;.</p>
<p>Procedure: INIT(p_appl_short_name varchar2)<br />
The procedure used by the applications when starting a new session. Based on the profile options &#8220;MO: Operating Unit&#8221; (ORG_ID) and &#8220;MO: Security Profile&#8221; (XLA_MO_SECURITY_PROFILE_LEVEL), this procedure calls set_org_access to establish the multi-org context for the session. To call this from withing SQL, the profile option context should have been initialized for the session.</p>
<p>Function: GET_CURRENT_ORG_ID<br />
Returns the current operating unit setting. This should be null if the access mode is not &#8216;S&#8217;</p>
<p>Function: GET_ACCESS_MODE<br />
Returns the current access mode value.</p>
<p>For Example: </p>
<p>1) When logging into a SQL session to set the org context as it would be for a particular user in a particular responsibility:</p>
<p>a) If you know the security_profile_id for that responsibility and user, you could call:</p>
<p>execute mo_global.set_org_access(null, , &#8216;PA&#8217;);<br />
Security profiles are stored in PER_SECURITY_PROFILES, and the final parameter is the application short name of the application associated with the responsibility you would be using.</p>
<p>b) If you do not know the security profile or operating unit profile option settings for your user, responsibility and application, you could use code similar to the following to get this information:</p>
<p>declare</p>
<p>  l_user_id fnd_user.user_id%type;<br />
  l_resp_id fnd_responsibility.responsibility_id%type;<br />
  l_appl_id fnd_application.application_id%type;<br />
  l_appl_short_name fnd_application_vl.application_short_name%type;<br />
  l_ou_value fnd_profile_option_values.profile_option_value%type;<br />
  l_sp_value fnd_profile_option_values.profile_option_value%type;</p>
<p>begin</p>
<p>select user_id into l_user_id<br />
from fnd_user<br />
where user_name = upper(&#8216;&amp;user_name&#8217;);</p>
<p>select responsibility_id into l_resp_id<br />
from fnd_responsibility_vl<br />
where responsibility_name = (&#8216;&amp;resp_name&#8217;);</p>
<p>select application_id, application_short_name into l_appl_id, l_appl_short_name<br />
from fnd_application_vl<br />
where application_short_name = upper(&#8216;&amp;appl_short_name&#8217;);</p>
<p>l_ou_value := fnd_profile.value_specific(<br />
  &#8216;ORG_ID&#8217;,l_user_id, l_resp_id, l_appl_id);<br />
l_sp_value := fnd_profile.value_specific(<br />
  &#8216;XLA_MO_SECURITY_PROFILE_LEVEL&#8217;, l_user_id, l_resp_id, l_appl_id);</p>
<p>dbms_output.put_line(&#8216;MO: Operating Unit: &#8216;||l_ou_value);<br />
dbms_output.put_line(&#8216;MO: Security Profile: &#8216;||l_sp_value);</p>
<p>if l_sp_value is null and l_ou_value is null then<br />
  dbms_output.put_line(&#8216;No operating unit or security profile information<br />
    found&#8217;);<br />
else<br />
  mo_global.set_org_access(l_ou_value, l_sp_value, l_appl_short_name);<br />
end if;</p>
<p>exception when others then<br />
  dbms_output.put_line(&#8216;Error: &#8216;||sqlerrm);<br />
end;<br />
/</p>
<p>2) To set the operating unit context to a single operating unit, you could simply use:</p>
<p>execute mo_global.set_policy_context(‘S’,);</p>
<p>Backwards Compatibility<br />
When running queries on multi-org objects in SQL, you can still use the old CLIENT_INFO settings to gather data and run queries against multi-org objects if the profile option:</p>
<p>MO: Set Client_Info for Debugging (FND_MO_INIT_CI_DEBUG) is set to &#8220;Yes&#8221;. </p>
<p>When this profile option is set to “Yes” and the global access mode setting is null (as it would be in a SQL*Plus or other client session unless specifically set), the VPD function MO_GLOBAL.ORG_SECURITY will return the following as the additional where clause condition for the object:</p>
<p>org_id = substrb(userenv(&#8216;CLIENT_INFO&#8217;),1,10)</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dineshnair.wordpress.com/132/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dineshnair.wordpress.com/132/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dineshnair.wordpress.com/132/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dineshnair.wordpress.com/132/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/dineshnair.wordpress.com/132/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/dineshnair.wordpress.com/132/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/dineshnair.wordpress.com/132/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/dineshnair.wordpress.com/132/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dineshnair.wordpress.com/132/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dineshnair.wordpress.com/132/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dineshnair.wordpress.com/132/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dineshnair.wordpress.com/132/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dineshnair.wordpress.com/132/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dineshnair.wordpress.com/132/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dineshnair.wordpress.com&amp;blog=7549997&amp;post=132&amp;subd=dineshnair&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dineshnair.wordpress.com/2009/05/05/sql-queries-and-multi-org-architecture-in-release-12/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/58f134fe6c9e30ac137f0169cf87b4ab?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dineshnair</media:title>
		</media:content>
	</item>
		<item>
		<title>Multi-Organization Access Control &#8211; Release 12</title>
		<link>http://dineshnair.wordpress.com/2009/05/05/multi-organization-access-control/</link>
		<comments>http://dineshnair.wordpress.com/2009/05/05/multi-organization-access-control/#comments</comments>
		<pubDate>Tue, 05 May 2009 10:36:44 +0000</pubDate>
		<dc:creator>Dinesh Nair</dc:creator>
				<category><![CDATA[Multi Org - Tips and Queries]]></category>

		<guid isPermaLink="false">http://dineshnair.wordpress.com/?p=130</guid>
		<description><![CDATA[How to setup and check MO/MOAC setup in APPS instance at R12 Level Ebusiness Suite started using this feature at R12 level MOAC (Multi-Organization Access Control) A) How To Setup MO / MOAC Setup In APPS Instance At R12 Level ? B) What Are The Defaulting Rules Between Different Profile Options C) How To Check [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dineshnair.wordpress.com&amp;blog=7549997&amp;post=130&amp;subd=dineshnair&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>How to setup and check MO/MOAC setup in APPS instance at R12 Level<br />
Ebusiness Suite started using this feature at R12  level<br />
MOAC (Multi-Organization Access Control)</p>
<p>A) How To Setup MO / MOAC Setup In APPS Instance At R12 Level  ?<br />
B) What Are The Defaulting Rules Between Different Profile Options<br />
C) How To Check MO / MOAC Setup In APPS Instance At R12 Level  ?</p>
<p>Here is the solution for the above questions.<br />
Solution 1:</p>
<p>Setup MOAC (Multi-Organization Access Control) :</p>
<p>1) Define Security Profile for MOAC (Multi-Organization Access Control) </p>
<p>a) HRMS Super User Responsibility &gt; Security &gt; Define Security Profile.<br />
b) Enter name &#8216;XX-TM-SECURITY-PROFILE&#8217;.<br />
c) Enter &#8216;Vision Corporation&#8217; for &#8216;Business Group&#8217;.<br />
d) Select &#8216;Organization Security&#8217; tab,<br />
e) For &#8216;Security Type&#8217;, select &#8216;Secure organizations by organization hierarchy and/or organization list&#8217;<br />
f) Enter rows with the following organization names with Classification &#8216;Operating Unit&#8217; : </p>
<p>- Vision Operations<br />
- Vision Corporation<br />
- Vision Services<br />
- Vision Utilities</p>
<p>2) Run Security List Maintenance request </p>
<p>a) Processes &amp; Reports &gt; Submit Process &amp; Report.<br />
b) Select &#8216;Security List Maintenance&#8217; for request name.<br />
c) Enter the followings : </p>
<p>- Generate lists for = One Named Security Profile<br />
- Security Profile = &#8216;XX-TM-SECURITY-PROFILE&#8217; </p>
<p>d) Submit the request and wait until it completes. </p>
<p>3) Assign TM Responsibilities to User </p>
<p>a) System Administrator Responsibility &gt; Security : User &gt; Define.<br />
b) Query/add the User you are going to use with Trade Management ( TM).<br />
c) Add the following direct responsibilities : </p>
<p>- Oracle Trade Management User<br />
- Oracle Trade Management Administrator<br />
4) Assign Security Profile to Responsibilities : </p>
<p>a) Profile &gt; System.<br />
b) Assign values to the following profiles as indicated for each of the above responsibilities : </p>
<p>- MO: Default Operating Unit = Vision Operations  (e.g.)<br />
- MO: Security Profile = XX-TM-SECURITY-PROFILE </p>
<p>This will give the responsibilities access to the 4 operating units assigned to the security profile  &#8216;XX-TM-SECURITY-PROFILE&#8217;.</p>
<p>Note that a valid configuration is to setup only profile option MO: Security Profile and leave MO: Operating Unit at null (ie no setup at any level) which is mandatory to be in MOAC situation and also leave MO: Default Operating Unit at null (ie no setup at any level) which is a possible option </p>
<p>B)  R12 MOAC defaulting / precedence rules:</p>
<p>Here is the process which determines the precedence ( priority)between MO and MOAC profile options</p>
<p> 1) If the profile  option “MO: Security Profile” is not set, then “MO:  Operating Unit”  value is used as the default Operating Unit even if “MO:  Default  Operating Unit” profile is set to a different value.</p>
<p> 2) If the profile option “MO: Security Profile” is set and gives access to only one Operating Unit, the default Operating Unit will return this  value even if  “MO: Default Operating Unit” is set to a different  value.</p>
<p> 3) If the profile option “MO: Security  Profile” is set and gives access to  multiple Operating Units :</p>
<p>    * If the profile value “MO: Default Operating Unit”  is set, it is          validated  against the list of Operating Units in “MO: Security Profile”.<br />
    * If  the Operating Unit is included in the security profile then it is  returned as the default value.<br />
    * Else there is no defaulted Operating Unit .<br />
    * If the Profile Option “MO: Default Operating Unit”  is not  set, then there is zero (no)  default Operating Unit.</p>
<p>C) Run below SQL statements : </p>
<p>1.To check Organization which are related to a profile </p>
<p>select *<br />
from PER_SECURITY_PROFILES PPR,<br />
     PER_SECURITY_ORGANIZATIONS PPO<br />
where PPR.security_profile_id = PPO.security_profile_id<br />
and security_profile_name like &#8216;%&amp;your_security_profile_name %&#8217;</p>
<p>2.To check global profile options setup :</p>
<p>select substr(e.profile_option_name,1,35) Profile,<br />
decode(a.level_id,10001,&#8217;Site&#8217;,10002,&#8217;Application&#8217;,10003,&#8217;Resp&#8217;,10004,&#8217;User&#8217;) L,<br />
decode(a.level_id,10001,&#8217;Site&#8217;,10002,c.application_short_name,<br />
10003,b.responsibility_name,10004,d.user_name) LValue,<br />
nvl(a.profile_option_value,&#8217;Is Null&#8217;) Value<br />
from  fnd_profile_option_values a, fnd_responsibility_tl b,<br />
fnd_application c, fnd_user d, fnd_profile_options e<br />
where  e.profile_option_name in (&#8216;ORG_ID&#8217;,'DEFAULT_ORG_ID&#8217;, &#8216;XLA_MO_SECURITY_PROFILE_LEVEL&#8217;,'XLA_MO_TOP_REPORTING_LEVEL&#8217;)<br />
and  e.profile_option_id = a.profile_option_id<br />
and  a.level_value = b.responsibility_id (+)<br />
and  a.level_value = c.application_id (+)<br />
and  a.level_value = d.user_id (+)<br />
order by 1,2;</p>
<p>2. To get detail of profile options setup at user level : </p>
<p>select substr(e.profile_option_name,1,35) Profile,<br />
decode(a.level_id,10001,&#8217;Site&#8217;,10002,&#8217;Application&#8217;,10003,&#8217;Resp&#8217;,10004,&#8217;User&#8217;) L,<br />
decode(a.level_id,10001,&#8217;Site&#8217;,10002,c.application_short_name,<br />
10003,b.responsibility_name,10004,d.user_name) LValue,<br />
nvl(a.profile_option_value,&#8217;Is Null&#8217;) Value<br />
from  fnd_profile_option_values a, fnd_responsibility_tl b,<br />
fnd_application c, fnd_user d, fnd_profile_options e<br />
where  e.profile_option_name in (&#8216;ORG_ID&#8217;,'DEFAULT_ORG_ID&#8217;, &#8216;XLA_MO_SECURITY_PROFILE_LEVEL&#8217;,'XLA_MO_TOP_REPORTING_LEVEL&#8217;)<br />
and  e.profile_option_id = a.profile_option_id<br />
and  a.level_value = b.responsibility_id (+)<br />
and  a.level_value = c.application_id (+)<br />
and  a.level_value = d.user_id (+)<br />
and decode(a.level_id,10001,&#8217;Site&#8217;,10002,&#8217;Application&#8217;,10003,&#8217;Resp&#8217;,10004,&#8217;User&#8217;) = &#8216;User&#8217;<br />
and decode(a.level_id,10001,&#8217;Site&#8217;,10002,c.application_short_name,10003,b.responsibility_name,10004,d.user_name) in (&#8216;&amp;user_name&#8217; )   &#8212; enter fnd user name<br />
order by 1,2;</p>
<p>3. To get detail of  profile options setup at Site and Application level : </p>
<p>select substr(e.profile_option_name,1,35) Profile,<br />
decode(a.level_id,10001,&#8217;Site&#8217;,10002,&#8217;Application&#8217;,10003,&#8217;Resp&#8217;,10004,&#8217;User&#8217;) L,<br />
decode(a.level_id,10001,&#8217;Site&#8217;,10002,c.application_short_name,<br />
10003,b.responsibility_name,10004,d.user_name) LValue,<br />
nvl(a.profile_option_value,&#8217;Is Null&#8217;) Value<br />
from  fnd_profile_option_values a, fnd_responsibility_tl b,<br />
fnd_application c, fnd_user d, fnd_profile_options e<br />
where  e.profile_option_name in (&#8216;ORG_ID&#8217;,'DEFAULT_ORG_ID&#8217;, &#8216;XLA_MO_SECURITY_PROFILE_LEVEL&#8217;,'XLA_MO_TOP_REPORTING_LEVEL&#8217;)<br />
and  e.profile_option_id = a.profile_option_id<br />
and  a.level_value = b.responsibility_id (+)<br />
and  a.level_value = c.application_id (+)<br />
and  a.level_value = d.user_id (+)<br />
and decode(a.level_id,10001,&#8217;Site&#8217;,10002,&#8217;Application&#8217;,10003,&#8217;Resp&#8217;,10004,&#8217;User&#8217;) in (&#8216;Site&#8217;, &#8216;Application&#8217;)<br />
order by 1,2,3;</p>
<p>4. To get detail of  profile options setup at Responsibility level : .</p>
<p>select substr(e.profile_option_name,1,35) Profile,<br />
decode(a.level_id,10001,&#8217;Site&#8217;,10002,&#8217;Application&#8217;,10003,&#8217;Resp&#8217;,10004,&#8217;User&#8217;) L,<br />
decode(a.level_id,10001,&#8217;Site&#8217;,10002,c.application_short_name,<br />
10003,b.responsibility_name,10004,d.user_name) LValue,<br />
nvl(a.profile_option_value,&#8217;Is Null&#8217;) Value<br />
from  fnd_profile_option_values a, fnd_responsibility_tl b,<br />
fnd_application c, fnd_user d, fnd_profile_options e<br />
where  e.profile_option_name in (&#8216;ORG_ID&#8217;,'DEFAULT_ORG_ID&#8217;, &#8216;XLA_MO_SECURITY_PROFILE_LEVEL&#8217;,'XLA_MO_TOP_REPORTING_LEVEL&#8217;, &#8216;FND_INIT_SQL&#8217;)<br />
and  e.profile_option_id = a.profile_option_id<br />
and  a.level_value = b.responsibility_id (+)<br />
and  a.level_value = c.application_id (+)<br />
and  a.level_value = d.user_id (+)<br />
and decode(a.level_id,10001,&#8217;Site&#8217;,10002,&#8217;Application&#8217;,10003,&#8217;Resp&#8217;,10004,&#8217;User&#8217;) in (&#8216;Resp&#8217;)<br />
and upper(decode(a.level_id,10001,&#8217;Site&#8217;,10002,c.application_short_name,10003,b.responsibility_name,10004,d.user_name)) like upper(&#8216;%&amp;resp_name%&#8217;)<br />
order by 1,2,3;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dineshnair.wordpress.com/130/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dineshnair.wordpress.com/130/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dineshnair.wordpress.com/130/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dineshnair.wordpress.com/130/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/dineshnair.wordpress.com/130/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/dineshnair.wordpress.com/130/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/dineshnair.wordpress.com/130/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/dineshnair.wordpress.com/130/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dineshnair.wordpress.com/130/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dineshnair.wordpress.com/130/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dineshnair.wordpress.com/130/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dineshnair.wordpress.com/130/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dineshnair.wordpress.com/130/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dineshnair.wordpress.com/130/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dineshnair.wordpress.com&amp;blog=7549997&amp;post=130&amp;subd=dineshnair&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dineshnair.wordpress.com/2009/05/05/multi-organization-access-control/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/58f134fe6c9e30ac137f0169cf87b4ab?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dineshnair</media:title>
		</media:content>
	</item>
	</channel>
</rss>
