cancel
Showing results for 
Search instead for 
Did you mean: 

How to set a default value to a transaction property?

Former Member
0 Kudos

Hi All,

I have a table in which one of the columns is production_date. I need to retrieve and display the data corresponding to the month as selected by the user in the front end. But prior to the selection, the user should see the data of the current month. I am able to show the data of the user selected month, but am unable to show the data of the current month. Instead of the current month, the transaction returns the data of the month of January by default. Can anybody help?

Thanks and Regards,

Lipsa.

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

I might be a little confused, but it seems as though your question is different from your explanation.

Are you trying to pass the current month (dynamically) into the BLS through the front end?

If so, it's a straight forward JavaScript:


// get current month
var current_month = document.myApplet.dateNowFormatted("MM");
// and to get the full (formatted) current month
var current_month_formatted = document.myApplet.dateNowFormatted(current_month+"/01/yyyy 00:00:00");

Former Member
0 Kudos

Hang on Ryan.

I am through with passing the current month into the BLS. Thats not at all an issue. Let me explain you the whole scenario again.

In the front end, there is a drop down list where the user can select a month. There is also a graph which always shows the data of the current month. That is, as soon as the user comes to this page, he should see the graph having the details of the current month, and he will have an option to select a month. Once the user selects a month, he can see the data of the month he selected in the same graph.

I have done the second part. That is, once the user selects the month, he can see the data of the month he selected.

But, the problem where I am stuck is I am not able to show the user the data of the current month.

Hopefully, you got my problem.

Regards,

Lipsa.

jcgood25
Active Contributor
0 Kudos

Lipsa,

Is your query time based, with the start and end data buttons visible in the time refresh control bar of the applet? If it is make sure you have the Allow Future Date checkbox set, otherwise the time engine of the query will cap the query end date to the current time on the server.

If it would help can you post the javascript snippet that you are using to take the selected month and effect the iChart.

Regards,

Jeremy Good

Former Member
0 Kudos

Jeremy,

I am not at all bothered about the selected month. I think, you too did not get my question. Let me explain you the scenario once again.

In the left hand side of the user's dashboard, there is a link to view current status. Once the user clicks the link, he should see two things.

1. a chart to display the data of the current month.

2. a drop down list to select a month of his choice.

The data is available in the database table. This table is having a column called Production_Date. Once the user selects a month from the list, the selected item is set to an applet parameter. I have designed a BLS which calls the query template having this parameter. The QT queries for all the data from the database. The BLS is having a transaction property called 'month'. The parameter value is assigned to this property. Now, this property has the month selected by the user. Finally, I have the logic where I repeat the column Production_Date, get the month out of the date, compare the month with the property value in a conditional block, and get the data once the condition is true. Using these steps, I can get the data of the month selected by the user.

My issue is, the user should see the data of the current month prior to selection from the drop down list which I am unable to do. Any suggestions as to how can I achieve this?

Regards,

Lipsa.

Former Member
0 Kudos

Ok, thanks for the much better explanation.

So, what you should do is set your chart applet to be InitialUpdate = false.

Then,have a CreationEvent on the applet that will call a javascript function to set the StartDate and EndDate of the Applet Query to the current month. Then, update the Applet.

This will set the data of the applet to current month. And as Jeremy mentioned, make sure the applet allows future dates or else the EndDate will be the current date. I don't know if this is what you want or not.

Former Member
0 Kudos

Are you good with this, or are you looking for other approaches?

Former Member
0 Kudos

Ryan,

Let me try this out. Will reply back if some other approach is required.

Thanks and Regards,

Lipsa.

Former Member
0 Kudos

Based on you rinformation, you supply date(choosen by user) as a parameter in the calling QT to rertive data.Right?

Former Member
0 Kudos

Sajjad,

In the front end, there is a drop down list where the user can select a month. That selected item is passed as a parameter in the QT to retrieve data.

Regards,

Lipsa.

Former Member
0 Kudos

Sahu,

This is all very basic xMII usage that should be common know how if you looked through the help docs at all.

You can either declare your default values withing the BLS transaction when you define the trasaction property and link it to the query action or through the Xacute Query as a parameter when calling that BLS transaction.

Please reference the xMII wiki for links on Best Practices of xMII and the help guide. https://www.sdn.sap.com/irj/sdn/wiki?path=/display/xmii/main&;

Former Member
0 Kudos

Before answering your question, i need to know what are yor trying to do?

Are your calling QT from a business transaction

Former Member
0 Kudos

Sajjad,

You are right. I am calling a QT from the business transaction.

Regards,

Lipsa.