Skip to Content
author's profile photo Former Member
Former Member

Selecting Row in a table of BSP

Hello all,

I am using a BSP .I would like to know ,in std ABAP as we have double click option or hotspot option , can we have the same for a table in BSP .My requirement is that when the user selects a particular row in the table which is used in BSP, I should be ableto fetch the value of that particular row and pass it to some other BSP .Is it possible.Some piece of code will be useful.

Thanks and Regards

Amruta

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Oct 08, 2005 at 12:31 PM

    DATA: TV TYPE REF TO CL_HTMLB_TABLEVIEW,

    TABLE_EVENT TYPE REF TO CL_HTMLB_EVENT_TABLEVIEW.

    DATA SELECTEDROWUNDEX TYPE STRING.

    WHEN 'TV1'.

    TV ?= CL_HTMLB_MANAGER=>GET_DATA( REQUEST = REQUEST

    NAME = 'tableView'

    ID = 'TV1' ).

    IF TV IS NOT INITIAL.

    TABLE_EVENT = TV->DATA.

    SELECTEDROWINDEX = TABLE_EVENT->SELECTEDROWINDEX.

    READ TABLE <b><internal table></b> INDEX SELECTEDROWINDEX

    INTO <b><work area>.</b>

    ENDIF.

    ENDCASE.

    Use this Above Code

    In place of Internal Table Give The Table name Which u are using to populate the table.

    And In The Work Area You Will Get All The Columns Of the selected row with the help of which you pass to other BSP page by setting the values in the attribute fields.

    Hope It Will Solve Your Problem.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      You cannot use <td> tag as it is an html tag, instead of this use

      <htmlb:tableViewColumns>

      </htmlb:tableViewColumns>

      this tag.

      Inside This use

      <htmlb:tableViewColumn/>

      for each of your Column heading.

      there are various attribute of this tag which you can set.

      Set the <b>Value</b> Attribute of each of your column as and also provide other attributes otherwise it will not send request..

      <htmlb:tableView id = "tab1"

      headerVisible = "true"

      design = "alternating"

      fillUpEmptyRows = "true"

      onHeaderClick = "MyEventHeaderClick"

      onRowSelection = "MyEventRowSelection"

      selectionMode = "singleselect"

      table = "<%= notif %>"

      <htmlb:tableViewColumns>

      <htmlb:tableViewColumn columnname = ""

      title = "Query Number"

      value = "<%= wa_notif-qmnum %> "

      />

      <htmlb:tableViewColumn columnname = ""

      title = "Query Type "

      value = <%= wa_notif-KURZTEXT %> "

      />

      <htmlb:tableViewColumn columnname = ""

      title = "Creation Date "

      value = "<%= wa_notif-date %> "

      />

      <htmlb:tableViewColumn/>

      </htmlb:tableView>

      <b>in the columnname write the name of the column of the table notif</b>

      On initialization You Can Fetch Those data in the table through select query.

      and on Input Processing Use

      DATA: tv TYPE REF TO cl_htmlb_tableview.

      DATA: tv_data TYPE REF TO cl_htmlb_event_tableview.

      TV ?= CL_HTMLB_MANAGER=>GET_DATA( REQUEST = REQUEST

      NAME = 'tableView'

      ID = 'tab1' ).

      IF TV IS NOT INITIAL.

      TABLE_EVENT = TV->DATA.

      SELECTEDROWINDEX = TABLE_EVENT->SELECTEDROWINDEX.

      READ TABLE <internal table> INDEX SELECTEDROWINDEX

      INTO <work area>.

      ENDIF.

      If it solves your Problem then its ok Otherwise do revert back...........

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.