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

Regarding previous date range ;

Former Member
0 Likes
592

Hi Friends,

Can anybody tell me Function Module for getting previous date range if input provided is Month and Year.

For Ex :

Input is Jan2008 or ( Month = '01' & Year = '2008' )

O/P i need is : 1/11/2007 to 31/1/2008

Similarly

Input is Feb2008 or ( Month = '02' & Year = '2008' )

O/P i need is : 1/12/2007 to 31/2/2008

Regards

Chitrakant

5 REPLIES 5
Read only

Former Member
0 Likes
555

Hi,

Use This FM

'OIL_LAST_DAY_OF_PREVIOUS_MONTH'

if u know the last date first date is not a problem u can use

FM 'OIUREP_FG1_CALC_FIRST_LAST_DAY'

Cheers,

Will.

Read only

RaymondGiuseppi
Active Contributor
0 Likes
555

(1) Calculate first day in period via

Function module FIRST_DAY_IN_PERIOD_GET

(2) Subtract one from this date giving last day in previous period

(3) Force day position +6(2) at value '01' giving first day in previous period

Regards

Read only

0 Likes
555

Hi ,

Can you just tell me what i need to pass for

-Mid-Month for Half Month Periods

-Period Variant

-Fiscal Period

in 'FIRST_DAY_IN_PERIOD_GET'.

I tried but it did not worked

Regards

Read only

0 Likes
555

These value come from society customizing, read table T001

CALL FUNCTION 'FIRST_DAY_IN_PERIOD_GET'
       EXPORTING
            i_gjahr = w_gjahr " Year
            i_periv = t001-periv " Fiscal year variant
            i_poper = w_poper " Period/Month
       IMPORTING
            e_date  = w_date
       EXCEPTIONS
            OTHERS  = 1.

If you don't have the society, look in table T009 for a correct variant. For calendar value, just concatenate year, period and '01' to give the first day of month.

Regards

Read only

Former Member
0 Likes
555

Answered