‎2009 Jul 23 9:27 PM
Hello Experts,
I have a Block ALV List report for displaying data from two Internal Tables.
Now I have to make this report as interactive Block ALV List report.
When the user double clicks on a filed on the ALV List, it needs to read the field name and value and call transaction depending on the fieldname.
E.g. If the fieldname is 'MATNR' then call Transaction MM03 and so on.
I am using ALV event u2018slis_ev_user_commandu2019 for this purpose.
But I am not getting the fieldname in structure u2018rs_selfieldu2018.
Can anybody suggest me what could be the reason and how to solve this issue?
I have written following code:
FORM execute_function USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
IF r_ucomm EQ '&IC1'.
CASE rs_selfield-fieldname.
Display material
WHEN 'MATNR'.
SET PARAMETER ID 'MAT' FIELD rs_selfield-value.
CALL TRANSACTION 'MM03' AND SKIP FIRST SCREEN.
................
ENDCASE.
ENDIF.
ENDFORM. " EXECUTE_FUNCTION
Thanks in Advance.
‎2009 Jul 23 9:33 PM
‎2009 Jul 23 9:36 PM
Hi Try This.
FORM user_command USING r_ucomm TYPE sy-ucomm
rs_selfield TYPE slis_selfield.
CASE r_ucomm.*User clicks a transaction code and that tcode is called from ALV
WHEN '&IC1'.
READ TABLE itab_final INDEX rs_selfield-tabindex INTO wa_final.
IF sy-subrc = 0.
SET PARAMETER ID 'MAT' FIELD rs_selfield-value.
CALL TRANSACTION 'MM03' AND SKIP FIRST SCREEN.
ENDIF.
Regards,
Satish
‎2009 Jul 23 9:52 PM
Thanks for your reply Satish and Avinash.
But, I need the fieldname in my code, as i have to decide on which transaction to call based on the field name.
I also have customer number, sales order, ..... in the same line, and i have to decide based on the field user has clicked..
I need to know the fieldname, the user has clicked.
Thanks and Regards,
Sanjay
Edited by: Sanjay Sarode on Jul 23, 2009 4:52 PM
‎2009 Jul 24 7:25 AM
Hi,
To know the field on which user has clicked use rs_selfield-fieldname.
This will give the fieldname within the internal table that is used to display the grid.
Hope this solves ur problem.
‎2009 Jul 27 1:29 PM
‎2009 Jul 27 2:09 PM
Hi Sanjay,
Use code :
FORM user_command USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
case sy-ucomm.
when '&IC1'.
if rs_selfield-fieldname = 'MATNR'.
SET PARAMETER ID 'MAT' FIELD rs_selfield-fieldname.
CALL TRANSACTION 'MM02' AND SKIP FIRST SCREEN.
ENDIF.
ENDCASE.
Hope this can solve your problems.
Regards,
Tutun
‎2009 Sep 08 12:10 PM
Sanjoy I have also facing same Prob. I need to field name on which user click.
How you solve your problem. Plz help me.
Thanks & Regards
AjoySaha
‎2009 Sep 08 12:14 PM
Try this
FORM execute_function USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
IF r_ucomm EQ '&IC1'.
CASE rs_selfield-sel_tab_field.
* Display material
WHEN 'ITAB-MATNR'.
SET PARAMETER ID 'MAT' FIELD rs_selfield-value.
CALL TRANSACTION 'MM03' AND SKIP FIRST SCREEN.
................
ENDCASE.
ENDIF.
ENDFORM. " EXECUTE_FUNCTION Using The field rs_selfield-sel_tab_field works for me (i had the same problem) and contains the full name (TABLE-FIELD).
‎2009 Sep 08 12:45 PM
Hi Frnd ,
The code you written in Form is same with me . But i my case I saw in debug that field name is not coming in
U_RS_SELFIELD-SEL_TAB_FIELD. So is any think need to any where. Or is there any think required in table declaration.
FORM F_USER_COMMAND USING u_comm TYPE sy-ucomm
u_rs_selfield TYPE slis_selfield.
IF U_COMM = '&IC1'.
BREAK-POINT.
CASE U_RS_SELFIELD-SEL_TAB_FIELD.
WHEN 'TA_PROD_ORDER_DETAILS_ALV-EBELN'.
BREAK ASAHA2.
WHEN 'TA_PROD_ORDER_DETAILS_ALV-BANFN'.
BREAK ASAHA2.
ENDCASE.
ENDIF.
ENDFORM.