Skip to Main Content

Analytics Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Timing with FDM report generation using batch processing

user8267354Jun 10 2015 — edited Jun 10 2015

Hello,

We have a FDM batch processing process that is loading a couple files from our ERP overnight to our Essbase databases. At the end of the process, we have FDM email our team the Batch File Listing report. However, when FDM runs the report, the process isn't far enough along for the
report to confirm it finished successfully. The report is sent when batch process is still on Consolidating. Currently the script, which I have included below, is in the AftConsolidate step and if I put it in BefCheck, it doesn't run. I do have a validation rule in place. Do you know of a way to delay the running of the report a bit longer so I can receive a completed report? Any thoughts would be greatly appreciated.

Thank you.

Sub AftConsolidate(strLoc, strCat, strPer, strTCat, strTPer, strEntGroup)

If strLoc = "PLNGLVPAUTO" Then

'Declare local variables

Dim objReport1

Dim objConfig1

Dim objMsg1

Dim lngReportID1

Dim lngPublishType1

Dim strPublishPath1

Dim strFromAddress1

Dim strToAddress1

Dim strSubject1

Dim strEmailMsgLine1

Dim strSMTPServer1

'Initialize Variables

lngReportID1 = 424

lngPublishType1 = 31 'PDF

strPublishPath1 = API.DataWindow.Connection.PstrDirOutbox &
"\NightlyPLNLoad\" & adaptor & "\" &
API.POVMgr.PPOVLocation & ".pdf"

'Create the Report object

Set objReport1 = CreateObject ("upsWReportingDM.clsReportPublisher")

objReport1.mInitialize API

'Set Parameters

objReport1.mParametersClear

objReport1.mParametersAddNew "Period", PeriodKey

objReport1.mParametersAddNew "CatKey", RES.PlngCatKey

'Publish the Report

objReport1.mReportPublishToFile CLng(lngReportID1), CStr(strPublishPath1),
CLng(lngPublishType1)

'Web Client (Set API action properties)

RES.PlngActionType = 4 '(See Enumeration: ScriptActionTypes)

RES.PstrActionValue = strPublishPath1

 

'Initialize message content variables

strFromAddress1 = "FDMLoad@company.com"

strToAddress1 = "me"

strSubject1 = "Test Batch Report PLNGLVPAUTO Email"

strEmailMsgLine1 = "Test Batch Report PLNGLVPAUTO Emailing
Functionality"

'Initialize Mail Server Variables

'SMTP server name

strSMTPServer1 = "Smtp1.acxmailhosting.com"

'CdoSendUsing enumeration-1=use smtp on local machine, 2=use smtp over network

intSendUsing = 2

'SMTP port on server

intSMTPPort = 25

'Create CDO configuration object

Set objConfig1 = CreateObject ("CDO.Configuration")

'Set Config object settings

With objConfig1.Fields

.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") =intSendUsing

.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") =strSMTPServer1

.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport")
= intSMTPPort

.Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout")
= 10

.Update

End With

'Create CDO message object

Set objMsg1 = CreateObject("CDO.Message")

'Assign config object to configuration property of message object

Set objMsg1.Configuration = objConfig1

'Set Message object settings and send mail

With objMsg1

.To = strToAddress1

.From = strFromAddress1

.Subject = strSubject1

.TextBody = strEmailMsgLine1

.AddAttachment strPublishPath1

.Send

End With

 

'Destroy message objects

Set objMsg1 = Nothing

Set objConfig1 = Nothing

Set objReport1 = Nothing

End If

End Sub

Comments

fac586
Answer

eaolson1 wrote:

I've just finished debugging a strange problem in a page process that was giving incorrect results because a page item had the wrong value. We discovered this page item value was getting set as soon as the user's session was created and even before he loaded that page. The V() function would return a value for this item even when there was no value in WWV_FLOW_DATA.

Eventually, I turned on session tracing and found this when V('P1_ITEM') was being called:

SELECT ATTRIBUTE_VALUE FROM WWV_FLOW_PREFERENCES$ WHERE USER_ID=:B3 AND SECURITY_GROUP_ID = :B2 AND PREFERENCE_NAME = 'PERSISTENT_ITEM_'||:B1

There was indeed a value in WWV_FLOW_PREFERENCES$ for PERSISTENT_ITEM_P1_ITEM. We don't really use preferences except for the usual built in report sorting and this "persistent_item" type of preference is new to me. Even when I deliberately set a preference (apex_util.set_preference), it does not add this prefix.

I can't find anything in the documentation on this. Does anyone know what this might be?

This is on Apex 5.1.2.

This is how values are persistently stored for page items where the Maintain Session State property is set to Per User.

This may have been set in error as it is an uncommon but occasionally useful feature.

Marked as Answer by Eric Olson 1 · Sep 27 2020
Eric Olson 1

That must have been what happened. It appears in 5.2 if the item is changed back to Per Session, the preferences remain, and the V() function can retrieve the preference rather than the page item value. As far as I can tell, this has been fixed in 18.2, at least in testing on apex.oracle.com.

1 - 2
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Jul 8 2015
Added on Jun 10 2015
1 comment
218 views