Technical Articles
How to Add a New Field to Existing Templates in SAP ByDesign
Hello All,
In this blog post, I would like to acquaint you with how to add a new field to the existing templates available in the Application and User Management WoC — Microsoft Office Template Maintainance — of SAP Business ByDesign.
In this use case, we would like to add the field Time Type to the template Employee Activity List – Quick Activity (Billable Projects)
1. Prerequisite
To customize an existing template you would need the following two tools.
a. A Zip tool (i.e WinRar, WinZip,7-Zip, etc)
b. A tool to Modify XML Files
Firstly we would have to download the existing template to our local desktop from the Application and User Management WoC — Microsoft Office Template Maintainance — Employee Activity List – Quick Activity (Billable Projects). I have downloaded it for the English language.
Open the file in excel and switch to the “Developer” tab and click on “Source”
If you don’t have the developer tab in your Excel, please go to “File” -> “Options” -> “Customize Ribbon” and enable the check box for “Developer”:
Once you click on the source button you should be able to see the underlying data structure associated with it. To determine which cell is mapped to which attribute simply select the cell and you can see the mapping on your right-hand side. This also works vice-versa. To map a cell to an attribute simply right-click on the XML field and click “map element”. To remove the mapping click “remove element”.The bold attributes are mapped to cells in the sheet.
2. Add new fields to the template
To add a new field the data structure needs to be enhanced first. To do so perform the following steps.
a. Locate the “Excel” file stored on your local desktop.
b. Right click and change the extension to .zip.
c. Open it with your preferred Zip-Tool and navigate to the folder “XL”.
d. Copy the file xmlMaps.xml and paste it in a new location on your local desktop.
e. Open the “xmlMaps.xml” file that is there on your local desktop with your preferred XML-editor.( I have used Notepad++ to open the file )
f. Bound the new field “Time Type” to the field of the ECO.
g. Under the complex type add the new field “Time Type”.
h. Save the XML file.
i. Now copy the XML file which was saved in step h and replace the xmlMaps.xml file in step d with this new file.
j. Change the extension of the file from “.Zip” to “.XLSX”.
3. Modification of the excel template
Proceed with the below steps to modify the excel template.
a. Add the new field “Time Type” in the excel file.
b. Open the developer tab and click on Source.
c. Locate the “Time Type” in the XML source.
e. Now we have the new field added to our excel.
At run time the value is passed on to the UI designer field which in turn gets filled up with the value coming from the ECO/BO. This ultimately gets filled in the excel since we have bound it to the field in the UI designer.
4. Upload the new template
Once the changes are ready in the excel file we would have to perform the following steps to ensure that the downloaded content has the new field Time Type added.
a. Go to Application and User Management WoC — Microsoft Office Template Maintainance — of SAP Business ByDesign.
b. Open Employee Activity List – Quick Activity (Billable Projects) Language English and upload and publish the excel file.
Once this is done the download of the excel file will have the newly added field “Time Type” in it.
Conclusion
Hence following the above-outlined steps of the blog post you can enhance any template provided by SAP Business ByDesign in the application and user management work center.
Thank you for reading, hope it helped!