How to get the First day in a Week in a Fiscal Year
Hi guys,
I have a Requirement to calculate the First day in a Week in a Fiscal year .
The FM GET*FIRST_DATE and all are for Calender year.
Is there any FM to calculate the First in a Week in a Fiscal year.
For eg. They will give 200826.
In this 26 is the Week.
I need to find the First date value in that Week.
Thanks,
Gokul
Hi Gokul...
Instead of using the funtion module you can just write the 3 statements of code to get the first day of the week.
Its similar to the above one but instead of writing case statement you can achive the following.
data : w_res type i,
w_data type d,
w_res = w_date mod 7.
w_date = w_date - w_res.
write w_date.
This works.
Regards,
Siddarth
Similar Messages
-
How to get the first day in the month from a domain date ?
Hi,
I like to know how to get the first day in the month from a domain date?
Thanks
StephenHi Gokul...
Instead of using the funtion module you can just write the 3 statements of code to get the first day of the week.
Its similar to the above one but instead of writing case statement you can achive the following.
data : w_res type i,
w_data type d,
w_res = w_date mod 7.
w_date = w_date - w_res.
write w_date.
This works.
Regards,
Siddarth -
How to get the FIRST DAY OF THE CURRENT MONTH
how to get the FIRST DAY OF THE CURRENT MONTH in oracle 9i.
plzzzzz send immedaily.advance thanksTEST@test SQL> select trunc(sysdate,'MON') from dual;
TRUNC(SYS
01-OCT-06
TEST@test SQL> -
How to get the first day of current month
hi guys,
i am trying to get the first day of current month which get from the date i input at the selection screen. my method is not so good, so i was wondering if there is better way to get the this,
thanks.Try this .
data : DAYNR LIKE HRVSCHED-DAYNR,
DAYTXT LIKE HRVSCHED-DAYTXT.
data langu like sy-langu value 'EN'.
Parameters PDATE LIKE SY-DATUM.
PDATE+6(02) = '01'.
CALL FUNCTION 'RH_GET_DATE_DAYNAME'
EXPORTING
LANGU = LANGU
DATE = PDATE
CALID =
IMPORTING
DAYNR = DAYNR
DAYTXT = DAYTXT
DAYFREE =
EXCEPTIONS
NO_LANGU = 1
NO_DATE = 2
NO_DAYTXT_FOR_LANGU = 3
INVALID_DATE = 4
OTHERS = 5
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
WRITE :/ PDATE, DAYNR, DAYTXT.
Cheers -
How to get the last day of the week?
Hii
i can get the calender week number for any given date using
SELECT to_char(to_date('04/04/2011','MM/DD/YYYY'),'WW') FROM dual
can any body tell me, how to get the last day of that week ?
and the answer should be 04/08/2011(8th april )
thanks
San
Edited by: sandeep9 on Apr 4, 2011 3:50 AMHi, San,
Here's one way:
WITH sample_data AS
SELECT DATE '2011-04-04' AS dt
FROM dual
SELECT dt
, TO_CHAR (dt, 'WW') AS week_num
, NEXT_DAY ( dt - 1
, TO_CHAR ( TRUNC (dt, 'YEAR') - 1
, 'Day'
) AS end_o_week
FROM sample_data;Another way is to use date arrithmetic:
WITH sample_data AS
SELECT DATE '2011-04-09' AS dt
FROM dual
SELECT dt
, TO_CHAR (dt, 'WW') AS week_num
, TRUNC (dt, 'YEAR')
+ (7 * CEIL ( (dt - (TRUNC (dt, 'YEAR') - 1))
/ 7
- 1 AS using_date_arithmetic
FROM sample_data; -
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 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 -
Apple Mail - how to get the first word in a sentence to auto-capitalize
How to get the first word in a sentence to auto-capitalize
Anwarsomething to look forward to then, because we get used not to use our shift button any more, since iPhone and iPad do it for us. entourage and other ms stuff do it. pages does it too now (put it on in the auto-correct in preferences). bizarre however some loose the capitalization when you copy the text. pages to stickies or mail does not. that's good !
-
How to get the first 4 chars form a var ?
Hi guys,
How to get the first 4 chars form a var ?
i.e temp type num20 value '00000000000012345678'.
how to move the first 4 chars to another var?
thx in advance.hi
use OFFESTS..
example:
var1 = '12345678'.
var2 = var1+0(4).
now var2 conatins '1234'.
thx
pavan -
How to get the exact day date with the another date field?
Hi,
Please help me how to get the specific day of the week's date with the help of another date field.
Actually , one field(week_day) has 1,2,3,4,5,6,7 here 1--MON,2-- TUE like that.
another field has the date. based on that date, we have to go to that particular week and need to pick up the date by the above week_day. It should be in that week itself.
Thanks in advance!!
Regards,
Vissu...
Edited by: vissu on Oct 29, 2010 3:07 AMHi,
Something like this
SELECT TRUNC(<DATE_COLUMN>,'DAY')+<WEEK_NO_COLUMN> FROM <YOUR_TABLE>;for the particular week of the date
SELECT TRUNC(SYSDATE,'DAY')+<WEEK_NO_COLUMN> FROM <YOUR_TABLE>;for the current week
cheers
VT -
How to set the First Day of the week in OBIEE 11g
In OBIEE 10g, there was a timeline.pcxml , that allowed you to change the First Day of a week (Default Sunday) to monday etc etc..
Where can we find the same in OBIEE 11g ?
Thank you ,
SmrithyThere are probably several ways. We have a universe string object named "Month" which is in the format "YYYY" then "M" and the month number. For instance any date in June 2010 would have in this object:
2010M06
So we made this variable in Webi for [First Day of Month]:
=ToDate(Right([Query1].[Month];2) + "-01-" +Left([Query1].[Month];4);"MM-dd-yyyy")
Hope that helps. -
How to get the first friday of the MARCH and SEPTEMBER month of any year...
Hello-
How can we get the first FRIDAY of MARCH and SEPTEMBER month for any given year.
Any help would be appreciate!
Thanks,
NikhilHi,
Please use the following function to get first fiday of any month, we have to pass month,year as varchar2 as input to this function and it will return the
date in char format, we can convert it to date.
CREATE OR REPLACE FUNCTION find_fri
(p_month VARCHAR2,
p_year VARCHAR2)
RETURN VARCHAR2 AS
p_friday VARCHAR2(15);
BEGIN
SELECT (CASE triM(TO_CHAR(TO_DATE(p_month||'-'||p_year,'mm-yyyy'),'DAY')) WHEN 'MONDAY' THEN TO_CHAR(TO_DATE(p_month||'-'||p_year,'mm-yyyy')+4 ,'DD-MM-RRRR')
WHEN 'TUESDAY' THEN TO_CHAR(TO_DATE(p_month||'-'||p_year,'mm-yyyy')+3 ,'DD-MM-RRRR')
WHEN 'WEDNESDAY' THEN TO_CHAR(TO_DATE(p_month||'-'||p_year,'mm-yyyy')+2 ,'DD-MM-RRRR')
WHEN 'THURSDAY' THEN TO_CHAR(TO_DATE(p_month||'-'||p_year,'mm-yyyy')+1 ,'DD-MM-RRRR')
WHEN 'FRIDAY' THEN TO_CHAR(TO_DATE(p_month||'-'||p_year,'mm-yyyy'),'DD-MM-RRRR')
WHEN 'SATURDAY' THEN TO_CHAR(TO_DATE(p_month||'-'||p_year,'mm-yyyy')+6,'DD-MM-RRRR')
WHEN 'SUNDAY' THEN TO_CHAR(TO_DATE(p_month||'-'||p_year,'mm-yyyy')+5 ,'DD-MM-RRRR')
ELSE 'OTHER'
END) INTO p_friday FROM dual;
RETURN p_friday;
END; -
How to get the last day of the next month?
Hi all.
I need to get the last day of the next month. E.g. if the date is 20.03.2008 I need to get 30.04.2008.
Is there any FM for it?
TIA, Nikolai.hi Nikolai,
pls. have a look athe following piece of code:
PARAMETERS : p_date TYPE sy-datum.
DATA : gv_res TYPE sy-datum.
CALL FUNCTION 'CALCULATE_DATE'
EXPORTING
* DAYS = '0'
months = '2'
start_date = p_date
IMPORTING
result_date = gv_res.
==> Now you have (gv_res) 2 months later as today
gv_res+6(2) = '01'. ==> gv_res is first day of next-next month
gv_res = gv_res - 1. ==> gv_res is last day of next month
hope this helps
ec -
How to get the last day of the payroll period
Hi all,
I need to get the last day of the payroll period e.g. last day of Jan 2007 is 31 Jan 2007. Can anyone suggest as to how to get it?
Thanks,
MadhuT549S contains the payroll periods with pay date. T549Q contains the begin and end dates of the payroll period.
You can select from the appropriate table (or from both depending on your given data) to get the end date of the period.
Hope that helps.
Mary -
How to get the first month of the year inputed by user manually
Hi Expert,
Just like the subject, I 'd like to get the first month of the year inputed by user manually, but don't know how to set the variable, please help.
For example, user execute a query and input the value of variable Year = 2010, and what I want to get is 201001 into another variable, so that I can use this variable to setup another selection.
Thank you.
AndyHi Andy,
1) U will create a user input varaible for year and say it is ZYEAR.
2) U will create another variable for calmonth which has processing type : customer exit ..single value ...mandatory ....say ZCMONTH.
This needs to be populated using the year( user inputted ) and calmonth '001'
This code will fetch the user input value into ZYEAR and append '001' to the user input value and the value
will be passed to the ZCMONTH varaible...
Sample Code is....
When 'ZCMONTH'.
IF I_STEP = 2.
READ TABLE I_T_VAR_RANGE WITH KEY VNAM = 'ZYEAR'.
IF SY_SUBRC = 0.
L_S_RANGE-LOW = I_T_VAR_RANGE-LOW.
L_S_RANGE-LOW+4(3) = '001'.
L_S_RANGE-SIGN = 'I'.
L_S_RANGE-OPT = 'EQ'.
APPEND L_S_RANGE TO E_T_RANGE.
ENDIF.
ENDIF.
Regards
vamsi
Maybe you are looking for
-
How to reinstall iPhotos without previous apple id for mac book
I bought a macbook and have the master password. But i can't update iPhotos because i do not have the previous owners apple id. How can i reinstall or update
-
Help - how to create java proxy (sender) in NWDS 7.1
Hi, I am trying to develop a java proxy as sender to send message from WAS to PI. I am using NWDS 7.1. Let me explain what I have done so far, 1. Received proxy classes from PI 2. Created a EJB Project, imported the proxy classes into EJB project 3.
-
i had tomcat installed and running until i installed the sun java studio creator. when i did that, tomcat would not start! i tried removing it and reinstalling it on port 8085 (i thought it would conflict with the studio creator's port number) but it
-
How can I make the second internal drive bootable drive bootable for trouble shooting?
I suspect that a newly installed SSD boot drive may be causing instability in my new 2012 Mac Mini Server. The logic board and RAM have been replaced and boot drive wiped and partitioned and 10.10.2 reinstalled. I'd like to make the second drive boot
-
Classpath problems - Javaranch
Hi, I have a package called JavaRanchCommon.zip. I try to use its classes for an exercise. I have this zip file in the Java directory where I am saving this class I try to compile. I'm having trouble to try compile a class on Windows 98. I keep getti