Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

reports

Former Member
0 Likes
644

hi all,

i got a requirement as given below

(A) If job run date is July 13, 2006 (Thursday) 2:00 AM, report should fetch the data from July 10, 2006 (Monday) 2:00AM till July 13, 2006 1:59AM.

(B) If job run date is July 10, 2006 (Monday) 2:00 AM, report should fetch the data from July 03, 2006 (Monday of last week) 2:00AM till July 10, 2006 1:59AM.

Can u pls ell me the logic behind this

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
617

use function module

BWSO_DATE_GET_FIRST_WEEKDAY

and enter the date u will get the first day of the week

time i think u can hard code and fetch the required jobs in it

Harish

reward if useful

4 REPLIES 4
Read only

Former Member
0 Likes
618

use function module

BWSO_DATE_GET_FIRST_WEEKDAY

and enter the date u will get the first day of the week

time i think u can hard code and fetch the required jobs in it

Harish

reward if useful

Read only

Former Member
0 Likes
617

1) pass job run date to the fm GET_WEEK_INFO_BASED_ON_DATE, to get the last monday

Regards,

ravi

Read only

naimesh_patel
Active Contributor
0 Likes
617

Hello,

You can use the FM WEEK_GET_FIRST_DAY to get the first day (monday) fo the week. You have to pass the week to get the date. Use FM 'DATE_GET_WEEK' to get the week.

Fill the range as I BT 'date of monday' 'sy-datum'.

Select the date of latest monday and do the selection.

Reagrds,

Naimesh

Read only

Former Member
0 Likes
617

Hi,

I think your requirement is to fetch the data from the week's first day.

You can use function module WOD1_GET_FIRST_DAY

to get the first day of the week. Use the Job run date and get first day of week using this function module. If the Function module returns the same day as first day, then consider the previous weeks first day.

Example - When Job run on July 13th, the function module would return Jul 10th as first day.

When the Job run date is Jul10, function module would return Jul 10 itself. In this case, feed Job run date - 1 to the function module, so that you get previous week's first day.

Hope this helps.

Regards,

HR