Email Output

jagrams

jagrams

Member
Hello list,
I’ve researched available posts and found that JDE will almost do what I need to do.
I need to run a UBE and have it sent to a user via email. Here is what I think I need to do.
Create a ube that will launch the UBE that I want to email.
1) Use B91300C Launch Batch Application – call this in synchronous mode to make sure the called ube ends.
2) This is where I need help. I need to retrieve the Full path of where the file is on the server. Is there an API that can do this? I’m new to Unix, and it stores it differently than a AS/400.
3) Use B0500190 SendEmailHRM to send the email.
If anyone knows of a BSFN or custom code to get the full path, it would be appreciated.
 
Jeff,

Therer's a couple ways to do what you want - but since you're using B91300C already all you have to do is to contruct the full path yourself using the Job number passed back back from B91300C, the path to your server PrintQueue directory, the program name, and the version name as follows:

If VA rpt_mnServerJobNumber_JOBNBR is greater than <Zero>
VA rpt_szMailSubject_EMAL = concat("A/R Aging for ",concat(rtrim([BC Description (F0005)],' '),concat(" as of ",[SL DateToday ])))
VA rpt_szFilePath_DRPT = concat("/u01/oneworld/b7333/PrintQueue/R03B4201B_WAG0099_",concat([VA rpt_mnServerJobNumber_JOBNBR],"_PDF"))
VA rpt_szAttachmentFileName_DRPT = concat("AR_Aging_for_",concat(rtrim([BC Description (F0005)]," "),".pdf" ) )
Send E-Mail - HRM
"OneWorld" -> szFrom
VA rpt_szToEmailAddress_EMAL -> szTo
<Blank> -> szCC
VA rpt_szMailSubject_EMAL -> szSubject
<Blank> -> szMessageTextChar256
"1" -> cIncludeAttachmentFlag01
VA rpt_szFilePath_DRPT -> szNameOfAttachmentFile
VA rpt_szAttachmentFileName_DRPT -> szAttachmentDisplayText
<Zero> -> cSendCopyOfEMailToSelfFlag01
<Zero> -> cSetOneWorldErrorFlag01
<Zero> -> cRecordOperInLogFileFlag01
UNDEFINED -> cAppenOrOverwriteLogFile01
UNDEFINED -> szNameOfLogFile
VA rpt_mnErrorIndicator_EIND <- mnErrorCodeReturned
End If
 
Hi Larry,

I tried your solution, it works out fine for sending the emails, but when i tried to send an attachment it gives me an error of 16 "Attachment file does not exist".

The path for an attachment i am giving is for my local machine i.e "D:\PrintQueue\R570202B_RV57TEST_PDF", am I missing any slashes?.

I am passing a value of 1 in "cIncludeAttachmentFlag01".

Thanks.
 
Hi detroit1,

Just seeing your syntax, wouldn't be better:
D:\PrintQueue\R570202B_RV57TEST.PDF
instead of
D:\PrintQueue\R570202B_RV57TEST_PDF

changing the dash to dot before file extension?

Regards,

Zoltán
 
Hi Zoltán,

Thanks for the input also i figured slashes has to be "/" not "\". That solved the problem.

Once again appreciate your help.
 
Detroit,

the reason my example used _PDF (instead of .pdf) is that on a UNIX server thats how Oneworld creates the file - no extension. Keep that in mind if your code will be running on a server - by the way - please include your system config in your signature so we don't have to guess what your config is!
 
Back
Top