Skip to Content
author's profile photo
Former Member

OO event to specific object in LINE-SELECTION

Hi,

I have a problem like this: the application builds a table/collection of objects which has been called to print themselves on the screen using WRITE: statements. Now I have an AT LINE-SELECTION event where I want to trigger that object which/whose line was selected by GET CURSOR ...

How do I send the event to that specific object in that table without causing 'thundering herds' problem. It basically means that the trigger should awake only that object which has been clicked/selected instead of all objects.

With regards.

Swapan

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

2 Answers

  • Best Answer
    author's profile photo
    Former Member
    Posted on Feb 22, 2005 at 11:01 PM

    Are you familiar with the HIDE command? This command allows you to add information to the WRITE line that is not displayed to the user. Do help on HIDE to see examples of how to use this.

    Here is a simple example.

    Each line of your report is associated with an object. When you WRITE the line, append a reference to the object to an internal table with type REF TO OBJECT. Get back the SY-INDEX where the internal table entry was written. Use HIDE and add SY-TABIX (a copy of it) to the WRITE line.

    When the line is returned to your program via AT LINE-SELECTION, the HIDE are is also returned. You now have the SY-TABIX of the internal table line for the object reference that was used to create the line. Use the object reference to do whatever you need to do with the object.

    Does this meet your needs?

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Posted on Feb 23, 2005 at 07:17 PM

    Thanks for the ideas, it worked but I had to use SY-TABIX instead of SY-INDEX. So basically store the index into a global variable gv_index, write out the line and immediately call HIDE gv_index. Later on I have access to gv_index at line-selection to pass to the object which then works on the table of pointers. In this case I have to make sure the table and index are in sync.

    BR

    Swapan

    Add comment
    10|10000 characters needed characters exceeded