Skip to main content

Posts

Showing posts from August, 2017

Using Attachement API in Oracle Apps

How to use Attachment APIs 1. Create Directory - Optional CREATE DIRECTORY test as '/home/oracle/' Grant all on directory test to public   2. Upload file to the location / Identify the location of the Document to be attached   3. DECLARE l_rowid ROWID ; l_attached_document_id NUMBER ; l_document_id NUMBER ; l_media_id NUMBER ; l_category_id NUMBER ; l_pk1_value fnd_attached_documents.pk1_value% TYPE := 747085 ; ----<Primary Key information that uniquely identifies the product (such as the product_ID)>; l_description fnd_documents_tl.description% TYPE := 'Test Attachment' ; l_filename VARCHAR2 ( 240 ) := 'FNDWRR.pdf' ; --'cost allocation code.txt'; --'<File Name>'; l_file_path varchar2 ( 240 ) := 'test' ; ---'SALE_INVOICE_PATH'; --Server Directory Path for upload files l_seq_num NUMBER ; l_blob_data BLOB ; l_blob BLOB ; l_bfile BFILE ; l_byte NUMBER ; l_fnd_user_id NUMBER ; l_short_d

Discoverer: Command Line Export / Import

Command Line Export / Import Instructions java -jar eulbuilder.jar -connect apps/password@$Database -import <FILE_NAME>.eex -keep_format_properties -preserve_workbook_owner -auto_refresh -log <LOG_FILENAME> java -jar eulbuilder.jar -identifier -export <FILE_NAME>.eex -connect apps/password@$Database -audit_info -created_by ORACLE_APPS -set_updated_by ORACLE_APPS -cmdfile export.txt -log <LOG_FILENAME>

Assign WorkList Access to EBS User

Script uses API to assign WF User Roles for Worklist access set serveroutput on  declare  l_userTable WF_DIRECTORY.UserTable;  l_roleName varchar2(240):='<EBS USERNAME>';  l_roleDispName varchar2(240):='<EBS USERNAME>';  l_userName varchar2(240):='<EBS USERNAME>';  l_userDispName varchar2(240):='<EBS USERNAME>';  begin -- wf_directory.CreateAdHocUser(name=>l_userName, -- display_name=>l_userDispName,language=>'AMERICAN', territory=>'UNITED KINGDOM'); --dbms_output.put_line('After User '|| l_userName);  l_userTable(0) := l_userName;  wf_directory.CreateAdHocRole2(role_name=>l_roleName,  role_display_name=>l_roleDispName,  role_users=>l_userTable,language=>'AMERICAN', territory=>'UNITED KINGDOM');  dbms_output.put_line('After Role '|| l_roleName);  commit;  end; Now run the following sqls to verify the wfds tables select * from wf_

Discoverer Queries to find Report Details

How to find the External Table referred in the Query? SELECT doc_name, ba_name,   folder_name,   user_name,   ext_table,   EUL FROM   (SELECT d.DOC_name,     b.ba_name ba_name,     o.obj_name folder_name,     o.sobj_ext_table ext_table,     e.EXP_name item_name,     UPPER (USR1.user_name) user_name,     'EUL4_US' EUL   FROM eul4_us.eul5_objs o   LEFT JOIN eul4_us.eul5_expressions e   ON o.obj_id = e.it_obj_id   LEFT JOIN eul4_us.eul5_elem_xrefs x   ON e.exp_id = x.ex_to_id   LEFT JOIN eul4_us.eul5_documents d   ON d.doc_id = x.ex_from_id   LEFT JOIN eul4_us.EUL5_ba_obj_links l   ON l.bol_obj_id = o.obj_id   LEFT JOIN eul4_us.EUL5_bas b   ON b.ba_id = l.bol_ba_id   LEFT JOIN eul4_us.eul5_eul_users EU1   ON d.DOC_EU_ID + 0 = EU1.eu_id   LEFT JOIN applsys.fnd_user USR1   ON SUBSTR (EU1.eu_username, 2) = TO_CHAR (USR1.user_id)   WHERE b.ba_name LIKE '%'   --AND upper(e.exp_name) LIKE upper('%')                        --folder item

Workflow Important Debug Queries

deq_time is not always populated in WF_DEFERRED. The best way to monitor is to check if there are any READY events select msg_state,count(*) from applsys.aq$wf_deferred  group by msg_state; For getting Item_Type and Display name for Runnable processes. SELECT WFA_ACT.ITEM_TYPE ITEM_TYPE ,   WFA_ACT.NAME PROCESS_NAME ,   WFA_ACT.DISPLAY_NAME DISPLAY_NAME FROM wf_activities_vl wfa_act WHERE wfa_act.runnable_flag = 'Y' AND wfa_act. type            = 'PROCESS' AND sysdate BETWEEN wfa_act.begin_date AND NVL(wfa_act.end_date, sysdate); Query to find records that are pending in each of the workflow agent listener queues SELECT 'select ''' || t.component_name || ' (queue_table: ' || p.queue_table ||        ')''||'' Count: ''||count(*) c from ' || p.owner || '.' || .queue_table ||        ' where deq_time is null and nvl(delay,enq_time)<sysdate-1/24  ||        nvl2(t.correlation_id,