Skip to Content
0
Former Member
Apr 20, 2007 at 05:15 PM

secondary list doesnt trigger

12 Views

hi,

i have pasted the code below.

when i click in the basic list ...its taking me to secondary list sy-lsind = 1. but in this list its not allowing me to click.(not taking me to sy-lsind>=2) something wrong with my menu painter stuff. when i try to click....i get as chose valid function in the status place.

I have given 'TEST' in the function key place before choose.

in application tool bar have crated MARC.MARD.MAKT. GAVE THEM AS sap gui FUNCTIONS. can some one plz correct me.

Tables: marc,mard,makt.

data: begin of itab occurs 0,

matnr like mara-matnr,

ersda like mara-ersda,

ernam like mara-ernam,

mtart like mara-mtart,

end of itab.

TOP-OF-PAGE.

WRITE:/ 'INTERACTIVE REPORTS'.

ULINE.

WRITE:/ 'MATNR', 'ERSDA', 'ERNAM', 'MTART'.

START-OF-SELECTION.

SELECT MATNR ERSDA ERNAM MTART INTO TABLE ITAB FROM MARA.

END-OF-SELECTION.

LOOP AT ITAB.

WRITE:/ ITAB-MATNR HOTSPOT ON,ITAB-ERSDA,ITAB-ERNAM,ITAB-MTART.

HIDE: ITAB-MATNR.

ENDLOOP.

AT LINE-SELECTION.

WRITE:/ 'LIST INDEX NO:',SY-LSIND.

IF SY-LSIND > 0.

WRITE:/ ITAB-MATNR , ITAB-ERSDA, ITAB-ERNAM.

ENDIF.

"this below part of the code is not really executin i guess'

SET PF-STATUS 'THREE'.

AT USER-COMMAND.

CASE SY-UCOMM.

WHEN 'MARC'.

SELECT * FROM MARC WHERE MATNR = ITAB-MATNR.

WRITE:/ MARC-MATNR, MARC-WERKS.

ENDSELECT.

IF SY-SUBRC <> 0.

WRITE:/ ' NO RECORDS AVAILABLE'.

ENDIF.

WHEN 'MARD'.

SELECT * FROM MARD WHERE MATNR = ITAB-MATNR.

WRITE:/ MARD-MATNR, MARC-WERKS.

ENDSELECT.

IF SY-SUBRC <> 0.

WRITE:/ ' NO RECORDS AVAILABLE FROM MARD'.

ENDIF.

WHEN 'MAKT'.

SELECT * FROM MAKT WHERE MATNR = ITAB-MATNR.

WRITE:/ MAKT-MATNR, MAKT-SPRAS.

ENDSELECT.

IF SY-SUBRC <> 0.

WRITE:/ 'NO RECORDS AVAILABLE FROM MAKT'.

ENDIF.

ENDCASE.

END-OF-SELECTION.