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

Date logic

Former Member
0 Likes
958

Hi all,

How to abtain friday of every week.

Regards,

Srik

8 REPLIES 8
Read only

Former Member
0 Likes
887

Means? can you please elaborate?

Read only

0 Likes
887

hi,

I want to run the report on weekly basis like every friday of the week.

Regards,

Srik

Read only

0 Likes
887

Ye then the FM day_in_week is useful

FUNCTION DAY_IN_WEEK.

*"----


""Lokale Schnittstelle:

*" IMPORTING

*" VALUE(DATUM) TYPE D

*" EXPORTING

*" VALUE(WOTNR) TYPE P

*"----


PERFORM DAY_IN_WEEK USING DATUM

CHANGING WOTNR.

pass the date over here

if value is 5 execute ur report

Hope it helps

Read only

0 Likes
887

Sric,

use FM DAY_IN_WEEK pass sy-datum in date field and

if result is *5* means today is friday than do nothing
else.
pass error message
endif.

Amit.

Read only

Former Member
0 Likes
887

Hi,

DAY_IN_WEEK is the functio nmodule, which will return the day of the week.

Pass sy-datum to this fm and check for the day '5'. If it is '5', it's friday.

If not some ohter day.

Reward if helpful,

RSS

Read only

Former Member
0 Likes
887

Hi,

You can use Code or Function module :

DATA:  WOTNR TYPE P.

   DATA: DIW_FIRST TYPE D VALUE '19790101'.

   PARAMETERS: p_date type D.

   WOTNR = ( ( p_date - DIW_FIRST ) MOD 7 ) + 1.

   WRITE:  WOTNR.

Or FM

DAY_IN_WEEK.

You use the logic that if day is 5( ie o/p of above FM) schedule a job.

This will surely help you.

Plz reward if useful.

Thanks,

Dhanashri.

Read only

0 Likes
887

Hi Srik,

If your problem is solved, please reward teh points and close the thread.

RSS.

Read only

Former Member
0 Likes
887

done