How to Configure Expense report Numbers? Customized expense report number

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.