Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
cancel
Showing results for 
Search instead for 
Did you mean: 
robinthakral
Advisor
Advisor
0 Kudos

Adding Custom font

  1. Go to SE73. Select Install True type font to add new or Font Families and click on Change, to change.

robinthakral_0-1707822363421.png

2. Give the Font Name "ZARIAL" for ARIAL font to be uploaded, and select the TTF file from the presentation server in ‘Name of the Font File’.

robinthakral_1-1707822363447.png

3. Select ‘Do not Replace Other Fonts’ every time in upload. Checkboxes for BOLD, ITALIC, and BOLD ITALIC as per font style TTF files. The system will prompt the workbench request.

4. When the upload is complete, check in Font Family.

robinthakral_2-1707822363455.png

5. Go to Edit font, Inside Replacement Font enter HELVE when it is a proportional font else COURIER, if it is not proportional.

robinthakral_3-1707822363465.png

6. Continue OR press Enter. The system will prompt the workbench request. Save it inside the same request.

7. Now test your print preview.

If there is still a spacing issue, the font family must be missing from the printer font. Follow the next steps to handle so.

Adding Custom Fonts to Printer Fonts

  1. Go to SPAD, type output device, and Display.

robinthakral_4-1707822363484.png

2. If not visible, go to Utilities -> Mass changes, then select output device there from the list and Check the device type for the output device.

robinthakral_5-1707822363478.png

3. Go back to SE73, Printer fonts and check for the device type, double click and that device must be missing custom font uploads i.e. ‘ZARIAL’.

4. Opt for TrueType Fonts in change mode in the device type and the system will check custom fonts and add it to the device type.

robinthakral_6-1707822363492.png

 

robinthakral_7-1707822363516.png

 

Providing BMP image with correct color and dimensions

for this: https://online-converting.com/image/convert2bmp/ can be used.

Adding Custom Colors as per RGB combination in Form Elements

** Need to create enhancement with information on RGB combination of Custom colors.

  1. Create Enhancement in include LSTXBF36 as below

robinthakral_8-1707822363527.jpeg

Numbering will be starting from 64 as there are initially 64 color combinations available in Smarform / Smart style with numbering 0 to 63.

** The colors will not be visible in Smart form. We need to opt for debugging before color selection and assign our combination number in the debug screen to assign RGB combination.

 

  1. Usage –
  • Select Cell in Smart form/character node in smart style.
  • Enter ‘/h’ in OK_CODE.
  • Select any color combination from 64 color grid and the following screen will appear:

robinthakral_9-1707822363726.png

  • On importing, it will show the value of the color combination in PARAM_I of the random color you selected. To replace this with our required RGB combination numbers like 65 and F8. Our color combination will be assigned irrespective of the color shown in the selection.

robinthakral_10-1707822363519.png

 

 

To manage the spacing of SO10 text.

SO10 Text will appear different in Smartform from the layout of SO10 creation as it will vary on window width, font, and size.

So, we will have to hit & and trial all SO10 text to match the requirements.

Make sure you use the right formatting as

(*) means the beginning of a new line... so will be used for blank lines in SO10 text as well.

(space) / (=) means continuity of the line so there will be no spacing and continue as overflow.

robinthakral_11-1707822363499.png

will appear as shown in the below image within the red box.

 

To Handle two elements over the same page i.e. Page Protection

robinthakral_12-1707822363528.png

**Like here we need to handle red box contents on the 2nd page, whenever there is text on the 2nd page.

  1. First, we need to make sure that the contents in the red box are different SO10 text, not in overflow/join with another SO10 text. If so, we need to separate them (as shown in the earlier point image).
  2. Include text elements for both the texts in a folder and apply PAGE PROTECTION to it.

robinthakral_13-1707822363507.png

here we can see that

  • TEXT53 - is the red box content,
  • SPACE - we have used single line space between them (even applied condition to it, so that space doesn't create a blank page alone on the basis of font fetched in CODE_FOOTER) and
  • TEXT_FOOTER - is the dynamic footer content appearing as per CODE_FOOTER logic.

 

 To give fixed spacing between two elements

  1. To give a single line spacing, we will use blank text with a space.

robinthakral_14-1707822363541.png

It is generally opted next to an element like a table, template, or include/dynamic text.

  1. To give a fixed height spacing gap instead of a single line, use a template (Blank Template) with no text and field in it with the height required assigned to the template line.

robinthakral_15-1707822363543.png

To give space from the top of a page, window, or between two elements. (** here blank template i.e. BT2 is created but will appear as per some condition, hence the first line will start from different heights from top of the main window as per BT2 condition).

 

To Use standard Text/include text with restricted style.

To Handle this, we simply assign the shared style in the Output options of that Text field, so it follows that style irrespective of the Style assigned to the form.

robinthakral_16-1707822363545.png

It is also used when the names of style nodes are the same and it's hectic to change either of one... For earlier B1 was bold 10, but now this text needs B1(as this was assigned at SO10 level) and bold 12.