2007 Oct 26 10:52 AM
hello frnds,
my requirement is like this.
i want run a report. if i run the report on tuesday(15-03-07) the date should start from monday(14-03-07).
ho w can in achieve this functionality?
Hi,
Please use the FM 'DATE_COMPUTE_DAY'.
With this FM you can get the day of the week using the current date.
for e.g. 0 stands for Monday,1 for Tuesday, 2 for Wednesday,3 for Thursday.
Once you get the day then you can subtract the exact no of days to get the get of Monday.
Hope it was useful.
Thanks,
Sandeep.
2007 Oct 26 10:54 AM
2007 Oct 26 10:56 AM
i dont know on wat day i may run.
let us say i run 2 day i.e., friday even though i should get starting date of the week i.e, monday
2007 Oct 26 11:00 AM
I understand your requirement...
Just use this FM..this returns always that week monday...
CALL FUNCTION 'GET_WEEK_INFO_BASED_ON_DATE'
EXPORTING
date = sy-datum
IMPORTING
monday = pdat.
2007 Oct 26 11:02 AM
Hi Madan,
chk this
REPORT YCHATEST2.
DATA : V_DATE LIKE SY-DATUM.
CALL FUNCTION 'GET_WEEK_INFO_BASED_ON_DATE'
EXPORTING
DATE = SY-DATUM
IMPORTING
* WEEK = WEEK
MONDAY = V_DATE.
* SUNDAY = SUNDAY.
WRITE : / 'First day of week is ' , V_DATE.
2007 Oct 26 11:03 AM
Hi Madan..
These are the Hints:
First Call the FM <b>DATE_GET_WEEK "</b>Returns the Week No of the Given Date
Call the FM <b>WEEK_GET_FIRST_DAY</b> "Returns the First day of the week
reward if Helpful.
2007 Oct 26 11:13 AM
how can i add 7 days to a date.
suppose v_date is type sy-datum
contains date as 22.10.2007.
how can i add 1 week to that date.
2007 Oct 26 11:17 AM
Hi,
To add 7 days to your date
Use the function module
<b>RP_CALC_DATE_IN_INTERVAL</b>
Sample code:
DATA V_DATE TYPE SY-DATUM.
CALL FUNCTION 'RP_CALC_DATE_IN_INTERVAL'
EXPORTING
DATE = SY-DATUM
DAYS = 7
MONTHS = 0
SIGNUM = '+'
YEARS = 0
IMPORTING
CALC_DATE = V_DATE.
write:/ v_date.
2007 Oct 26 11:20 AM
Hi Madan,
chk this
REPORT YCHATEST2.
DATA : V_DATE1 LIKE SY-DATUM,
V_DATE2 LIKE SY-DATUM.
V_DATE1 = SY-DATUM + 7.
CALL FUNCTION 'GET_WEEK_INFO_BASED_ON_DATE'
EXPORTING
DATE = V_DATE1
IMPORTING
* WEEK = WEEK
MONDAY = V_DATE2.
* SUNDAY = SUNDAY.
WRITE : / 'First day of week is ' , V_DATE2.
2007 Oct 26 10:56 AM
Hi madam,
create select screen using sy-datum,
fetch data based on sy-daum - 1.
If useful, reward points,
Regards,
Bhaskar
2007 Oct 26 11:05 AM
You can use the FM - BWSO_DATE_GET_FIRST_WEEKDAY.
That will give the first day of the week.
2007 Oct 26 11:06 AM
Hi Madan,
If you want the Start Date to be the 1st day of the week on which you run the report, then you can use the following FMs:
DATE_GET_WEEK: To get the week in which a date lies.
WEEK_GET_FIRST_DAY :To return first day for a particular week
Reward points for useful answers.
2007 Oct 26 11:07 AM
Hi,
PARAMETERS: p_date TYPE sy-datum.
DATA: v_wotnr TYPE p.
INITIALIZATION.
p_date = sy-datum.
DO.
CALL FUNCTION 'DAY_IN_WEEK'
EXPORTING
datum = p_date
IMPORTING
wotnr = v_wotnr.
IF v_wotnr = 1.
EXIT.
ELSE.
p_date = p_date - 1.
ENDIF.
ENDDO.
2007 Oct 26 11:08 AM
use the below FM: it will always give you the monday,
CALL FUNCTION 'GET_WEEK_INFO_BASED_ON_DATE'
EXPORTING
date = sy-datum
IMPORTING
monday = l_monday.
*reward if solved*
2007 Oct 26 11:15 AM
Hi,
Please use the FM 'DATE_COMPUTE_DAY'.
With this FM you can get the day of the week using the current date.
for e.g. 0 stands for Monday,1 for Tuesday, 2 for Wednesday,3 for Thursday.
Once you get the day then you can subtract the exact no of days to get the get of Monday.
Hope it was useful.
Thanks,
Sandeep.
| User | Count |
|---|---|
| 6 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |