cancel
Showing results for 
Search instead for 
Did you mean: 

reg : date calculation

Former Member
0 Kudos

hi,

I have a FROM DATE and TO DATE fields.

If I select a date from the calendar ..it should display the week start date in the FROM DATE field and

week end date in TO DATE field

Can you please let me know how to approach??

thx

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member189058
Active Contributor
0 Kudos

Hi Murali,

Let your form context have two attributes namely dt_from and dt_to.

In the Backend before calling the form do the following:

Call Function DATE_GET_WEEK passing the current date (sy-datum) . This function will return the current week number.

Call Function WEEK_GET_FIRST_DAY passing the week number and get the first date of the week.

Add 7 to it and get the last date of the week.

Set these values to the context attributes of the Form.

On the form bind the values of these two fields to the respective context attributes.

Now can you let from where are you calling the form - Is it an ABAP Accordingly, I will be able to tell you where to write the code.

Regards,

Reema.

Edited by: Reema Shahbazkar on Sep 19, 2008 12:39 AM

Former Member
0 Kudos

Hi Reema.

Thanks for your answer, but I want this functionality in Adobe form.