Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

printing calender

Former Member
0 Likes
963

how can print caleneder

If the user enters any value, say, 062006, then print the calendar for this month in the output list.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
677

hi joseph,,

try tis program,

REPORT Z_CALANDER.

parameter period(6) type c.

data: month(2) type c,

year(4) type c.

data workdate like sy-datum.

data monthday type i.

data pos type p.

data numdays type p.

data day_of_week_num like SCAL-INDICATOR.

data LAST_DAY like sy-datum.

month = period+0(2).

year = period+2(4).

write:/ month,/ year.

concatenate year month '01' into workdate.

write:/ workdate.

CALL FUNCTION 'DATE_COMPUTE_DAY'

EXPORTING

DATE = workdate

IMPORTING

DAY = day_of_week_num.

write:/ 'the day is', day_of_week_num ,'th day of the week'.

write: /20 'mon',30 'tue',40 'wed',50 'thu',60 'fri',70 'sat',80 'sun',

/.

monthday = 1.

case day_of_week_num.

when '1'.

write monthday under 'mon'.

pos = 10.

when '2'.

write monthday under 'tue'.

pos = 20.

when '3'.

write monthday under 'wed'.

pos = 30.

when '4'.

write monthday under 'thu'.

pos = 40.

when '5'.

write monthday under 'fri'.

pos = 50.

when '6'.

write monthday under 'sat'.

pos = 60.

when '7'.

write monthday under 'sun'.

pos = 70.

when others.

endcase.

CALL FUNCTION 'HR_E_NUM_OF_DAYS_OF_MONTH'

EXPORTING

P_FECHA = workdate

IMPORTING

NUMBER_OF_DAYS = numdays.

while monthday lt numdays.

monthday = monthday + 1.

pos = pos + 10.

if pos = 80.

write /.

pos = 10.

endif.

write at pos monthday.

endwhile.

if it is helpfull,

reward points,

regards,

padma.

2 REPLIES 2
Read only

Former Member
0 Likes
678

hi joseph,,

try tis program,

REPORT Z_CALANDER.

parameter period(6) type c.

data: month(2) type c,

year(4) type c.

data workdate like sy-datum.

data monthday type i.

data pos type p.

data numdays type p.

data day_of_week_num like SCAL-INDICATOR.

data LAST_DAY like sy-datum.

month = period+0(2).

year = period+2(4).

write:/ month,/ year.

concatenate year month '01' into workdate.

write:/ workdate.

CALL FUNCTION 'DATE_COMPUTE_DAY'

EXPORTING

DATE = workdate

IMPORTING

DAY = day_of_week_num.

write:/ 'the day is', day_of_week_num ,'th day of the week'.

write: /20 'mon',30 'tue',40 'wed',50 'thu',60 'fri',70 'sat',80 'sun',

/.

monthday = 1.

case day_of_week_num.

when '1'.

write monthday under 'mon'.

pos = 10.

when '2'.

write monthday under 'tue'.

pos = 20.

when '3'.

write monthday under 'wed'.

pos = 30.

when '4'.

write monthday under 'thu'.

pos = 40.

when '5'.

write monthday under 'fri'.

pos = 50.

when '6'.

write monthday under 'sat'.

pos = 60.

when '7'.

write monthday under 'sun'.

pos = 70.

when others.

endcase.

CALL FUNCTION 'HR_E_NUM_OF_DAYS_OF_MONTH'

EXPORTING

P_FECHA = workdate

IMPORTING

NUMBER_OF_DAYS = numdays.

while monthday lt numdays.

monthday = monthday + 1.

pos = pos + 10.

if pos = 80.

write /.

pos = 10.

endif.

write at pos monthday.

endwhile.

if it is helpfull,

reward points,

regards,

padma.

Read only

vinod_gunaware2
Active Contributor
0 Likes
677

<b>RS_VARI_V_WDAYS_UP_TO_NOW</b> RS_VARI_V_WDAYS_UP_TO_NOW

<b>DATE_CONVERT_TO_FACTORYDATE</b> Returns factory calendar date for a date Calculates and returns factory calendar date for a date (if CorrectOption = '+');

Checks if the date is work day (if CorrectOption = '-').

<b>DATE_GET_WEEK</b> Returns week in which a date lies Import : YYYYMMDD; Export : YYYYNN, where NN is # of week.

<b>WEEK_GET_FIRST_DAY</b> Calendar function: Return first day for a week

Import week in format YYYYNN where NN is # of week.

<b>DATE_COMPUTE_DAY</b> Returns day of week for a date

Import : YYYYMMDD; Export : 1-Monday, ...

RS_VARI_V_1_ACTUAL_MONTH

RS_VARI_V_1_LAST_MONTH

RS_VARI_V_1_NEXT_MONTH Returns first day of the actual/last/next month.

RS_VARI_V_ACTUAL_MONTH

RS_VARI_V_LAST_MONTH Returns selection range for the actual/last month.

Output: 1st line in table P_DATETAB

RS_VARI_V_DAYS_UP_TO_NOW Returns selection range from today-a_days to today+b_days.

Input: 1st line in P_INTRANGE (a=P_INTRANGE-LOW, b=P_INTRANGE-HIGH);

Output: 1st line in table P_DATETAB

RS_VARI_V_WDAYS_UP_TO_NOW Returns selection range from today-a_work_days to today+b_work_days.

Input: a=P_INTRANGE-LOW, b=P_INTRANGE-HIGH (if P_INTRANGE-SIGN <> 'C');

Fact.Calendar Id = P_INTRANGE-OPTION (if P_INTRANGE-SIGN = 'C')

Output: 1st line in table P_DATETAB

RS_VARI_V_MONTH_XXX_YYY Returns selection range for the actual month [-a_months +b_months].

Input: 1st line in P_INTRANGE (a=P_INTRANGE-LOW, b=P_INTRANGE-HIGH);

Output: 1st line in table P_DATETAB

RS_VARI_V_L_LAST_MONTH Returns last day of last month.

RS_VARI_V_MONTH_UP_TO_NOW Returns selection range for the actual month up to now.

Output: 1st line in table P_DATETAB

RS_VARI_V_QUARTER1XXXX

RS_VARI_V_QUARTER2XXXX

RS_VARI_V_QUARTER3XXXX

RS_VARI_V_QUARTER4XXXX

Returns selection range for the Quarter of the given year.

Input: 1st line in P_INTRANGE (Year=P_INTRANGE-LOW);

Output: 1st line in table P_DATETAB

RS_VARI_V_TODAY Today

RS_VARI_V_TODAY_X Returns Today + P_INTRANGE-LOW days

RS_VARI_V_TODAY_XWD Returns Today + P_INTRANGE-LOW work_days

Input: work_days = P_INTRANGE-LOW (if P_INTRANGE-SIGN <> 'C');

Fact.Calendar Id = P_INTRANGE-OPTION (if P_INTRANGE-SIGN = 'C')

RS_VARI_V_XWD_ACTUAL_MONTH Returns 1st day of the actual month + P_INTRANGE-LOW work_days

Input: work_days = P_INTRANGE-LOW (if P_INTRANGE-SIGN <> 'C');

Fact.Calendar Id = P_INTRANGE-OPTION (if P_INTRANGE-SIGN = 'C')

regards

vinod