Pages

Recently Viewed

Saturday, December 1, 2012

Concurrent Program Status


/* Query to check program status and completion time*/


SELECT fcr.REQUEST_ID,
  FU.USER_NAME,
  f.responsibility_name,
  fcr.USER_CONCURRENT_PROGRAM_NAME,
  DECODE(fcr.PHASE_CODE,'C','Completed','R','Running','E','Error','P','Pending','Other') PHASE,
  DECODE(fcr.STATUS_CODE,'C','Normal','E','Error','G','Warning','X','Terminated','Q','Sacheduled',fcr.STATUS_CODE)STATUS ,
  TO_CHAR(fcr.ACTUAL_START_DATE,'DD-MON-YYYY HH24:MI:SS') STARTED_AT,
  TO_CHAR(fcr.ACTUAL_COMPLETION_DATE,'DD-MON-YYYY HH24:MI:SS') ENDS_ON,
  ROUND((NVL(fcr.ACTUAL_COMPLETION_DATE,SYSDATE)-fcr.ACTUAL_START_DATE)*24*60) "Duration (mins)",
  fcr.argument_text,fo.file_type,fo.file_size,fo.file_name,LOGFILE_NAME, LOGFILE_NODE_NAME, OUTFILE_NAME,OUTFILE_NODE_NAME
FROM FND_CONCURRENT_REQUESTS fcr1,
  FND_CONC_REQ_SUMMARY_V FCR,
  FND_USER FU,
  fnd_conc_req_outputs fo,
  fnd_responsibility_vl f
WHERE FCR.REQUESTED_BY=FU.USER_ID
AND fcr.request_id = fo.concurrent_request_id(+)
and f.responsibility_id =  fcr.responsibility_id
and fcr1.REQUEST_ID = fcr.REQUEST_ID
AND USER_CONCURRENT_PROGRAM_NAME like ('%Programname%')
--and user_name like '%SANDEEP%'
ORDER BY NVL(fcr.ACTUAL_START_DATE,SYSDATE-1000) DESC;


Send Email using Task Scheduler

Requirement – Task scheduler to send any file as attachment.
 
Prerequisite – Should have SMTP details for any available email service
 
Resolution – Task scheduler has send email option, which is not helpful and people face many issues.
sendEmail is one utility, which can be used to fulfill the need. Download this executable file and save at system.
  1.        Create a task in scheduler
  2.        Select action- Run a program
  3.      Give the sendEmail.exe in file name
  1.  Start in (optional)=path of sendEmail.exe in your system
  2.  Add arguments (Optional) – provide mailing details as mentioned below -
-f sandeep19rm@gmail.com -u Test Email -m Here is the Email Option! -a sandeep.txt -t sandeep@oalearning.com -cc learning@oalearning.com -s smtp.gmail.com:587 -xu username@gmail.com -xp password -o tls=yes
 
Options :
-f
From Email Address
-u
Mail Subject
-m
Mail Body
-a
Attachment file name
-t
To Email Address
-cc
CC Email Address
-bcc
BCC Email Address
-s
SMTP details (server:port)
-xu
Username
-xp
Password
-o
Mailing options
 
 
 
 

Thursday, November 29, 2012

Windows Task Scheduler

This article is nowhere related with EBS, but will be useful for any computer users.
 
Requirement – Automated process to be executed on schedule basis in windows.
Wanted to ensure if there exist any specific file in system, I should be alerted with details.
 
Solution – Window provides task scheduler to achieve same. Task scheduler is same as oracle triggers with GUI.
 
How to find - Login to windows >> Start>> Task Scheduler
 
Create Task – Click on create Task action  
 
 
General Tab – Set the task name and description and click on Triggers
 
Triggers – This tab is to set the execution time. It can be set to run on schedule or on demand. Click on New button or edit existing schedule.
Provide scheduling detail and move to Actions

Actions- This is to perform different activity. It can run a program, send email or display messages. Click new button to set a new action.
Action = start a program   Program Name = Path of executable file.
We can give the file name only and place path in Start in (optional) block.
 
Conditions – To set various conditions when task should run and when not.
 
Settings – This is to define different instance scenarios.
 
Press OK and it will pop up the windows login password. Task will run at defined schedule.
 
 
 
 

Sunday, November 25, 2012

