‎2009 Nov 20 7:38 AM
Hi,
My program is
Write:/9 'City', /9
'Description', /9
'District'.
AT LINE-SELECTION.
CASE SY-UCOMM.
WHEN 'City'.
WRITE: 'CITY'.
WHEN 'Description'.
WRITE: 'DESCRIPTION'.
ENDCASE.
When i am double clicking on city i am expecting only city to display in my secondary list
and when i double click on description only description has to display.
But when i am doble clicking on City or description it is displaying City Description.
How to rectify this error.
‎2009 Nov 20 7:42 AM
‎2009 Nov 20 7:44 AM
‎2009 Nov 20 7:53 AM
Hi Venkat,
If you use AT USER COMMAND instead of AT LINE SELECTION, you have to create a PF status & create a button on TOOLBAR or salect any function from menu.
OR else if you have to continue with AT LINE SELECTION, before using this you have to hide the records which you want to display. & then later display then on double click, using AT LINE SELECTION EVENT.
Please refer a sample code :-
TABLES: zreaders.
DATA: BEGIN OF itab OCCURS 1,
readerid LIKE zreaders-readerid,
firstname LIKE zreaders-firstname,
lastname LIKE zreaders-lastname,
deposit LIKE zreaders-deposit,
END OF itab,
itab1 LIKE zreaders OCCURS 1 WITH HEADER LINE.
SELECT * FROM zreaders INTO CORRESPONDING FIELDS OF TABLE itab.
SORT itab BY readerid.
LOOP AT itab.
WRITE:/ icon_calculation AS ICON, itab-firstname.
*--Here if i dont hide when i double click i will get the last record
*--o/p because it will show header record
HIDE itab-readerid.
ENDLOOP.
AT LINE-SELECTION.
LOOP AT itab where readerid = itab-readerid.
WRITE:icon_calculation AS ICON, itab-firstname.
WRITE: /4 'Deposit of',itab-firstname,itab-lastname,':', itab-deposit,
'Rupees'.
ENDLOOP.Kindly set to resolved if it helps you.
Regards
Abhii
‎2009 Nov 20 8:41 AM
use get cursor field in at line selection and then based on teh field clicked get the data.
AT LINE-SELECTION.
GET CURSOR FIELD fldname VALUE fldval.
CONDENSE fldname.
CONDENSE fldval.
WRITE : / 'You have clicked ', fldname, ' & its value is ', fldval.
or
GET CURSOR LINE l_linea.
READ TABLE itab_bsik_v INDEX l_linea.
‎2009 Nov 20 8:43 AM
Hi,
Try giving the Function Codes in capitals ,
if AT LINE SELECTION is not working
then try using AT USER COMMAND.
Hope it helps
Regards
Mansi
‎2009 Nov 20 9:55 AM
Hi all thks for your answers.
Issue solved and the correct one is
Write:/ 'City', /
'Description'.
AT line-selection.
CASE syst-LISEL.
WHEN city.
WRITE: 'CITY'.
WHEN 'Description'.
WRITE: 'DESCRIPTION'.
ENDCASE.
Regards
VEnk@