cancel
Showing results for 
Search instead for 
Did you mean: 

creating a date range selection and displaying the output in the table when selecting a duration

former_member222346
Participant
0 Kudos

Hi Folks,

We have a requirement of selecting a date range. Suppose if we select from date as Apr,2016 and to date as march,2017, the data should be displayed in the table below with months in each column.

Table should be like

Apr 16 May 16 .................. Jan 17 Feb 17 Mar 17

Please provide me an example of building this code.

Regards,

Sindhu

Accepted Solutions (0)

Answers (1)

Answers (1)

mantrishekar
Active Participant
0 Kudos

Hi Sindhuja,

On Selecting Date Range What operation you are performing(I mean to say are you fetching any Data From Backend or filtering data in Client side).

If you are filtering Data from backend using any select query then you can get the Distinct Months for the selected Date Range and and Bind this date range values to sap.m.Table Header Column Values.

Other wise even if you are filtering Data with in client model using JSON.Even here also you perform the same to fetch distinct Month and year Values and bind it to sap.m.Table Header.

former_member222346
Participant
0 Kudos

Hi Shekar,

On selecting the Date Range, We need to fetch the data of the selected financial year using oData model in a tabular format (each month each column) as I mentioned in the question.

Please provide me any JS Bin code if possible for better understanding the resolution.

Regards,

Sindhu

mantrishekar
Active Participant
0 Kudos

Hi Sindhuja,

Below link would help to get Different months for the selected Date range.

Apply your values to the below code available in the link.

http://jsfiddle.net/DianaNassar/C97DJ/1/

former_member222346
Participant
0 Kudos

Hi Shekar,

I couldn't find date range selection the code.

My requirement is select a date range as

Financial Year : (fromdate) - (todate)

Display values in the table fetching the data from Odata. Table will be like below.

Apr May June July ................................................. jan Feb Mar

Regards,

Sindhu