DOA assignment using Data Loader

Data loader is a tool, used for data entry during EBS setups. This can be leveraged to do any manual data entry in various applications.
This post is to have data loader script for assigning DOA (delegation of Authority) to oracle positions in procurement.
 
 
First DOA Assignments Update DOA Value Add additional DOA value
\{TAB} \{TAB} \{TAB}
POSITION POSITION POSITION
\{TAB} \{TAB} \{TAB}
Purchase Requisitions \{F11} \{F7}
\{TAB} Purchase Requisitions Purchase Requisitions
10M \^{F11} \{TAB}
\{TAB} \{TAB} 200K
\{TAB} \{TAB} \{TAB}
\^s \{TAB} \{TAB}
\{F4} SYSDATE \^s
\{ENTER}  \{TAB} \{F4}
  \^s \{ENTER}
  \{F4}  
  \{ENTER}  
 
First DOA Assignment - Position does not have any existing active/inactive assignment
Update DOA Value - Given sample is to end date existing assignment. Incase there is a change in value,give new value at second TAB.
Add additional DOA Value - assignment for a position having already some assignments. 

Sunday, September 23, 2012

Multiple Queries in Data Templete

Problem – Oracle report builder provides flexibility to create multiple queries and join those with common attribute. How does data template method help us to use multiple queries?

Solution – Data template also provides same flexibilities to list down queries in multiple sections and connect them as parent child relationship.
There are two approached available to join multiple queries in data template.
  •        Bind variable
  •        Data link method
Bind Variable most efficient and faster option. Identify the common column in parent query and use it as bind variable in child queries.
<dataQuery>
<sqlstatement name="Q1_USER">
<![CDATA[
SELECT user_id BIND_USER_ID ,user_name From fnd_user
]]>
</sqlstatement>

<sqlstatement name="Q2_RESP">
<![CDATA[
SELECT responsibility_id  From fnd_user_resp_groups WHERE user_id=: BIND_USER_ID
]]>
</sqlstatement>
</dataQuery>


Data Link is another way to establish the relationship between multiple queries
<link name="USER_RESP_LINK" parentQuery="Q1_USER" parentColumn="user_id" childQuery="Q2_RESP" childColumn="user_id" condition="Q1_USER.user_id= Q2_RESP.user_id" />


XML Output
<?xml version="1.0" encoding="UTF-8" ?>
< XXXOALEARNING >
<P_CUSTOMER/>100 </P_CUSTOMER/>
<LIST_G_USER>
<G_USER>
  <USERID>100</USERID>
  <USERNAME>Sandeep</USERNAME>
            <LIST_G_RESP>
            <G_RESP>
            <RESPONSIBILITY_ID>1010</ RESPONSIBILITY_ID >               
            <RESPONSIBILITY_ID>1020</ RESPONSIBILITY_ID >               
</G_RESP>
<LIST_G_RESP>
</G_USER>
<G_USER>
  <USERID>200</USERID>
  <USERNAME>Deepak</USERNAME>
            <LIST_G_RESP>
            <G_RESP>
            <RESPONSIBILITY_ID>1010</ RESPONSIBILITY_ID >               
            <RESPONSIBILITY_ID>1030</ RESPONSIBILITY_ID >               
</G_RESP>
<LIST_G_RESP>
</G_USER>
</LIST_G_USER>
</ XXXOALEARNING >

Insert Table in XML Layout

Requirement – Insert a Table in xml layout. Inserting table in MS word and placing place holder creates some alignment issues.

Options – Instead of creating table in MS word manually, we can use BI publisher desktop utility to insert table in RTF file.

  1.       Generate the XML Tags
  2.       Open the MS Word to create RTF layout
  3.       Go to Add on ( Menu) >> Data >> Load XML Data
  4.       Browse the xml file and load
  5.       Go to Add on ( Menu) >> Insert >> Table/Form>>Select the group and drag to Template section and press Drop All Nodes                                 
  6.       Select the Group and pick Table property (Other options are form and free form).Select and delete any unwanted field and press OK.                      


Table will be created with all column and respective place holders.

Saturday, September 22, 2012

XML Report Using Source as Data Template

Problem – Generate XML source for BI publisher report.

Solution – There is several options available to generate XML tags, intend as source for BI/XML publisher reports in EBS. One among those is use of data template.

