The last day of the month when the report is run
Hi,
I am working on custom outbound idocs for FICO module through INTERFACE Program the third party sytem needs <b> "The last day of the month when the report is run"</b> so is there any sytem field or standard SAP Sytem Table field which can give me that value.plz let me know ASAP.
Other wise should i develop custom logic.
Hi,
Try this way.
Selection-screen
PARAMETERS: p_bldat LIKE bsis-bldat .
INITIALIZATION.
DATA: v_end_date LIKE sy-datum.
CALL FUNCTION 'LAST_DAY_OF_MONTHS'
EXPORTING
day_in = sy-datum
IMPORTING
last_day_of_month = v_end_date
EXCEPTIONS
day_in_no_date = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
p_bldat = v_end_date.
Thanks,
Anitha
Similar Messages
-
How to get the last day of a month?
HI,
I want to know how to get the last day of a month.
In my JClient form, I tried to get it by using oracle.sql.Date method, that is:
lastday=oracle.sql.Date anydate.lastDayOfMonth();
But it does not work. The result is lastday=anydate.
Why?
StephenYou can use the Calender class...
Calendar c = Calendar.getInstance();
and then something like...
c.add(c.MONTH, 1);
int dayOfMonth = c.get(Calender.MONTH);
c.add(c.DAY_OF_MONTH, - (dayOfMonth-1) );
other usefull functions are:
System.out.println(" YEAR : " + c.get(Calendar.YEAR));
System.out.println(" MONTH : " + c.get(Calendar.MONTH));
System.out.println(" DAY_OF_MONTH : " + c.get(Calendar.DAY_OF_MONTH));
System.out.println(" DAY_OF_WEEK : " + c.get(Calendar.DAY_OF_WEEK));
System.out.println(" DAY_OF_YEAR : " + c.get(Calendar.DAY_OF_YEAR));
System.out.println(" WEEK_OF_YEAR : " + c.get(Calendar.WEEK_OF_YEAR));
System.out.println(" WEEK_OF_MONTH : " + c.get(Calendar.WEEK_OF_MONTH));
System.out.println(" DAY_OF_WEEK_IN_MONTH : " + c.get(Calendar.DAY_OF_WEEK_IN_MONTH));
System.out.println(" HOUR : " + c.get(Calendar.HOUR));
System.out.println(" AM_PM : " + c.get(Calendar.AM_PM));
System.out.println(" HOUR_OF_DAY (24-hour): " + c.get(Calendar.HOUR_OF_DAY));
System.out.println(" MINUTE : " + c.get(Calendar.MINUTE));
System.out.println(" SECOND : " + c.get(Calendar.SECOND));
System.out.println();*/ -
How do I set a reminder for the last day of every month
Have I missed something? But how do you set a reminder for the last day of every month to recurr indefinatley in iOS6? Sorry if this is really simple but I just can't seem to work it out. Any help gratefully received.
Hey Mattye88 not sure if you have seen but actully you can do this, but for some reason you have to use Siri. If you bring up Siri and say "set a reminder ever 4 weeks from next wednesday to check the gas meter" it will set one and it will work just fine, I have reminders to water a Bonsai every three days and it works fine it just shows as custom repeat on the user interface. Alas it seems you can not use Siri to set one for the end of the month though which is why I am in this threed. Still hope it helps you to know how to sort this problem atleast.
-
Define event to repeat on the last day of each month?
(I've searched the forum and can't find this question addressed)
I want to create a repeating event for the last day of each month. Is this possible?Unfortunately Apple does not have an option available that allows you to add an event repeating on the last day of the month. An "OK" way around this would be to repeat on the 1st of every month and send a reminder a day earlier. I know this is less then perfect but the only option currently available. If you happen to find a 3rd party program that allows such integration please don't hesitate to mention it here as I have been looking for this sort of option for quite some time now!
-
i have a scenario where i need the data of last date of every month and if the month is current month need current date data...
is it possible using MDX...Hi Shashi,
According to your description, you want to return the last day for each month except current month, right?
In MDX, we can use ClosingPeriod function to return the member that is the last sibling among the descendants of a specified member at a specified level, here is a sample query for you reference.
with member [measures].[a]
as
ClosingPeriod ([Date].[Calendar].[Date],[Date].[Calendar].currentmember).name
select {[measures].[a]} on 0,
[Date].[Calendar].[Month].members on 1
from
[Adventure Works]
And then use the IIF function to evaluate if the month is current month. Please refer to the links below.
http://msdn.microsoft.com/en-us/library/ms145584.aspxhttp://msdn.microsoft.com/en-IN/library/ms145994.aspx
Regards,
Charlie Liao
TechNet Community Support -
Show data of last day of previous month against any day of current month
Hi,
I have fact table which contains data at date level (we have data for oct-2009 to april-2010). Our requirement is to show data of last day of previous month against any day of current month in obiee 11g. I am facing problem in Feb 2010 its picking data of 28-Jan-2010 instead of 31-jan-2010 and for April its picking data of 30-mar-2010 instead of 31-mar -2010.
Any suggestion ???You're asking to filter your data set to only include rows between:
1) last day of the previous month
2) any day of the current month
This can be achieved with prompting in OBIEE Answers.
last day of previous month = TIMESTAMPADD( SQL_TSI_DAY , -(1), TIMESTAMPADD( SQL_TSI_DAY , DAYOFMONTH( CURRENT_DATE) * -(1) + 1, CURRENT_DATE)) . The problem is you need to make query work within Oracle's Answer syntax.
In the prompt, select the operator type for your date dimension as 'between' and default to 'SQL Results'.
For the 'last day of previous month' , use the query:
SELECT
case when 1=0 then Time."Fiscal Date" else TIMESTAMPADD( SQL_TSI_DAY , -(1), TIMESTAMPADD( SQL_TSI_DAY , DAYOFMONTH( CURRENT_DATE) * -(1) + 1, CURRENT_DATE))
end
FROM ENTER_YOUR_PRESENTATION_FACT_FOLDER_HERE
For the current date, use the query:
SELECT
case when 1=0 then Time."Fiscal Date" else CURRENT_DATE
end
FROM ENTER_YOUR_PRESENTATION_FACT_FOLDER_HERE
Another option is to create a last_date_pervious_month variable in the RPD and have that as the default value in your prompt. -
How do I set a recurring event for the last day of the month on iphone 4s calendar?
I want to set a recurring event for the last day of every month - regardless of the date/number of days in the month. I'd prefer not to have to use an app to do this.
Hi,
You can do this using the custom repeat in iCal. You'll need two events to cover the second and fourth Mondays.
Create the event on the second Monday of the month. In Repeat select Custom... > Frequency: Monthly > On the: second Monday.
Do the same for the Fourth Monday.
Best wishes
John M -
Function to get the last day of the current month
Hi friends
Now I need to know a function to get the last day of a month. I had between my notes that function but I do not find it and I think you can give the answer faster.
Thanks
Joel Pérez
DBA OracleI know emoticons are a bit naff but in the absence of a UBB markup to indicate humourous intent they do serve to indicate a joke. This is useful in a purely verbal domain like these forums, especially given that many participants don't have English as their first lanaguage and so often miss the wordplay.
Cheers, APC -
How to get the last day according to fiscal period input in selection scree
Hello expert
how to get the last day of fiscal period input.
the fiscal period inculdes 1-16
when fiscal period is greater than 12, only calculate the last day of 12nd month
your solution will be apprecaited, FM existing?
thank you
KevinHi,
when you give a particular date in any month
the following fm will give you the last date of that month
here you can give
R_FDATE-HIGH as 01 and month as the period you wnat and year for current year
concatenates '01' month year into r_fdate-high separated by '.'.
then it will give g_ltdt for that month and year which wil be the last date of that month
CALL FUNCTION 'RP_LAST_DAY_OF_MONTHS'
EXPORTING
DAY_IN = R_FDATE-HIGH
IMPORTING
LAST_DAY_OF_MONTH = G_LTDT
EXCEPTIONS
DAY_IN_NO_DATE = 1
OTHERS = 2.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
thanks & regards,
Venkatesh -
How can I know the last day of the subscription of...
How do I know when will be the last day of my subscription of the month?
I just purchased a subscription, it starts immediately. When will be the last day? 3/25?
Since the setting page shows me that my next payment will due on 3/23, so I got confused.
Thanks!Hi,
Please specify what you mean by last manager?
If you mean, previous manager:
You can try something like this...
--Test Data
CREATE TABLE emp_manager
empid NUMBER,
manager NUMBER,
start_date DATE,
end_date DATE
INSERT INTO emp_manager values (100,200,'1-JAN-00','31-DEC-05');
INSERT INTO emp_manager values (100,202,'1-JAN-06','31-DEC-10');
INSERT INTO emp_manager values (100,204,'1-JAN-11',null);
COMMIT;
--Generalized SQL for getting the previous managers
SELECT manager FROM
SELECT manager, ((COUNT(*) OVER (PARTITION BY empid))-ROWNUM) morder
FROM emp_manager
WHERE empid = 100 --Pass EMP ID here
ORDER BY start_date DESC)
WHERE morder = 1; --Pass 0 for current manager and 1 for previous manager and 2 for manager before previous manager and so on..Results:
MANAGER
202Hope it helps..
Regards,
Rakesh
Edited by: Rakesh Desai on Mar 28, 2011 3:12 PM -
Date: Is it possible to get the last Friday of each month?
Hello all, I am trying to create a column of dates which are a specific day in each month, e.g. the last Friday of every month, or the first Monday of every month. Is this possible, and if so could you please guide me on how to?
Thanks
JamesJames,
My thought was that you would create an array of dates with this table and Copy/Paste Values it into the range where you need it.
What I did was build a table of controls, below, where I set the year and what day of the week you were interested in and the top table will compute the dates. I used direct entry for the year and a POP-UP menu for day of the week.
The 4th 'Friday' formula is: =IF(Controls :: $C>$C, $B+Controls :: $C-$C+21, $B+Controls :: $C-$C+28)
The Last 'Friday' formula is: =IF((G+7)>EOMONTH(B, 0), G, G+7)
The formula in the Header Row is: ="4th "& Controls :: $B , etc.
There is no reason you couldn't transpose the table to have your Last Fridays in a row rather than in a column. I don't think I noticed that requirement in your original post.
And, there's no reason to have a fancy control panel if you don't think you'll ever need to create another series of dates. Just substitute values for the references to the control table.
Jerry -
Defining last day of previous month in ABAP
All,
I am a BW guy and hardly know ABAP. I have a requirement where I have to calculate last day of previous month and use it in the routines of the transformations.
I have decided to define the Last day of previous month in Start routine and then use the global variable in Transformations to calculate further.
The logic that i have used is outlined below.
Define G_DATE in global declaration for further use in Transformations.
In the Routine section,
Assign G_DATE to SY-DATUM
G_DATE + 6(2) = '01' (Replace last to field of date with '01' to establish first day of the current month)
G_DATE = G_DATAE - 1 (To get to last day of previous month)
My dilemma is to implement this in ABAP in Start routine of transformations. Please include the exact ABAP code that would be needed in Declarations and Routine section.
Thanks in advance.Hi..,
Go with the function module: LAST_DAY_OF_MONTHS
So, Just determine the last month from the sy-datum and then use above function module and pick the last date of the month.
Thanks,
Naveen Inuganti. -
Last day of previous month for data load
Hi,
I have to load data from the previous month into the psa and then into an infocube. I was wondering as to how to get the last of the previous month to write a code in ABAP. I will be writing the code at the infopackage level in the data selection. I could load data from the 1st of the previous month to the 1st of the current month. This will be an additional load of 30,000 records for the 1st of every month, since I will be loading 30,000 records everyday, I was wondering if I could limit the load from the 1st of every previous month to the last day of that month. This will be a repetitive loading.
DATA: CURR_MM(2) TYPE N,
CURR_YYYY(4) TYPE N,
CURR_DD(2) TYPE N,
PREV_MM(2) TYPE N,
PREV_YYYY(4) TYPE N,
PREV_DD(2) TYPE N,
YYYY_MM(6),
YYYY_MM1(6),
DATE LIKE SY-DATUM.
DATE = SY-DATUM.
CURR_YYYY = DATE+0(4).
CURR_MM = DATE+4(2).
CURR_DD = DATE+6(2).
PREV_DD = 1.
IF CURR_MM = '01'.
PREV_MM = '12'.
PREV_YYYY = CURR_YYYY - 1.
ELSE.
PREV_MM = CURR_MM - 1.
PREV_YYYY = CURR_YYYY.
ENDIF.
concatenate PREV_YYYY PREV_MM PREV_DD into YYYY_MM.
concatenate CURR_YYYY PREV_MM PREV_DD into YYYY_MM1.
read table l_t_range with key
fieldname = 'BLDAT'.
l_idx = sy-tabix.
l_t_range-low = YYYY_MM.
l_t_range-high = YYYY_MM1.
l_t_range-sign = 'I'.
l_t_range-option = 'BT'.
modify l_t_range index l_idx.
p_subrc = 0.
Mind you this code will load data from 1st of the previous month to the 1st of current month. I just don't want to load that extra "1st day" of current month data as I have 30,000 records everyday.
Say for example, I want to load data from 1st Mar to 31st Mar or 1st Feb to 28thFeb. How should I modify the above code.
Is there a formula to get the last date of the previous month. That's all I need. This would solve the problem.try this routine. it will return a range from 1st day to end of the month.
DATA: l_s_range TYPE rsr_s_rangesid,
E_T_RANGE TYPE RSR_T_RANGESID.
DATA: year(4) TYPE n,
month(2) TYPE n,
day(2) TYPE n,
ld_keydate TYPE sydatum,
ld_lastday TYPE sydatum.
REFRESH e_t_range.
CLEAR l_s_range.
year = sy-datum(4).
month = sy-datum+4(2).
*Months with 31 days in year
IF month = '01' OR
month = '03' OR
month = '05' OR
month = '07' OR
month = '08' OR
month = '10' OR
month ='12'.
day = '31'.
ENDIF.
*check for leap year: provoking sy-sybrc <> 0
IF month = '02'.
day = '29'.
MOVE: '02' TO ld_keydate+4(2),
year TO ld_keydate(4),
day TO ld_keydate+6(2).
CALL FUNCTION 'DATE_CHECK_PLAUSIBILITY'
EXPORTING
date = ld_keydate
EXCEPTIONS
OTHERS = 1.
IF sy-subrc <> 0.
day = '28'.
ENDIF.
ENDIF.
*months with 31 days in year
IF month = '04' OR
month = '06' OR
month = '09' OR
month = '11'.
day = '30'.
ENDIF.
MOVE: year TO ld_lastday(4),
month TO ld_lastday+4(2),
day TO ld_lastday+6(2).
l_s_range-low = sy-datum.
l_s_range-high = ld_lastday.
l_s_range-sign = 'I'.
l_s_range-opt = 'BT'.
APPEND l_s_range TO e_t_range. -
Last day of previous month, first day of current month
Hi,
Whats the best way to calculate the last date of the previous month, and the first day of the current month.
Thank you for your help.
Sumit.Here are FMs
SG_PS_GET_LAST_DAY_OF_MONTH FM calculating the last day of a month
FVOZ
RE_LAST_DAY_OF_MONTH
HRHCP00_TIME_HANDLING
HR_HCP_GET_LAST_DAY_OF_MONTH
HRVE_REPORTING
HRVE_LAST_DAY_OF_MONTH
RPDD HR-D: Payroll Germany
RP_LAST_DAY_OF_MONTHS HR-D: Determine last day of month
SLS0 PAW - Miscelaneous (MISC)
SLS_MISC_GET_LAST_DAY_OF_MONTH FM calculating the last day of a month
VVSRCH
LAST_DAY_OF_MONTHS
BWSO_DATE_GET_FIRST_WEEKDAY
CKSO
CK_F_GET_FIRST_DAY_OF_DATE
HRBEN00SPENDA
HR_BEN_SPENDA_FIRST_LAST_DAY
HRPB
HRPP_CCODE_GET_FIRSTDAY_PERIOD
HRVE_PAYROLL
HRVE_GET_FIRST_LAST_MONDAY
JBT6
ISB_GET_FIRST_DAY
KED2
RKE_GET_FIRST_DAY_IN_PERIOD
MCP2
MC_PERIOTAB_BT_FIRST_LASTDAY
MC_PERIO_GET_FIRST_AND_LASTDAY
Thanks
SK -
Printing Last Day of previous month
I need to print Last day of previous month, and the date value is relative to the system date.
In my previous post i have got the answer to print last day of current month. To print last date in previous month do i need to use RelativeDate? and I am not sure whether I can use RelativeDate for months.
RaghuRight now I have written below formula, and it works fine in all cases like if the current month equals to 01, 03, 05,07,08,10 and 12 and months other than mentioned in above including 02.
for First day of previous month
=If (FormatDate(CurrentDate();"MM"))InList("07";"08";"10";"12";"05";"01";"03") Then
(If(FormatDate(CurrentDate();"dd"))="01" Then
FormatDate(LastDayOfMonth(RelativeDate(CurrentDate();-1));"MM")"/01/"FormatNumber(Year(LastDayOfMonth(RelativeDate(CurrentDate();-1)));"####")Else
FormatDate(LastDayOfMonth(RelativeDate(CurrentDate();-31));"MM")"/01/"FormatNumber(Year(LastDayOfMonth(RelativeDate(CurrentDate();-31)));"####"))Else
FormatDate(LastDayOfMonth(RelativeDate(CurrentDate();-30));"MM")"/01/"FormatNumber(Year(LastDayOfMonth(RelativeDate(CurrentDate();-30)));"####")
For Last day of previous month
=If (FormatDate(CurrentDate();"MM"))InList("07";"08";"10";"12";"05";"03";"01") Then
(If(FormatDate(CurrentDate();"dd"))="01" Then LastDayOfMonth(RelativeDate(CurrentDate();-1))Else
LastDayOfMonth(RelativeDate(CurrentDate();-31)))Else LastDayOfMonth(RelativeDate(CurrentDate();-30))
Please let me know any other suggestions.
-Raghu
Maybe you are looking for
-
Hi, Where can i find Business Packages for EP6 SP9 version.Iam looking for Maintenance Technician BP. The BP available in Content Portfolio is for 2004s SP5. The Prerequisites mentioned in the document are : ECC 6.0 and 2004s SP5. Thanks, Uma.
-
How do i add more photo albums?
please help
-
IOS 7.0.3 iMessage
Still an issue. I txt my wife and when she resplys her txt comes back in a whole new conversation. Sometimes I have to restart my phone and I'll get her messages after the restart. Great job Apple!! Feel like I have Droid again. Anyone else havin
-
Error when putting music onto ipod
when i open itunes to put music onto my ipod and it pops up and says unknown failure occured to my ipod error code(-69) so if this has happened to anybody else please reply to this your help is appreciated
-
Using Mail to download from AOL, can't see photos in messages, help
We are using Mail to download our AOL account and can't seem to see photos in the emails even though they are being sent by another mac user. I did a search and saw this question was posted last Oct but no responses. Is there a solution? Any help wou