External File Processing

pfaloney

Well Known Member
We are implementing JDE at a division that uses external systems due to their unique processing requirements. At some point they may be brought completely onto the system but not for the initial implementation.

The issue is that they could have multiple instances of the same file (Text format) come through before it could be processed into JDE. These files will have the same unique prefix to identify what they are.

Due to security issues, we limit access to the import folder. These files will go into a hold folder and be renamed/transferred via an automated AS/400 script over to the import folder for processing to JDE.

The issue I have is what if multiple files come at the same time or close to the same time or a new file comes before the last file can be processed.

Also:

1: Can a UBE be run from a AS/400 Script
2: Can text files be transferred/renamed within JDE.
 
Hi Patrick,

We integrate a WMS with our ERP through the EDI tables in JD Edwards then process the inbound EDI with a UBE on the scheduler. Could this be a fit for you?

Regards,
 
Not sure what a WMS is.

However, some of the files will be via the F47 files and some will be processed directly to the Z-files.
 
Patrick,

[ QUOTE ]
We are implementing JDE at a division that uses external systems due to their unique processing requirements. At some point they may be brought completely onto the system but not for the initial implementation.

The issue is that they could have multiple instances of the same file (Text format) come through before it could be processed into JDE. These files will have the same unique prefix to identify what they are.

Due to security issues, we limit access to the import folder. These files will go into a hold folder and be renamed/transferred via an automated AS/400 script over to the import folder for processing to JDE.

The issue I have is what if multiple files come at the same time or close to the same time or a new file comes before the last file can be processed.

Also:

1: Can a UBE be run from a AS/400 Script
2: Can text files be transferred/renamed within JDE.



[/ QUOTE ]

Answers:

1: Can a UBE be run from a AS/400 Script: Probably, for unix and windows there is an executable called runube that takes a number of parameters. I know at one stage this executable was hard to find. But it might depend on the version of JDE you use - which you have neglected to include in you post or signature.

2: Can text files be transferred/renamed within JDE. Yes, there are a couple of business functions that will do that. There is also a business function that will execute a host command.

However to solve you problem of multiple files, instead of the AS/400 script renaming and transfering files to the JDE import folder, it would be better saving them in a holding folder, making sure that the unique prefix is intact. Create a custom table to store the unique prefix from the filename. You can write a JDE UBE to handle the renaming/transfering of the file and loading it into the F47 or Z tables. The UBE process would be something like:

1) Get a list of the files in the holding folder and save to text file.
2) Read the text file line by line.
for each line in the filelist text file:
3) extract the the unique prefix
4) check to see if the unique prefix is in the custom table
If the unique prefix is not in the custom table:
5) write the unique prefix to the custom table
6) move/copy/rename the import file to the JDE import folder
7) call another section or separate UBE to import the file

The above does not include error checking and unsuccessful import or cleanup processes.

I hop this helps.
 
Peter:

This may be viable.

I have some ideas on this that I am going to research. This may be a way to do a lot more automation that would reduce the behind the scenes processing on other functions.

Now if I can find the actual Business Functions. Not successful so far. The only ones I have found are Client Only.

Another issue may be we are AS/400 not windows based.
 
Patrick,

Below are most of the standard business functions I use for working with Flat/Text files. None are client only. I use them on Windows and Unix computers. I do not know about the AS/400. They all exist in E811 sp1 (TR 8.97.2.1) and I would expect that most would exist probably back to Xe or before.

Function Name:; OpSysFileOperations
Souce Module: B0500180
Description: Operating System File Operations Delete, Rename, File Exists

Function Name:; GetNewLineCharacter
Souce Module: B0800207
Description: Get New Line Character

Function Name:; CloseFlatFile
Souce Module: B34A1010
Description: Close Flat File

Function Name:; OpenFlatFile
Souce Module: B34A1010
Description: Open Flat File

Function Name:; WriteOneLine
Souce Module: B34A1010
Description: Write One Line To Flat File

Function Name:; ExecuteExternalProgram
Souce Module: B34A1030
Description: Execute External Program

