STL Digital logo - Global IT services and consulting company.

Allocation Posting in SAP – An Implementation Perspective

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:

  1. Convert hours into days (or) months based on project/customer/product-specific configuration
  2. Ability to subtract from days (or) months based on leave (not billed time)
  3. Ability to handle variant days per month for calculation (working days or calendar days) per project
  4. Post the converted quantity for billing
  5. 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

  1. Refer to the link in References: on enterprise resource blog for the overall process.
  2. 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.
  3. In the Project Billing tab , select contract type as  “Usage Based”
  4. The day after the billing date, the automation program picks up the project and presents the list to project managers.
  5. 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.
  6. 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.
  7. After the timesheet conversion scheduled process is completed, the project manager reviews the converted quantity and makes corrections if required.
  8. The project manager marks the project as ready for allocation posting.
  9. 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
  1. Open App “Plan Customer Project”.
  2. Create a new Project by providing the necessary details.
  3. Go to the Work Package Tab.
  4. There will be a default work package of Type “Resource Based”.
  5. Add a new work package. While adding, provide the work package type as “Service Based (Unit)”.
  6. 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.
  7. Delete the default resource-based work package if not required
  8. 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
  • Get all the WBS that products mapped to days/months and ready for billing.
  • Post the WBS into the WBS tables.
  • Key SAP Views (Logical): EntepriseProject, EnterpriseProjectElement, CustomerProjectBillingPlan (Due Date), FinancialPlanningEntry (Linkage to product).
Post Timesheet
  • Extract timesheet with the status ‘Approved’ and does not have ‘Cancelled’.
  • Record from the identified WBS for all personnel.
  • Post the timesheet into timesheet tables.
  • Key SAP Views (Logical): TimesheetRecord.
Convert into days and months
  • Convert hours into days for each person in the project. If the hours are less than the prescribed hours, convert as per rules (e.g. 3hrs = ½ day, 7hrs = 1 day).
  • Aggregate days into months for each person in those projects that have monthly billing.
  • If the aggregated days are less than a month, adjust the quantity based on the number of working days in a month.
  • quantity to a base on 1 quantity
Temp Cache
  • A Temp cache table to hold data required for allocation posting. This includes WBS, cost center, activity type Controlling Area, product, day or month flag.
  • Key SAP Views (Logical): EnterpriseProjectElement, FinancialPlanningEntry.
Consolidated Record
  • Move the daily and monthly quantity into a consolidated table to ease posting.
  • Append the record with additional data required for posting from the temp cache table.
Allocation Posting
  • Connect to the service based on the communication scenario, service ID and communication system.
  • For each record in the consolidated Record table, post the allocation. This will need the required data to be populated to the structure as defined in the web services.
  • Handle SOAP exceptions.

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.

  1. Timesheet Allocation App – An app to approve WBS (Projects) for which allocation can be posted.
  2. Timesheet Approve App – An App to approve the quantity. This will be used for posting.
  3. 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:

  1. Creation of Fiori App in BTP Application Developer Studio.
  2. 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.
  3. Select the System and UI service exposed defined in service bindings in Eclipse ADT.
  4. Enter the main entity for which the UI is created (From the database entity defined in Eclipse ADT).
  5. In the package, enter the package defined in Eclipse ADT.
  6. In the Action, specify maintain.
  7. Other data can be entered as per project needs.
  8. Options like multi-edit can be set in the application before deploying to enable multi-edit.
  9. 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

  1. Gomathi S – Functional SME – Configurations and Testing
  2. Prabhat Panwar – Developer and Tester
  3. Vinod Plakkal – Project Manager

References

  1. How to add 080 into ADT
  2. Installing and configuring Eclipse for SAP
  3. Enterprise Resource Planning Blogs by SAP – Provides a functional view for Allocation posting
  4. Reference to Allocation posting SOAP Service
  5. Create SOAP-based Web Services with SAP BTP, ABAP Environment
  6. A sample program to create developer extensibility

More White Papers

Scroll to Top