Use ABAP code to upload custom Smart Styles in your SAP system in bulk. With it, you’ll be able to upload more than one Smart Style in one attempt instead of selecting every Smart Style one by one.
Key Concept
SAP Smart Styles are used to format printing documents that companies normally send outside the company. These include sales orders, purchase orders, delivery notes, invoices, and quotations.
As an ABAP programmer, you have times when you want to upload your work (whether it’s programs, custom SAP Smart Styles, applications, enhancements, or tables) to a different local system or external media. You might need to take it to another machine or another project that could benefit from the work you’ve developed.
Let’s take SAP Smart Styles as an example. Imagine you have 100 SAP Smart Styles that you want to upload to another machine. The usual process involves uploading each Smart Style individually, resulting in a repetitive, time-consuming process. I’ve developed a utility with ABAP code that allows you to upload all custom SAP Smart Styles in one effort. There is no third-party tool involved; it is completely based on the SAP system. To run it, you should have some basic knowledge of ABAP. I’ll start by showing you what the process to upload SAP Smart Styles usually requires, and then I’ll show you the code involved in my process.
The Usual Process
Typically, you upload SAP Smart Styles by using transaction SMARTSTYLES and pressing Enter to see the main SAP Smart Styles screen (Figure 1).

Figure 1
Main screen of SAP Smart Styles
Enter the name of the SAP Smart Style you want to upload (e.g., zarial_for_cdb_N) (Figure 2). Follow menu path Utilities > Upload Style to bring up the screen in Figure 3.

Figure 2
Enter the SAP Smart Style name

Figure 3
Upload the SAP Smart Style
Press Enter or click the green check mark icon and the screen in Figure 4 appears. Choose the location to upload the SAP Smart Style and click the Open button.

Figure 4
Open the SAP Smart Style
You would then need to repeat all these steps for every resulting SAP Smart Style. Now let’s look at the utility I’ve developed to simplify this process.
Utility to Upload SAP Smart Styles
By using this utility, you can upload all your custom SAP Smart Styles. Figure 5 shows you the code for the utility. You can download the code here.

Figure 5
Code for Smart Styles uploader
After adding the code from Figure 5 in your program, activate it. Run the report and the screen looks like the one in Figure 6. Click the icon next to the Source Folder field to bring up the pop-up screen in Figure 7. Select the path My Computer > Local Disk (C:) > Styles to get all the custom Smart Styles you’ve saved. Click the OK button and the screen in Figure 8 appears.

Figure 6
Smart Style bulk uploader main screen

Figure 7
Smart Style bulk uploader screen for selecting a source of uploading all Smart Styles

Figure 8
Smart Style bulk uploader screen with selected source of uploading all Smart Styles
Click the execute icon and all your custom Smart Styles are uploaded in your system one after the other.
For every Smart Style, the system asks you for a transport request, just as it does when saving with transaction SMARTSTYLES. You can save all your Smart Styles in one transport request, or use more than one. Figure 9 shows the option of using one transport request.

Figure 9
Smart Style transport request screen
You can also save the current Smart Style in an existing transport request by pressing F4 and selecting the existing request in the Request field (Figure 10).

Figure 10
Save Smart Styles in an existing transport request screen
After clicking the green check mark icon or pressing Enter, your Smart Style is created and saved in the SAP system. Select the request for all Smart Styles and the rest of the process is automatic.
Remember that as part of this solution, all Smart Styles are initially inactive, just like when you create or upload a Smart Style via transaction SMARTSTYLES. You need to activate it once you have completed your work. Use transaction code SMARTSTYLES to bring up the screen in Figure 1. Enter the name of the Smart Style in the Style field and click the activate icon, or press Ctrl-F3 (Figure 11).

Figure 11
Activate the Smart Style
Note
You need to follow the above steps for all Smart Styles that you want to activate.
Now I’ll explain the purpose of the second field on the main screen of this utility. This field is basically for when you want to upload some specific Smart Styles in your SAP system instead of all at once. Suppose in some industry you had created a Smart Style each for purchase orders (POs), purchase requisitions (PRs), requests for quotation (RFQs), invoices, goods receipts (GRs), invoice receipts (IRs), and so on. Now you have downloaded them all, but you are in another industry and you only want to use the RFQ, GR, and IR. Click the yellow arrow icon next to the Specific Smart Style to Uplo field and enter the complete path of the RFQ, GR, and IR styles in the screen (Figure 12). Press F8 or click the execute icon as shown in Figure 12 and the screen in Figure 13 appears.

Figure 12
Upload specific Smart Styles

Figure 13
Screen with filled values of a specific Smart Style to upload
Press F8 or click the execute icon as shown in Figure 13 and from there the process is the same as it was for uploading all Smart Styles at once that I already explained.
Exception
There is only one exception of this utility: You need to upload all custom fonts in the server as well if the custom fonts are being used as part of the Smart Styles. Once these fonts have been uploaded and activated, the Smart Style that is using these objects can be used.
Qazi Wasif Ali
Qazi Wasif Ali is an SAP ABAP certified consultant at Descon Engineering Limited in Pakistan. He has more than six years of SAP ABAP experience. He has a degree in computer science and has worked in industries such as packaging, beverages, and chemicals. Previously, he worked at Siemens Pakistan and Abacus Consulting. Qazi has also participated in support projects.
You may contact the author at qaziwasifali786@gmail.com.
If you have comments about this article or publication, or would like to submit an article idea, please contact the editor.