06-01-2011 7:24 AM
hi there!
if i double click outside of the classical list it is showing the secondary list in alv . How to avoid that?
06-01-2011 7:33 AM
Hi,
Please check the condition at which you are triggering the secondary list.
If possible past eyour code sniippet here.
06-01-2011 8:00 AM
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
06-01-2011 8:07 AM
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.
06-01-2011 11:55 AM
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...
06-01-2011 7:43 AM
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!
06-01-2011 8:15 AM
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?
06-01-2011 8:21 AM
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
06-01-2011 7:48 AM
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
06-01-2011 10:15 AM
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
06-01-2011 11:23 AM
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