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

months determine

Former Member
0 Likes
473

My issue is I am giving i/p 200609 as period.

Then I am giving month i/p as 4.

I am having o/p field startmonth and Endmonth.

In startmonth i should get 200605 &

In endmonth I will get obviously 200609.

How can I do this. Is there any fm for this.

Plz help me..

My issue is I am giving i/p 200609 as period.

Then I am giving month i/p as 4.

I am having o/p field startmonth and Endmonth.

In startmonth i should get 200605 &

In endmonth I will get obviously 200609.

How can I do this. Is there any fm for this.

Plz help me..

3 REPLIES 3
Read only

Former Member
0 Likes
455

Hi, declare l_startmonth and l_endmonth

l_endmonth = i/p (200609)

l_startmonth = i/p (2000609 - 04)

then try this way

or take the month in input value and subtract from the given input month value

Read only

former_member386202
Active Contributor
0 Likes
455

Hi,

use FM to add months

CALL FUNCTION 'RE_ADD_MONTH_TO_DATE'

EXPORTING

months = '2'

olddate = lv_date

IMPORTING

newdate = lv_newdate.

Regards,

prashant

Read only

Former Member
0 Likes
455

Hi veera,

Please use the FM below.

You can use the FM RE_ADD_MONTH_TO_DATE

DATA: V_DATE TYPE SYDATUM.

V_DATE = SY-DATUM.

CALL FUNCTION 'RE_ADD_MONTH_TO_DATE'

EXPORTING

MONTHS = '-6'

OLDDATE = V_DATE

IMPORTING

NEWDATE = V_DATE.

WRITE: / 'BEFORE SIX MONTHS', V_DATE.

Thankx.

reward if useful.