Wednesday, April 12, 2017

Create Employee Contact in Oracle Apps


/* Formatted on 2017/04/12 15:35 (Formatter Plus v4.8.8) */
DECLARE
ln_contact_rel_id per_contact_relationships.contact_relationship_id%TYPE;
ln_ctr_object_ver_num per_contact_relationships.object_version_number%TYPE;
ln_contact_person per_all_people_f.person_id%TYPE;
ln_object_version_number per_contact_relationships.object_version_number%TYPE;
ld_per_effective_start_date DATE;
ld_per_effective_end_date DATE;
lc_full_name per_all_people_f.full_name%TYPE;
ln_per_comment_id per_all_people_f.comment_id%TYPE;
lb_name_comb_warning BOOLEAN;
lb_orig_hire_warning BOOLEAN;
BEGIN
— Create Employee Contact
— ————————————-
hr_contact_rel_api.create_contact
( — Input data elements
— —————————–
p_start_date => sysdate,
p_business_group_id => fnd_profile.VALUE
(‘PER_BUSINESS_GROUP_ID’),
p_person_id => XX, — Number field
p_contact_type => ‘M’,
p_date_start => TO_DATE (’12-Apr-2017′),
p_last_name => ‘XYZ’,
p_first_name => ‘XX’,
p_personal_flag => ‘Y’,
— Output data elements
— ——————————–
p_contact_relationship_id => ln_contact_rel_id,
p_ctr_object_version_number => ln_ctr_object_ver_num,
p_per_person_id => ln_contact_person,
p_per_object_version_number => ln_object_version_number,
p_per_effective_start_date => ld_per_effective_start_date,
p_per_effective_end_date => ld_per_effective_end_date,
p_full_name => lc_full_name,
p_per_comment_id => ln_per_comment_id,
p_name_combination_warning => lb_name_comb_warning,
p_orig_hire_warning => lb_orig_hire_warning
);
COMMIT;
EXCEPTION
WHEN OTHERS
THEN
ROLLBACK;
DBMS_OUTPUT.put_line (SQLERRM);
END;


API to Create Supplier


/* Formatted on 2017/04/12 15:39 (Formatter Plus v4.8.8) */
 -- API to Create Supplier

DECLARE
   l_vendor_rec      ap_vendor_pub_pkg.r_vendor_rec_type;
   l_return_status   VARCHAR2 (10);
   l_msg_count       NUMBER;
   l_msg_data        VARCHAR2 (1000);
   l_vendor_id       NUMBER;
   l_party_id        NUMBER;
BEGIN
-- --------------
-- Required
-- --------------
   l_vendor_rec.segment1 := '0000000001';
   l_vendor_rec.vendor_name := 'XYZ';
-- -------------
-- Optional
-- --------------
   l_vendor_rec.match_option := 'R';
   pos_vendor_pub_pkg.create_vendor (
                                     p_vendor_rec         => l_vendor_rec,
                                     x_return_status      => l_return_status,
                                     x_msg_count          => l_msg_count,
                                     x_msg_data           => l_msg_data,
                                     x_vendor_id          => l_vendor_id,
                                     x_party_id           => l_party_id
                                    );
   COMMIT;
EXCEPTION
   WHEN OTHERS
   THEN
      ROLLBACK;
      DBMS_OUTPUT.put_line (SQLERRM);
END;


Tuesday, April 11, 2017

Oracle Apps Inventory Tables

