cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

FM module to get all month-year for given date

Pritam
Explorer
0 Likes
327

HI All,

I need a FM to get all the months in mm.yyyy format. For example if I give input as 03.07.2024 to 03.07.2024 then output should be:

jun2024

jul2024

aug2024

sep2024

oct2024

nov2024

dec2024

jan2025

feb2025

.......upto  june2025.

Kindly let me know if any FM is available or else any other method to achieve this.

Accepted Solutions (0)

Answers (1)

Answers (1)

RaymondGiuseppi
Active Contributor

AFAIK there is no such FM

  • Can you correct your example (you provide a single date (from=to) which can be march or july depending on format of date in your country (DD.MM.YYYY or MM.DD.YYYY)
  • To convert month to text, look at FM MONTH_NAMES_GET or class CL_ABAP_DATFM (or the text table beyond T247)
  • Start with 'from date', add 1 month (e.g. FM MONTH_PLUS_DETERMINE or ADD_TIME_TO_DATE or RP_CALC_DATE_IN_INTERVAL...) until greater or equal to 'to date' and format your output