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: 

How to get the previous month

Former Member
0 Kudos

Hi All,

I have a requirement. If i enter month in selection screen, depends on the month value how to get the previus month value. For Input criteria i can able to give only month.

Can you please suggest me how to do that?

Thanks,

Sreekala.

9 REPLIES 9

Former Member
0 Kudos

hi

can you please more clear about requirement.

babu_kilari4
Active Contributor
0 Kudos

Sreekala,

I have a question for you. Have you searched in SCN Forums for this question?

Please let me know

Thanks,

Babu Kilari

0 Kudos

Yes, I searched in Forum. But i am getting the Function modules with the inpur criteria Date field.

But i can able to give input only month.

Thanks,

Sreekala.

0 Kudos

You neither need to search the forum, nor look for a Function Module for your requirement.

A little bit of common sense will do the trick.

pk

0 Kudos

I searched in Forum and i tried with F4 help in SE37. Still i didnt get, if you find any FM let me know.

Former Member
0 Kudos

Hi...

If in selection criteria if u entering only month then its easy to get previous month by simply do -1 from that.

If you are taking date in selection then do following method



* if format is YYYYMMDD

then 

DATA : v_date type sy-datum,
            v_month type i.

PARAMETERS: P_DATE TYPE SY-DATUM.

v_month = P_DATE+4(2).
v_month = v_month - 1.

write v_month.

This way u can get the pre. month. hope this will helpful to u.

Regards,

Chintan.

0 Kudos

if i enter input month as 1 then previous month will be 0. I have to find out the previous month. if i enter month in selection screen 1 then previous month will be 12 .

Is there any FM.

Thanks,

Sreekala.

Former Member
0 Kudos

for getting previous month you have somany function modules.

search for the same in SE37 ,providing as input PREVIOUSMONTH* and press F4 then you will get set of function modules.call this function module and populate as per definition of that function module.

Hope it will helpful

Former Member
0 Kudos

hi,

use this link .

.

~linganna