cancel
Showing results for 
Search instead for 
Did you mean: 

Urgent Help!!

0 Kudos

Hi BIans,

Is there any SAP exit variable for

a.Last year Current month

b.Current Year Current Month.

Built on 0DATE.

i.e User enters 06/2011 then,

a.Last year Current month -


01/06/2010 - 30/06/2010.

b.Current Year Current Month. --01/06/2011 - 30/06/2011

Thanks in advance,

Shreya.

Accepted Solutions (1)

Accepted Solutions (1)

jaigupta
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Shreya,

Pls refer to appendix D in the below link...

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/324de5a1-0201-0010-dc9a-a093cde87...

Hope it helps..

Regards,

jai

Answers (2)

Answers (2)

ravikanth_indurthi
Active Contributor
0 Kudos

Hi,

Use the variable on month, as per your requirement user enters the month value 06/2011.

As the month and date are mapped automatically it will display the required date of selected months.

For Ex: 06/2011 is entered as input all the dates in that month will be displayed.

For last year current month use any manual input standard variable with -12 as offset value and restict the KF.

For current year use the direct manual input variable.

But you cannot put the month in either in rows or columns.

Hope this helps....

Rgs,

Ravikanth.

0 Kudos

Hi Ravi,

Thanks for the reply.

That would be an easier task to get the current month data and do -12 offset but the case is different here.0calmonth is not mapped to date.

I have written customer exit to get current month and did offset -365.

only for reading purpose i am using 0calmonth.I will be restricting all my selections with 0date.

To avoid customer exit i had asked for SAP exit.

Thanks,

Shreya

ravikanth_indurthi
Active Contributor
0 Kudos

Hi,

That would be good to have 365 days as offset value, but have you considered leap year also?

then it should have 366 days as offset, as the coming is year (2012) is Leap year.....

Hope this helps......

Rgs,

Ravikanth

0 Kudos

Hi Ravi,

Thanks for reminding me this i have almost forgotten leap year.

I have not considered leap year.

How do i have to proceed for leap years??

Thanks,

Shreya.

ravikanth_indurthi
Active Contributor
0 Kudos

Hi,

in the customer exit pass the YYYY from the date into a new variable or existing YEAR

->Divide it by 4, if the remainder is '0', consider as leap year and use 366 days as offset else 365 days.

->There is a function module to pass the date and find if it is leap year or not LEAP_DAYS_BETWEEN_TWO_DATES' or FIMA_LEAP_DAYS_BETWEEN_2_DATES

->Else you can hard code, if the year is 2012 or 2016 or 2020 etc.,then offset is 366 else offset is 365.

->Click the below link:

[Checking for a leap year|http://wiki.sdn.sap.com/wiki/display/ABAP/Checkingforaleapyear.]

Hope this helps...

Rgs,

Ravikanth.

Edited by: Ravikanth Indurthi on Dec 29, 2011 5:07 PM

Former Member
0 Kudos

Hi

Please check this link which is helpful..

Thanks

Riyez