cancel
Showing results for 
Search instead for 
Did you mean: 

Time Elapsed for Workitem Completion

former_member197703
Participant
0 Kudos

I want to find the time elapsed for the Workitem completion

excluding holidays/saturday/sunday based on Factory Calender.

I have to include the Holidays/saturday/sunday

only if the workitem start or enddate is a Holiday/saturday/sunday.

Time elapsed is needed in the format of 0000d 00h 00m 00s .

Please suggest how should i proceed.

SAP Version: ECC 5.0

Accepted Solutions (0)

Answers (3)

Answers (3)

imthiaz_ahmed
Active Contributor
0 Kudos

USe this FM SWL_WI_GET_HISTORY and build your logic.

Regards, IA

Former Member
0 Kudos

i think you will get this data in the SWWWIHEAD table.

former_member197703
Participant
0 Kudos

As i need to remove the Holidays/saturday/sunday so i can't use the SWWWIHEAD data directly.

I want, if the workitem is completed then the time elapsed should be the time between the start and completion of workitem excluding holidays/saturday/sunday.

If the workitem is 'In Process' state then the time should be the time between the Start of workitem and current date excluding holidays/saturday/sunday.

Thanks,

Vaibhav

Former Member
0 Kudos

for the respective dates viz, WI start date and WI completion date, you will need to refer to the SWWWIHEAD table and then perform calculation on these dates using some FM to remove Holidays/saturday/sunday as per your requirement.

Former Member
0 Kudos

You can use the FM 'DATE_CONVERT_TO_FACTORYDATE' to get a factory calender day for any given day.

Former Member
0 Kudos

Example of code to get the factor working days, which i have used for multiple approvals

and depends on the day, i pass.

DATA:

REQNUMBER TYPE EBAN-EBELN,

DAYS TYPE i,

WORKINGDAY TYPE SYST-DATUM,

CREATEDATE TYPE SYST-DATUM,

LV_FABKL TYPE T001W-FABKL.

SWC_GET_ELEMENT CONTAINER 'ReqNumber' REQNUMBER.

SWC_GET_ELEMENT CONTAINER 'Days' DAYS.

SWC_GET_ELEMENT CONTAINER 'CreateDate' CREATEDATE.

SELECT SINGLE t~fabkl

INTO lv_fabkl

FROM ( t001w AS t

INNER JOIN eban AS e ON ewerks = twerks )

WHERE banfn = reqnumber.

CALL FUNCTION 'FKK_ADD_WORKINGDAY'

EXPORTING

i_date = createdate

i_days = days

I_CALENDAR1 = lv_fabkl

  • I_CALENDAR2 =

IMPORTING

E_DATE = workingday.

  • E_RETURN =

SWC_SET_ELEMENT CONTAINER 'WorkingDay' WORKINGDAY.

Hope this helps.

Thanks,

Sudhir.

Former Member
0 Kudos

do you mean time elapsed 'after' completion or time remaining to completion?