Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Number of day in a quarter

Hi , i want to know how to get the number of day in a quarter

I use the following routine for the number of a day in a year

lv_month = mes - 1.

lv_noofdays = dia.

DO lv_month TIMES.

v_par_month = sy-index.

v_par_year = ano.

CALL FUNCTION 'NUMBER_OF_DAYS_PER_MONTH_GET'

EXPORTING

par_month = v_par_month

par_year = v_par_year

IMPORTING

par_days = v_par_days.

lv_noofdays = lv_noofdays + v_par_days.

ENDDO.

dias = lv_noofdays.

The variable "dias" give me the number of day in a year, but what can i do for the quarter?

Tags:
Former Member
Former Member replied

Try this... change the code according to your needs.

DATA : par_month  LIKE  t009b-bumon,
       par_year   LIKE  t009b-bdatj,
       par_days   type  numc4,
       lv_days    LIKE  t009b-butag.

par_month  = '01'.
par_year   = '2007'.

DO 12 TIMES.
clear lv_days.
  CALL FUNCTION 'NUMBER_OF_DAYS_PER_MONTH_GET'
    EXPORTING
      par_month = par_month
      par_year  = par_year
    IMPORTING
      par_days  = lv_days.
  ADD 1 TO par_month.
  ADD lv_days TO par_days.
ENDDO.

WRITE:/ par_days.

A

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question