Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Long text box using CL_GUI_TEXTEDIT - can I change font size

Former Member
0 Kudos
562

I am using the class CL_GUI_TEXTEDIT for a long text box on a screen. I want to display some text larger than the rest or in bold (to make it stand out) but I can't seem to find a way of doing this.

I've looked into the tag column on standard texts but they don't offer a font option. I've also tried adding html tags to my standard texts but these just show up in the display as <B>some text</B>.

Can anyone point me in the right direction? Maybe I need to use a different class which is html enabled?

Thanks,

Gill

2 REPLIES 2

Former Member
0 Kudos
105

hi

good

go through this links

http://help.sap.com/saphelp_nw2004s/helpdata/en/2a/755b94ca5911d299af5c9604c10e27/content.htm

https://wiki.sdn.sap.com/wiki/display/ABAP/CreateTextEditorSourcecode

-


go through this report too->

report zrich_0001.

data:

dockingleft type ref to cl_gui_docking_container,

text_editor type ref to cl_gui_textedit,

repid type syrepid.

data: begin of header.

include structure thead.

data: end of header.

data: begin of lines occurs 0.

include structure tline.

data: end of lines.

data: textlines type table of tline-tdline,

wa_text type tline-tdline.

data: totlines type i.

data: start_line type i.

parameters: p_check.

at selection-screen output.

repid = sy-repid.

create object dockingleft

exporting repid = repid

dynnr = sy-dynnr

side = dockingleft->dock_at_left

extension = 1070.

create object text_editor

exporting

parent = dockingleft.

clear lines. refresh lines.

call function 'READ_TEXT'

exporting

id = 'Z001'

language = sy-langu

name = '999999'

object = 'ZPT_DET'

tables

lines = lines.

clear wa_text. refresh textlines.

loop at lines .

wa_text = lines-tdline .

append wa_text to textlines.

endloop.

  • Add a blank like to start adding new text

clear wa_text. append wa_text to textlines.

call method text_editor->set_text_as_r3table

exporting

table = textlines

exceptions

others = 1.

describe table textlines lines totlines.

start_line = totlines.

  • Protect only text lines, not the added one

totlines = totlines - 1.

call method text_editor->protect_lines

exporting

from_line = 1

  • PROTECT_MODE = TRUE

to_line = totlines

  • ENABLE_EDITING_PROTECTED_TEXT = false

exceptions

error_cntl_call_method = 1

invalid_parameter = 2

others = 3.

call method text_editor->GO_TO_LINE( start_line ).

start-of-selection.

call method text_editor->get_text_as_r3table

importing

table = textlines

exceptions

others = 1.

  • Set SAPscript Header

clear header.

header-tdname = '999999' . "Name

header-tdobject = 'ZPT_DET'. "Object

header-tdid = 'Z001'. "Id

header-tdspras = sy-langu.

  • Move text from container to function module table

clear lines. refresh lines.

loop at textlines into wa_text .

lines-tdline = wa_text.

append lines .

endloop.

call function 'SAVE_TEXT'

exporting

client = sy-mandt

header = header

tables

lines = lines

exceptions

id = 1

language = 2

name = 3

object = 4

others = 5.

reward point if helpful.

thanks

mrutyun^

0 Kudos
105

Thanks for your reply mrutyun but none of your suggestions contain the answer to my question.