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 on classical list

Former Member
0 Kudos

hi there!

if i double click outside of the classical list it is showing the secondary list in alv . How to avoid that?

10 REPLIES 10

Former Member
0 Kudos

Hi,

Please check the condition at which you are triggering the secondary list.

If possible past eyour code sniippet here.

0 Kudos

hi sap wiz,

HIDE : wa_result-matnr

CLEAR wa_result.

FORM sel_material .

GET CURSOR LINE lin.

IF lin > 4.

IF sy-lsind = 1.

WRITE : / wa_result-matnr.

ULINE.

SELECT SINGLE

matnr

mtart

mbrsh

matkl

FROM mara INTO wa_mara WHERE matnr = wa_result-matnr.

WRITE : 'MATERIAL NUM', 18 'MATERIAL TYPE', 32 'INDUSTRY SECTOR', 55 'MATERIAL GROUP'.

NEW-LINE.

ULINE AT 2(300).

NEW-LINE.

WRITE : / wa_mara-matnr UNDER 'MATERIAL NUM',

wa_mara-mtart UNDER 'MATERIAL TYPE',

wa_mara-mbrsh UNDER 'INDUSTRY SECTOR',

wa_mara-matkl UNDER 'MATERIAL GROUP'.

ENDIF.

ELSE.

MESSAGE i001(zmsg).

ENDIF.

this is my codind.....

thankyou

russel

0 Kudos

Hi,

You are using Get Cursor line. And if line greater then 4 you print the secondry list.

Just check what value do you get for LIN when you click outside the list.You might have to add an additional condition here, to check if user clicked on teh list or not.

0 Kudos

Hi,

Please ref the code. its working for me.



loop at itab into wa_result."in the final output list
write 😕 wa_result-matnr ,......
HIDE wa_result-matnr."put hide statement bassed on the value we go for the 2nd list
endloop.

at LINE-SELECTION ."write the code in this event

IF wa_result-matnr is NOT INITIAL." check the condition

WRITE : / wa_result-matnr.
ULINE.
SELECT SINGLE
matnr
mtart
mbrsh
matkl
FROM mara INTO wa_mara WHERE matnr = wa_result-matnr.

WRITE : 'MATERIAL NUM', 18 'MATERIAL TYPE', 32 'INDUSTRY SECTOR', 55 'MATERIAL GROUP'.
NEW-LINE.
ULINE AT 2(300).
NEW-LINE.

WRITE : / wa_mara-matnr UNDER 'MATERIAL NUM',
wa_mara-mtart UNDER 'MATERIAL TYPE',
wa_mara-mbrsh UNDER 'INDUSTRY SECTOR',
wa_mara-matkl UNDER 'MATERIAL GROUP'.

CLEAR wa_result." dont forget give clear statement after this

else.
Message ' '."give the message..
 ENDIF.

Regards,

Dhina...

Former Member
0 Kudos

Hello,

you must validate you are inside of the table and not in another place of the window. You can do this using::

CASE p_ucomm.

WHEN '&IC1'.

IF p_selfield-tabname = 'YOUR_TABLE'.

  • Actions with double click.

ENDIF.

ENDCASE.

Bye!

0 Kudos

hi, i used cursor position for double click validation

my code is:

HIDE : wa_result-matnr

CLEAR wa_result.

FORM sel_material .

GET CURSOR LINE lin.

IF lin > 4.

IF sy-lsind = 1.

WRITE : / wa_result-matnr.

ULINE.

SELECT SINGLE

matnr

mtart

mbrsh

matkl

FROM mara INTO wa_mara WHERE matnr = wa_result-matnr.

WRITE : 'MATERIAL NUM', 18 'MATERIAL TYPE', 32 'INDUSTRY SECTOR', 55 'MATERIAL GROUP'.

NEW-LINE.

ULINE AT 2(300).

NEW-LINE.

WRITE : / wa_mara-matnr UNDER 'MATERIAL NUM',

wa_mara-mtart UNDER 'MATERIAL TYPE',

wa_mara-mbrsh UNDER 'INDUSTRY SECTOR',

wa_mara-matkl UNDER 'MATERIAL GROUP'.

ENDIF.

ELSE.

MESSAGE i001(zmsg).

ENDIF.

here how to avoid double click outside of the classic list?

0 Kudos

Hi,

Use this code.


GET CURSOR LINE lin VALUE val. "using the value u get the cursor place value based on that you can put if condition

if the val is not initial." check the value is initial 

proceed 2nd list
else.
message . "diplay the message.
endif.

Regards,

Dhina..

Edited by: Dhina DMD on Jun 1, 2011 9:57 AM

Former Member
0 Kudos

have you used event called at user command if used it will display the secondary list like when'1'.....

than you must avoid that event

thanking you

0 Kudos

hi this is my codein:

HIDE : wa_result-matnr

CLEAR wa_result.

FORM sel_material .

GET CURSOR LINE lin.

IF lin > 4.

IF sy-lsind = 1.

WRITE : / wa_result-matnr.

ULINE.

SELECT SINGLE

matnr

mtart

mbrsh

matkl

FROM mara INTO wa_mara WHERE matnr = wa_result-matnr.

WRITE : 'MATERIAL NUM', 18 'MATERIAL TYPE', 32 'INDUSTRY SECTOR', 55 'MATERIAL GROUP'.

NEW-LINE.

ULINE AT 2(300).

NEW-LINE.

WRITE : / wa_mara-matnr UNDER 'MATERIAL NUM',

wa_mara-mtart UNDER 'MATERIAL TYPE',

wa_mara-mbrsh UNDER 'INDUSTRY SECTOR',

wa_mara-matkl UNDER 'MATERIAL GROUP'.

ENDIF.

ELSE.

MESSAGE i001(zmsg).

ENDIF.

here how to avoid double click outside of the list

0 Kudos

use AT LINE-SELECTION. before ur code

AT LINE-SELECTION.

GET CURSOR FIELD F VALUE V.

IF F = 'ITAB-MATNR'.

WRITE :/2(15) 'MATERIAL_NUMBER' , 20(15)'MATERIAL-DESCRIPTION'.

SELECT MATNR MAKTX FROM MAKT INTO TABLE IMAKT WHERE MATNR = ITAB-MATNR .

LOOP AT IMAKT.

WRITE:/2(15) IMAKT-MATNR,

20(15) IMAKT-MAKTX.

ENDLOOP.

Thanks,

Vamsee

Edited by: vamsee krishna on Jun 1, 2011 3:54 PM