Following are important tables in Oracle Apps Inventory
MTL_SYSTEM_ITEMS_B
This table holds the definitions for inventory items, engineering items, and purchasing items. The primary key for an item is the INVENTORY_ITEM_ID and ORGANIZATION_ID.
MTL_ITEM_STATUS
This is the definition table for material status codes. Status code is a required item attribute. It indicates the status of an item, i.e., Active, Pending, Obsolete.
MTL_UNITS_OF_MEASURE_TL
This is the definition table for both the 25-character and the 3-character units of measure. The base_uom_flag indicates if the unit of measure is the primary unit of measure for the uom_class. Oracle Inventory uses this table to keep track of the units of measure used to transact an item.
MTL_ITEM_LOCATIONS
This is the definition table for stock locators. The associated attributes describe which subinventory this locator belongs to, what the locator physical capacity is, etc.
MTL_ITEM_CATEGORIES
This table stores inventory item assignments to categories within a category set.
MTL_CATEGORIES_B 
This is the code combinations table for item categories.
MTL_CATEGORIES_B and MTL_CATEGORIES_TL. MTL_CATEGORIES_TL table holds translated Description for Categories.
MTL_CATEGORY_SETS_B 
It contains the entity definition for category sets.
MTL_DEMAND
This table stores demand and reservation information used in Available To Promise, Planning and other Manufacturing functions. There are three major row types stored in the table: Summary Demand rows,Open Demand Rows, and Reservation Rows.
MTL_SECONDARY_INVENTORIES 
This is the definition table for the subinventory.
MTL_ONHAND_QUANTITIES
It stores quantity on hand information by control level and location.
MTL_TRANSACTION_TYPES
It contains seeded transaction types and the user defined ones.
MTL_MATERIAL_TRANSACTIONS 
This table stores a record of every material transaction or cost update performed in Inventory.
MTL_ITEM_ATTRIBUTES
This table stores information on item attributes.
MTL_ITEM_CATALOG_GROUPS_B 
This is the code combinations table for item catalog groups.
MTL_ITEM_REVISIONS_B 
It stores revision levels for an inventory item.
MTL_CUSTOMER_ITEMS 
It stores customer item information for a specific customer. Each record can be defined at one of the following levels: Customer, Address Category, and Address. The customer item definition is organization independent.
MTL_SYSTEM_ITEMS_INTERFACE 
It temporarily stores the definitions for inventory items, engineering items and purchasing items before loading this information into Oracle Inventory.
MTL_TRANSACTIONS_INTERFACE 
It allows calling applications to post material transactions (movements, issues, receipts etc. to Oracle Inventory  transaction module.
MTL_ITEM_REVISIONS_INTERFACE
It temporarily stores revision levels for an inventory item before loading this information into Oracle Inventory.
MTL_ITEM_CATEGORIES_INTERFACE
This table temporarily stores data about inventory item assignments to category sets and categories before loading this information into Oracle Inventory.
MTL_DEMAND_INTERFACE 
It is the interface point between non-Inventory applications and the Inventory demand module. Records inserted into this table are processed by the Demand Manager concurrent program.
MTL_INTERFACE_ERRORS
It stores errors that occur during the item interface process reporting where the errors occurred along with the error messages.
MTL_PARAMETERS
It maintains a set of default options like general ledger accounts; locator, lot, and serial controls, inter-organization options, costing method, etc. for each organization defined in Oracle Inventory.

Register Table in Oracle Apps EBS


Create custom table on Custom Scheme
After that create synonym in APPS scheme.

CREATE TABLE XX_XTR_BOND_MASTER
(
BOND_CODE_ID          NUMBER                  NOT NULL,
BOND_CODE             VARCHAR2(20 BYTE)       NOT NULL,
BOND_NAME             VARCHAR2(200 BYTE),
TENURE                NUMBER,
HOLIDAY_CONSESSION    VARCHAR2(2 BYTE),
INTEREST_FREQUENCY    VARCHAR2(2 BYTE),
INTEREST_PAY_DATE     DATE,
EFFECTIVE_START_DATE  DATE,
EFFECTIVE_END_DATE    DATE,
LAST_UPDATE_DATE      DATE                    NOT NULL,
LAST_UPDATED_BY       NUMBER                  NOT NULL,
LAST_UPDATE_LOGIN     NUMBER,
CREATION_DATE         DATE                    NOT NULL,
CREATED_BY            NUMBER(15)              NOT NULL,
ATTRIBUTE1            VARCHAR2(150 BYTE),
ATTRIBUTE2            VARCHAR2(150 BYTE),
ATTRIBUTE3            VARCHAR2(150 BYTE),
ATTRIBUTE4            VARCHAR2(150 BYTE),
ATTRIBUTE5            VARCHAR2(150 BYTE),
ATTRIBUTE6            VARCHAR2(150 BYTE),
ATTRIBUTE7            VARCHAR2(150 BYTE),
ATTRIBUTE8            VARCHAR2(150 BYTE),
ATTRIBUTE9            VARCHAR2(150 BYTE),
ATTRIBUTE10           VARCHAR2(150 BYTE),
ATTRIBUTE11           VARCHAR2(150 BYTE),
ATTRIBUTE12           VARCHAR2(150 BYTE),
ATTRIBUTE13           VARCHAR2(150 BYTE),
ATTRIBUTE14           VARCHAR2(150 BYTE),
ATTRIBUTE15           VARCHAR2(150 BYTE),
ATTRIBUTE_CATEGORY1   VARCHAR2(250 BYTE)
);


CREATE SYNONYM APPS.XX_XTR_BOND_MASTER FOR XX_XTR_BOND_MASTER;


BEGIN
AD_DD.REGISTER_TABLE(‘XX’,’XX_XTR_BOND_MASTER’,’T’);
END;

BEGIN
AD_DD.DELETE_TABLE(‘XX’,’XX_XTR_BOND_MASTER’);
END;

BEGIN
AD_DD.REGISTER_COLUMN(‘XXREC’,’XX_XTR_BOND_MASTER’,’BOND_CODE_ID’,1,’NUMBER’,100,’N’,’N’);
AD_DD.REGISTER_COLUMN(‘XXREC’,’XX_XTR_BOND_MASTER’,’BOND_CODE’,2,’VARCHAR2′,20,’N’,’N’);
AD_DD.REGISTER_COLUMN(‘XXREC’,’XX_XTR_BOND_MASTER’,’BOND_NAME’,3,’VARCHAR2′,200,’Y’,’N’);
AD_DD.REGISTER_COLUMN(‘XXREC’,’XX_XTR_BOND_MASTER’,’TENURE’,4,’NUMBER’,100,’Y’,’N’);
AD_DD.REGISTER_COLUMN(‘XXREC’,’XX_XTR_BOND_MASTER’,’HOLIDAY_CONSESSION’,5,’VARCHAR2′,2,’Y’,’N’);
AD_DD.REGISTER_COLUMN(‘XXREC’,’XX_XTR_BOND_MASTER’,’INTEREST_FREQUENCY’,6,’VARCHAR2′,2,’Y’,’N’);
AD_DD.REGISTER_COLUMN(‘XXREC’,’XX_XTR_BOND_MASTER’,’INTEREST_PAY_DATE’,7,’DATE’,20,’Y’,’N’);
AD_DD.REGISTER_COLUMN(‘XXREC’,’XX_XTR_BOND_MASTER’,’EFFECTIVE_START_DATE’,8,’DATE’,20,’Y’,’N’);
AD_DD.REGISTER_COLUMN(‘XXREC’,’XX_XTR_BOND_MASTER’,’EFFECTIVE_END_DATE’,9,’DATE’,20,’Y’,’N’);
AD_DD.REGISTER_COLUMN(‘XXREC’,’XX_XTR_BOND_MASTER’,’LAST_UPDATE_DATE’,10,’DATE’,20,’N’,’N’);
AD_DD.REGISTER_COLUMN(‘XXREC’,’XX_XTR_BOND_MASTER’,’LAST_UPDATED_BY’,11,’NUMBER’,20,’N’,’N’);
AD_DD.REGISTER_COLUMN(‘XXREC’,’XX_XTR_BOND_MASTER’,’LAST_UPDATE_LOGIN’,12,’NUMBER’,20,’Y’,’N’);
AD_DD.REGISTER_COLUMN(‘XXREC’,’XX_XTR_BOND_MASTER’,’CREATION_DATE’,13,’DATE’,20,’N’,’N’);
AD_DD.REGISTER_COLUMN(‘XXREC’,’XX_REC_XTR_BOND_MASTER’,’CREATED_BY’,14,’NUMBER’,20,’N’,’N’);
AD_DD.REGISTER_COLUMN(‘XXREC’,’XX_XTR_BOND_MASTER’,’ATTRIBUTE1′,15,’VARCHAR2′,250,’N’,’N’);
AD_DD.REGISTER_COLUMN(‘XXREC’,’XX_XTR_BOND_MASTER’,’ATTRIBUTE2′,16,’VARCHAR2′,250,’N’,’N’);
AD_DD.REGISTER_COLUMN(‘XXREC’,’XX_XTR_BOND_MASTER’,’ATTRIBUTE3′,17,’VARCHAR2′,250,’N’,’N’);
AD_DD.REGISTER_COLUMN(‘XXREC’,’XX_XTR_BOND_MASTER’,’ATTRIBUTE4′,18,’VARCHAR2′,250,’N’,’N’);
AD_DD.REGISTER_COLUMN(‘XXREC’,’XX_XTR_BOND_MASTER’,’ATTRIBUTE5′,19,’VARCHAR2′,250,’N’,’N’);
AD_DD.REGISTER_COLUMN(‘XXREC’,’XX_XTR_BOND_MASTER’,’ATTRIBUTE6′,20,’VARCHAR2′,250,’N’,’N’);
AD_DD.REGISTER_COLUMN(‘XXREC’,’XX_XTR_BOND_MASTER’,’ATTRIBUTE7′,21,’VARCHAR2′,250,’N’,’N’);
AD_DD.REGISTER_COLUMN(‘XXREC’,’XX_XTR_BOND_MASTER’,’ATTRIBUTE8′,22,’VARCHAR2′,250,’N’,’N’);
AD_DD.REGISTER_COLUMN(‘XXREC’,’XX_XTR_BOND_MASTER’,’ATTRIBUTE9′,23,’VARCHAR2′,250,’N’,’N’);
AD_DD.REGISTER_COLUMN(‘XXREC’,’XX_XTR_BOND_MASTER’,’ATTRIBUTE10′,24,’VARCHAR2′,250,’N’,’N’);
AD_DD.REGISTER_COLUMN(‘XXREC’,’XX_XTR_BOND_MASTER’,’ATTRIBUTE11′,25,’VARCHAR2′,250,’N’,’N’);
AD_DD.REGISTER_COLUMN(‘XXREC’,’XX_XTR_BOND_MASTER’,’ATTRIBUTE12′,26,’VARCHAR2′,250,’N’,’N’);
AD_DD.REGISTER_COLUMN(‘XXREC’,’XX_XTR_BOND_MASTER’,’ATTRIBUTE13′,27,’VARCHAR2′,25,’N’,’N’);
AD_DD.REGISTER_COLUMN(‘XXREC’,’XX_XTR_BOND_MASTER’,’ATTRIBUTE14′,28,’VARCHAR2′,250,’N’,’N’);
AD_DD.REGISTER_COLUMN(‘XXREC’,’XX_XTR_BOND_MASTER’,’ATTRIBUTE15′,29,’VARCHAR2′,250,’N’,’N’);
AD_DD.REGISTER_COLUMN(‘XXREC’,’XX_XTR_BOND_MASTER’,’ATTRIBUTE_CATEGORY1′,30,’VARCHAR2′,250,’N’,’N’);
END;

How to generate XML report through PL/SQL Code


First Create procedure or package in Database.
See below sample code
Create or replace procedure xx_test_pro_rep(errfbuff out varchar2,retcode out varchar2)
IS
CURSOR data_cur
IS
SELECT empno, ename, job, hiredate, sal
FROM emp;
output_row data_cur%ROWTYPE;
BEGIN
DBMS_OUTPUT.put_line
(‘<?xml version=”1.0″ encoding=”US-ASCII” standalone=”no”?>’);
fnd_file.put_line
(fnd_file.output,
‘<?xml version=”1.0″ encoding=”US-ASCII” standalone=”no”?>’
);
DBMS_OUTPUT.put_line (‘<OUTPUT>’);
fnd_file.put_line (fnd_file.output, ‘<OUTPUT>’);
—
OPEN data_cur;
LOOP
—
FETCH data_cur
INTO output_row;
EXIT WHEN data_cur%NOTFOUND;
—
DBMS_OUTPUT.put_line (‘<ROW>’);
fnd_file.put_line (fnd_file.output, ‘<ROW>’);
—
DBMS_OUTPUT.put_line ( ‘<ENUM>’
|| DBMS_XMLGEN.CONVERT (output_row.empno)
|| ‘</ENUM>’
);
fnd_file.put_line (fnd_file.output,
‘<ENUM>’
|| DBMS_XMLGEN.CONVERT (output_row.empno)
|| ‘</ENUM>’
);
—
DBMS_OUTPUT.put_line ( ‘<ENAME>’
|| DBMS_XMLGEN.CONVERT (output_row.ename)
|| ‘</ENAME>’
);
fnd_file.put_line (fnd_file.output,
‘<ENAME>’
|| DBMS_XMLGEN.CONVERT (output_row.ename)
|| ‘</ENAME>’
);
—
DBMS_OUTPUT.put_line ( ‘<JOB>’
|| DBMS_XMLGEN.CONVERT (output_row.job)
|| ‘</JOB>’
);
fnd_file.put_line (fnd_file.output,
‘<JOB>’
|| DBMS_XMLGEN.CONVERT (output_row.job)
|| ‘</JOB>’
);
—
DBMS_OUTPUT.put_line ( ‘<HIRE_DATE>’
|| DBMS_XMLGEN.CONVERT (output_row.hiredate)
|| ‘</HIRE_DATE>’
);
fnd_file.put_line (fnd_file.output,
‘<HIRE_DATE>’
|| DBMS_XMLGEN.CONVERT (output_row.hiredate)
|| ‘</HIRE_DATE>’
);
—
DBMS_OUTPUT.put_line ( ‘<SAL>’
|| DBMS_XMLGEN.CONVERT (output_row.sal)
|| ‘</SAL>’
);
fnd_file.put_line (fnd_file.output,
‘<SAL>’
|| DBMS_XMLGEN.CONVERT (output_row.sal)
|| ‘</SAL>’
);
—
DBMS_OUTPUT.put_line (‘</ROW>’);
fnd_file.put_line (fnd_file.output, ‘</ROW>’);
—
END LOOP;
CLOSE data_cur;
—
DBMS_OUTPUT.put_line (‘</OUTPUT>’);
fnd_file.put_line (fnd_file.output, ‘</OUTPUT>’);
—
END xx_test_pro_rep;

After that create executable and Concurrent program.
In concurrent program output format is “XML”.
Add CP to responsibility and run program from SRS window.
See output file of that program.


Thanks
Sajal Agarwal

Difference between Open Interface and API in Oracle Apps


Open Interfaces-
  • In EBS one Open Interface may run many API calls.
  • Open Interface run asynchronously.
  • The good is that if there is failure of record, they remain in the table until either fixed or purged.
  • They automate the interface into the APIs.
  • This requires less work and less code as few SQL DML would simply .
APIs-
  • When there is no corresponding Open Interface.
  • Normally all Oracle APIs run synchronously, and provide immediate responses, therefore machism to be provided to handle such situation.
  • That requires custom error handling routine.
  • This may requires lot more effort as these need fine grain control approach.

How to copy attachment files from One record to another



Test Procedure for Copy Attachments(Short, Long, File, URL)
PROCEDURE copy_attachment (p_sow_number VARCHAR2)
IS
CURSOR c_long (l_sow_number VARCHAR2)
IS
SELECT ad.seq_num, dct.category_id, dt.description, dat.datatype_id,
dlt.long_text, af.function_name,
det.data_object_code entity_name, ad.pk1_value, d.media_id
FROM fnd_document_datatypes dat,
fnd_document_entities_tl det,
fnd_documents_tl dt,
fnd_documents d,
fnd_document_categories_tl dct,
fnd_attached_documents ad,
fnd_documents_long_text dlt,
fnd_doc_category_usages dcu,
fnd_attachment_functions af
WHERE d.document_id = ad.document_id
AND dt.document_id = d.document_id
AND dct.category_id = d.category_id
AND d.datatype_id = dat.datatype_id
AND ad.entity_name = det.data_object_code
AND dlt.media_id = d.media_id
AND dcu.category_id = d.category_id
AND dcu.attachment_function_id = af.attachment_function_id
AND function_name = ‘xxx_DTL_FUN’
AND dcu.enabled_flag = ‘Y’
AND dat.NAME = ‘LONG_TEXT’
AND pk1_value = l_sow_number;
CURSOR c_short (l_sow_number VARCHAR2)
IS
SELECT ad.seq_num, dct.category_id, dt.description, dat.datatype_id,
dlt.short_text, af.function_name,
det.data_object_code entity_name, ad.pk1_value, d.media_id
FROM fnd_document_datatypes dat,
fnd_document_entities_tl det,
fnd_documents_tl dt,
fnd_documents d,
fnd_document_categories_tl dct,
fnd_attached_documents ad,
fnd_documents_short_text dlt,
fnd_doc_category_usages dcu,
fnd_attachment_functions af
WHERE d.document_id = ad.document_id
AND dt.document_id = d.document_id
AND dct.category_id = d.category_id
AND d.datatype_id = dat.datatype_id
AND ad.entity_name = det.data_object_code
AND dlt.media_id = d.media_id
AND dcu.category_id = d.category_id
AND dcu.attachment_function_id = af.attachment_function_id
AND function_name = ‘xxx_DTL_FUN’
AND dcu.enabled_flag = ‘Y’
AND dat.NAME = ‘SHORT_TEXT’
AND pk1_value = l_sow_number;
CURSOR c_file (l_sow_number VARCHAR2)
IS
SELECT ad.seq_num, dct.category_id, dt.description, dat.datatype_id,
af.function_name, ad.entity_name, ad.pk1_value, d.media_id,
l.file_name
FROM fnd_document_datatypes dat,
fnd_document_entities_tl det,
fnd_documents_tl dt,
fnd_documents d,
fnd_document_categories_tl dct,
fnd_attached_documents ad,
fnd_lobs l,
fnd_doc_category_usages dcu,
fnd_attachment_functions af
WHERE d.document_id = ad.document_id
AND dt.document_id = d.document_id
AND dct.category_id = d.category_id
AND d.datatype_id = dat.datatype_id
AND ad.entity_name = det.data_object_code
AND l.file_id = d.media_id
AND dcu.category_id = d.category_id
AND dcu.attachment_function_id = af.attachment_function_id
AND function_name = ‘xxx_DTL_FUN’
AND dat.NAME = ‘FILE’
AND dcu.enabled_flag = ‘Y’
AND pk1_value = l_sow_number;
CURSOR c_url (l_sow_number VARCHAR2)
IS
SELECT ad.seq_num, dct.category_id, dt.description, dat.datatype_id,
af.function_name, ad.entity_name, ad.pk1_value, d.media_id,
d.url, d.file_name
FROM fnd_document_datatypes dat,
fnd_document_entities_tl det,
fnd_documents_tl dt,
fnd_documents d,
fnd_document_categories_tl dct,
fnd_attached_documents ad,
fnd_doc_category_usages dcu,
fnd_attachment_functions af
WHERE d.document_id = ad.document_id
AND dt.document_id = d.document_id
AND dct.category_id = d.category_id
AND d.datatype_id = dat.datatype_id
AND ad.entity_name = det.data_object_code
AND dcu.category_id = d.category_id
AND dcu.attachment_function_id = af.attachment_function_id
AND dat.NAME = ‘WEB_PAGE’
AND dcu.enabled_flag = ‘Y’
AND function_name = ‘xxx_DTL_FUN’
AND pk1_value = l_sow_number;
BEGIN
FOR rec_long IN c_long (p_sow_number)
LOOP
fnd_webattch.add_attachment
(seq_num => rec_long.seq_num,
category_id => rec_long.category_id,
document_description => rec_long.description,
datatype_id => rec_long.datatype_id,
text => rec_long.long_text,
file_name => NULL,
url => NULL,
function_name => rec_long.function_name,
entity_name => rec_long.entity_name,
pk1_value => :header_block.sow_number,
–rec_long.pk1_value,
pk2_value => NULL,
pk3_value => NULL,
pk4_value => NULL,
pk5_value => NULL,
media_id => rec_long.media_id,
user_id => :header_block.created_by,
usage_type => ‘O’
);
END LOOP;
FOR rec_short IN c_short (p_sow_number)
LOOP
fnd_webattch.add_attachment
(seq_num => rec_short.seq_num,
category_id => rec_short.category_id,
document_description => rec_short.description,
datatype_id => rec_short.datatype_id,
text => rec_short.short_text,
file_name => NULL,
url => NULL,
function_name => rec_short.function_name,
entity_name => rec_short.entity_name,
pk1_value => :header_block.sow_number,
–rec_short.pk1_value,
pk2_value => NULL,
pk3_value => NULL,
pk4_value => NULL,
pk5_value => NULL,
media_id => rec_short.media_id,
user_id => :header_block.created_by,
usage_type => ‘O’
);
END LOOP;
FOR rec_file IN c_file (p_sow_number)
LOOP
fnd_webattch.add_attachment
(seq_num => rec_file.seq_num,
category_id => rec_file.category_id,
document_description => rec_file.description,
datatype_id => rec_file.datatype_id,
text => NULL,
file_name => rec_file.file_name,
url => NULL,
function_name => rec_file.function_name,
entity_name => rec_file.entity_name,
pk1_value => :header_block.sow_number,
–rec_short.pk1_value,
pk2_value => NULL,
pk3_value => NULL,
pk4_value => NULL,
pk5_value => NULL,
media_id => rec_file.media_id,
user_id => :header_block.created_by,
usage_type => ‘O’
);
END LOOP;
FOR rec_url IN c_url (p_sow_number)
LOOP
fnd_webattch.add_attachment
(seq_num => rec_url.seq_num,
category_id => rec_url.category_id,
document_description => rec_url.description,
datatype_id => rec_url.datatype_id,
text => NULL,
file_name => rec_url.file_name,
url => rec_url.url,
function_name => rec_url.function_name,
entity_name => rec_url.entity_name,
pk1_value => :header_block.sow_number,
–rec_short.pk1_value,
pk2_value => NULL,
pk3_value => NULL,
pk4_value => NULL,
pk5_value => NULL,
media_id => rec_url.media_id,
user_id => :header_block.created_by,
usage_type => ‘O’
);
END LOOP;
END;