Introduction
The SAP S/4HANA public cloud offers out-of-the-box support for professional services that track hours-based timesheets. However, many professional services firms typically bill clients based on daily or monthly rates, which is not currently supported.. Consequently, it is necessary to create an extension to accommodate daily and monthly billing. This blog outlines how this can be achieved in the SAP S/4HANA cloud environment.
Key Requirements
The extension should support the ability to convert timesheet hours into days/months and prepare billing:
- Convert hours into days (or) months based on project/customer/product-specific configuration
- Ability to subtract from days (or) months based on leave (not billed time)
- Ability to handle variant days per month for calculation (working days or calendar days) per project
- Post the converted quantity for billing
- Ability for project managers to view/correct data before posting the quantity
Design
The conversion involves the following elements:
- Functional Configuration to handle service-based posting (days/months) instead of Time & Material (hours-based posting).
- A backend program that will read the timesheet hours, convert and post the quantity for Billing.
- A UI to configure key elements required for the program and the ability to view/correct the data before posting the allocation.
Considerations:
- All Entities should start with Z in Eclipse ADT.
- It is good to suffix with the type (e.g. CL for ABAP Class, etc) and the name.
- In Eclipse ADT, activate the code/configurations after the changes.
- Create the code in a custom development package so that it can be transported into Test and Production Environments.
Technologies
Technologies | Components | Function/Capability |
S/4HANA Cloud | App | Functional configuration of days and months product. |
Eclipse ADT. Refer to References: for Eclipse setup | Database Tables, ABAP, CDS | Core engine for modelling, programming, and creating views for UI. |
Business Services, Cloud Communication Management | Support UI and Web Services integrations with S/4HANA. | |
Application jobs, Identity Management | Enable UI and application jobs to be run from S/4HANA. | |
BTP Developer Studio | UI components – Page and object framework, Report templates, npm | Create UI to be run as Fiori Apps in S/4HANA . Refer to References: for BTP setup. |
Business Process
- Refer to the link in References: on enterprise resource blog for the overall process.
- The project is configured as daily or monthly billing. This is done by creating a service-based project that has specific products identified for daily or monthly billing.i.e create a work package with type “Service Based (Unit)”. To identify if billing is required in Days or Months, create two different product codes , one for Day Billing and one for Month Billing.
- In the Project Billing tab , select contract type as “Usage Based”
- The day after the billing date, the automation program picks up the project and presents the list to project managers.
- The project manager marks a flag to indicate the project is ready for timesheet conversion. This is to ensure all timesheets are approved before the conversion process.
- The automation program picks up all the projects marked for timesheet conversion and converts the timesheet. This is done by picking up all the approved timesheet records from the previous run and converting them to ‘Days’ or ‘Months’ quantity. The determination of days or month billing is based on the product associated with the project.
- After the timesheet conversion scheduled process is completed, the project manager reviews the converted quantity and makes corrections if required.
- The project manager marks the project as ready for allocation posting.
- The automation program picks up all the records marked for allocation posting and posts the quantity to the respective projects to trigger billing.
Prerequisites/Assumptions
- The configuration table is updated at the company level for the number of working days. If a customer-level override is required, that should also be configured.
- The products for daily and monthly billing are configured in the configuration table.
- The timesheet process is not part of the automation process and depends on the project manager marking the project as ready for timesheet conversion.
Functional Configuration
Prerequisites Create Two Product Codes using “Manage Product Master Data”. You can copy and create products from any pre-delivered U series product code. Here is an example of the code that can be created.
Material Code (Example) | Description | Account Assignment Group for Material |
U800 | Monthly Rate – Professional Services | X1 |
U900 | Daily Rate – Professional Services | X1 |
- There is no separate CBC configuration required to convert hours to days or monthly billing. However, follow the below steps while creating a customer project where Days or Monthly Billing is required
- Open App “Plan Customer Project”.
- Create a new Project by providing the necessary details.
- Go to the Work Package Tab.
- There will be a default work package of Type “Resource Based”.
- Add a new work package. While adding, provide the work package type as “Service Based (Unit)”.
- Select “Service (Unit)” from the drop-down. This service unit is nothing but already-created product codes that will provide identification for Day or Month Billing. Ex U800 or U900.
- Delete the default resource-based work package if not required
- Save the project and continue with other sets of data required for the project to complete.
Backend Programs and UI Enablers
This is largely programmed in Eclipse ADT. Install Eclipse ADT and connect with the development (080 client) instance.
Database Design
The database holds data for configurations, extracting timesheets, conversion, and posting. Some of the key enmities are:
Area | Key Entity | Description |
Configuration | Products | Set of products to be used as the basis for conversion into days and months. |
Working Days | Number of working days per month per customer/company code. This will be used to adjust non-billable time during conversion. | |
Core Entities | WBS (Work Breakdown Structure) | Set of WBS that should be processed. This is extracted based on products mapped to WBS and is due for billing. |
Timesheet | Extract the ‘Approved’ and not ‘Cancelled’ timesheet based on the selected WBS. | |
Days | Convert hours into days and adjust if the hours are less than the prescribed hours. | |
Months | Aggregate the days into months and rationalize to 1 for the full month. If the number of days is less than the configured working days, adjust the monthly quantity accordingly. | |
Consolidated Table | Move data from the days and months table to ease posting the allocation. Add additional data that is required for posting such as product, Controlling Area, and WBS. |
ABAP Programs (Source Code)
Program | Key Functions |
Extract WBS |
|
Post Timesheet |
|
Convert into days and months |
|
Temp Cache |
|
Consolidated Record |
|
Allocation Posting |
|
CDS Views
The views help in exposing the custom table data for UI consumption.
Type | Entities | Description |
Information | Allocation | Expose WBS Table as a root entity view. In the Behavior definition set allocation flag for update and other columns to be not updatable. Create and Delete are not allowed. This will enable allocation posting to be run only for projects approved by the project manager. The displayed records are constrained to display only for the respective project managers. |
Consolidated Records | Expose consolidated data as a root entity view. In the behavior definition set the quantity for update and other columns to be not updatable. Create and Delete are not allowed. This will enable project managers to update the computed Quantity. The displayed records are constrained to display only for the respective project managers. | |
Working Days Config | Expose working days data as a root entity view. In the behavior definition enable update, create, and delete. The access to be controlled. | |
Consumption View | Allocation | Create projection CDS on WBS Table with columns to be displayed and modified. This will enable displaying data in the Fiori app. |
Consolidated Records | Create projection CDS on the Consolidated Record Table with columns to be displayed and modified. This will enable displaying data in the Fiori app. | |
Working Days Config | Create projection CDS on the Working Days Table with columns to be displayed and modified/created. This will enable displaying data in the Fiori app. |
Business Services, Application Jobs, Communication Management and Identity Management
The business services enable integration for web services and UI.
Purpose | Category | Entity | Description |
SOAP Configuration. Refer to References: for SOAP configuration | Service Consumption Model | Allocation Posting | Upload WSDL configured from Allocation posting communication arrangements in S/4HANA cloud. Create a consumption model based on the WSDL. |
COM Outbound Services | Allocation Posting | Create a new outbound service of type SOAP and link to the interface created during the creation of the service consumption model. | |
Communication Scenarios | Allocation Posting | Create a communication scenario and link to the outbound service. This will link the outbound service from the automation program to the inbound service defined in S/4HANA for allocation posting. | |
Backend Automation | Application Job Catalog | Hours Automation | Create a catalog entry and link to the program that should be run in S/4HANA cloud when the job is scheduled. |
Application Job Templates | Hours Automation | Template linked to the Application job catalog. This will be used to schedule the job in S/4HANA cloud. | |
Business Catalogs | Hours Automation | Define a catalog that will be used to control access to the automation program. Link to the entry created in the Application Job Catalog. | |
UI Services | Service Definitions | Hour Automation | Define the consumption CDS that needs to be exposed as services. This will be required for displaying in the S/4HANA Fiori app. |
Service Binding | Hour Automation | Publish the services defined in the service definitions. Define the binding type (e.g. Odata V2 – UI) for UI consumptions. | |
IAM Apps | UI Apps | Based on the service bindings, there are three apps – Approve WBS for Allocation, Approve Timesheet Quantity, and Working Days configuration. Create an IAM APP for each with type ext. | |
Business Catalogs | Hours Automate App | A catalog to control access to the Fiori apps used for UI. Add UI Apps created to the Catalog. In S/4HANA, business roles can be configured and assigned to the catalog. |
UI Design
Create 3 apps of type SAP Fiori and leverage reports template.
- Timesheet Allocation App – An app to approve WBS (Projects) for which allocation can be posted.
- Timesheet Approve App – An App to approve the quantity. This will be used for posting.
- Config Working Days – An App to configure the number of working days per month/year by customer/company code. This will be used in quantity calculation during posting.
The creation of a Fiori App involves the following Steps:
- Creation of Fiori App in BTP Application Developer Studio.
- Creation of the Application for the App using a List Report Object Page template. This will help in displaying the data in reporting format and the ability to edit.
- Select the System and UI service exposed defined in service bindings in Eclipse ADT.
- Enter the main entity for which the UI is created (From the database entity defined in Eclipse ADT).
- In the package, enter the package defined in Eclipse ADT.
- In the Action, specify maintain.
- Other data can be entered as per project needs.
- Options like multi-edit can be set in the application before deploying to enable multi-edit.
- After the application is created, enter npm run deploy to create an app in Eclipse ADT. Post that, it can be linked to the catalog.
S/4HANA Cloud Configurations
Communication scenarios created in Eclipse ADT for Allocation Posting will be pushed to S/4HANA. This will have a linkage to the outbound Services. This needs to be mapped to the SAP_COM_0315 for posting the quantity against the person/project.
Type | Entity | Description |
Communication Arrangements | Allocation Posting | Link to the scenario created from Eclipse ADT. Configure communication systems for allocation posting and outbound services. |
SAP_COM_0315 | Link to the SAP_COM_0315 from S/4HANA that hosts the SOAP service. The WSDL is used to create the service consumption model in Eclipse ADT. Configure communication systems for allocation posting and inbound services. Configure API URL. | |
Communication systems | Allocation Posting | Create Allocation systems with inbound and outbound users same for allocation posting. Configure the password for outbound same as that of inbound. |
Communication User | Allocation Posting | Configure Communication User that will be used in communication systems and arrangements. |
Business Role | Automation Job | Create a business role and link to the catalog created in the Backend Automation business catalog in Eclipse ADT. |
Hours Automate App | Create a business role and link to the catalog created in the Hours Automate business catalog in Eclipse ADT. | |
Business User | Access | Provide role access to the business users as appropriate. |
Test Scenarios
Dimensions | Key Scenarios | Expected Results |
Hours based project | Enter Timesheet | No change to the process |
Daily Project | Enter Timesheet every Day | Aggregated days posted for all days |
1-day leave | Aggregated days for the month – 1 day posted |
|
1-day less than 5 hours | Aggregated days for the month – 0.5 days posted |
|
Monthly project | Enter Timesheet every Day | Aggregated days/number of days in the month posted |
1-day leave | Aggregated days – 1 day/number of days in the month posted |
Appendix
Acknowledgments
- Gomathi S – Functional SME – Configurations and Testing
- Prabhat Panwar – Developer and Tester
- Vinod Plakkal – Project Manager
References
- How to add 080 into ADT
- Installing and configuring Eclipse for SAP
- Enterprise Resource Planning Blogs by SAP – Provides a functional view for Allocation posting
- Reference to Allocation posting SOAP Service
- Create SOAP-based Web Services with SAP BTP, ABAP Environment
- A sample program to create developer extensibility