Skip to Content
Author's profile photo Satendra Mishra

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_RANGELOW+0(4).
L_MM
= LOC_VAR_RANGELOW+4(2).
L_DD
= LOC_VAR_RANGELOW+6(2).

L_YY = L_YY 1.
CONCATENATE L_YY L_MM L_DD INTO L_S_RANGELOW.
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. 🙂 🙂

Assigned Tags

      17 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Chandra Janardhansudhir Kunar
      Chandra Janardhansudhir Kunar

      Hi Satendra,

      Very useful document, most importantly well presented.

      Thanks for it & wish to see more such helpful stuff.

      Best Rgds,

      Sudhir.

      Author's profile photo Satendra Mishra
      Satendra Mishra
      Blog Post Author

      Thanks Sudhir.for this wonderful appreciation and likes. 🙂

      Author's profile photo Harshil Joshi
      Harshil Joshi

      Hi Satendra,

      Appreciate your efforts.

      Author's profile photo Satendra Mishra
      Satendra Mishra
      Blog Post Author

      Thanks Harshil for appreciation 🙂

      Author's profile photo Manna Das
      Manna Das

      Indeed very useful document. Thanks for sharing your experience.

      Author's profile photo Satendra Mishra
      Satendra Mishra
      Blog Post Author

      Thanks Manna Das 🙂

      Author's profile photo CH Raman
      CH Raman

      Useful information and nice presentation satendra.

      Thanks for your time and sharing with us.

      Raman

      Author's profile photo Satendra Mishra
      Satendra Mishra
      Blog Post Author

      Thanks Raman 🙂 .

      I am really happy to see your feedback and appreciation 🙂 🙂

      Thanks Ones again. 🙂

      Author's profile photo Anshu Lilhori
      Anshu Lilhori

      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

      Author's profile photo Satendra Mishra
      Satendra Mishra
      Blog Post Author

      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

      Author's profile photo Anshu Lilhori
      Anshu Lilhori

      Yes i just realized it.. 😉 .I missed that year part.

      Regards,

      AL

      Author's profile photo Phani KV
      Phani KV

      Hi,

      Nice document.

      Thanks, phani.

      Author's profile photo Satendra Mishra
      Satendra Mishra
      Blog Post Author

      Thanks Pani 🙂

      Author's profile photo Krishna Chaitanya
      Krishna Chaitanya

      Nicely illustrated, Good job.  Thanks for sharing.  🙂

      Regards,

      Krishna Chaitanya.

      Author's profile photo Satendra Mishra
      Satendra Mishra
      Blog Post Author

      Thanks Krishna 🙂

      Author's profile photo venkat yerva
      venkat yerva

      Good document ...

      Author's profile photo Satendra Mishra
      Satendra Mishra
      Blog Post Author

      Thanks Venkat 🙂