If you’re building a Time Entry Zapp using the universal micro app and you source application is SAP, there are several enhancements in the micro app that are specific to SAP. In addition, there are a few nuances in how you should attach the micro app that are also specific to SAP.
The following article describes the differences you should be aware of and the steps you should follow when attaching the Time Entry micro app.
The article relies on the general flow of attaching a Time Entry micro app described in this article and only emphasizes the differences.
Attaching the date picker
In SAP, when selecting a date from the calendar to change the time period, you must click the Apply button for the weekly view to actually change.
Therefore, after you attached the Date Picker control to the one on the web, you then need to grab the Apply button as well and add an automation for it.
Select the Button type from the Controls toolbar and grab the Apply button.
Open the button ILE and turn off the Display option so the button will not be visible to the user.
Now add the automation to click on the button after selecting a different date.
Open the page Automation dialog.
Click the ‘+’ button in the top right corner to add a new automation.
Select the Internal connections option for the automation trigger.
Then select the Date Picker button as the trigger.
For the New automation step, select the newly grabbed Apply button.
And click the blue checkmark button to confirm.
Finally, click on the checkmark button on the top right corner of the Automation dialog to confirm the new automation.
A new automation is created so when a user selects a date from the calendar, the Apply button will be clicked automatically.
Attaching the Total Hours text
In SAP, the total hours of the week are usually inside the table and are represented as a disabled text field on the web.
To attach the Total Hours, change the control type in the Controls toolbar to a text field.
Then click on the total hours field in the timesheet table on the web.
If the rank of the total hours control is low, you can strengthen it by adding the "Total" column header as an anchor.
Attaching the ‘+’ button to add a new project to the timesheet
When building a Time Entry Zapp on SAP, the ‘+’ button does not need to be attached to any control on the web. The button is virtual and contains a short script to identify the first empty row in the timesheet table on the web.
Simply click the ‘+’ button to connect it to the next page, the Add Project page.
In the Add Project page, you’ll note that the Cancel button is also virtual and does not require attaching. Since there is no option to delete a row in the SAP table, the Cancel button simply clears the selections the user has made in case the button is tapped (this is done through an extension).
Learn more about the Add Project button and page in this article.
Adding a Project when there are no empty rows
In SAP empty rows are added to the table only when the current timesheet is saved. There could be a situation where the user is left with only one empty row in the table, adds a new project that takes that empty row, does not save the timesheet yet and then tries to add another new project row. In that case, since there are no available empty rows in the timesheet table on the web, we will not be able to add this new project until the user saves the timesheet and new empty rows are added automatically by SAP.
One option to address this scenario is to add a message to the user to first save the timesheet before attempting to add another project.
First add a new page with a message to the user. Click on the ‘+’ button and add a new page, insert a virtual text and a virtual button and style it as a modal. See an example below.
Now you need to set the condition to show this page in the connection conflict resolution dialog.
Go to the Timesheet page connections and open the Outgoing tab.
Expand the ‘+’ button connection and click on RESOLVE.
Select to show the Add Project page and add a condition if the page is applicable. Since all controls on this page are mandatory, the page will be applicable if an empty row is found in the timesheet table on the web page.
Else, show the error message page.
Now if there are no empty rows in the timesheet table on the web, the user will be asked to save the timesheet first before adding the next project.
Known issues and limitations
The following are a few known issues and limitations of the SAP platform.
- If a user adds a new project and saves the timesheet without adding any time to that project in any of the days of the week, SAP does not save that row. The project details are cleared.
- If a user adds a new project to the timesheet, it cannot be deleted using the Delete button in the swipe action. The button is attached to the column with the trash can button but that button is not yet available if the row is not filled with time information and saved first. A possible workaround is to add a script that clears those input fields from the row before it is saved.