Application Development 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: 

Calculating the date on first monday

Former Member
0 Kudos

Hi Experts,

Hi Experts,

Ihave to calculate the date on First Monday in the given date range.

Say user enters

Week 24/09/2008 to 10/10/2008.

It should show the date on the Monday corressponding the first date i.e 22/09/2008

Regards,

Krishan

3 REPLIES 3

Former Member
0 Kudos

but 22092008 doent fall between your range.

use FM DATE_TO_DAY

former_member329859
Participant
0 Kudos

Hi

try this,

CALL FUNCTION 'DAY_ATTRIBUTES_GET'

EXPORTING

date_from = st_month

date_to = en_month

TABLES

day_attributes = itab

EXCEPTIONS.

itab contains all the attributes.....

Former Member
0 Kudos

Hi,

You can do as below:

Populate the values into internal table containing only field of type sy-datum.


loop at itab.

CALL FUNCTION 'DATE_COMPUTE_DAY'
  EXPORTING
    date          = itab-date
 IMPORTING
   DAY           = gv_date
          .

if gv_date = '1'.
write : itab-date.
endif.
endloop.

Thanks,

Sriram Ponna.