Reference Document: Document ID 365238.1
According to the documentation, you only need to ap_web_oa_custom_pkg the program. Getnewexpensereportinvoice Add the Build logic
Examples of programs:
FUNCTION Getnewexpensereportinvoice (P_employeeid in Ap_expense_report_headers.employee_id%type, P_userid in Fnd_user.user_id%type, P_reportheaderid in Ap_expense_ Report_headers.report_header_id%type) RETURN VARCHAR2 is L_reportnumber ap_expense_report_headers.invoice_num%type : = NULL; L_username Fnd_user.user_name%type: = null; L_nreport number: = 0; BEGIN IF (P_employeeid is not null and P_userid are NOT null) then--SAMPLE CODE--IF you W Ant to access the Ap_web_repnum_prefix profiles option,--Use the following function:--Fnd_profile . value_specific (' Ap_web_repnum_prefix ', P_userid)----The following sample code would generate th E Report Invoice of <userid><YY-DDMMHHMI><-><number> format--Where:-- Userid:the Employee ' s user name--Yy:the Las 2 digit of the current year and--number:the total number of expense reports the employ EE has--for the current year, including the current report. ------Get the user name SELECT user_name into L_username from fnd_user fn D WHERE fnd.employee_id = P_employeeid and fnd.user_id = P_userid and Sysdate < = NVL (Fnd.end_date, sysdate) and rownum = 1; --Get The total of the number of expense report--This employee has a for current year SELECT count (*) Into L_nreport from ap_expense_report_headers WHERE employee_id = P_employeeid and T O_char (sysdate, ' rr ') = To_char (creation_date, ' RR '); L_nreport: = L_nreport + 1; --Max length of the report number is l_reportnumber: = SUBSTR (L_username, 1, 30) | | To_char (sysdate, ' Rr-ddmmhhmi ') | | '-'|| LTrim (To_char (l_nreport, ' 0999 ')); END IF; RETURN L_reportnumber; Exceptionwhen No_data_found Thenreturn NULL; When OTHERS then return NULL; END Getnewexpensereportinvoice;
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
How to Configure Expense report Numbers? Customized expense report number