cancel
Showing results for 
Search instead for 
Did you mean: 

Process chain requirement

Former Member
0 Kudos

Hi friends,

I have a requirement to schedule a process chain on weekdays and on weekends the process chain must get unscheduled,How to proceed with this requirement.

Regards,

Sivarama Landa

Accepted Solutions (0)

Answers (10)

Answers (10)

former_member202517
Participant
0 Kudos

Hi Siva,

You can try with Decision Between Multiple alternatives process type which is available under General Services.


DATE_WEEKDAY1( SYST-DATUM ) = '6' OR DATE_WEEKDAY1( SYST-DATUM ) = '7'.

. Design the chain in way that after start variant include Decision Between Multiple alternatives and then the remaining steps


Every day the chain will trigger but it will check the decision, if it is sunday or saturday the chain will go to AND variant or else it will process to the next steps.

Hope this will work

Thanks

Ravi

Former Member
0 Kudos

Hi Siva,

Easiest way is to schedule 5 different WEEKLY jobs, each weekly job should be scheduled to run on monday, tuesday, wednesday, thursday and friday respectively.

Regards,

Harish.

thanga_prakash
Active Contributor
0 Kudos

Hello Siva,

Did you check on the above option?

Regards,

Tp

thanga_prakash
Active Contributor
0 Kudos

Hello Siva,

Implement BADI "RSAR_CONNECTOR" where you can implement a custom function.


In the custom function you can write a logic to find the day.


refer to the below forum it serves your purpose.


http://scn.sap.com/docs/DOC-56309


Regards,

Tp

Former Member
0 Kudos

hello all,

Thanks for the important inputs.All the inputs have been very helpful

Thanks

Former Member
0 Kudos

Hi,

You can achieve this by using event in process chain.

  • Go to SM62/SM64 create on event (Ex YEVENT.).
  • Maintain that event in process chain start variant.
  • To trigger the event need to write one executable ABAP program in SE38 by using function module DATE_COMPUTE_DAY and RSSM_EVENT_RAISE.

       

DATE_COMPUTE_DAY will give the Day no for the particular date.

0 Sunday

1 Monday

2 Tuesday

3 Wednesday

4 Thursday

5 Friday

6 Saturday

Sample program.

REPORT YXXXXX.

DATA: WK_DAY TYPE SCAL-INDICATOR.

DATA: EVENTID LIKE TBTCJOB-EVENTID.

DATA: EVENTPARM LIKE TBTCJOB-EVENTPARM.

EVENTID = 'YEVENT'.

EVENTPARM = 'YEVENT_PARAMETER'.

CALL FUNCTION 'DATE_COMPUTE_DAY'

EXPORTING

   DATE = SY-DATUM

IMPORTING

   DAY = WK_DAY.

IF WK_DAY EQ 1 OR

     WK_DAY EQ 2 OR   

     WK_DAY EQ 3 OR

     WK_DAY EQ 4 OR

     WK_DAY EQ 5.

   CALL FUNCTION 'RSSM_EVENT_RAISE'

   EXPORTING

   I_EVENTID = EVENTID

   I_EVENTPARM = 'YEVENT_PARAMERTER'

   EXCEPTIONS

     BAD_EVENTID = 1

     EVENTID_DOES_NOT_EXIST = 2

     EVENTID_MISSING = 3

     RAISE_FAILED = 4

     OTHERS = 5.

Thanks,

Somesh.

Former Member
0 Kudos

Hello Kris,

1. You can also use a 3rd party scheduling tool to meet your condition. 

2. Create a background job.

  • If calday = Mon OR Tues OR......Thursday
  • Execute Process chain job
  • else Exit
  • end if

Regards,

AR

Former Member
0 Kudos

Yes, Factory caladar is the way to go in this scenario. You can use the existing one as well, but make sure that it doesn't have any holidays listed, otherwise chain will run not run on that day. The best way to create a seperate Calandar w/o any holiday, that way chain will run from Mon to Fri.

Rgds..

Shambhu

Former Member
0 Kudos

Hi,

you could schedule a job or trigger an event only on weekdays, and then let your PC run after that job/event.  But to schedule this job you will have the same problem 🙂

The easiest way is to create a factory calendar in BW which is NOT used in ECC.

Txn SCAL is what you're looking for.  Select factory calendar and click edit.  then create a new calendar and don't enter a holiday calendar.  Select your working days and you're good to go.

regards

Former Member
0 Kudos

Hi

I think we have at least 2 way to get this :

first of all, if there's factory calendar maintained or extracted into your BW system, when you maintain the start variant, schedule the process chain everyday, then use "Restirction" option to check on "do not run or sunday or holiday" option.

Second, use some code to deal with it :

1. Schedule process chain executed everyday, at the beginning of processchain, you can use a "Decision" process to check if it's working day or weekend, if weekend terminate process chain , otherwise go ahead.

2. Create a simple ABAP program, check whether the current date is working day or weekend, if working day , raise a event to trigger the process chain, otherwise, finish program. and then schedule this program executed everyday. For this way, process chain starter must configured as after event.

Maybe there're more better idea, let's share them together, thanks.