E9.2 Copy PDF file from PrintQueue to file share

akkakm

Active Member
Hello,
We are in process of migrating from JDE 9.0 TR 9.2.2.8 to JDE 9.2 TR 9.2.7.3, we are retrofiting our objects, one of the base object using this function B0500180 to copy the PDF file from F:\JDEdwards\E920\PrintQueue\ and to copy to file share \\server\folder.
We are using the system user and I did a map drive from Entreprise Server to file share to be sure that no issue with security acces, and every thing is OK, the system user can access to file share Read/Write.
The same object, in JDE 9.0, I have no issue with, the ErrorCode = 0, but in the new env. JDE 9.2, the ErrorCode = 1.
I checked every, may be I missed something, any one has an idea it will welcomed
Thanks in advance for the help
Mohamed
EnterpriseOne 9.20
Tools Release : 9.2.7.3
Enterprise Server : W2019x64 / Visual C++ .NET 2022
Web Server : W2019x64 / IBM WebSphere WAS 9.0.5.14


Database Server : Microsoft SQL Server 2019
 
Try using business function B4700230 "Delete or Copy Flat File" instead with action '2'. While B0500180 hasn't had a code change in years, JDE possibly changed the underlying tools function called from B0500180 when using the 'R' function. I no longer have access to an older tools release to confirm, but it may have worked for you similar to like the Unix "move" function operated, which can either move a file to a different path, rename it in place, or move and rename at the same time.
 
Hi Mo,

In addition to Kim's excellent suggestion, another option may be to use the B34A1030 - Execute External Program business function. You would have to build the command to be used as a parameter for the business function.

Have you logged onto the enterprise server as the user under which JDE is run and tested the copy involved. I'm not sure if that is what you meant by system user. In JDE the system user is the database user id.
 
As say peterbruce, we usually use Execute External Program, in your case you should mount a unit \\server\folder in your server (you can configurate in fstab if your server si linux) and execute external command (in our case linux enterprise \bin\cp -f fileOrigin fileDestination)
 
Thanks for all of you guys, I realy appreciate your help, the function B4700230 is only for TEXT, I used the B34A1030 - Execute External Program, but I got an issue, the PDF copied with zero KB in my file share.

My goal is to copy the R03B5001_ZJDE_PDF.PDF from PrintQueue to a file share \\Server\folder. I just replace the function B0500180 by B34A1030 in my custom report R55xxx which is called at the End Section of R03B5001.
I ends up with empty PDF, but in JDE 9.0 (TR 9.2.28) the function B0500150 working perfect.

R03B500X -> R03B5005 -> R03b5001 -> R55xxxx the call is synchronous.

any idea I appreciate
Regards

1709865659759.png
 
Hi Mo,

Does the user ID under which JDE is run have appropriate permissions to the file share to be able to write the copied file there.
 
Thanks Peterbruce, yes the system user has a full access to use the share file, I logged with my user, and after that I request a map drive with the user system, and I was able to explore the file share without any issue....It is a maystery.
Regards
 
I think could be a server permissions in the folder from or destination, or user...

Could you launch in mode debug level 6 and get the command for B34A1030 - Execute External Program and if has error, and launch the command in your server with jde920 user logon and check if file is copied?

Update us and share log exit.
REgards.
 
Try using business function B4700230 "Delete or Copy Flat File" instead with action '2'. While B0500180 hasn't had a code change in years, JDE possibly changed the underlying tools function called from B0500180 when using the 'R' function. I no longer have access to an older tools release to confirm, but it may have worked for you similar to like the Unix "move" function operated, which can either move a file to a different path, rename it in place, or move and rename at the same time.
In addition to Kim's excellent suggestion, another option may be to use the B34A1030 - Execute External Program business function. You would have to build the command to be used as a parameter for the business function.
This is good advice, as B0500180 calls jdeRename which works like the rename() POSIX system call, and the rename underlying system call requires the file source and destination of renaming to be on the same physical volume (literally it just changes the iNode's pointer).

If B0500180 checked errno after jdeRename failed, I bet it would say "EXDEV" was the error code, which means "The links named by new and old are on different file systems and the implementation does not support links between file systems."
 
Last edited:
I had a similar issue, and I came to conclude that B4700230 must not work on binary files. So, I ended up using execute external program and building the "dos" copy command to get around it. I have successfully used execute external command to launch a powershell script too. That works.
 
Hello everyone,
Thanks guys for your feedback, I appreciate your help, finaly I used the function B34A1030 and every thing was fine.
Regards
Mo
 
Back
Top