Application Development 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: 

Printing the calendar

Former Member
0 Kudos

I want to print the calendar for the entire month of the user given date

For example if user enters 01.01.2008. I want to display the entire calendar for the entered date

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi

report yxxxx.

DATA:

W_D1 TYPE D VALUE '19000101',

W_I1 TYPE I,

W_I2 TYPE I,

W_I3 TYPE I,

W_X TYPE I,

W_C TYPE I VALUE 1,

W_C1(2) TYPE C,

X TYPE I,

W_LD TYPE I,

W_DATE TYPE D.

W_C1 = W_C.

PARAMETER W_D2 TYPE D.

W_I1 = W_D1.

W_I2 = W_D2.

W_I3 = W_I2 - W_I1.

W_X = W_I3 MOD 7.

W_X = W_X + 1.

W_DATE = W_D2.

do.

w_date = w_date + 1.

x = w_date+6(2).

if x = 1.

w_date = w_date - 1.

exit.

endif.

enddo.

W_LD = w_date+6(2).

W_LD = W_LD + 1.

WRITE: 5 'MON', 15'TUE',25 'WED', 35 'THU', 45 'FRI', 55 'SAT',

65 'SUN'.

WRITE /.

DO.

IF W_X EQ 1.

WRITE W_C1 UNDER 'MON'.

W_C = W_C + 1.

W_C1 = W_C.

W_X = W_X + 1.

IF W_C EQ W_LD .

EXIT.

ENDIF.

ENDIF.

IF W_X EQ 2.

WRITE W_C1 UNDER 'TUE'.

W_C = W_C + 1.

W_C1 = W_C.

W_X = W_X + 1.

IF W_C EQ W_LD.

EXIT.

ENDIF.

ENDIF.

IF W_X EQ 3.

WRITE W_C1 UNDER 'WED'.

W_C = W_C + 1.

W_C1 = W_C.

W_X = W_X + 1.

IF W_C EQ W_LD.

EXIT.

ENDIF.

ENDIF.

IF W_X EQ 4.

WRITE W_C1 UNDER 'THU'.

W_C = W_C + 1.

W_C1 = W_C.

W_X = W_X + 1.

IF W_C EQ W_LD.

EXIT.

ENDIF.

ENDIF.

IF W_X EQ 5.

WRITE W_C1 UNDER 'FRI'.

W_C = W_C + 1.

W_C1 = W_C.

W_X = W_X + 1.

IF W_C EQ W_LD.

EXIT.

ENDIF.

ENDIF.

IF W_X EQ 6.

WRITE W_C1 UNDER 'SAT'.

W_C = W_C + 1.

W_C1 = W_C.

W_X = W_X + 1.

IF W_C EQ W_LD.

EXIT.

ENDIF.

ENDIF.

IF W_X EQ 7.

WRITE W_C1 UNDER 'SUN'.

W_C = W_C + 1.

W_C1 = W_C.

W_X = 0.

IF W_C EQ W_LD.

EXIT.

ENDIF.

ENDIF.

IF W_X EQ 0.

WRITE /.

W_X = 1.

IF W_C EQ W_LD.

EXIT.

ENDIF.

ENDIF.

IF W_C EQ W_LD.

EXIT.

ENDIF.

ENDDO.

plzz reward if it is useful.

3 REPLIES 3

Former Member
0 Kudos

Hi,

I think following programs will help you

SAPCALENDAR_CELLTEXT_DEMO

SAPCALENDAR_DEMO1

SAPCALENDAR_DRAG_DROP

SAPCALENDAR_H_SET_COLORS

SAPCALENDAR_NAVIGATOR

SAPCALENDAR_SET_COLORS

SAPCALENDAR_STYLE_SIMPLIFIED

Reward if found Helpfull,

Chaitanya.

Former Member
0 Kudos

Hi,

if you want to provide the calender option to a fields then you can directly declare the field as shown below or use the type as Dats . this will give you a calender on click of F4 .

parameter :p_date type dats.

SAPCALENDAR_CELLTEXT_DEMO

SAPCALENDAR_DEMO1

SAPCALENDAR_DRAG_DROP

SAPCALENDAR_H_SET_COLORS

Reward Points if found helpfull..

Cheers,

Chandra Sekhar.

Former Member
0 Kudos

Hi

report yxxxx.

DATA:

W_D1 TYPE D VALUE '19000101',

W_I1 TYPE I,

W_I2 TYPE I,

W_I3 TYPE I,

W_X TYPE I,

W_C TYPE I VALUE 1,

W_C1(2) TYPE C,

X TYPE I,

W_LD TYPE I,

W_DATE TYPE D.

W_C1 = W_C.

PARAMETER W_D2 TYPE D.

W_I1 = W_D1.

W_I2 = W_D2.

W_I3 = W_I2 - W_I1.

W_X = W_I3 MOD 7.

W_X = W_X + 1.

W_DATE = W_D2.

do.

w_date = w_date + 1.

x = w_date+6(2).

if x = 1.

w_date = w_date - 1.

exit.

endif.

enddo.

W_LD = w_date+6(2).

W_LD = W_LD + 1.

WRITE: 5 'MON', 15'TUE',25 'WED', 35 'THU', 45 'FRI', 55 'SAT',

65 'SUN'.

WRITE /.

DO.

IF W_X EQ 1.

WRITE W_C1 UNDER 'MON'.

W_C = W_C + 1.

W_C1 = W_C.

W_X = W_X + 1.

IF W_C EQ W_LD .

EXIT.

ENDIF.

ENDIF.

IF W_X EQ 2.

WRITE W_C1 UNDER 'TUE'.

W_C = W_C + 1.

W_C1 = W_C.

W_X = W_X + 1.

IF W_C EQ W_LD.

EXIT.

ENDIF.

ENDIF.

IF W_X EQ 3.

WRITE W_C1 UNDER 'WED'.

W_C = W_C + 1.

W_C1 = W_C.

W_X = W_X + 1.

IF W_C EQ W_LD.

EXIT.

ENDIF.

ENDIF.

IF W_X EQ 4.

WRITE W_C1 UNDER 'THU'.

W_C = W_C + 1.

W_C1 = W_C.

W_X = W_X + 1.

IF W_C EQ W_LD.

EXIT.

ENDIF.

ENDIF.

IF W_X EQ 5.

WRITE W_C1 UNDER 'FRI'.

W_C = W_C + 1.

W_C1 = W_C.

W_X = W_X + 1.

IF W_C EQ W_LD.

EXIT.

ENDIF.

ENDIF.

IF W_X EQ 6.

WRITE W_C1 UNDER 'SAT'.

W_C = W_C + 1.

W_C1 = W_C.

W_X = W_X + 1.

IF W_C EQ W_LD.

EXIT.

ENDIF.

ENDIF.

IF W_X EQ 7.

WRITE W_C1 UNDER 'SUN'.

W_C = W_C + 1.

W_C1 = W_C.

W_X = 0.

IF W_C EQ W_LD.

EXIT.

ENDIF.

ENDIF.

IF W_X EQ 0.

WRITE /.

W_X = 1.

IF W_C EQ W_LD.

EXIT.

ENDIF.

ENDIF.

IF W_C EQ W_LD.

EXIT.

ENDIF.

ENDDO.

plzz reward if it is useful.