Thursday, 29 September 2016

How to print 'Run By User' in Oracle Report Output

To capture the user name who is submitting concurrent request, by using fnd_global.user_id, follow the below steps:

1. Create a user parameter 'P_CONC_REQUEST_ID' of NUMBER type.

2. Add the below code in 'BEFORE REPORT' trigger:
SRW.USER_EXIT('FND SRWINIT');

3. Add the below code in 'AFTER REPORT' trigger:
SRW.USER_EXIT('FND SRWEXIT');

4. Use the below code to get the concurrent request id:
                                                  DECLARE
                                                         v_conc_req_by varchar2(1000);
                                                         v_conc_req_id number;
                                                  BEGIN
                                                 v_conc_req_id := fnd_global.user_id;
                                                If v_conc_req_id is not NULL then 
                                                           SELECT user_name into   v_conc_req_by
                                                          FROM fnd_user
                                                          WHERE user_id = fnd_global.user_id; 
                                                          return(v_conc_req_by);
                                              Else
                                          return NULL;
                                                      End If;
                                                  END;

Note: We may get the error "REP-1415: 'beforereport': Unknown user exit 'FND'" while running the RDF in Report Builder.

Oracle support says it is not supported feature to run them on the desktop.Sometimes you can comment out those user exits and run the report, then uncomments them before saving and sending to applications.

solution from Oracle is to run the report from Oracle concurrent manager.

Monday, 26 September 2016

How to print 'Request Id' in Oracle Report Output

To capture the concurrent request id which is submitted is by using fnd_global.conc_request_id, follow the below steps:

1. Create a user parameter 'P_CONC_REQUEST_ID' of NUMBER type.

2. Add the below code in 'BEFORE REPORT' trigger:
SRW.USER_EXIT('FND SRWINIT');

3. Add the below code in 'AFTER REPORT' trigger:
SRW.USER_EXIT('FND SRWEXIT');

4. Use the below code to get the concurrent request id:
                                                  DECLARE
                                                      v_conc_req_id number;
                                                  BEGIN
                                                      v_conc_req_id := fnd_global.conc_request_id; 
                                                      return(v_conc_req_id);
                                                  END;

Note: We may get the error "REP-1415: 'beforereport': Unknown user exit 'FND'" while running the RDF in Report Builder.

Oracle support says it is not supported feature to run them on the desktop.Sometimes you can comment out those user exits and run the report, then uncomments them before saving and sending to applications.

solution from Oracle is to run the report from Oracle concurrent manager.