Data Template is an xml file having predefined set of tags. Create a data template file and attach file at (XML Publisher Administrator (R) >> Data Definition >> Add Files >> Data Template)

Header
<?xml version="1.0" encoding="WINDOWS-1252" ?>
<dataTemplate name="XXXOALEARNING"  dataSourceRef="ORCL_DB1"   defaultPackage=”T1” version="1.0" >      


Data Trigger

<dataTrigger name="beforeParameter" source="T1.beforeParameterFunction"/>


Parameter Section
      <Parameters>
            <parameter name="p_param1" datatype="number"/>
      </Parameters>


Data Trigger

<dataTrigger name="afterParameter" source="T1.afterParameterFunction"/>
<dataTrigger name="beforeReport" source="T1.beforeReportFunction"/>

Query Section :
We can use multiple query here
     <dataQuery>
            <sqlstatement name="Q_EMP">
                <![CDATA[SELECT empname From EMP WHERE empid=: p_param1]]>
            </sqlstatement>
     </dataQuery>


Data Structure :
XML tag generation.

   <dataStructure>         
            <group name="G_EMP" source="Q_EMP">
                <element name="EMPNAME" value="empname"/>
           </group>
    </dataStructure>


Data Trigger
  
<dataTrigger name="aftreReport" source="T1. aftreReportFunction "/>

  
</dataTemplate>


Sample Data Template File
<?xml version="1.0" encoding="WINDOWS-1252" ?>
<dataTemplate name="XXXOALEARNING"  dataSourceRef="ORCL_DB1" defaultPackage="T1"   version="1.0" >      
<Parameters>
<parameter name="p_user_id" datatype="number"/>
</Parameters>
<dataQuery>
<sqlstatement name="Q_USER">
<![CDATA[
SELECT user_id,
                User_name,
       FROM FND_USER
       where
        user_id=:p_user_id
   ]]>
</sqlstatement>
</dataQuery>
<dataStructure>
<group name="G_USER" source="Q_USER">
                <element name="USERID" value="user_id"/>
<element name="USERNAME" value="user_name"/>
  </group>
</dataStructure>
</dataTemplate>


Sample generated XML -
<?xml version="1.0" encoding="UTF-8" ?>
< XXXOALEARNING >
<P_CUSTOMER/>100 </P_CUSTOMER/>
<LIST_G_USER>
<G_USER>
  <USERID>100</USERID>
  <USERNAME>Sandeep</USERNAME>
</G_USER>
</LIST_G_USER>
</ XXXOALEARNING >


Friday, September 21, 2012

XML Publisher - Different Executables & Data Source available

This post is to list out different executable and corresponding data source available for XML publisher report.

System Administrator Responsibility -
Concurrent >> Program >> Executable >> Create Executable file
                XML_LEARNING  (Oracle Report Builder)
                OA_LEARNING.XML_LEARNING (PL/SQL Stored Procedure)
                XDODTEXE (Java Concurrent Porgram)     <*** Standard program provided by Oracle>

Concurrent >> Program >> Define >> Create Program
                Executable Name – should be as above
                Output Format - XML

XML Publisher Responsibility -
Data Definition >> Create New data definition (code should be CP name)
                Data Template File = Attached if data source is XML file and CP is Java concurrent program

Template >> Create a new template and attach the layout (RTF) file

                                                                               
 Table: Different Executable and Data source for BI Report
 



Sunday, September 16, 2012

Excel Output Without XML publisher

Requirement There are limited formats available to view Concurrent Program output. XML is one format which is not available. 
                    
Available Options – XML publisher is one frequently used solution, which has capability to display output in PDF, EXCEL and RTF formats. EXCEL file generated using xml processing is having more size compare to actuals.
                                    
Solution – This post is to discuss another way to generate output file in EXCEL format without using XML publisher. A small setup change is required.
    1. Create a concurrent program having PL/SQL as executable
    2. Select the output type as any available option (ex - PCI)                              
    3. Print the output using FND_FILE.PUT_LINE(FND_FILE.OUTPUT,’Output Message’);
    4. Change the Mime type(view option) as EXCEL for PCL file format
    5. Run the concurrent program
    6. Select Tool>>Copy option to see the output

