Application Development and Automation 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: 
Read only

Interactive Block ALV List

Former Member
0 Likes
1,104

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.

9 REPLIES 9
Read only

Former Member
0 Likes
1,042

Hi,

Refer to this link..

Read only

Former Member
0 Likes
1,042

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

Read only

0 Likes
1,042

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

Read only

Former Member
0 Likes
1,042

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.

Read only

Former Member
0 Likes
1,042

please check the standard report BCALV_TEST_BLOCK_LIST

Read only

Former Member
0 Likes
1,042

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

Read only

Former Member
0 Likes
1,042

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

Read only

SimoneMilesi
Active Contributor
0 Likes
1,042

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).

Read only

0 Likes
1,042

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.