Display current month records only
Hi Experts,
I have the following requirement.
Report should display current month records only.
For example If the report is run on 20090324, It should display records from 20090301 to 20090324.
That means, report may run on any date of that month, It should display from 01 (of that month) to current date.
I have a select statement saying
SELECT * FROM likp
WHERE wadat_ist BETWEEN month_start_date AND sy-datum
AND vkorg IN s_vkorg
AND vkbur IN s_vkbur
AND kunnr IN s_kunnr.
How to calculate date for month_start_date, so that it can display only current month records.
Thanks in advance
Rohan
Hi Kunta, Suhas, Nandi,
Thank you for your quick reply, I really appreciate it.
for this current month records, I need to display a check box saying
Open orders and shipments with the current month.
But where as Selection text is accepting 32 characters only. Is there any possibility to overcome this?
Thanks in advance
Rohan
Similar Messages
-
Workaround to display current month in calendar
Hello,
This is regarding Mr. Krishnamurthy's workaround to display current month in calendar. He asked us to run the URL with some name value pairs attached to get rid of the default "Next" button that the portal will create. But if i add this as a portlet how will i let portal know to run the portlet with these parameter values.
one way that i'm guessing is to add these parameters to the page and pass the values in the customization page. But can we do without doing this customization and everything. And also how do i display the next month of the calendar in the portal itself(i.e inline rendering). Presently if i click the next month link it takes me out of the portal. Eagerly waiting for suggestions/solutions. Thanks and regards,
--Ganti.Hi,
Thanks for the reply. Actually, I have the workaround to display the current month with Previous month / Next month capabilities and I thought maybe somebody wants to know about this workaround .
-Krishnamurthy -
Display current and previous months records only
Hello gang,
My selection criteria looks like this:
not ({HRDEPBEN.PLAN_CODE} startswith ["C", "EAP", "HMIL", "V", "W"]) and
(month({hrdepben.Creation_date}) = month(currentdate)) and
{HRDEPBEN.PLAN_TYPE} = "HL"
I modified it to this in order to pull in previous month's data too:
{HRDEPBEN.PLAN_TYPE} = "HL" and
not ({HRDEPBEN.PLAN_CODE} startswith ["C", "EAP", "HMIL", "V", "W"]) and
(month({hrdepben.Creation_date}) = month(currentdate) or month ({hrdepben.Creation_Date})= month (currentdate)-1)
However, it's still pulls the same record count and only January records, not Decembers'.
Where am I going wrong?
ThanksLooks like you're reporting against Lawson? What database are you using?
There are a few issues with the record selection criteria as it's written:
1) Month(CurrentMonth) - 1 = 0 when the current month is January. That's why your not getting any records from December.
2) The monthly criteria won't be passed to the database for processing, which is a huge performance issue when you're reporting against a system like Lawson. You're basically telling the report to bring back all records that don't start with an array of values, irrespective of the date. Only after all the possible records are returned across the network will the extraneous records be filtered out on the client side. That's bad.
3) It's easy to use StartsWith or Like, but it's also pretty inefficient, since it forces a full table scan of the underlying table
Personally, I'd do one of two things in order to both fix the query and optimize it:
1) Write the underlying query in SQL as either a View or SQL Command object
or
2) Keep the current report, but make use of SQL Expression fields in order to optimize the query.
Here are some examples of SQL Expression fields against Oracle (PL/SQL) that could be useful:
/*{%PLANCODES}*/
/*This SQL Expression evaluates whether or not a Plan Code starts with the specified values*/
/*"HRDEPBEN"."PLAN_CODE" is selected directly from the Field Tree in the SQL Expression Editor*/
CASE
WHEN SUBSTR("HRDEPBEN"."PLAN_CODE",1) IN ('C','V','W') THEN 'Y'
WHEN SUBSTR("HRDEPBEN"."PLAN_CODE",3) = 'EAP' THEN 'Y'
WHEN SUBSTR("HRDEPBEN"."PLAN_CODE",4) = 'HMIL' THEN 'Y'
ELSE 'N'
END
/*{&CREATEDATEMONTH}*/
/*This SQL Expression returns the month of the Creation Date field*/
/*"HRDEPBEN"."CREATION_DATE" is selected directly from the Field Tree in the SQL Expression Editor*/
TO_NUMBER(TO_CHAR("HRDEPBEN"."CREATION_DATE",'mm'))
You could also create formula to return the Month value for last month and then use it in your record selection:
//{@LASTMONTH}
//This formula returns the Month value for Last Month
//IIF statements can be passed to the database for processing
IIF(Month(CurrentDate) = 1, 12, Month(CurrentDate) - 1)
With expressions and formulas like these in place (this code is Oracle and DB2 compatible, it would be different for T-SQL), you could then modify your record selection criteria to be something simpler, like this:
{HRDEPBEN.PLAN_TYPE} = "HL" and
{%PLANCODES} = 'N' and
{%CREATEDATEMONTH} IN {@LASTMONTH} TO MONTH(CURRENTDATE)// MONTH(CURRENTDATE) is passed to the DB
By laying the groundwork, you'll have a much more efficient report and, in the case of the @LastMonth, more accurate! Hope this helps!
p.s. a disclaimer on using SQL Expressions in this manner - it's not officially supported, although it's worked since Version 7 (when SQL Expressions were introduced) and there will be support for them in various 2011 versions. As such, they'll work for years. I use them all the time and they're fantastic for optimizing reports. -
Display Current Month's calendar
Hello,
I have a calendar that will display several months worth of data. I would like the calendar to display the current month's data initially and allow the user to scroll back to previous months. Obviously, when you set the start_date and end_date you can only view the curretn month.
Is there a way to control the month that is initially displayed on the calendar?
Thanks,
CurtKrishnamurthy,
This workaround does work quite well and I've implemented it successfully, but I do have a question:
I need to place this calendar into a page as a portlet. When I click the 'next,previous,current' buttons, it does take me to appropriate month, but opens up in a new page and I need it to stay as a portlet within the page. Have any ideas on how to implement this? I'm using Portal Release 2. Thanks for the help in advance.
Jeremy -
'Calendar UI' which will display current month's calendar in one line
Hi Experts,
I have to create a calendar in following way. Here I have to display calendar of current month for the employee. The entire month detail has to appear in one line. In fact it is needed for Leave Overview iView.
Manager needs to view the Leave details of all employees working in his department
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
Mon Tues Wed Thurs Friday Sat Sun
Smith
Marteen
Thomas
I am not sure how to do it? Do we have any ready made UI element which we can use. I can see Date navigator. However it
displays the calendar in 4 rows.
Please help.
Regards,
GaryHi Abhinav, Experts
Thanks. The design of my RFC will be like this:
1) Input Org Unit, Month, Year
2) Output
Pernr (datatype number 8)
Name (datatype string)
Day1 (datatype string)
Day2 (datatype string)
Day3 (datatype string)
Day4 (datatype string)
Day29 (datatype string)
Day30 (datatype string)
Day31 (datatype string)
3) The default value Day1, Day2 etc will be null
4) I will find out Leave Details. If Leave has been approved for say Day5 then I will populate Day5 = 'AP'.
5) I will write another logic to make the color of cell as 'Green' for Day5.
6) In Feb 2011, there are 28 days. There will be another logic to make the Day29, Day30, Day31 invisible for months like Feb 2011.
Please let me know if this approach is correct.
Please also let me know how to display day i.e. 01.04.2011 is Friday. In Calendar I have to display
1.4.2011 2.4.2011 3.4.2011
Friday Saturday Sunday
Smith
Tony
I did small Proof of Concept. The table does not look good although displays the information.
Please help.
Regards,
Gary -
Displaying current month with all empty months
None of the answers I've seen for showing current month in a calendar has given a solid answer. So, here is my question. My objective is to display all calendar months rather they are empty or not, plus I want the calendar to start at the current month. I added coding to display a next month and previous month button, so you should be able to click next or previous month from the current month showing. I have the "Show All Empty Months" checked in the Display Options under Common Options and the start and end date are empty. I have a bind variable in my coding that defaults to the current month but it will not show an empty month. I get the "no rows returned" situation because it doesn't have anything in it. Is there a solution to showing all empty months?
Also, has anyone found a solution to hide/remove the default Next/Previous buttons? I read in one of the replies that this would be fixed in a forthcoming release. Is this true?
Thanks for any assistance.The calendar works on a sql query result. I had done something similar to what you are looking for by spoofing the sql query to return rows for all the months which I am interested in. I had a query like the following.
select *
from scott.emp a , ( select (trunc(sysdate) - 7910 + rownum) dat from user_objects ) b
where b.dat = a.hiredate (+)
Hope you can do something similar to this. -
Displaying current month in prompt
Hi,
I want to show the current month as the default value in Prompt in XI R3.1 Webi. i.e. when the user runs the report, the prompt for "Month" should show the current month (Say March) and if user wants to change it he can change it to someother month.
Pls let me know how to acheive this (May be by doing changes to report or to the Universe).
Regards
JimYou can try the below step in Universe
Steps
1.You have a date time field = u201CDateXu201D
2.Build another object of the same field in unv = u201CDate X New Objectu201D
code:
case When to_date (Sysdate, "MM") then "Current Month"
end
3.Build Condition in Unv = Date Picker
code:
@Select(Cass\DateX New Object) = @Prompt(u2019Date Pickeru2019,'Au2019,{u2019Customu2019,'Yesterdayu2019,'Last 10 Daysu2019,'Todayu2019},mono,constrained,persistent,{u2019Current Monthu2019})
You can take reference of the below
http://www.dagira.com/2008/07/15/how-can-i-make-today-my-default-prompt-value/ -
How to display Current Year and Month in Drop Down list
Hi Dear friends,
I am devloping a report. It has got 2 pages--input and output(Report) page.
IN input page, user will select Month and Year from drop down list as one of the input parameters. (seperate drop down list 4 month and year)
Now, my problem is:
HOw to display current month and year by default in the dropdown list...........
I hope my question is clear.
Please help.
Regards,
AShNO da,
it is not working.
First i tired with for-loop. I initialized variable "i" to -2 (i=-2) I would get the year drop down list from 2003 but, by default 2003 would come.
So, i posted the question.
I tried your code. It is giving following error.
A Servlet Exception Has Occurred
org.apache.jasper.JasperException: Unable to compile class for JSP
An error occured between lines: 122 and 127 in the jsp file: /test/inpt.jsp
Generated servlet error:
C:\Program Files\Apache Tomcat 4.0\work\localhost\general\test\inpt$jsp.java:182: Invalid type expression.
first.set(Calendar.YEAR, 2003)
^
An error occured between lines: 127 and 131 in the jsp file: /test/inpt.jsp
Generated servlet error:
C:\Program Files\Apache Tomcat 4.0\work\localhost\general\test\inpt$jsp.java:186: Invalid declaration.
out.write("\r\n \r\nYear : \r\n \r\n"); ^ An error occured between lines: 198 and 203 in the jsp file: /test/inpt.jsp Generated servlet error: C:\Program Files\Apache Tomcat 4.0\work\localhost\general\test\inpt$jsp.java:282: Invalid type expression. first1.set(Calendar.YEAR, 2003) ^ An error occured between lines: 203 and 207 in the jsp file: /test/inpt.jsp Generated servlet error: C:\Program Files\Apache Tomcat 4.0\work\localhost\general\test\inpt$jsp.java:286: Invalid declaration. out.write("\r\n \r\nYear :\r\n \r\n");
^
4 errors
Pls. Help.
Regards,
Ashu -
Re: Displaying Current Record After Delete
Hi all,
I am using Jdeveloper 11.1.2.3.0
I have two tables which has parent child relation among the both.
I dragged the parent table as a adf form on to the .jspx page.
Now if i am trying to delete fifth record in the parent table it is giving error message like "Table has child record, delete unsuccessful"
It is fine, but the control going to first record after deletion.
But i want to display current deleting record on the page if deletion is unsuccessful.
Can anybody help me to resolve the above one.
Thanks,
SyamIn this code when the bolded if condition fails i want to delete that record. I tried "delete struct1 index sy-tabix" but that record is not deleted.
I tried "clear struct1 ". its deletes the current record.
but in some field its getting zero value & it is appending as a additional record.
Please help me.
loop at cdhdr.
if ( it1-tcode = 'FSS0' or it1-tcode = 'FS00' ).
w1_saknr = it1-objectid+4(10).
w_orgid = it1-objectid+14(4).
loop at it_cdpos where changenr eq it1-changenr
and objectid eq it1-objectid
and objectclas eq it1-objectclas.
<b>If w_orgid in r_orgid.</b>
IF ( it_CDPOS-FNAME = 'XLOEV' AND it_cdpos-value_new eq 'X' ).
replace struct1-change_ind with 'D' into struct1-change_ind.
struct1-bukrs = w_orgid.
struct1-cost = space.
struct1-plant = space.
append struct1.
else.
struct1-bukrs = w_orgid.
struct1-change_ind = w_chngid.
struct1-cost = space.
struct1-plant = space.
append struct1.
endif.
<b> else</b>.
<b>delete struct1 index sy-tabix</b>.
endif.
append struct1.
endloop.
endif.
endloop. -
IW69 report not fetching all transaction data of current month.
Dear Guru Ji,
While doing testing IW69 report, i noticed that it is not displaying current month data. It is only get the data uptil last date of past month data in DEV & QA client.
I wonder why this is happening?
I tried using Malfunction start date & notification reference date input. But still the same result.
Please guide me, what is going wrong?Hi,
The selection option 'notification date' is based on notification date (VIQMEL-QMDAT). Transaction IW69 is used to display notification items - when there is no item data in the notification nothing will be returned.
-Paul -
Sales order consuming current month forecast
Hi All,
We are using weekly planning bucket in DP and weekly bucket in SNP. We are trying to release forecast in weekly bucket.
When forecast is getting released from DP to SNP it gets validity of one week. We would like to change forecast validity to one month.so any sales order within one month can consume the forecast.
Please let me know if its possible that slaes order should consume current month forecast only while releasing from DP to SNP?
any user exit we need to enhance for changing forecast validity to one month from one week?
HrishikeshDidn't understand your question.
You changed the schedule line date and it re-appeared in DP? -
Current Month & Current Year Sales
hi,
How to get current month sales & previous month sales if sales measure is available for 2 years. I would like to display current month sales in one column and previous month sales in the second column and difference in the next column. For example, if i take this month as the current month, i have to display march sales in first column, february sales in second column and difference in third column. If you take a query designer, we restrict by month and display that month's value. Please advise.
Thanks in advance.Hi
create two variables in your WebI report containing if then clauses which restrict your key figures to the actual (or previous) month. Use those variables instead of your key figure directly.
(NOTE: THIS IS PSEUDO CODE):
if [0CALMONTH]=CurrentMonth then [KeyFigure1] else 0
if [0CALMONTH]=PreviousMonth then [KeyFigure1] else 0
The third column can contain the difference between the first two variables.
Regards,
Stratos -
How to display records based on current month and last month???
i have a query that want to display the data for current month and last month. when i try to view the reports, all the data/key figures is return all in 0.00.
i modify the variables for this current month and last month but still the results is the same. i could not see the data. any advise on how to modify the variables for this current month and last month? i am thinking my variables is wrong.
for the current month variable:
the type of variable is characteristic value, processing by customer exit, reference characteristic is calendar year/month.
thanks for all who are kind to help me here....Hi,
If you install the variables from BC correctly and they are in active state, you can use them directly use them. check for this month the total values at info cube is ZERO or some value. as you told you are getting ZEROS for your input.and check the data at cube level based on your query design, apply all restrictions, fileters and see do you get any data at cube level and compare with report. -
Returning Records Only for the Current Month
Hello,
I have a query that returns records for the current week and I would like to extend it to return records for the current month.
where TRUNC (START_DATE) < NEXT_DAY (TRUNC (CURRENT_TIMESTAMP) - 1, 'Sat') + 1
AND TRUNC (END_DATE) > NEXT_DAY (TRUNC (CURRENT_TIMESTAMP) - 1, 'Sat') - 7
I have two date fields, the first is called 'Start_Date', the second is called 'End_Date'. I would like the query to return all records for the current month including those that may begin prior to or finish post the month as events can begin in one month and end in another. Does anyone know how this is done in a 'Where Clause'?
Kind Regards,
Steve WelchActually LAST_DAY(ADD_MONTHS(TRUNC(sysdate),-1))+1 gives you the starting day of the current month, and LAST_DAY(TRUNC(sysdate)) gives you the last day of the current month.
So the where be
WHERE TRUNC(START_DATE) >= LAST_DAY(ADD_MONTHS(TRUNC(sysdate),-1))+1 OR TRUNC(END_DATE) <= LAST_DAY(TRUNC(sysdate))
Start Date >= 1st Day of Month OR End Date <= Last Day of Month, meaning either date is within the current month. -
How to display empty months when grouping records by month
Guys, I've got a recordset that successfully displays all
records in the
table grouped according to the month that the record was
created in.
This allows me to display a Monthly tally (a bit like a
barchart - where the
height of the column is derived by the qty of records for
that given month)
for each of the months in the year so far. However, it dawned
on me today
that if there was no activity in a given month, the month
simply doesn't
appear at all, rather than displaying but showing "0" as I
would prefer.
For example, the type of thing I want to display onscreen is:
Month 1 2 3 4 5 6 7 8 9 10 11 12
But let's say there were no records inserted in months June
to September
(inclusive), what I'm actually getting onscreen is:
Month 1 2 3 4 5 10 11 12
But what I actually want to appear onscreen is:
Month 1 2 3 4 5 6 7 8 9 10 11 12
I hope that makes some kind of sense...
I'm using Dreamweaver CS3, ASP/VBScript, and MySQL.
My current SQL Statement is as follows:
SELECT Count(AffiliateID) AS TotalClicks, MONTH(`VisitDate`)
AS Month
FROM tbl_affiliaterefferals
WHERE `AffiliateID` = "49" AND YEAR(`VisitDate`) =
YEAR(Now()) GROUP BY
MONTH(`VisitDate`)
ORDER BY MONTH(`VisitDate`) ASC
I figured one workaround would be to have 12 separate
recordsets - one for
each month - on the one page, but there must be a cleaner way
of doing it
surely?
Any/all help greatly appreciated.
Regards
DavidThis is a multi-part message in MIME format.
------=_NextPart_000_0086_01C932EC.D9CE33D0
Content-Type: text/plain;
format=flowed;
charset="iso-8859-1";
reply-type=original
Content-Transfer-Encoding: 7bit
Hi Joe,
I've simply got a table, within one cell of which is another
table to which
I've applied a background colour and am specifying the height
of the <td>
cell as the qty of the number of records returned for Month 1
of the current
year. Then I'm applying a repeat region to the <TD>
cell containing the
table that varies in height, in order to force the table to
repeat
horizontally according to the number of records (months)
retrieved from the
database.
The code for the table is in the attached txt file.
I appreciate your time in responding however you must have
missed my
comments about what I'm working in as I'm working in
ASP/VBScript and
haven't the first clue when it comes to PHP.
I don't suppose you know or can point me in the direction of
an ASP
equivalent of your suggestion?
Regards
David
"Joe Makowiec" <[email protected]> wrote in
message
news:[email protected]...
> On 20 Oct 2008 in macromedia.dreamweaver, DTB-K wrote:
>
>> I figured one workaround would be to have 12
separate recordsets -
>> one for each month - on the one page, but there must
be a cleaner
>> way of doing it surely?
>
> Without seeing the code you're using to display it...
>
> Probably what that code is doing is looping through the
recordset:
>
> <?php do { ?>
> ...
> <?php } while ($row_dates =
mysql_fetch_assoc($dates)); ?>
>
> That's DW's standard PHP MySQL recordset behavior. What
you want to do
> is something more like:
>
> <?php
> for ($i=1;$i<13;$i++) { // Do 12 months
> echo '<p>Month: ';
> echo $i; //Echo the month
> if ($row_Recordset1['Month'] == $i) {
> // Have data for this month
> echo ' Clicks: ';
> echo $row_Recordset1['TotalClicks'];
> // Now get the next row
> // Note that we only want to get the next row if the
current month
> // has data. That's why the fetch command is inside the
if.
> $row_Recordset1= mysql_fetch_assoc($Recordset1);
> } // End if
> echo "</p>\n";
> } // End for
> ?>
>
> --
> Joe Makowiec
>
http://makowiec.net/
> Email:
http://makowiec.net/contact.php
------=_NextPart_000_0086_01C932EC.D9CE33D0
Content-Type: text/plain;
format=flowed;
name="Code.txt";
reply-type=original
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
filename="Code.txt"
<table border=3D"0" cellpadding=3D"0"
cellspacing=3D"0">
<tr>
<td colspan=3D"2" valign=3D"bottom"><h1>Current
Year:</h1></td>
</tr>
<tr>
<td valign=3D"bottom" =
class=3D"BodyTxtsml"><strong>Month</strong></td>
<%=20
While ((Repeat1__numRows <> 0) AND (NOT
Rs_MonthlyClicks.EOF))=20
%>
<%Dim TotalClicks, Cellheight
TotalClicks =3D =
FormatNumber((Rs_MonthlyClicks.Fields.Item("TotalClicks").Value),
0, -2, =
-2, -2)
Cellheight =3D (TotalClicks)
%> =20
<td valign=3D"bottom" class=3D"BodyTxtsml" =
title=3D"<%=3D(TotalClicks)%>"><div
align=3D"center"><table border=3D"0" =
cellspacing=3D"0" cellpadding=3D"0">
<tr>
<td height=3D"<%=3D(Cellheight)%>" =
bgcolor=3D"#003366" onMouseOver=3D"this.bgColor =3D
'#FFDB9D'" =
onMouseOut=3D"this.bgColor =3D'#003366'"
width=3D"40"> </td>
</tr>
=
</table><%=3D(Rs_MonthlyClicks.Fields.Item("Month").Value)%></div></td>
<%=20
Repeat1__index=3DRepeat1__index+1
Repeat1__numRows=3DRepeat1__numRows-1
Rs_MonthlyClicks.MoveNext()
Wend
%> =20
</tr>
</table>
------=_NextPart_000_0086_01C932EC.D9CE33D0--
Maybe you are looking for
-
While updating my iTunes this message came up "Service 'apple mobile device' (apple mobile device) failed to start. Verify that you have sufficient privileges to start system services" what can I do to get my iTunes to work again?
-
How to connect Air with Thunderbolt?
How do I connect Air with Thunderbolt? Bought Air in Oct 2011 and Thunderbolt today. Does Mac OS X (10.6.5) work with Thunderbolt? Do I need a special cable other than what came in box?
-
Factory Reset Toshiba Satellite M305-S4848
Hello, We recently got this model laptop from a friend due to the fact ours was stolen. I'd like to factory reset it, but I was wondering if I really need to copy the restoration data onto seperate disks, or if I can just do it from my system. I did
-
Connection conn1= DriverManager.getConnection(url, "", ""); Statement stmt1 = conn1.createStatement(); ResultSet rset1 =stmt1.executeQuery("SELECT FOLLOW_UP_TABLE.ACCTNO,ADDRESS_TABLE.P_ID From ADDRESS_TABLE INNER JOIN FOLLOW_UP_TABLE on FOLLOW_UP_TA
-
Trouble with wireless switch (rfkill) and wireless connectivity.
Hello, this is my first message in this community so please bare with me if this message should be in the newbie part; but I think it's better fitted here. Other than that, I'm glad to be here . After quite some time in Fedora I'm coming to Arch and