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

FM for Date

muhammad_sohail
Participant
0 Likes
508

Dear All,

Is there any function Module which take current date as input and return previous month start and end date.

e.g; Input = 20100811

output = 20100701 and 20100731

Regards,

Sohail

Moderator message: date conversion questions = FAQ, please search before posting.

locked by: Thomas Zloch on Aug 11, 2010 11:08 AM

3 REPLIES 3
Read only

Former Member
0 Likes
476

Hello Muhammed,

You can use fm WSAF_GET_LAST_DAY_OF_MONTH. As parameter you have to process the current date and subtract 1 from current month. For example today is 11.08.2010, you can change the month portion to 07 and give 11.07.2010 to the fm. It will return the relevant last day of the month.

Regards,

Ali

Read only

Former Member
0 Likes
476

Hello,

Use FM "'RS_VARI_V_LAST_MONTH"'

Pass current date in P_DATETAB-low and execute the FM.

Regards,

Bhavana

Read only

Former Member
0 Likes
476

Check this Wiki

http://wiki.sdn.sap.com/wiki/display/ABAP/FunctionModulerelatedonDate+calculations

Regards

Sas