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: 

Double click functionality

Former Member
0 Kudos

Hi Group,

I am having one table control on the screen.If user clicks on the field called item(which is in disable mode)

I need to display the POP-UP window.please suggest in writing the double click functionality.

27 REPLIES 27

Former Member
0 Kudos

Hi,

In PAI use the addition AT CURSOR-SELECTION.

FIELD EXPN_MOD-BUKRS MODULE CURSOR_BUKRS_0100 AT CURSOR-SELECTION.

Calling Modules after Cursor Selection

You can specify that a module should only be called if the cursor is positioned on a particular screen element. To do this, use the statement

MODULE <mod> AT CURSOR-SELECTION.

The module <mod> is called whenever the function code of the user action is CS with function type S. If you use this statement, it is best to assign the function code CS to function key F2. This also assigns it to the mouse double-click.

Svetlin

Former Member
0 Kudos

HI,

I used the same statement but it is not working

FIELD I_Z50_WTY_ITEMS-POSNR MODULE cur_9014 AT CURSOR-SELECTION.

Note: I_Z50_WTY_ITEMS-POSNR this is my screen field.

do I need mention any function code,if it is the case

I am not abe to do that because it is not allowing.

0 Kudos

Go to transaction SE41. If you don't have gui status, create your own. Press "Function keys" and in "Recommended function key settings" and assign to "F2" function code "CS".

Svetlin

P.S. If you find an answer useful, please assign reward points.

Former Member
0 Kudos

Hi,

You may have a set PF-STATUS 'XXX' in your program.

Double click on XXX and it will take you to the place where you can maintain function code.

Cheers.

Former Member
0 Kudos

Hi,

I don't have have authorization to define that,because

my table control in the CLM1/CLM2 transaction.So client

not allowing me to define any fubnction code in the menu bar.please suggest the alternative method

Former Member
0 Kudos

Hi,

My table control is in the sub screen so I am not able to

define the function code in the set PF-STATUS.Please suggest the alternative way.

Former Member
0 Kudos

Hi,

Are you using screen exit .

If yes give the enhancement name and other details fo screen number etc of main prog.

Cheers.

0 Kudos

If you are using a screen exit as Sanjay mentioned, there must be a pre-defined menu for this screen. Check the menu for the function code of double click. Usually it is 'PICK'. If it is active then in your PAI, you can have "WHEN 'PICK'." statement for CASE of sy-ucomm or ok-code. Write your logic for pop-up there.

Srinivas

0 Kudos

if the subscreen holding the table control is modifiable, go to screen painter open the screen, doubleclick on the column for which you need double click event, go to the display attributes tab and check the check box <b>respond to double click</b> and also assign a function code to F2 in the gui status.

Regards

Raja

0 Kudos

HI RAJA,

I did the same thing,but I am not able to assign function code to F2 in gui status,because for my

syb screen there is no pf-status.Will you please

suggest.

0 Kudos

Hi Srinivas,

Yes it is in one screen exit,but how to find the function code of double click.

0 Kudos

Press F1 on any field on your subscreen. Go to technical info. In the subsequent pop-up you should see the 'STATUS' name under the GUI data section. Double click on it, which will take you to the menu display. There you will have to find out what code is assigned to F2.

Srinivas

0 Kudos

Hi Srinivas,

I found the Function code(AZOB) for F2.But how to write the functionality for the double click on particular field (I mean if user double click on the partiular field in my case it is 'i_z50_wty_zw_items-posnr')

0 Kudos

hi

in PAI

u get the cursor field

Data : FELD(30),

P_ZEILE LIKE SY-LINNO.

IF SY-STEPL EQ 1.

GET CURSOR FIELD FELD LINE P_ZEILE.

ENDIF.

from this u can get field in FELD & line no is P_ZEILE

check FELD = 'i_z50_wty_zw_items-posnr' and ok-code = 'AZOB'....

regards

gv

0 Kudos

data: fnam(40),

fval(100) .

if sy-ucomm = 'AZOB' .

clear : fnam, fval .

get cursor field fnam value fval .

if fnam eq '<screen field name>' .

move: fval to <variable> .

else .

Endif .

Regards

Raja

Former Member
0 Kudos

HI,

I wrote the following code but it is not at all

entering in to the function module 'ZPOPUP_WITH_TABLE_DISPLAY'.

MODULE cur_9014 INPUT.

data: fnam(40),

fval(100) .

if sy-ucomm = 'AZOB' .

clear : fnam, fval .

get cursor field fnam value fval .

if fnam eq 'i_z50_wty_zw_items-posnr' .

CALL FUNCTION 'ZPOPUP_WITH_TABLE_DISPLAY'

EXPORTING

ENDPOS_COL = 90

ENDPOS_ROW = 20

STARTPOS_COL = 45

STARTPOS_ROW = 15

TITLETEXT = 'internal table display'

  • IMPORTING

  • CHOISE =

