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

need a logic

Former Member
0 Likes
397

Hi,

who can help me to implement this requirement.

Given are two fields.

SELECT-OPTIONS s_evdate FOR ccihs_ialhiot-evdat.

PARAMETERS p_dayweek TYPE bkk_kdate_week.

This is a pseudo code:

User selects at s_evdate any date e.g. 20th May 2008.

Further more he chooses a weekday at p_dayweek

e.g.Wednesday.

Check if the entered s_evdate is Wednesday,

if so

take only all days with eventdays where are on

Wednesday

if not calculate the next possible Wednesday

according to 20th May 2008. And take only all days with

eventdays where are on Wednesday.

Hope somebody can support me in this matter.

Regards

sas erdem

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
381

Hi,

I didn't get the exact requirement, but have a look on the following pseudo code, you may get some idea.

data: day type c,

wkday type c value 1.

1.Use following function module to get the weekday number

DATE_COMPUTE_DAY

2.give the input date(10 characters) and store it in another variable with 1 char(ex day)

3.Use switch case and compare with above value

when 'monday'.

if wkday = day.

ABAP Statement

endif.

when 'tuesday'.

if wkday = day.

ABAP Statement

endif.

when 'wednesday'.

if wkday = day.

ABAP Statement

endif.

.

.

.

when 'sunday'.

if wkday = day.

ABAP Statement

endif.

Regards,

Chandu

Hi,

who can help me to implement this requirement.

Given are two fields.

SELECT-OPTIONS s_evdate FOR ccihs_ialhiot-evdat.

PARAMETERS p_dayweek TYPE bkk_kdate_week.

This is a pseudo code:

User selects at s_evdate any date e.g. 20th May 2008.

Further more he chooses a weekday at p_dayweek

e.g.Wednesday.

Check if the entered s_evdate is Wednesday,

if so

take only all days with eventdays where are on

Wednesday

if not calculate the next possible Wednesday

according to 20th May 2008. And take only all days with

eventdays where are on Wednesday.

Hope somebody can support me in this matter.

Regards

sas erdem

2 REPLIES 2
Read only

Former Member
0 Likes
382

Hi,

I didn't get the exact requirement, but have a look on the following pseudo code, you may get some idea.

data: day type c,

wkday type c value 1.

1.Use following function module to get the weekday number

DATE_COMPUTE_DAY

2.give the input date(10 characters) and store it in another variable with 1 char(ex day)

3.Use switch case and compare with above value

when 'monday'.

if wkday = day.

ABAP Statement

endif.

when 'tuesday'.

if wkday = day.

ABAP Statement

endif.

when 'wednesday'.

if wkday = day.

ABAP Statement

endif.

.

.

.

when 'sunday'.

if wkday = day.

ABAP Statement

endif.

Regards,

Chandu

Read only

Former Member
0 Likes
381

Hi,

ok thanks for the hints as far. How can I say

each Wednesday or the required day up to

end date ?

Regards

sas