‎2007 Nov 14 3:05 PM
Hi Guys,
I developed an alv report and my problem is a pretty simple one. When the output is being displayed, what needs to be done is when I click on the material number, it should go to MM03.
CLEAR fieldcat.
fieldcat-fieldname = 'MATNR'.
fieldcat-tabname = 'HEADER'.
fieldcat-ref_tabname = 'MARA'.
fieldcat-hotspot = 'X'.
APPEND fieldcat.I tried doing this, but nothing is happening. Can you suggest me what needs to be done.
Thanks
Kumar.
‎2007 Nov 14 3:09 PM
You need to impelement one USER_COMMAND perfomr which can handel this
Like:
in FM
REUSE_ALV_LIST_DISPLAY
I_CALLBACK_USER_COMMAND = 'USER_COMMAND'Form user_command should be like this:
FORM USER_COMMAND USING R_UCOMM LIKE SY-UCOMM
RS_SELFIELD TYPE SLIS_SELFIELD.
SET PARAMETER ID 'MAT' FIELD RS_SELFIELD-value.
CALL TRANSACTION 'MM03' AND SKIP FIRST SCREEN.
ENDFORM. "USER_COMMANDRegards,
Naimesh Patel
‎2007 Nov 14 3:09 PM
‎2007 Nov 14 3:16 PM
Atish,
I cant paste my whole code here. Its 3900 lines, so i dont think it will be of much help to paste my code here.
All others,
I am actually confused as to how to implement each of your suggestions. Can you give me an example which i can look into and use it.
Thanks for all your answers
Kumar.
‎2007 Nov 14 3:20 PM
Hi,
In that case I think you should look at the sample code of Naimesh.
Regards,
Atish
‎2007 Nov 14 3:09 PM
Hi Kumar,
do like this
READ TABLE itab INDEX selfield-tabindex
INTO wa.
if ucomm = '&IC1'.
Set parameter id 'MAT' field selfield-value.
Call transaction 'MM03' and skip first screen.
endif.
<b>Reward points for helpful answers</b>
Satish
Message was edited by:
Satish Panakala
‎2007 Nov 14 3:09 PM
You need to impelement one USER_COMMAND perfomr which can handel this
Like:
in FM
REUSE_ALV_LIST_DISPLAY
I_CALLBACK_USER_COMMAND = 'USER_COMMAND'Form user_command should be like this:
FORM USER_COMMAND USING R_UCOMM LIKE SY-UCOMM
RS_SELFIELD TYPE SLIS_SELFIELD.
SET PARAMETER ID 'MAT' FIELD RS_SELFIELD-value.
CALL TRANSACTION 'MM03' AND SKIP FIRST SCREEN.
ENDFORM. "USER_COMMANDRegards,
Naimesh Patel
‎2007 Nov 14 3:31 PM
Naimesh,
Thanks man, it works. But the problem is if I double click on any line, say I click on plant(001) it still goes to MM03 and says material 001 doesnt exist.
Can we restrict our selection only to the material number?
Thanks
Kumar.
‎2007 Nov 14 3:35 PM
Ok..
Put one condition in USER_COMMAND
FORM USER_COMMAND USING R_UCOMM LIKE SY-UCOMM
RS_SELFIELD TYPE SLIS_SELFIELD.
* case r_ucomm.
* when '&IC1'. " << code for double click
IF RS_SELFIELD-fieldname = 'ITAB-MATNR' . "<< your field name for material
SET PARAMETER ID 'MAT' FIELD RS_SELFIELD-value.
CALL TRANSACTION 'MM03' AND SKIP FIRST SCREEN.
endif.
*endcase.
ENDFORM.Regards,
Naimesh Patel
‎2007 Nov 14 3:10 PM
Hi Kumar, you will need to create an 'AT LINE-SELECTION' statement. All statements under this statement will be executed upon double clicking the line in question. I usually put the 'AT LINE-SELECTION' statement just before the 'END-OF-SELECTION' statement. You can also use the 'HOTSPOT ON' option with your write statement for the material number. This will allow the user to single click the material which will invoke the 'AT LINE-SELECTION' event. Hope this helps.
Kevin
‎2007 Nov 14 3:41 PM