Thursday, October 27, 2016

Calling a Concurrent Program - Web ADI


Calling a concurrent program can be achieved by defining an ‘importer’ during Integrator definition (Please follow other Web ADI posts for details).


There are three options to define an importer



Asynchronous concurrent request:
Here Integrator submits the specified concurrent program after completing the upload and returns the request ID to the user, but does not wait for the import program to complete. This importer type reduces the wait time by deferring the import process. However, you need to verify the concurrent program by your own. it is recommended that you define pre-import rules with this type to validate the data at the time of upload. If the pre-validation fails, then integrator returns an error message.

 Synchronous concurrent request:
Integrator submits the specified concurrent program after completing the upload, waits for the program to complete, and then returns the results to the user. This importer type gives users immediate feedback about the success of the import, but can increase the wait time.

 PL/SQL AP:
It is same as the Synchronous concurrent request, only difference is that it calls an API instead on concurrent request and partly reduces the time by bypassing the concurrent processing queue.

Here, I am using an Asynchronous Concurrent Request importer type.
“Asynchronous concurrent request” importer type allows:
-          Pre-Import Rules    - Optional                          
-          Group Definitions  - Optional
-          Document Row : Interface Attribute Mapping - Optional
-          Concurrent Program Request Submission  - Mandatory
-          Success Message Definition  - Optional
-          Cleanup - Optional

Pre-Import Rules:  These can be used to run a select statement or to run some PL/SQL.  We can define a pre-import rule in order to use a value from the spreadsheet as a parameter value in the concurrent program submission.
 
Rule can be based on :
SQL Query
PL/SQL API Function
PL/SQL API Procedure
Sequence


I am using SQL Query and taking benefit_name from the staging table.

* Please note that it always fetches the first row of the result.

Test your query and ‘Apply’

Provide the reference name so that you can refer this rule.
Group Definition:  It is needed when you want to process the records in a particular group. I am skipping it here.

Document Row : Interface Attribute Mapping: This rule type is required for asynchronous concurrent request importer and optional for other importer types. This is how we identify each row that may have a unique result. I am skipping it here.

Concurrent Program Request Submission - Specifies the concurrent program to perform the import. This rule type is required only for an asynchronous or synchronous importer type.
Select the specified concurrent program name and ‘Apply’

Please provide ‘Reference Name’ and any values you want. Here I am providing default value ‘NEW’ to p_status and the importer rule value to the benefit name.

Value source can be:
Environment Variables
Import
Import Table
Upload Parameters

‘Apply’

Success Message Definition: You can provide a message to display when the import process is submitted successfully.

Program 'XXAK: Content Parameter Test ADI Program' Submitted Successfully With Request ID: $import$.requestid
Please verify the status from concurrent request window.

‘Apply’
Cleanup - Specifies cleanup processing to perform if errors occurred during any of the previous importer rules. I am skipping it here.

‘Submit’

> Now It is time to test,  run the ADI
Insert a new row and ‘upload’

Note the request id returned

Check the request






*Parameter tag and value for import is bne:import=Yes or No
Yes: Program submitted automatically after the upload



Ref: My Experience/Oracle Metalink/User Guides/Different other blogs available/Colleagues

Signing Limit - API

Unfortunately there is no any API available to enter signing limit.

Is There A Method To Enter Signing Limits Other Than Through The Form? (Doc ID 171837.1)
fix:
This must be done through the form. There is no supported API or alternate method which can be used.

Through form >
Payable Manager > Employee > Signing Limit

Else,

Do the direct insert to the base table ?
           --
          insert into ap_web_signing_limits_all
                                        (document_type
                                        ,employee_id
                                        ,cost_center
                                        ,signing_limit
                                        ,last_update_date
                                        ,last_updated_by
                                        ,last_update_login
                                        ,creation_date
                                        ,created_by
                                        ,org_id
                                        )
                                  values('APEXP'
                                        ,ln_person_id
                                        ,lc_cost_center
                                        ,ln_signing_limit
                                        ,sysdate
                                        ,fnd_profile.value('USER_ID')
                                        ,fnd_profile.value('LOGIN_ID')
                                        ,sysdate
                                        ,fnd_profile.value('USER_ID')
                                        ,ln_org_id                                     
                                        );         

Ref: http://ebsanil.blogspot.co.uk/2012/09/oracle-employee-signingapproval-limits.html

ORA-20001: The Value Set value XXXXXXXX is invalid for this Value Set

Another error while calling API pay_element_entry_api.create_element_entry. I was passing the correct value but API was returning this error.

Reason: Value set used for the API column is dependent on the session values or using FND_SESSION table

Insert an entry in the fnd_session table before calling the API and then remove the same after the call.



Ref: My Experience/Oracle Metalink/User Guides/Different other blogs available/Colleagues

ORA-20001: The QuickCode is invalid for XXXX_XXXXXXX

I got this error while calling the API pay_element_entry_api.create_element_entry

Reason: Incorrent value passed
Solution: Make sure you are pass the lookup code value not the meaning or description to the entry values also date values in the correct format.



Ref: My Experience/Oracle Metalink/User Guides/Different other blogs available/Colleagues