Function Name:; DeleteOrCopyFlatFile
Souce Module: B4700230
Description: Delete Or Copy Flat File

Function Name:; ConvertCRLFtoHex
Souce Module: B7400150
Description: Convert CR And LR to Hexadecimal

Function Name:; AppendLineToFlatFile
Souce Module: B76B0220
Description: Append Line to Flat File

Function Name:; FetchNextLineFromFlatFile
Souce Module: B76B0220
Description: Fetch Next Line from Flat File
 
Hi. I hope someone can help me with this issue.

We are running 8.11SP1 on 8.97.2.5. We are a Windows 2003/SQL2005 environment.

I'm having an issue using the B34A1010 BSFN. I am trying to write a file to a UNC path. The path is setup as \\<servername>\<share>\dv\[filename].txt. I build this path from a UDC and the environment variable. When I pass the full UNC path to B34A1010, the flat file is not created. If I replace the UNC <servername> path with a local drive (D:\), the BSFN works as expected.

So, here is the syntax of what I am passing to the BSFN:

UNC: \\testjdec01\export\dv\boaw20110331.txt

Local: D:\export\dv\boaw20110331.txt

The local works. The UNC does not work. Is there a trick or syntax change for making the UNC path work correctly?
 
Hi,

Check that your JDE services (on your Enterprise Server)
are running under a domain account, not a local or
system account.
 
Our services are running under a domain account. This problem also occurs from the development client when I am processing the UBE locally.
 
To add on to Sebastian's statement in case you didn't read between the lines:
In general, local accounts do not have access to network resources.
 
Hi,
I also have faced this issue. Try changing the back slash to front slash. In Local the way you are passing is perfect, but in server it should be the other way.
Pass it as "testjdec01/export/dv/boaw20110331.txt"

Thanks,
Lakshmi
 
Peter,

Looks like you are a guru in using all the flat files BSFNs. I have a simple case where i want to append some data in a flat file. Looks like AppendLineToFlatFile is the one which I can use but do you know what's the mnRecordLength field is?
In my case, i have a flat file with data but once i write everything on a flat file, i want to append some data on top of the file, means at first row.
Please let me know If thats the BSFN i can use it for or do i need to use another one?

Thanks,
Tariq
 
Tarique,

mnRecordLength field is the number of characters that the business function shunts around to append the line to the end (last row) of the flat file.

If you want to add a row to the front of a flat file so it becomes the first line of the file, in a UBE it might be easier and quicker to run OS commands on the machine on which the UBE is running using ExecuteExternalProgram. But that depends on your system config - which you have not provided.

Add a row to the front of a flat file so it becomes the first line of the file using only business functions will be a bit long winded. However, without puting in the actual code/business functions:

1) rename the target_file (I'll refer to the new name file as copy_file)
2) Create a new file with the name of the target_file and write your new line to it.
3) read consecutive lines from copy_file and append them to the end of the target_file.

I hope the above helps.
 
Hi Sabastian,

i am struggling with an issue.. I need to execute unix command to print pdf to printer where i have all the info like file name and printer name in JDE custom table.

I tried to do it with B34A1030- Execute external program, you said in one of your post unix command can be executed either using .sh file or directly command can be mapped , so to test I mapped "pico C:\test1.txt" and "rm C:\test.txt"to see if it executes unix commands, could you please guide me if I am stepping in wrong direction

Thank you somuch in advance
Sridhar
 
[ QUOTE ]
Hi,
I also have faced this issue. Try changing the back slash to front slash. In Local the way you are passing is perfect, but in server it should be the other way.
Pass it as "testjdec01/export/dv/boaw20110331.txt"

Thanks,
Lakshmi

[/ QUOTE ]

I'm faced with similar problem when runs thru as a batch from the iSeries.

I alterted it including even the suggested /QNTC/.... but nothing comes thru.

I then attempted to write to a iSeries test folder off my profile and nothing.

And the same on others on this thread where it runs just fine as local request.

Curious.
confused.gif
 
Back
Top