To get first date and end date after entering any month and year
Hi,
I need to to get first date and end date of a month and year in yyyyMMdd format. I am reading month and year from a properties file. But I don't know how to get the first date and End date in given format. The properties file gives me just text. But I don't know how to get the date format using this. I need this urgently. Can anyone help me to get code for this?
I am reading the fields as,
Properties props = new Properties();
props.load(new FileInputStream("AnyMonthVolume.properties"));
String date_month = props.getProperty("date_month");
String date_year = props.getProperty("date_year");
Thanks.
I know this has been posted a while ago but incase someone looking for it, here is the code to get the end of current month date.
Calendar cal = Calendar.getInstance();
cal.setTime(new java.util.Date());
cal.set(Calendar.DATE, 1); //set the date to start of month
cal.add(Calendar.MONTH,1);
cal.add(Calendar.DATE,-1);
System.out.println(cal.getTime());
Similar Messages
-
How to calculate first date and end date of this year in Query
Hi Expert
I want to calculate following dates with inputted date in query.
I have no knowledge on ABAP and I just can create a query with simple logic.
Could you teach me how to calculate following date?
(If inputted date is April 12 2009)
- First date of this year (Ex January 1 2009)
- End date of this year (Ex December 31 2009)
- First date of last year (Ex January 1 2008)
- End date of last year (Ex December 31 2008)
- First date of this month (Ex April 1 2009)
Thank you!
TakeHR_JP_MONTH_BEGIN_END_DATE use this FM to get the begin and end date of the Date you are passing. eg when u give input as 04/12/2009, it will return
04/01/2009 as begin date
04/30/2009 as end date
pass the Year in this FM HR_E_GET_FISC_YEAR_DATES, you will get the Fiscal year Begin and End Dates
Abh -
Getting error while invoking ADF Start and End Dates
Hi,
I am new to developing ADF Application.
Into :
I am developing a search Page which has a select (drop down), startDate and endDate and a 'GO' Button
when user selects 'data from Drop Down', selects startDate and endDate and Presses 'GO' Button
Based on the Selected combination of Data i should get the Data.
Problem :
I am getting the following Error
WARNING: JBO-25058: Definition TheStartDate of type Variable not found in FastTelcoQueryTransactionDetailsVO1
What i have done / doing
Jspx -
<af:selectInputDate label="Start Date" value="#{FastTelcoTransactionBean.startDate}"></af:selectInputDate>
<af:selectInputDate label="End Date" value="#{FastTelcoTransactionBean.endDate}"></af:selectInputDate>
Bean File
I am converting the this.startDate and this.endDate (both Date format) (which i have taken startDate & endDate as Dates and Generated Getters & Setters for them ) to String format.
DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT).format(this.startDate);
map.put("_startDate", startDate);
map.put("_endDate", endDate);
VOImpl File
public void getTransStartEndDate(Number transTypeId, String startDate, String endDate)
TransactionDetailsVOImpl QueryVO = getQueryTransactionDetailsVO1();
QueryVO.setNamedWhereClauseParam("MstTransTypeId", transTypeId);
QueryVO.setNamedWhereClauseParam("TheStartDate",_startDate);
QueryVO.setNamedWhereClauseParam("TheEndDate",_endDate);
QueryVO.executeQuery();
BindVariables Used
TheStartDate - String format
TheEndDate - String format
SQL Query in VOIMPL - JDEV
SELECT DISTINCT
TransactionDetail.TRANS_TYPE_ID,
MstTransaction.TRANS_DESC,
TransactionDetail.TRANSACTION_NUMBER,
TransactionDetail.CREATOR_NAME,
TransactionDetail.CREATOR_EMAIL,
TO_CHAR(TransactionDetail.TRANS_DATE, 'MM/DD/YYYY hh:mm:ss') TRANS_DATE,
Error.ERROR_SH_MSG,
Error.ERROR_DETAIL_MSG
FROM
TRANSACTION_DETAIL TransactionDetail,
MST_TRANSACTION MstTransaction,
ERROR Error
WHERE
(TransactionDetail.TRANS_TYPE_ID = MstTransaction.TRANS_TYPE_ID)
AND (TransactionDetail.ERROR_ID = Error.ERROR_ID)
AND MstTransaction.TRANS_TYPE_ID=(:MstTransTypeId)
AND MstTransaction.IS_NOTIFICATION_REQ='Y'
AND TransactionDetail.TRANS_DATE BETWEEN (TO_DATE((:TheStartDate), 'MM/DD/YYYY')) AND (TO_DATE((:TheEndDate), 'MM/DD/YYYY'))
order by TRANS_DATE
NOTE : TheStartDate & TheEndDate are not in Attribute list of JDEV
i think i made it clear ...
anybody as a solution or Idea please provide
Thanx in advance
regards,
anvv sharmaHi,
I have started developing the code with the following SQL Query -
Query 1
SELECT DISTINCT
TransactionDetail.TRANS_TYPE_ID,
MstTransaction.TRANS_DESC,
TransactionDetail.TRANSACTION_NUMBER,
TransactionDetail.CREATOR_NAME,
TransactionDetail.CREATOR_EMAIL,
TO_CHAR(TransactionDetail.TRANS_DATE, 'MM/DD/YYYY hh:mm:ss') TRANS_DATE,
Error.ERROR_SH_MSG,
Error.ERROR_DETAIL_MSG
FROM
TRANSACTION_DETAIL TransactionDetail,
MST_TRANSACTION MstTransaction,
ERROR Error
WHERE
(TransactionDetail.TRANS_TYPE_ID = MstTransaction.TRANS_TYPE_ID)
AND (TransactionDetail.ERROR_ID = Error.ERROR_ID)
AND MstTransaction.TRANS_TYPE_ID=(:MstTransTypeId)
After that there is a change in the Requirement to add "Start Date" and "End Date" with a "Go Button" --> Clicking on this Go Button displays the Data Based on
"Drop Down" box, "Start Date" & "End Date" --> Corresponding Data is Picked From Database and Displayed....
Now, i have Updated the VO (From JDEV Design Time) with the latest Updated Query (added Start Date and End Date in the Query),
also check the Corresponding XML file is also Updated with the latest Query.
Query 2
SELECT DISTINCT
TransactionDetail.TRANS_TYPE_ID,
MstTransaction.TRANS_DESC,
TransactionDetail.TRANSACTION_NUMBER,
TransactionDetail.CREATOR_NAME,
TransactionDetail.CREATOR_EMAIL,
TransactionDetail.TRANS_DATE,
Error.ERROR_SH_MSG,
Error.ERROR_DETAIL_MSG
FROM
TRANSACTION_DETAIL TransactionDetail,
MST_TRANSACTION MstTransaction,
ERROR Error
WHERE
(TransactionDetail.TRANS_TYPE_ID = MstTransaction.TRANS_TYPE_ID)
AND (TransactionDetail.ERROR_ID = Error.ERROR_ID)
AND MstTransaction.TRANS_TYPE_ID=(:MstTransTypeId)
AND MstTransaction.IS_NOTIFICATION_REQ='Y'
AND TransactionDetail.TRANS_DATE BETWEEN (TO_DATE((:TheStartDate), 'YYYY-MM-DD')) AND (TO_DATE((:TheEndDate), 'YYYY-MM-DD')) order by TRANS_DATE
So now at Design Time i have Query 2, but Strangely at RUN Time Query 1 is Excecuting asking for "Start Date" Binding Variable NOT Found (as there is no Start Date Bind Variable in Query 1)
for this i have to re-Design the required Part...to make it work
can any body explain why it behaved like this ??
regards,
anvv sharma -
Function Module to get BEGIN and END date of a month?
Hello everybody,
Is there any function module to get BEGIN and END date of a month
GIVEN EITHER THE CURRENT SYSTEM DATE or MONTH?
Regards,
Sanghamitra.A.hi
CALL FUNCTION 'PA03_PERIODDATES_GET'
EXPORTING
f_abkrs = p_abkrs1
IMPORTING
f_permo = wf_permo
f_current_begda = wf_begda
f_current_endda = wf_endda
CHANGING
f_current_period = wf_pabrp
f_current_year = wf_pabrj
EXCEPTIONS
pcr_does_not_exist = 1
abkrs_does_not_exist = 2
period_does_not_exist = 3
OTHERS = 4.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
this is the function module to get the first date and last date of a particular month
if u have any doubts ask
regads
karthik
reward points if useful -
Getting the start and end dates of the week
Hi,
I was stuck with a problem in getting the start date and end date of the week,i know the month ,week and year also,with these three values how can i get the start and end dates of a week.please help me
ThanksThere is no simple way. It has to be a math calculation.
There are several ways you can get the dates. First you have to know what day is January 1st and what day is december 31st for a particular year. Second you have to check whether the given year is a leap year or not. Based on the abvove information you should be able to find out what day is a particular date.
Hope this helps to get you started.
- Venkat Dhurjati. -
How to get starting date and ending date of the given Fiscal Period
Hi Friends,
In my Selection screen parameter, I've Fiscal year and Period , I want to get the starting date and ending date with the Fiscal period.
How to get and throught which FM.
Pls advise.
thanks®ards
Sankar.Hello Sankar,
Check the FM PERIOD_DAY_DETERMINE.
DATA :
l_periv TYPE periv,
l_blart TYPE blart,
l_fday TYPE bkpf-budat, "First day in period
l_lday TYPE bkpf-budat. "Last day in period
* Fetch the fiscal year variant from T001
SELECT SINGLE periv INTO TABLE l_periv
FROM t001
WHERE bukrs EQ p_bukrs.
* Get first day/last day
CALL FUNCTION 'PERIOD_DAY_DETERMINE'
EXPORTING
i_gjahr = p_gjahr
i_monat = p_monat
i_periv = l_periv
IMPORTING
e_fday = l_fday
e_lday = l_lday
EXCEPTIONS
error_period = 1
error_period_version = 2
firstday_not_defined = 3
period_not_defined = 4
year_invalid = 5
OTHERS = 6.
Hope this helps.
BR,
Suhas
Edited by: Suhas Saha on Jan 9, 2009 2:08 PM -
How can I get the start date and end date of a certain week?
Hello, in my java code, I can get the week ID , using
org.joda.time.base.AbstractDateTime.getWeekOfWeekyear() , for example, this week is the 16th week of this year. And I want to get the start date(date of Monday) and end date(date of Sunday) of the week. Is there any method can supply such date value??thanks1 public Date getCurrentMonday(){
2 Date monday = null;
3 Calendar rightNow = Calendar.getInstance();
4 int day = rightNow.get(Calendar.DAY_OF_WEEK);
5 int distance = 0;
6
7
8 if (day == Calendar.MONDAY)
9 monday = rightNow.getTime();
10 else
11 {
12 distance = day - Calendar.MONDAY;
13 if (distance == -1)
14 distance = 6;
15
16 monday = (Date) (rightNow.getTime());
17 monday.setTime(monday.getTime() - 1000 *60 *60 *24 *(distance));
18 }
19 return monday;
20 } -
Org.Assignment Infotype start date and End date is getting wrong.
Hi, When i create a new employee in PA40, in Org. Assignment infotype start date and end date is getting wrong. for eg. When i create an employee on 01.04.2014. In org. assignment infotype its getting like this. 01.01.2014 to 31.03.9999 and 01.04.9999 to 31.12.9999 Two date entries are creating by default.
Hi
Check in the Table - T588Z : Dynamic Actions ,is there any custom routines causing the defaulting dates functionality.
Thanks,
Sreeram -
Hi All,
I need to get the start date and end date of a month by passing parameter like 'MAy-2011'
Result should be start date - 01-MAY-2011 and end date - 31-MAY-2011
thnxsI did the documentation drill down for you :
http://tahiti.oracle.com/
http://www.oracle.com/pls/db112/homepage?remark=tahiti
http://www.oracle.com/pls/db112/portal.all_books
http://www.oracle.com/pls/db112/portal.all_books#index-SQL
http://download.oracle.com/docs/cd/E11882_01/server.112/e17118/toc.htm
http://download.oracle.com/docs/cd/E11882_01/server.112/e17118/functions.htm#i1482196
http://download.oracle.com/docs/cd/E11882_01/server.112/e17118/functions002.htm#i88891
from here on you should be able to find a solution on yout own. -
FM to get start and end date when given month
Hi all,
can anybody help me if there a FM to get start and end date when given month like 01 for jan.
Thanks in advance
SahityaHi,
Check this Function Module
HR_JP_MONTH_BEGIN_END_DATE
here if you r giving the month u wil get the start date and the end date.
Hope this helps you.
Thanks & regards,
Y.R.Prem Kumar -
How to get the current month starting date and ending date by default ?
Hello Creators,
This is my requirement, kindly do the needful, Please dont gimme any links i've no access for other sites, gimme the right solution.
My Requirement :
Creation Date (VBAK-ERDAT) - Select Option. By default, the program should run for the current Month ie between the starting and ending date of the current month when the program is run. Today the date is 18th using sy-datum we can bring the current date by calling it in the initialization event, but the requirement is it should not give me the current date, it should only give me the month starting date and the end date. Kindly help.
Thanks in advance ...DATA: gv_datum LIKE vbak-erdat.
SELECT-OPTIONS: so_date FOR gv_datum.
INITIALIZATION.
CALL FUNCTION 'HR_JP_MONTH_BEGIN_END_DATE'
EXPORTING
iv_date = sy-datum
IMPORTING
ev_month_begin_date = so_date-low
ev_month_end_date = so_date-high.
so_date-option = 'BT'.
APPEND so_date.
START-OF-SELECTION.
Hope this solves the issue. Don't forget to be generous
Cheers,
Sougata. -
Search on basis of start date and end date
Hi,
I have added two fields 'Start Date' and 'End Date' on a search page.
I have done the VO extension also.
Now, I have to implement search logic to get all the records created in between 'Start Date' and 'End Date' after pressing the 'GO' button on that page.
Can anyone please provide guidance to extend the controller.
Thanks in advance.
Gaurav.Hi Anil,
Thanks for ur reply.
As per the link, I have written following code in the controller :
package oracle.apps.irc.vacancy.webui;
import oracle.apps.fnd.framework.OAApplicationModule;
import oracle.apps.fnd.framework.OAViewObject;
import oracle.apps.fnd.framework.webui.OAPageContext;
import oracle.apps.fnd.framework.webui.beans.OAWebBean;
import oracle.apps.fnd.framework.webui.beans.table.OAAdvancedTableBean;
public class xxVacancyCriteriaCO extends VacancyCriteriaCO
public xxVacancyCriteriaCO() {}
public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
super.processFormRequest(pageContext, webBean);
// Pressing the Go button causes the search to be executed.
OAApplicationModule am = (OAApplicationModule)pageContext.getApplicationModule(webBean);
OAViewObject oaviewobject = (OAViewObject)am.findViewObject("XXIrcVacancySearchCriteriaVO");
if (pageContext.getParameter("Go") != null)
String created = pageContext.getParameter("ViewDate");
oaviewobject.setWhereClauseParam(0, created);
oaviewobject.executeQuery();
OAAdvancedTableBean table = (OAAdvancedTableBean)webBean.findChildRecursive("ResultsTable");
table.queryData(pageContext, false);
But while compiling it, I am getting the error as :
"Error(14,42): PerTransactionTopCOImpl not found in class oracle.apps.irc.common.webui.IrcOAControllerImpl in class oracle.apps.irc.vacancy.webui.VacancyCriteriaCO in class oracle.apps.irc.vacancy.webui.xxVacancyCriteriaCO"
Can u please suggest where the mistake is?
Thanks again.
Gaurav.
Edited by: Gaurav on Jan 14, 2011 12:51 AM -
Hyperion Planning dynamic forms based on start and end date across years
Hi All,
I have a requirement where i need to be able to view a form showing periods across years that are dynamically built depending on the start and end dates. If i have a start date of 01/11/2009 and an end date of 31/7/2013 i want to be able to view a form that shows all of the periods (Jan,Feb etc) in a form that is driven by these dates, in addition it will need to show the actual scenario up to the current month and the forecast from the current month to the end date. So basically if a user inputs the start and end dates the form will display the relevant periods driven by these dates.
Any tips very much appreciated!Hello,
This is difficult to realize, but you can get quite far with a workaround. The first question is, where do you want to input your selection of time periods? Assuming you have a webform with the complete timeline in months and years and you type in the start period and end period.
Webforms have the option to suppress rows and columns.
This can be extended with option of empty cells or not empty cells.
You will need to apply your creativity on this.
Put every month-year combination in a column and add the suppression.
Calculate the timeline between start period and end period with a dummy member, so data exists for these and columns will show.
Maybe you will need to copy the required timeline into a separate version for this, to avoid having periods which were outside the selection and still have data.
I hope these hints help a bit in this challenge.
Regards,
Philip Hulsebosch
www.trexco.nl -
Reduce Working Days by Emp Start and End Dates
I'm banging my head trying to get this working. The set-up:
DimResources table with various employee information including a Start and End Date.
A Calendar table with FullDate, Year, Quarter....WorkingDays (1 for working and 0 for non-working) and WorkingDayNumber (working days increased by 1, weekends are not).
Page View report with page view filters for Business, Role, Month, Week, Year.
In the calculation the denominator is total working days for the period * 8. Works great. Further reduced by any submitted time off. Again, so far so good. The part I'm having trouble with is trying to further reduce total working days by
the number of days the person wasn't available in a month, defined by the person's start or end date.
The calculated field works great when only 1 person is selected. As soon as more than 1 person is selected or the slicer is cleared, an error is thrown.
Any ideas on what is wrong or better ways to accomplish what's needed?
TotalWorkingDays2CF=CALCULATE
SUM(Calendar[WorkingDays]),
FILTER(Calendar,Calendar[WorkingDays]=1),
Calendar, DATESBETWEEN(Calendar[FullDate],SUM(DimResources[Start Date]),SUM(DimResources[End Date]))
Error:
<detail>
<ErrorCode>rsErrorExecutingCommand</ErrorCode>
<Message>Query couldn't run for dataset 'Tablix41DataSet'.</Message>
<ProductName>Power View</ProductName>
<ProductVersion>11.0.2150.3</ProductVersion>
<MoreInfo>MdxScript(Model) (10, 27) Calculation error in measure 'Calendar'[TotalWorkingDays2CF]: An invalid numeric representation of a date value was encountered.</MoreInfo>
</detail>
Dennis DeRobertisok, but this is not a running total but just a sub-total/grand-total
so what you can do is the following:
create two measures - first calculate the workdays per ressourcen and second use SUMX() to get the sub-/grand-total if multiple employees are selected (e.g. subgroups, groups,division, etc)
WorkdaysRessource:=CALCULATE(
COUNTROWS('Date'),
FILTER('Date',
'Date'[Date] >= CALCULATE(MIN('DimResources'[Start Date]))
&& 'Date'[Date] <= CALCULATE(MIN('DimResources'[End Date])))
Workdays:=CALCULATE:=SUMX(
'DimResources',
[WorkdaysRessource]
hth,
gerhard
Gerhard Brueckl
blogging @ http://blog.gbrueckl.at
working @ http://www.pmOne.com -
What parameters determine Planned order production start and end dates?
Greetings
We are using the graphical planning table @ MF50 to firm Planned Orders (Basically checking off "Firm Order" field within the Planned Order). We are on ECC 6.0
Whenever I backflush, the production start and end dates get overwritten (The Basic dates do not change).
I would like to prevent this. Can someone advise me on what parameter controls how the production start and end dates getting changed?
Thank you
HanarinHi,
Calculating production dates ( Lead time scheduling) are explained in detail in the SAP help URL as below:
If "Automatci Scheduling indicator" is set in the customizing for scheduling parameters then after every change relevant to scheduling, the production order is also automatically rescheduled before saving.
You need to check these settings.
regards
Datta
Maybe you are looking for
-
Function module going for DUMP
Hi ALL, I have import request and i got sucess .My 3 function modules are import to client system.2 FM are working properly but 1 function module is going for DUMP. When iam Executing this FM through SE37 F8 its running but iam not able to display or
-
for those you don't know, itunes 9.0.1 is out: iTunes 9.0.1 provides a number of important bug fixes, including: • Resolves issues browsing the iTunes Store. • Addresses a performance issue where iTunes may become unresponsive. • Fixes a problem wher
-
Basic binary search tree question
Hi, I was just wondering, if there's a binary search tree that holds objects can the binary search tree be based on any of the attributes in those objects. So for example say we have a Person object and it has the attributes name, age, and height. Ca
-
Solaris 10 U8 autofs homes not working
On three fresh installs of U8, home directories are not automounting. Has this been changed in any way? This is using files based users. Autofs shows online and there are no errors in the SMF log. Any ideas? Charles
-
Footer rising up on page w/.dwt file
Hello all, I've been having a problem with the footer location when using the templates. I have been working on a site, built a model page which seemed to work well, and then saved it as a template. Header, footer, left sidebar, main content area. On