Posts

Showing posts from 2016

FND_REQUEST.SUBMIT_REQUEST

declare v_request_id number(15); v_user_id               fnd_user.user_id%TYPE := 40827; v_responsibility_id     fnd_responsibility.responsibility_id%TYPE; l_boolean  boolean begin     select name into l_db     from v$database;         SELECT responsibility_id     INTO v_responsibility_id     FROM fnd_responsibility_vl     WHERE responsibility_name = 'AR Receivables';         -- set environment context     fnd_global.apps_initialize (v_user_id,                                 v_responsibility_id,                                 v_application_id                                 );     l_boolean := fnd_request.set_mode (TRUE);  v_request_id :=       fnd_request.submit_request (  'XXAPP',           -- Application Short Name                                     'XXSHORTNAME',     -- Program Name                                     'DESCRIPTION',  -- Description                                     SYSDATE,                  -- Start_time                        

Create attachments and attach them to Sales Order Header or Order Lines

Use the API below to create the attachment. This could be a limited text that you want on the order header or line. OE_FND_ATTACHMENTS_PUB.CREATE_SHORT_TEXT_DOCUMENT (1.0, --version P_SHORT_TEXT, --Text to be added as attachment P_CATEGORY_ID, -- Attachment category id P_DESCRIPTION, -- Attachment description NULL, V_SECURITY_ID, --The value is 4 for no security NULL, 'Y', 'O', -- One time usage SYSDATE, NULL, NULL, V_DOCUMENT_ID , -- Document id returned by the API V_RETURN_STATUS_CS, V_MSG_COUNT_CS, V_MSG_DATA_CS); Pass V_DOCUMENT_ID from above API into below second API OE_FND_ATTACHMENTS_PUB.ADD_ATTACHMENT (1.0, P_ENTITY_NAME, --Value of this parameter would be 'OE_ORDER_HEADERS' for header level attachment -- and 'OE_ORDER_LINES' for line level attachment P_PK1_VALUE, --line id or header id (For line level or header level attachment) NULL, NULL, NULL, NULL, 'N', NULL, V_DOCUMENT_ID , --Document id from above ap

Script to find Oracle API's

select substr(a.owner,1,20) , substr(a.name,1,30) , substr(a.type,1,20) , substr(u.status,1,10) stat , u.last_ddl_time , substr(text,1,80) description from dba_source a, dba_objects u where 2=2 and u.object_name = a.name and a.text like '%Header%' and a.type = u.object_type and a.name like 'PA_%API%' order by a.owner, a.name;

How to find list of Users assigned to a responsibility

select u.description name,u.user_name logon, t.description, t.responsibility_name, d.start_date resp_start_date,  last_logon_date, u.creation_date, email_address from apps.fnd_user u, apps.fnd_responsibility r, apps.fnd_user_resp_groups_direct d, apps.fnd_responsibility_vl t where t.responsibility_id=d.responsibility_id and u.user_id=d.user_id and d.responsibility_id=r.responsibility_id and (t.end_date is null or t.end_date > sysdate) and (u.end_date is  null or u.end_date > sysdate) and u.description <> '1' and (d.end_date is null or d.end_date > sysdate) and upper(t.responsibility_name) like  '%PAYABLES%' order by 1,3;