TABLES

VALUETAB = i_z50_wty_zw_items.

  • EXCEPTIONS

  • BREAK_OFF = 1

  • OTHERS = 2

.

IF SY-SUBRC <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

ENDIF.

endif.

ENDMODULE. " cur_9014 INPUT

0 Kudos

just keep break-point and check at

get cursor field fnam value fval .

regards

gv

0 Kudos

hi,

Yes I checked it it is giving correct value.Problem is only it is not entering in to FM

0 Kudos

if conditions satisfies then it will go in to the fm..

try to use capital letters inside the singel codes

if fnam eq 'i_z50_wty_zw_items-posnr' .

and try

regards

gv

0 Kudos

Hi GV,

Thank you very much for your suggestions.it is working fine.But in the POP-up it is showing all the records,I need only the record correponding to the item on which user double click.

0 Kudos

thats because you are passing the whole internal table to the function. only pass the record you want to display.

Regards

Raja

0 Kudos

while getting cursor get the line no also

IF SY-STEPL EQ 1.

GET CURSOR FIELD FELD <b>LINE P_ZEILE</b>.

ENDIF.

then while checking with field check the line index also

if fnam eq '<field name>' and SY-STEPL EQ P_ZEILE.

use this data to display ur popup...

endif.

or read the screen itab with index = P_ZEILE and pass this to popup

regards

gv

0 Kudos

HI GV,

I used following code but still it is showing all the records in the pop-up window

MODULE cur_9014 INPUT.

data: fnam(40),

P_ZEILE LIKE SY-LINNO,

fval(100) .

if sy-ucomm = 'AZOB' .

clear : fnam, fval .

get cursor field fnam LINE P_ZEILE .

if fnam eq 'I_Z50_WTY_ZW_ITEMS-POSNR' .

read table i_z50_wty_zw_items index P_ZEILE.

CALL FUNCTION 'ZPOPUP_WITH_TABLE_DISPLAY'

EXPORTING

ENDPOS_COL = 120

ENDPOS_ROW = 35

STARTPOS_COL = 45

STARTPOS_ROW = 15

TITLETEXT = 'internal table display'

  • IMPORTING

  • CHOISE =

TABLES

VALUETAB = i_z50_wty_zw_items

EXCEPTIONS

BREAK_OFF = 1

OTHERS = 2

.

IF SY-SUBRC <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

ENDIF.

endif.

ENDMODULE.

0 Kudos

Change your code as follows. Please remember to reward and close the post. Everyone here is trying to help you, so you should reciprocate their help.

Thanks,

Srinivas


MODULE cur_9014 INPUT.
  data: fnam(40),
        P_ZEILE LIKE SY-LINNO,
        fval(100) .
<b>   data: li_valuetab like i_z50_wty_zw_items occurs 0 with header line.</b>
  if sy-ucomm = 'AZOB' .
    clear : fnam, fval .
    get cursor field fnam LINE P_ZEILE .
    if fnam eq 'I_Z50_WTY_ZW_ITEMS-POSNR' .
      read table i_z50_wty_zw_items index P_ZEILE.
      <b>check sy-subrc = 0.
      clear li_valuetab[].
      append i_z50_wty_zw_items to li_valuetab.</b>
      CALL FUNCTION 'ZPOPUP_WITH_TABLE_DISPLAY'
           EXPORTING
             ENDPOS_COL = 120
             ENDPOS_ROW = 35
             STARTPOS_COL = 45
             STARTPOS_ROW = 15
             TITLETEXT = 'internal table display'
*          IMPORTING
*            CHOISE =
           TABLES
             VALUETAB = <b>li_valuetab</b>
           EXCEPTIONS
             BREAK_OFF = 1
             OTHERS = 2.
      IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDIF.
  endif.

ENDMODULE. 

0 Kudos

Hi

I don't see all posts of this problem, so Srinivas excuse me, but I think it could be a little mistake.

The statament GET CURSOR LINE <LINE> gives the index of the tablecontrol step and it couldn't be index of internal table.

So I think the code should be changed here:

get cursor field fnam LINE P_ZEILE .

if fnam eq 'I_Z50_WTY_ZW_ITEMS-POSNR' .

p_zeile = p_zeile + <tablecontrol>-top_line - 1.

*

read table i_z50_wty_zw_items index P_ZEILE.

But I repeat I don't know previous posts, so perhaps I am mistaking.

Max

0 Kudos

Hi Max,

Actually I am also responding to one particular issue only. So, I may have overlooked the rest of the logic. I was only looking at the issue with seeing all the internal table records instead of the one that is selected. I didn't validate the rest of the code. As to which record he should be reading, may be he is write or may be you are right, but I did not look into that part of it.

Regards,

Srinivas

0 Kudos

Did the answers help you? Can you please close the post if resolved?

Thanks,

Srinivas