cancel
Showing results for 
Search instead for 
Did you mean: 

Checking the work schedule of a employee via ABSL

0 Kudos

Hello Experts,

for a project, we need to access the work schedule of the employees in their time profile. It must be evaluated how many hours the employee should work on which day. I think that the Business Object "EmployeeTimeAgreement" is the rigth place to look for this information, but i did not finde it.

Can someone guide me where I can find this information exactly?

Thanks in advance,

Mario

Accepted Solutions (0)

Answers (2)

Answers (2)

0 Kudos

Hi Mario,

I am not sure this id this is something you are looking :). Please find the sample code snippet below:

var lv_query_emp = Employee.QueryByIdentification;
var lv_params_emp = lv_query_emp.CreateSelectionParams();


foreach (var lv_emp in lv_result)
{
	lv_params_emp.Add(lv_query_emp.UUID.content, "I", "EQ", lv_emp.EmployeeUUID.content);
}


var lt_employees = lv_query_emp.Execute(lv_params_emp);


if (lt_employees.Count() > 0)
{


	foreach (var ls_employee in lt_employees)
	{


		foreach (var lv_working_hours in ls_employee.WorkingHours)			
		{
			foreach (var lv_working_days in lv_working_hours.OperatingHours.RecurringDayProgramme)	
			{					


				foreach (var lv_operating_period in lv_working_days.RecurringDayProgrammeOperatingPeriod)
				{
					var lv_start_hour = Numeric.ParseFromString(lv_operating_period.TimePeriod.StartTime.GetHour());
					var lv_start_minutes = Numeric.ParseFromString(lv_operating_period.TimePeriod.StartTime.GetMinute());
					var lv_end_hour = Numeric.ParseFromString(lv_operating_period.TimePeriod.EndTime.GetHour());
					var lv_end_minutes = Numeric.ParseFromString(lv_operating_period.TimePeriod.EndTime.GetMinute());
													
					while (lv_start_hour < lv_end_hour)
					{


		
					}	
				
				}
			}
		}	
								
	}										
}
0 Kudos

Hi Mario,

If you go to Employee in People WC, there is an TAB Working hours where you can maintain his Working Schedule as per selected Calendar. To read the information based on Employee read the relation as given below:

Employee->WorkingHours->RecurringDayProgrammeOperatingPeriod

Best Regards,

Monik Sharma

0 Kudos

Hi Monik,

unfortunately, I was unable to follow your steps in SAP Business ByDesign or SAP Cloud Applications Studio. Let me make this clear, I need the location in the Repository Explorer from SAP Cloud Applications Studioto, to read these values via ABSL for programming.

I did not find out in which business object these values are exactly stored.

Best Regards,

Mario