Tuesday, 18 July 2023
EBS : WHEN-TAB-PAGE-CHANGED change code in oracle forms in Oracle Apps (r12)
Sunday, 16 July 2023
EBS : Step to change supplier name prompt in AP Invoice Workflow in Oracle Apps (r12)
Step to change supplier name prompt in AP Invoice Workflow
Go to below table and update the display name
before change
Oracle : How to convert Column to Row in SQL in Oracle Apps (r12)
Convert Text (column) to Row in Oracle Apps
SELECT REGEXP_SUBSTR(p_inv_org_id,'[^,]+', 1, LEVEL) COL1 FROM DUAL
CONNECT BY LEVEL <= REGEXP_COUNT(p_inv_org_id, ',') + 1
===========================================================================
#SQL QUERY #Oracle Apps #EBS #Column to Row conversion #PLSQL #r12 #REGEXP
EBS : API to Add / Remove Concurrent Program from Request Group in Oracle Apps (r12)
How to ADD / Remove concurrent
Program using API in Request Group
Remove Concurrent Request from request Group
BEGIN
begin
apps.fnd_program.remove_from_group
(PROGRAM_SHORT_NAME => 'XXTECHARDS_PROG',
PROGRAM_APPLICATION => 'SQLAP',
REQUEST_GROUP => 'All_Payables',
GROUP_APPLICATION => 'SQLAP'
);
commit;
exception
when no_data_found then
dbms_output.put_line('Unable to remove from Request group');
end;
ADD Concurrent Request from request Group
begin
apps.fnd_program.add_to_group(
PROGRAM_SHORT_NAME => 'XXTECHARDS_TRANS',
PROGRAM_APPLICATION => 'SQLAP',
REQUEST_GROUP => 'All_Payables',
GROUP_APPLICATION => 'SQLAP'
);
=========================================================================
#Oracle Apps #EBS #Concurrent Request #Remove Concurrent Program from Request Group #Add Concurrent Program from Request Group #Request Group
#Add Concurrent Program to Request group without front end.
Tuesday, 11 July 2023
EBS : API To Delete Concurrent Program and Executable in Oracle Apps (R12)
DECLARE
v_executable_short_name VARCHAR2 (200);
v_application VARCHAR2 (200);
BEGIN
v_executable_short_name := 'XX_SHORTNAME'; ---Short name
v_application := 'Payables';
apps.fnd_program.delete_executable (executable_short_name => v_executable_short_name,
application => v_application
);
COMMIT;
END;
--API : How to Delete Concurrent Program AND Executable From Backend ---
begin
fnd_program.delete_program('TECHHARDS_SHORTNAME','APPLICATION');
fnd_program.delete_executable('TECHHARDS_EXE_NAME','APPLICATION');
COMMIT;
end;
EBS : Trigger in Sales Order Line Interface in Oracle Apps
How to write Trigger in Sales Order Line Interface
EBS : AR Interface Scripts in Oracle Apps (R12)
AR Interface Scripts in Oracle Apps (R12)
Some Important AR Interface Tables are :-
- ra_interface_lines_all
- ra_interface_distributions_all
- ra_interface_errors_all
Standard Import Program Name :- Autoinvoice Import Program
Saturday, 1 July 2023
Java : Send Email from Java
Java Code to send email
package com;
import java.io.File;
import java.util.Date;
import java.util.Properties;
import javax.activation.DataHandler;
import javax.activation.DataSource;
import javax.activation.FileDataSource;
import javax.mail.Authenticator;
import javax.mail.Message;
import javax.mail.MessagingException;
import javax.mail.Multipart;
import javax.mail.PasswordAuthentication;
import javax.mail.Session;
import javax.mail.Transport;
import javax.mail.internet.AddressException;
import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeBodyPart;
import javax.mail.internet.MimeMessage;
import javax.mail.internet.MimeMultipart;
/********
* This class is used to utility that sends e-mail messages.
* @author TechHards
*******/
public class EmailSender {
/*********
* Sends an e-mail with attachments.
* @param host address of the server
* @param port port number of the server
* @param userName email address used to send mails
* @param password password of the email account
* @param toAddress email address to send
* @param subject title of the email
* @param message content of the email
* @param attachFiles an array of file paths
* @throws AddressException
* @throws MessagingException
********/
public void sendEmail(String host, String port, String userName, String password,
String toAddress, String subject, String message, String[] attachFiles)
throws AddressException, MessagingException {
// sets SMTP properties----
Properties properties = new Properties();
properties.put("mail.smtp.host", host);
properties.put("mail.smtp.port", port);
properties.put("mail.smtp.auth", "true");
properties.put("mail.smtp.starttls.enable", "false");
properties.put("mail.user", userName);
properties.put("mail.password", password);
// creates a new session with an authenticator
Authenticator auth = new SMTPAuthenticator(userName, password);
//Authenticator auth = new SMTPAuthenticator("finance", password);
System.out.println("Authenticator reached"+password);
Session session = Session.getInstance(properties, auth);
// creates a new e-mail message
MimeMessage msg = new MimeMessage(session);
msg.setFrom(new InternetAddress(userName));
InternetAddress[] toAddresses = {new InternetAddress(toAddress)};
msg.setRecipients(Message.RecipientType.TO, toAddresses);
msg.setSubject(subject);
msg.setSentDate(new Date());
// creates message part
MimeBodyPart messageBodyPart = new MimeBodyPart();
messageBodyPart.setContent(message, "text/html");
// creates multi-part
Multipart multipart = new MimeMultipart();
multipart.addBodyPart(messageBodyPart);
// adds attachments
if (attachFiles != null && attachFiles.length > 0) {
for (String filePath : attachFiles) {
addAttachment_fnc(multipart, filePath);
}
}
// sets the multi-part as e-mail's content
msg.setContent(multipart);
// sends the e-mail
Transport.send(msg);
}
/******
* You can add a file as an attachment to the email's content
* @param p_multipart
* @param p_filePath
* @throws MessagingException
*****/
private void addAttachment_fnc(Multipart p_multipart, String p_filePath) throws MessagingException {
MimeBodyPart l_attachPart = new MimeBodyPart();
DataSource source = new FileDataSource(p_filePath);
attachPart.setDataHandler(new DataHandler(source));
attachPart.setFileName(new File(p_filePath).getName());
p_multipart.addBodyPart(l_attachPart);
}
/**
* This class is used to provides authentication information.
* @author TechHards
*
*/
private class SMTPAuthenticator extends javax.mail.Authenticator {
private String userName;
private String password;
public SMTPAuthenticator(String p_userName, String p_password) {
this.userName = p_userName;
this.password = p_password;
System.out.println("#SMTPAuthenticator reached.User:"+p_userName);
System.out.println("SMTPAuthenticator reached.pwd:"+p_password);
}
public PasswordAuthentication getPasswordAuthentication() {
System.out.println("# PassAuthentication reached point");
return new PasswordAuthentication(userName, password);
}
}
}
-----------------------------------------------------------------------------------------------------------------------------Call Java Program to send email
-----------------------------------------------------------------------------------------------------------------------------
package com;
import javax.mail.MessagingException;
import javax.mail.internet.AddressException;
import com.EmailSender.*;
import com.EmailSender;
public class TechHardsEmailSender {
public static void main(String[] args) throws AddressException, MessagingException {
String host = "mailgate";
String port = "25";
String mailFrom = "techhards.admin@outlook.com";
String mailTo = "ebs@dilmahtea.com";
//#String mailTo = "techhards.admin@gmail.com";
String password = "Engineer";
String userName = "Engineer.admin";
String subject = "News email";
String bodyMessage = "<html><b>Hello</b><br/><i>This is an HTML email with an attachment</i></html>";
EmailSender sender = new EmailSender();
String[] fileAttachment = null ;//{"/tmp/a.pdf"};
sender.sendEmail(host, port, mailFrom, password, mailTo, subject, bodyMessage, fileAttachment);
}
}
--###############################################################################---
Saturday, 24 June 2023
EBS : Submit XML Publisher report from backend : Oracle Apps : RTF Layout
How to submit RTF Layout from Backend
DECLARE
l_bool BOOLEAN;
l_request_id NUMBER;
BEGIN
fnd_global.apps_initialize (user_id => 9999,--fnd_global.user_id,
resp_id => 20560,--fnd_global.resp_id,
resp_appl_id => 706--fnd_global.resp_appl_id
);
l_bool :=
fnd_request.add_layout (template_appl_name => '''TECHHARDS''',
template_code => '''TECHHARDS_OSP_COMP_SHRTG''',
template_language => '''EN''',
template_territory => '''IN''',
output_format => '''PDF'''
);
l_request_id :=
fnd_request.submit_request (application => '''TECHHARDS''',
program => '''TECHHARDS_OSP_COMP_SHRTG''',
description => '',
start_time => SYSDATE,
sub_request => NULL
-- argument1 => fnd_global.org_id,
-- argument2 => p_inv_id
);
IF l_request_id = 0
THEN
DBMS_OUTPUT.put_line (l_request_id);
-- raise_application_error (-20001, '''Dear Unable to Submit Report''');
END IF;
DBMS_OUTPUT.put_line (l_request_id);
COMMIT;
END;
Oracle APEX : Interview Question
Oracle APEX : Interview Question
Thursday, 22 June 2023
EBS : API to Register Table in Oracle APPS
EBS : API to Register Table in Oracle APPS
This section will guide you how to register tables to be used in Oracle Alerts and Flexfields with Oracle Applications. We will be learning about Procedures of AD_DD Package like procedure REGISTER_TABLE, REGISTER_COLUMN, DELETE_COLUMN, DELETE_TABLE,
Introduction
EBS comes with lots of seeded database tables, there can be multiple applications in which one might be required to create a custom table to be used. Flexfields (like KFF, DFF etc ) and Oracle Alert are the only features or products that require the custom tables to be registered in Oracle Apps
We can register custom application tables using a PL/SQL procedure in the AD_DD package.
We only need to register those tables (and all of their columns) that will be used. Application Object Library tables should you later modify your tables. If you alter the table later, then you may need to include revised or new calls to the table registration routines.
Alter registration steps:-
- a) a) delete the registration
- b) b) Re-register the table or column. Delete the column registration first, then the table registration.
- c) c) Commit your changes.
Example of calling AD_DD Package
1) Register Table
BEGIN
AD_DD.REGISTER_TABLE ('FND','HARDTECH','T');
END;
2) Register Column
BEGIN
AD_DD.REGISTER_COLUMN ('FND','TEST_DESC','RESOURCE_NAME', 1,'VARCHAR2', 150, 'Y', 'N');
End;
Procedures in the
AD_DD Package
1. Procedure REGISTER_TABLE
procedure register_table ( p_appl_short_name in varchar2,
p_tab_name in varchar2,
p_tab_type in varchar2,
p_next_extent in number default 512,
p_pct_free in number default 10,
p_pct_used in number default 70);
2. Procedure REGISTER_COLUMN
procedure register_column (p_appl_short_name in varchar2,
p_tab_name in varchar2,
p_col_name in varchar2,
p_col_seq in number,
p_col_type in varchar2,
p_col_width in number,
p_nullable in varchar2,
p_translate in varchar2,
p_precision in number default null,
p_scale in number default null);
3. Procedure DELETE_TABLE
procedure delete_table (p_appl_short_name in varchar2,
p_tab_name in varchar2);
4. Procedure DELETE_COLUMN
procedure delete_column (p_appl_short_name in varchar2,
p_tab_name in varchar2,
p_col_name in varchar2);
VARIABLE
NAMES
DESCRIPTION
p_appl_short_name The application short name of the application that owns the table
(usually your custom application).
p_tab_name The name of the table (in uppercase letters).
p_tab_type Use ’T’ if it is a transaction table (almost all application tables), or
’S’ for a ”seed data” table (used only by Oracle Applications
products).
p_pct_free The percentage of space in each of the table’s blocks reserved
for future updates to the table (1–99). The sum of p_pct_free and
p_pct_used must be less than 100.
p_pct_used Minimum percentage of used space in each data block of the
table (1–99). The sum of p_pct_free and p_pct_used must be
less than 100.
p_col_name The name of the column (in uppercase letters).
p_col_seq The sequence number of the column in the table (the order in
which the column appears in the table definition).
p_col_type The column type (’NUMBER’, ’VARCHAR2’, ’DATE’, etc.).
p_col_width The column size (a number). Use 9 for DATE columns, 38 for
NUMBER columns (unless it has a specific width).
p_nullable Use ’N’ if the column is mandatory or ’Y’ if the column allows null
values.
p_translate Use ’Y’ if the column values will be translated for an Oracle
Applications product release (used only by Oracle Applications
products) or ’N’ if the
values are not translated (most application columns).
p_next_extent The next extent size, in kilobytes. Do not include the ’K’.
p_precision The total number of digits in a number.
p_scale The number of digits to the right of the decimal point in a
number.
Example of Using the AD_DD Package
Here is an example of using the AD_DD package to register a flexfield table and its columns:
Though the use of AD_DD package does not require that the table should exist first, it is always
better to create one and proceed further. Use the below mentioned script to create the dummy
table. Use the APPS User ID to run the below mentioned queries from TOAD or SQL*PLUS.
CREATE TABLE TEST_DESC ( RESOURCE_NAME VARCHAR2 (150),
RESOURCE_TYPE VARCHAR2 (100),
ATTRIBUTE_CATEGORY VARCHAR2 (40),
ATTRIBUTE1 VARCHAR2 (150),
ATTRIBUTE2 VARCHAR2 (150),
ATTRIBUTE3 VARCHAR2 (150),
ATTRIBUTE4 VARCHAR2 (150),
ATTRIBUTE5 VARCHAR2 (150),
ATTRIBUTE6 VARCHAR2 (150)
);
FUSION: Purchasing Query
1) ---------CPA to PO Amount---------- select poh.segment1, (select sum(nvl(cpol.quantity,1)* cpol.unit_price) from po_headers_all cpoh,po...
-
1) 1) Create transient Attribute as Boolean type in your VO 2) 2) Place this syntax in a fields properties where dynamic is...
-
List of WEBADI Tables 1) Integrator BNE_INTEGRATORS_B BNE_INTEGRATORS_VL BNE_INTEGRATORS_TL Layout BNE_LAYOUTS_B BNE_LAYOUTS_VL BNE_LAYOUTS...