Skip to Content
Author's profile photo Aravindan Aravi

Bulletin Text in Webdynrpo abap

Step 1: Create a webydnpro component.

Step 2: Go to layout tab in View controller.

Step 3: Create a context as shown below:

Step 4: Go to INIT method of the view and write the below code.

DATA:

         f1        TYPE REF TO cl_wd_formatted_text,

         f2        TYPE REF TO cl_wd_formatted_text,

         f3        TYPE REF TO cl_wd_formatted_text,

         f4        TYPE REF TO cl_wd_formatted_text,

                f         TYPE REF TO cl_wd_formatted_text,

         l_text1   TYPE string.

  f1 = cl_wd_formatted_text=>make_text( inner_text = ‘ ‘

                                        tag        = cl_wd_formatted_text=>e_tag-dl ).

  CONCATENATE: l_text1 ‘Diversity of coverages to build up individual pension schemes.’ INTO l_text1.

  f2 = cl_wd_formatted_text=>make_text( inner_text = l_text1

                                        tag        = cl_wd_formatted_text=>e_tag-li ).

  CLEAR l_text1.

  CONCATENATE: l_text1 ‘Comprehensive variety of funds for investment.’ INTO l_text1.

  f3 = cl_wd_formatted_text=>make_text( inner_text = l_text1

                                        tag        = cl_wd_formatted_text=>e_tag-li ).

  CLEAR l_text1.

  CONCATENATE: l_text1 ‘Flexible combination of products to meet employers and employees expectations.’ INTO l_text1.

  f4 = cl_wd_formatted_text=>make_text( inner_text = l_text1

                                        tag        = cl_wd_formatted_text=>e_tag-li ).

  CLEAR l_text1.

  f = cl_wd_formatted_text=>make_text( inner_text = ‘&STATE& &T1& &T2& &T3& ‘

                                       tag        = cl_wd_formatted_text=>e_tag-strong ).

  f->replace_placeholder( name = ‘STATE’  formatted_text = f1 ).

  f->replace_placeholder( name = ‘T1’     formatted_text = f2 ).

  f->replace_placeholder( name = ‘T2’     formatted_text = f3 ).

  f->replace_placeholder( name = ‘T3’     formatted_text = f4 ).

  DATA lo_nd_data TYPE REF TO if_wd_context_node.

  DATA lo_el_data TYPE REF TO if_wd_context_element.

  DATA ls_data TYPE wd_this->element_data.

  DATA lv_value TYPE wd_this->element_data-value.

* navigate from <CONTEXT> to <DATA> via lead selection

  lo_nd_data = wd_context->get_child_node( name = wd_this->wdctx_data ).

* get element via lead selection

  lo_el_data = lo_nd_data->get_element( ).

* set single attribute

  lo_el_data->set_attribute(

    name =  `VALUE`

    value = f->m_xml_text ).

Step 5: Now save check and activate the webdynpro component.

Step 6: Now create a webydnpro application and test it .

Regards

Aravindan

Assigned Tags

      Be the first to leave a comment
      You must be Logged on to comment or reply to a post.