Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
former_member183878
Active Participant
20,371

In this blog I will explain about Adding Custom Text Type on Web UI View  for Business Transaction.

This blog will touch all the topics covered so far starting from Customization and Component Enhancement.

Step 1: "Z" Text Created and Added under Text Determination  (Check customization in "Text Management").

Step 2: Text is visible In Note for Transaction Type.

Step 3: Extend BT Model for "Z" Text Type

Create New Entry Selecting Source Object "BTTextH" and Reletion Name "Your Custom Text Type" (find from F4 Help of  Reletion Name).

BT Model Get Extended

Step 4: Example of  Enhanceing Standard Component for Adding Text On View.

Create Custom Controller

Bind BTADMINH to Component Controller BTADMINH.

Enhance View Set  to Add Text on Veiw

Create Node "BTZTEXT"

Generate Getter Setter for "STRUCT.CONC_LINES"

in  Get method set " value = ' '  ".

Add code on .htm of view set.

<%@page language="abap" %>
<%@extension name="htmlb" prefix="htmlb" %>
<%@extension name="thtmlb" prefix="thtmlb" %>
<%@extension name="xhtmlb" prefix="xhtmlb" %>
<%@extension name="crm_bsp_ic" prefix="crmic" %>
<%@extension name="bsp" prefix="bsp" %>
<thtmlb:areaFrameSetter displayMode     = "<%= controller->view_group_context->is_view_in_display_mode( controller ). %>"
                        toolbarButtons  = "<%= controller->gt_button %>"
                        maxButtonNumber = "1" />
<thtmlb:grid xmlns:thtmlb = "CRMThinHTMLBLibrary"
             cellSpacing  = "1"
             columnSize   = "1"
             height       = "100%"
             rowSize      = "5"
             width        = "100%" >
  <thtmlb:gridCell colSpan     = "1"
                   columnIndex = "1"
                   rowIndex    = "1"
                   rowSpan     = "1" >
    <bsp:call comp_id = "<%= controller->GET_VIEWAREA_CONTENT_ID( 'TaskDetailsViewArea' ) %>"
              url     = "<%= controller->GET_VIEWAREA_CONTENT_URL( 'TaskDetailsViewArea' ) %>" />
  </thtmlb:gridCell>
  <thtmlb:gridCell colSpan     = "1"
                   columnIndex = "1"
                   rowIndex    = "2"
                   rowSpan     = "1" >
    <bsp:call comp_id = "<%= controller->GET_VIEWAREA_CONTENT_ID( 'NotesViewArea' ) %>"
              url     = "<%= controller->GET_VIEWAREA_CONTENT_URL( 'NotesViewArea' ) %>" />
  </thtmlb:gridCell>
  <%-- Text Add --%>

  <%
  include: crm_status_con.
  data:
  lv_status       type        string,
  lv_process_type type        string,
  lr_BTADMINH     type REF TO cl_crm_bol_entity.

  try.
  lr_BTADMINH ?= BTADMINH->collection_wrapper->get_current( ).
  lv_process_type = lr_BTADMINH->get_property_as_string( 'PROCESS_TYPE' ).


if lv_process_type = 'ZTST ' %>

<thtmlb:gridCell colSpan="1" columnIndex="1" rowIndex="4" rowSpan="1">
       <thtmlb:label id   = "text"
       design = "label"
       for    = "//"
       text = "Text" />
       </thtmlb:gridCell>
  
    <thtmlb:gridCell colSpan="1" columnIndex="1" rowIndex="5" rowSpan="1"  height = "15%"
       width       = "100%" >
       <thtmlb:textArea cols     = "164"
       rows     = "5"
       height   = "50"
       width    = "100%"
       text     = "//BTZTEXT/CONC_LINES"
       disabled = "<%= BTZTEXT->GET_I_Conc_Lines( ) %>" />
       </thtmlb:gridCell>


ENDIF.
<%
  catch cx_root.
  endtry.
  %>
 

Output of ZText Block Added on View

3 Comments
Labels in this area