cancel
Showing results for 
Search instead for 
Did you mean: 

Font change cl_wd_caption

kumar_kiran2
Participant
0 Kudos

Hi All,

I have added runtime text view and I have given caption like below.. It is working fine but I want to change the font as it is showing like big heading. Please help me. Thanks,

cl_wd_caption = cl_wd_caption=>new_caption( text = 'Testing' ).

cl_wd_group->set_header( the_header = lr_caption_group ).

output looks like below

This is standard Webdynpro application in Post-Exit of WDDOMODIFYVIEW I have done my dynamic code changes.

I want Testing font like Ques.. Thank you,

Full code is like below..

CHECK first_time = abap_true.

lr_node_info = wd_context->get_node_info( ).

CALL METHOD lr_node_info->add_new_child_node
EXPORTING
name = 'TEXTBOX'
is_mandatory = abap_false
is_multiple = abap_true
is_multiple_selection = abap_true
is_singleton = abap_false
is_initialize_lead_selection = abap_true
is_static = abap_false
RECEIVING
child_node_info = lr_node_info.

lr_container ?= view->get_root_element( ).

cl_wd_matrix_layout=>new_matrix_layout( container = lr_container ).

lr_group = cl_wd_group=>new_group( id = 'TEXTBOX' ).
lr_group->set_width( value = '60%' ).

cl_wd_matrix_layout=>new_matrix_layout( container = lr_group ).
cl_wd_matrix_head_data=>new_matrix_head_data( element = lr_group ).


lr_caption_group = cl_wd_caption=>new_caption( text = 'Testing' ).


lr_group->set_header( the_header = lr_caption_group ).

CONCATENATE 'ATTR'
attribute_name INTO attribute_name.

" Condense the ID to ensure that the format is consistent with SAP standard
CONDENSE attribute_name NO-GAPS.

" Prepare properties of attribute & add to context node CHILD
lr_attribute_info-name = attribute_name.
lr_attribute_info-type_name = 'STRING'.
lr_attribute_info-value_help_mode = '0'.

lr_node_info->add_attribute( EXPORTING attribute_info = lr_attribute_info ).

lr_node = wd_context->get_child_node( name = 'TEXTBOX' ).
lr_element = lr_node->create_element( ).

lr_element->set_attribute( name = attribute_name
value = lv_requirements ).

lr_node->bind_element( new_item = lr_element
set_initial_elements = abap_false ).

" Compute the attribute path dynamically i.e, like CHILD.ATTR1
CONCATENATE TEXTBOX.'
attribute_name INTO attribute_name.
CONDENSE attribute_name NO-GAPS.
lr_textedit = cl_wd_text_edit=>new_text_edit( read_only = abap_false
* cols = 10
rows = wd_this->gv_req_row
tooltip = lv_string
height = '30ex'
width = '60%'
bind_value = attribute_name ).

cl_wd_matrix_head_data=>new_matrix_head_data( element = lr_textedit ).

lr_group->add_child( the_child = lr_textedit ).

lr_container->add_child( the_child = lr_group ).

Accepted Solutions (0)

Answers (0)