Skip to main content

Hi Everyone,

We are trying to automate the process of External File Assistant for Vouchers, Customer Invoices and Supplier Invoices by having a Reader and Routing Rule to pick up a file when dropped into the SFTP server folder, and to execute the relevant logic through a Custom Event.

However the Reader picks up the file, but in the Application Messages it fails with the following error:

ORA-20112: ExternalBatchLoadFile.FND_RECORD_EXIST: The External Batch Load File already exists.

When we query and check the External_Batch_Load_File_Tab we can see the record has been created though. Is it trying to create it again?

The Reader is as below (ignore the Enabled toggle, its enabled when testing):


And Routing Rule as below:
 


Anyone who has come across this issue?

Best Regards,
Devin Amarasekara​​​​​​​

Dear @devin.amarasekara 

are you sure this is the right way to import an external file?

Usually, we use the “External File Assistant”:

You can also automate it here by using the batch process.


Hi @Link ,
 

Does the Batch Process automatically read the files if we copy it to a location on the SFTP Server (if we have defined the SERVER_DIRECTORY parameter)? or do we have to manually trigger the batch process with a schedule?

Best Regards,
Devin


Hi @devin.amarasekara 

why is it important to import these files from the SFTP server?

As far as I know you can’t import an external file via sftp to IFS.

The location for an external file is the database server if you want to use the batch process.


Hi @Link ,

It seems to be the customer requirement.

I can see the files in the External_Batch_Load_File_Tab though.
 


Best Regards,
Devin


Hi @devin.amarasekara 

 

Can you explain more on what your custom event is doing in this scenario?

You can create a batch process in the external file assistant and invoke the correct file template using the file name as I remember correct.

 

Regards,

Damith


Among other things, you also want to import manual supplier invoices, correct?

The error message says that your invoice already exists. Choose a unique ID in the file and try to import it again.

What routing address and rule do you use for it?


Hi @dsj ,

The Custom Event includes a SQL Statement getting file name from the fndcn_message_body_tab, and then creating the batch parameter message by setting the relevant values to its attributes depending on the file type and file template (we have created Reader, Message Queue, Routing Rule, Custom Event and Action for each external file category we are trying to handle… CustomerInvoice, Supplier Invoice, Vouchers, etc) which will be .
And then Creating the Load Id Param and then executing the External File Utility API’s Start_Input_Batch method. 

Best Regards,
Devin


Hi @Link ,

The error message is related to the External File loaded itself isnt it? I might be mistaken.

We have created separate routing rules for each fiel type, with Ext_File_Server_Util_API.Load_External_File as the routing address.

Best Regards,
Devin


Hi @Link ,

The error message is related to the External File loaded itself isnt it? I might be mistaken.

We have created separate routing rules for each fiel type, with Ext_File_Server_Util_API.Load_External_File as the routing address.

Best Regards,
Devin

Yes, it is. But if the supplier invoice already exist and is closed you can’t create a new one with the same id. Check that.


Hi @dsj ,

The Custom Event includes a SQL Statement getting file name from the fndcn_message_body_tab, and then creating the batch parameter message by setting the relevant values to its attributes depending on the file type and file template (we have created Reader, Message Queue, Routing Rule, Custom Event and Action for each external file category we are trying to handle… CustomerInvoice, Supplier Invoice, Vouchers, etc) which will be .
And then Creating the Load Id Param and then executing the External File Utility API’s Start_Input_Batch method. 

Best Regards,
Devin

 

Hi Devin,

I think you could solve the error easily by placing the event on EXTERNAL_BATCH_LOAD_FILE_TAB (Entity: ExternalBatchLoadFile ) on new object created.

There you can get the file name and use it for the batch schedule.

I had to do a similar event for a customer requirement and can give some tips here ;)

  • I’ve scheduled EXTERNAL_FILE_UTILITY_API.EXECUTE_BATCH_PROCESS2 which is the same method used by the assistant
  • In the event action, before creating the batch schedule, impersonate user to a finance super user. Otherwise the batch schedule is created with IFSCONNECT user and you have to give the sufficient rights to to execute the process

Hope it helps!

Damith


Reply