Derive YTD and PYTD based on 0Calday Input
Dear friend this blog will help you to derive YTD and PYTD based on Calday input.
So first we will discuss what is YTD and PYTD.
YTD – Year-to-date is a period, starting from the beginning of the current year, and continuing up to the present day. The year usually starts on January 1 (calendar year), but depending on purpose, can start also on July 1, April 1. YTD is often provided in financial statements detailing the performance of a business entity. Providing current YTD results, as well as YTD results for one or more past years as of the same date, allows owners, managers, investors, and other stakeholders to compare the company’s current performance to that of past periods.
PYTD – Previous year data for same date input.
Derive YTD Based on Calday input
after all the selection we need this screen
Now first we creating cal day input variable
Create a date Variable here value range is less then Equal or equal to ( ≤ ) single value mandatory input.
Date Variable—
Details tab setting
this input date variable should be less then or equal. Because when user will input any date then it will fetch data from that data or less then.
Now we need to create a customer exit variable on FISCAL YEAR.
Details tab setting
Create a new customer exit variable for date input variable. Give technical name and description and Variable process type customer exit.
Details tab settings,
Our cal day input variable is less then equal to cal day variable.
Select customer exit Fiscal year variable and select offset minus ➖ 1 for last 1Year.
Customer Exit Code for cal day variable ZCL_DAY_CUST (Cal day from customer Exit Var 1)
DATA : L_S_RANGE TYPE RSR_S_RANGESID ,
LOC_VAR_RANGE TYPE RRRANGEEXIT,
L_YY(4) TYPE C,
L_MM(2) TYPE C,
L_DD(2) TYPE C.
CASE I_VNAM.
WHEN ‘ZCL_DAY_CUST’.
IF I_STEP = 2.
LOOP AT I_T_VAR_RANGE INTO LOC_VAR_RANGE WHERE VNAM = ‘ZSJ_CALDAY’.
L_YY = LOC_VAR_RANGE–LOW+0(4).
L_MM = LOC_VAR_RANGE–LOW+4(2).
L_DD = LOC_VAR_RANGE–LOW+6(2).
L_YY = L_YY – 1.
CONCATENATE L_YY L_MM L_DD INTO L_S_RANGE–LOW.
L_S_RANGE–SIGN = ‘I’.
L_S_RANGE–OPT = ‘EQ’.
APPEND L_S_RANGE TO E_T_RANGE.
ENDLOOP.
ENDIF.
ENDCASE.
Waiting for yours valuable suggestion 🙂
Thanks for reading this Blog. 🙂 🙂
Hi Satendra,
Very useful document, most importantly well presented.
Thanks for it & wish to see more such helpful stuff.
Best Rgds,
Sudhir.
Thanks Sudhir.for this wonderful appreciation and likes. 🙂
Hi Satendra,
Appreciate your efforts.
Thanks Harshil for appreciation 🙂
Indeed very useful document. Thanks for sharing your experience.
Thanks Manna Das 🙂
Useful information and nice presentation satendra.
Thanks for your time and sharing with us.
Raman
Thanks Raman 🙂 .
I am really happy to see your feedback and appreciation 🙂 🙂
Thanks Ones again. 🙂
Hi Satendra,
Nice effort and i appreciate it.
Same thing i have covered in one of my document YTD Based on Fiscal Year Period without cmod code
Which indeed requires no code.The only difference is i have given it on the basis of fiscal year period and you have given it on date input.So i think only the offset length need to be changed to get the year from date input.
Regards,
AL
Hi Anshu,
Thanks for your Feedback
.
In my case and document for Jan Feb and March month should be considered as previous year so that we need code. without code it is not possible because here fiscal year will start from APR to MAR.
Regards,
SM
Yes i just realized it.. 😉 .I missed that year part.
Regards,
AL
Hi,
Nice document.
Thanks, phani.
Thanks Pani 🙂
Nicely illustrated, Good job. Thanks for sharing. 🙂
Regards,
Krishna Chaitanya.
Thanks Krishna 🙂
Good document ...
Thanks Venkat 🙂