cancel
Showing results for 
Search instead for 
Did you mean: 

How to pass start and end date and time in SAP MII url

former_member215598
Participant
0 Kudos

How to pass start and end date and time in SAP MII url?

Accepted Solutions (1)

Accepted Solutions (1)

swaroop_anasane
Active Contributor
0 Kudos

Hi Amr,

For your code, try something like:

http://<Server>:<Port>/XMII/Illuminator?QueryTemplate=QTName&Content-Type=text/html&Param.2=2014-10-...

Here, you are using Param.2 and Param.3 to form the date range but were passing SD and ED. Hence it takes what default was given to the QT from work bench.

This should work definitely for you.

Regards,

Swaroop

former_member215598
Participant
0 Kudos

Fantastic!  That worked....Thank you, very much - Swaroop.

Regards,

Amr

swaroop_anasane
Active Contributor
0 Kudos

Welcome Amr...!!!

Nice time,

Swaroop

Answers (2)

Answers (2)

swaroop_anasane
Active Contributor
0 Kudos

HI Amr,

I fyou are using single quotes while getting the values in Params, don't use it while passing it from URL and vice-versa.

Just a SQL thing. Ideally, SD/StartDate both should work. Have you hardcoded any date in the QT for testing, it might be picking it up while it's not able to read from URL.

Regards,

Swaroop

former_member215598
Participant
0 Kudos

The problem when I do not hard code any date, and when I run the url - it fails to display any content.

agentry_src
Active Contributor
0 Kudos

SD= and ED=

former_member215598
Participant
0 Kudos

No - it did not work.

We are defining SD as StartDate= and EndDate.

agentry_src
Active Contributor
0 Kudos

SD and ED are the MII default variables for Start Date and End Date.  Did you define your own transaction or query properties or are you using the defaults?

Regards, Mike

former_member215598
Participant
0 Kudos

So, far I was successful to pass a tag String, but we need to also pass start date and end time.  The following URL format we following:

http://<servername>/XMII/Illuminator?QueryTemplate=<Project>/<Path>/<TemplateName>

I hidden the server, port number and the name of the string.......company confidential but you should get the ideal.

The url is calling from webservices.

agentry_src
Active Contributor
0 Kudos

Hi Amr,

Depending on what you are using it for, there is some good help in

http://<servername>:<port>/CompanyName/App1/mypage.irpt?SD='2013-04-25'&ED='2014-04-25'

Should be close to the right syntax, but you may have to check the help for the specifics.  I don't have access to a system to check right at the moment.

Are you passing the values to a transaction or a query template?

Regards, Mike

SAP Customer Experience Group - CEG

Message was edited by: Michael Appleby

HariCS23
Contributor
0 Kudos

Amr, And it doesn't have to be default SD,ED variables. date parameters can be other standard parameters param.1,param.2..etc .

Quick question:  Are you encoding your URI before it is getting executed from MII application? I am assuming your using calling this URL using AJAX.

Thanks

Hari

former_member215598
Participant
0 Kudos

I am passing the values through a query template:

SET NOCOUNT ON

DECLARE @StartDate DateTime

DECLARE @EndDate DateTime

SET @StartDate = DATEADD(minute,60,'[Param.2]')

SET @EndDate = DATEADD(minute,60,'[Param.3]')

SET NOCOUNT OFF

SELECT TagName, DateTime, Value

FROM History

WHERE TagName IN ('[Param.1]')

AND wwRetrievalMode = 'Cyclic'

AND wwCycleCount = 500

AND wwVersion = 'Latest'

AND DateTime >= @StartDate

AND DateTime <= @EndDate

And declaring in the Transaction Details:

tagString      FEN_01_AMIX_ASIDE.FLOw

StartDate     2014-04-21 10:00:00

EndDate      2014-04-22 12:00:00

But every time I change the dates in the url it does not show the new dates it keep on showing the above dates.

For instance if I do the following:

http://<server>:50000/XMII/Illuminator?IsTesting=T&QueryTemplate=HistQuery/WebServices/WebServicesFE...

It still shows the content for

StartDate     2014-04-21 10:00:00

EndDate      2014-04-22 12:00:00

instead of

StartDate     2014-04-20 10:00:00

EndDate      2014-04-20 12:00:00

agentry_src
Active Contributor
0 Kudos

Welcome back Hari!  Haven't seen you posting in a while.

Cheers, Mike

HariCS23
Contributor
0 Kudos

Thanks Mike. It is always pleasure to see you in this forum as well.