Skip to Content
0
Aug 01, 2007 at 06:55 PM

Custom Column Value for HTMLB Table

6 Views

I am creating a BSP app to return a list of queries which have not been modified in X days. I am performing a calculation to convert the MODTIME field value in table RSRREPDIR to mm/dd/yyyy format. How do I go about including this calculation in my HTMLB table. Right now, I am overwriting the TXTLG field value in my dataset, but this is obviously not a good long-term solution. Code follows below:

<b>OnInitialization Event Handler:</b>

DATA: OldestDate TYPE D,
      strOldestDateTime TYPE STRING,
      strModDate TYPE STRING.

FIELD-SYMBOLS:  <wa> like line of g_t_dump.

TRANSLATE l_ICUBE to upper case.

IF ( l_ICUBE IS INITIAL ).
   l_ICUBE = '%'.
ENDIF.

IF ( intDays IS INITIAL ).
   intDays = 90.
ENDIF.

OldestDate = sy-datum - intDays.
CONCATENATE OldestDate '000000' INTO strOldestDateTime.


  SELECT *

  FROM RSRREPDIR as f INNER JOIN RSZELTTXT as p on

  f~COMPUID = p~ELTUID

  INTO CORRESPONDING FIELDS OF TABLE g_t_dump

             WHERE f~OBJVERS = 'A'
             AND p~OBJVERS = 'A'
             AND f~COMPTYPE = 'REP'
             AND f~INFOCUBE LIKE l_ICUBE
             AND p~LANGU = 'EN'
             AND f~COMPID LIKE 'AHQ%'
             AND f~MODTIME >= strOldestDateTime
             ORDER BY f~AUTHOR:, f~INFOCUBE:,f~COMPID.

LOOP AT g_t_dump ASSIGNING <wa>.
  strModDate = <wa>-MODTIME.
  CONCATENATE strModDate+4(2) '/' strModDate+6(2) '/' strModDate(4) INTO strModDate.
  <wa>-TXTLG = strModDate.
ENDLOOP.

<b>Layout:</b>

<%@page language="abap" %>
<%@extension name="htmlb" prefix="htmlb" %>
<htmlb:content design="design2003" >
  <htmlb:page title="BW AHQ Queries Aging" >
    <htmlb:textView id        = "tv2"
                    tooltip   = "BW AHQ Queries Aging"
                    design    = "HEADER1"
                    layout    = "BLOCK"
                    textColor = "dark blue" />
    <htmlb:form>
      <htmlb:tableView id              = "tb_Dump"
                       headerText      = "BW AHQ Queries Aging"
                       visibleRowCount = "25"
                       design          = "ALTERNATING"
                       headerVisible   = "TRUE"
                       fillUpEmptyRows = "FALSE"
                       table           = "<%= g_t_dump %>" >

        <htmlb:tableViewColumns>

          <htmlb:tableViewColumn columnName = "AUTHOR"
                                 title      = "Author"
                                 fixedColumn = "TRUE" >
          </htmlb:tableViewColumn>

          <htmlb:tableViewColumn columnName = "INFOCUBE"
                                 title      = "InfoProvider"
                                 fixedColumn = "TRUE" >
          </htmlb:tableViewColumn>
          <htmlb:tableViewColumn columnName = "COMPID"
                                 title      = "Query" >
          </htmlb:tableViewColumn>
          <htmlb:tableViewColumn columnName = "TXTLG"
                                 title      = "Description" >
          </htmlb:tableViewColumn>

          <htmlb:tableViewColumn columnName = "TXTLG"
                                 title      = "Last Modified" >
          </htmlb:tableViewColumn>

        </htmlb:tableViewColumns>
      </htmlb:tableView>
    </htmlb:form>
  </htmlb:page>
</htmlb:content>

Any help you can provide will be very much appreciated. Thanks!!