‎2009 Jan 13 11:38 AM
Hi experts,
i am developing a interactive alv, the requirement is that when i double click on the GRID output at vbeln the screen should jump to va02, and when i double click on matnr it should jump to mm02.
the code i usen is given below.
how can i use the coding in coloum.
FORM USER_COMMAND USING L_UCOMM LIKE SY-UCOMM L_SELFIELD TYPE SLIS_SELFIELD.
CASE L_UCOMM.
WHEN '&IC1'.
CALL TRANSACTION 'VA02'.
ENDCASE.
ENDFORM.
‎2009 Jan 13 11:40 AM
‎2009 Jan 13 11:42 AM
‎2009 Jan 13 11:44 AM
hi,
Try this way..
FORM USER_COMMAND USING L_UCOMM LIKE SY-UCOMM L_SELFIELD TYPE SLIS_SELFIELD.
CASE L_UCOMM.
WHEN '&IC1'.
IF L_SELFIELD-fieldname EQ 'VBELN'.
* L_SELFIELD-value holds the value of sales order
CALL TRANSACTION 'VA02'.
ELSEIF L_SELFIELD-fieldname EQ 'MATNR.
* L_SELFIELD-value holds the value of Material number
CALL TRANSACTION 'MMO2'.
ENDCASE.
ENDFORM.
‎2009 Jan 13 11:44 AM
Hi Raman,
Kindly check in SDN or SCN before posting any thread.
you can use following.
FORM USER_COMMAND USING L_UCOMM LIKE SY-UCOMM L_SELFIELD TYPE SLIS_SELFIELD.
CASE L_UCOMM.
WHEN '&IC1'.
IF L_SELFIELD-FIELDNAME = 'VBELN'.
CALL TRANSACTION 'VA02'.
ELSEIF L_SELFIELD-FIELDNAME = 'MATNR'.
CALL TRANSACTION 'MM02'.
endif.
ENDCASE.
ENDFORM.
Regards,
Pratik Vora
Edited by: Pratik Vora on Jan 13, 2009 12:44 PM
‎2009 Jan 13 11:44 AM
HI,
In the user_command,
check out
L_SELFIELD-TABINDEX
and L_SELFIELD-FIELDNAME.
Now if the L_SELFIELD-FIELDNAME is 'MATNR'. then call MM02
if L_SELFIELD-FIELDNAME is 'VBELN'. then call VA02.
Here MATNR and VBELN are the field names in your internal table declaration.
eg:
you need to use the set parameter id also before calling these transactions.
case L_SELFIELD-FIELDNAME.
when 'MATNR'.
call transaction 'MM02'.
when 'VBELN'.
call transaction 'VA02'.
endcase.
Regards,
Venkatesh
‎2009 Jan 13 11:54 AM
Hi Raman,
You took the correct step, the requirement can be handled by USER_COMMAND section. The code is as follows:
FORM USER_COMMAND USING L_UCOMM LIKE SY-UCOMM L_SELFIELD TYPE SLIS_SELFIELD.
CASE L_UCOMM.
WHEN '&IC1'.
IF rs_selfield-fieldname = 'VBELN'.
call transaction 'VA02'
elseif rs_selfield-fieldname = 'MATNR'.
call transaction 'MM02'.
endif.
ENDCASE.
ENDFORM.
This will sinmply take you to the transactions whenever you click on VBELN or MATNR.
If you some other requirement like passsing some values to the initial screen and let me know I will help you out.
Hope this will answer your requirement.
Cheers.
Abhi
‎2009 Jan 13 12:00 PM
‎2009 Jan 13 12:05 PM