Limitation – To view multi column format, use a separator during output print. Once output is opened in excel use excel options to display multi column view by using used separator.  

Saturday, September 15, 2012

Update MIME type

There are few file formats available in oracle EBS to support concurrent program output.


Each file format is having standard Mime Type associated and being stored in FND_MIME_TYPES_TL Table, which can be updated to any other mime type using below script –

UPDATE fnd_mime_types_tl
SET    mime_type = 'application/vnd.ms-excel'
,      description = 'Excel (SYLK) used to be application/vnd.hp-PCL: Printer Control Language'
,      last_updated_by = 0
,      last_update_date = sysdate
WHERE  file_format_code = 'PCL'
AND   mime_type = 'application/vnd.hp-PCL';

COMMIT;

Monday, August 6, 2012

Emailing Concurrent Program Output

Requirement –  It is very common that business request to share concurrent program output file on every run.
 
 
Resolution – There are multiple options available to notify the output via email. Some of those are as below -

  • - PL/SQL program unit to send the output file
  • - Unix commands to send the output file
  • - Email bursting concepts, if it is XML publisher report
 
Each program requires, additional effort/custom programs to achieve the emailing feature. In this post we shall learn the options already available in system. Which need small configuration change and CP will send the o/p as email.
 
 
 
Steps :-
1)      Configuration Change – 2 profile needs to be set.
·        FND: SMTP Host   >> This to store the smtp server host details
·        FND: SMTP Host  >> This to store the smtp server port details
 
 
2)     While submitting the CP, click the Delivery Opts (B)
 
 
3)     Go to Email tab
 
 
4)     Provide the To/From email address and Subject line, then press OK (B)
5)     Submit/Schedule the program
Email bursting should be better approach, if we are working with XML publisher report.
Program will send the output file to specified email address. Program log file can be referenced in case any issue occurred.

Tuesday, July 31, 2012

Profile to Enable Examine Option

Requirement -  Examine option in oracle core forms is not opening

On Oracle forms getting below error, while trying to explore examine options




Resolution -  Set the profile “Utilities:Diagnostics” to YES
This profile will enable examine option J


Check the examine option again



Saturday, May 12, 2012

UNIX commands.....

1) zip and unzip : zip <file_name>.zip <file_required_to_zip>
                         $_Test>zip test.zip ls *.*   It will zip all files available at location and create test.zip file

2) Softt link Creation :  ln -s $FND_TOP/bin/fndcsper <filename>

3) Execute the enviornment script : . ./*.env

Set Enviornment Variable in Unix Server

Purpose - To set enviornment variable on unix server (for example Product_TOP and custom_TOP ).

Enviornment Variable - is the shell  script needs to run and assign the corrosponding path to variables.

How to Set -
 >> Login to unix server
 >>  locate  *.env
 >>  execute the *.env script

Default Location : /oracle/ebs/apps/apps_st/appl

File Name Format : $DBserviceName_$InstanceName.env ( * File name can be anything)
Command -
To set the enviornment variable = . ./XXXXX.env 
To validate the enviornment variable = echo $XXX_TOP


Wednesday, April 4, 2012

Desktop Integrator - A webADI Introduction

Introduction :
For single records transaction Oracle suggest to use the application and
provides open interface and public APIs for bulk transaction.
webADI is another strong feature provided by Oracle for bulk operations,
which allows user to provide input in MS application (Word or Excel..etc).


Why WebADI ? :
It requires technical expertise for both interface and API usages.
For interface user should know to insert all transactional data into interface table and API needs transactional data to be imported in any portable format to server.
WebADI does not have such technical dependency as it is available to user as function and Launch desktop integrator (Excel) to feed transactional data.
This provides reporting option also.


How It works :
        For this one interface package required to do  initial validations.
Post it we can use any of options -   
1) Either insert all data into Interface Tables and run the Import
    Program Manually
2) Call API inside the interface program and do transactions directly  


Components  :  
1) Integrator  - Basic definition and includes user name, internal
                       name and application name
2) Interface   -  Most Important section , which directs data to flow (can
                       be either of Table or Procedure/Function type)
3) Content  -    This is required if webADI is being used for reporting
                       purpose also
4)  Upload    -   Controls the upload options
5)  Importer –  Definition of import options
6)  Layout  -     Attributes arrangement on excel