on 09-09-2014 4:30 PM
Hi,
We've a requirement where we've to derive week commencing date (Sun- Sat) e.g. week commencing 03.08.2014 --- from below ZPRINT_DT into ZWKCOM field. Please can you give sample code how we can achieve this. Should it be written at field level or in end routine.
We want to achieve something similar as below:
Hi Pawan,
You can use below code.
-------------------------------------
DATA: date_in TYPE sy-datum,
date_out TYPE sy-datum.
date_in = ZPRINT_DATE. " here pass your print date
CALL FUNCTION 'BWSO_DATE_GET_FIRST_WEEKDAY'
EXPORTING
date_in = date_in
IMPORTING
DATE_OUT = date_out .
-------------------------------------
Regards
Amit
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Pawan,
using below function module, you can derive the day of hte print date. then subtract that day from the print date, will you the Sunday's date (ie, week commencing date for you)
CALL FUNCTION 'DATE_COMPUTE_DAY'
EXPORTING
date = w_first_date (pass your print date here)
IMPORTING
day = w_day. (this will give you day of the date)
eg. if you pass the date as 01.08.2014, it will return as day as 5. subtracting this 5 from 01.08.2014, will give you 27.07.2014 .
i hope this is what you are looking for ..
Regards,
Sakthi.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
25 | |
12 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.