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: 

ALV - Double Click always on the same material?

Former Member
0 Kudos

I have created a ALV with materials. I want that when i click on the material appear MM03 about it.

I have this sentence on the click. But always is showing me the same material. Someone knows why? I forget to refresh something?

Thanks a lot!

&----


*& Form USER_COMMAND

&----


FORM USER_COMMAND USING UCOMM LIKE SY-UCOMM SELFIELD TYPE

SLIS_SELFIELD.

case UCOMM.

when '&IC1'. "this is for double click.

SET PARAMETER ID 'MAT' FIELD ITAB-MATNR.

CALL TRANSACTION 'MM03' AND SKIP FIRST SCREEN .

ENDCASE.

ENDFORM. "USER_COMMAND

1 ACCEPTED SOLUTION

LucianoBentiveg
Active Contributor
0 Kudos

Try this:


FORM USER_COMMAND USING UCOMM LIKE SY-UCOMM SELFIELD TYPE
SLIS_SELFIELD.
case UCOMM.
when '&IC1'. "this is for double click.
READ TABLE ITAB INDEX selfield-tabindex.
SET PARAMETER ID 'MAT' FIELD ITAB-MATNR.
CALL TRANSACTION 'MM03' AND SKIP FIRST SCREEN .

ENDCASE.
ENDFORM. "USER_COMMAND 

3 REPLIES 3

Former Member
0 Kudos

Hi Mpm,

SET PARAMETER ID 'MAT' FIELD ITAB-MATNR.

CALL TRANSACTION 'MM03' AND SKIP FIRST SCREEN .

Here you are assing the material numebr of the table itab... but you are not reading this table when ever the user double clicks.

you have to read this internal table to get the material number. When ever the user double clicks then this itab-matnr will not get populated with the correct material number.

Write the read statement before assing the itab-matnr to parameter id.

<b>read table itab index slis_selfield-tabindex.</b>

Regards,

Satya.

null

LucianoBentiveg
Active Contributor
0 Kudos

Try this:


FORM USER_COMMAND USING UCOMM LIKE SY-UCOMM SELFIELD TYPE
SLIS_SELFIELD.
case UCOMM.
when '&IC1'. "this is for double click.
READ TABLE ITAB INDEX selfield-tabindex.
SET PARAMETER ID 'MAT' FIELD ITAB-MATNR.
CALL TRANSACTION 'MM03' AND SKIP FIRST SCREEN .

ENDCASE.
ENDFORM. "USER_COMMAND 

Former Member
0 Kudos

hi,

you are selecting the material in the header of itab and not the material that you are clicking on...

give

read table itab into itab index rs-tabindex .

before you use

SET PARAMETER ID 'MAT' FIELD ITAB-MATNR.

CALL TRANSACTION 'MM03' AND SKIP FIRST SCREEN .

regards

Abdullah