Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

restricting 'AT LINE-SELECTION' for particular line in the list. !!

Former Member
0 Kudos

Hello,

While developing interactive list. If i use 'AT LINE-SELECTION' event, it gets fired on every line. Is it possible to restrict the double click on a particular line (lets say, for a particular item no - ebelp in a line. Hope i am comprehendable.

Thank,

Shehryar Dahar

1 ACCEPTED SOLUTION

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

Sure, check this example. This will only allow selection on lines items = 1



report zrich_0002 no standard page heading.

data: iekpo type table of ekpo with header line.

data : cursor_field(30),
       field_value(30) .


start-of-selection.

  select * into corresponding fields of table iekpo
      from ekpo up to 100 rows.

  loop at iekpo.

    if iekpo-ebelp = '1'.
      format hotspot on.
      write:/ iekpo-ebeln, iekpo-ebelp.
      hide iekpo-ebeln.
      format hotspot off.
    else.
      write:/ iekpo-ebeln, iekpo-ebelp.
    endif.

  endloop.

at line-selection.

  set parameter id 'BES' field iekpo-ebeln.
  call transaction 'ME23' and skip first screen.

Regards,

Rich Heilman

8 REPLIES 8

Former Member
0 Kudos

Not that I know of - but you can turn on the hotspot over the lines that can be selected so that users are guided in the right direction.

Rob

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

Sure, check this example. This will only allow selection on lines items = 1



report zrich_0002 no standard page heading.

data: iekpo type table of ekpo with header line.

data : cursor_field(30),
       field_value(30) .


start-of-selection.

  select * into corresponding fields of table iekpo
      from ekpo up to 100 rows.

  loop at iekpo.

    if iekpo-ebelp = '1'.
      format hotspot on.
      write:/ iekpo-ebeln, iekpo-ebelp.
      hide iekpo-ebeln.
      format hotspot off.
    else.
      write:/ iekpo-ebeln, iekpo-ebelp.
    endif.

  endloop.

at line-selection.

  set parameter id 'BES' field iekpo-ebeln.
  call transaction 'ME23' and skip first screen.

Regards,

Rich Heilman

0 Kudos

Rich - you probably know this by now, but if you use this code and click on a valid line, go to the transaction, come back and then double click on an invalid line, it will go to the first document.

In this case, I normally write the document to a work variable, hide it and then clear it. Then at line selection, check to see if the temp variable has anything in it, continue; otherwise, put out a message.

(And of course, clear the work variable after the line selection).

But it was my understanding (and definitely could be wrong) that the user wanted to entirely disable line selection in some cases.

Rob

Message was edited by:

Rob Burbank

Former Member
0 Kudos

Hi,

You can achieve your requirement. You need to write code under that event on line item, say ebelp. i.e., for example, if itab-ebelp = '000010' then <your logic>

thanks,

sksingh

Former Member
0 Kudos

hi,

while developing interactive report, we can genarate secondary list based on user action....

by using HOTSPOT keyword we can restrict to genarating secondary list when ever the user clicks on specific fields( for which you specifies the HOTSPOT property). once you set this preperty when ever the user place the cursor on that specific field then the cursor view changed into HAND symbol.

the AT LINE-SELECTION event triggered for SINGLE click, if we set the HOTSPOT property for the fields.

<b>syntax.</b>

LOOP AT IATB.
WRITE:/ ITAB-EBELP hotspot on. " here the hotspot property is on
ENDLOOP.

regards,

Ashok Reddy

former_member194669
Active Contributor
0 Kudos

Hi,

May be you can use checkbox option for this.


report  z_test line-size 256.
data: markfield(1) type c value 'X'.
write 😕 markfield as checkbox,
       05 'checkbox selected'.
clear markfield.
write 😕 markfield as checkbox input off,
      05 'deselected protected'.

aRs

Former Member
0 Kudos

Hi shehryar,

i use it in this way:

DATA: IPA0000 TYPE TABLE OF PA0000 WITH HEADER LINE.

DATA : CF(30),

cv(30),

PN1 like pa0000-pernr.

START-OF-SELECTION.

SELECT * INTO CORRESPONDING FIELDS OF TABLE IPA0000

FROM PA0000 UP TO 20 ROWS.

LOOP AT IPA0000.

IF sy-tabix = 11.

WRITE:/ IPA0000-PERNR color = 3 hotspot, IPA0000-BEGDA.

HIDE IPA0000-PERNR.

FORMAT HOTSPOT OFF.

ELSE.

WRITE:/ IPA0000-PERNR, IPA0000-BEGDA.

ENDIF.

ENDLOOP.

AT LINE-SELECTION.

get cursor field cf value cv.

pn1 = cv.

check pn1 = ipa0000-pernr.

WRITE: / 'gefunden', IPA0000-PERNR.

It's a short example. change it as you like.

Hope it helps.

Regards, Dieter

Former Member
0 Kudos

Hi shehryar,

try this code:

DATA: IPA0000 TYPE TABLE OF PA0000 WITH HEADER LINE.

DATA : CF(30),

cv(30),

PN1 like pa0000-pernr.

START-OF-SELECTION.

SELECT * INTO CORRESPONDING FIELDS OF TABLE IPA0000

FROM PA0000 UP TO 20 ROWS.

LOOP AT IPA0000.

IF sy-tabix = 11.

WRITE:/ IPA0000-PERNR color = 3 hotspot, IPA0000-BEGDA.

HIDE IPA0000-PERNR.

FORMAT HOTSPOT OFF.

ELSE.

WRITE:/ IPA0000-PERNR, IPA0000-BEGDA.

ENDIF.

ENDLOOP.

AT LINE-SELECTION.

get cursor field cf value cv.

pn1 = cv.

check pn1 = ipa0000-pernr.

WRITE: / 'gefunden', IPA0000-PERNR.

Change it as you want.

Hope it helps.

Regards, Dieter

Sorry, but i post this 2 times

Message was edited by:

Dieter Gröhn