Skip to Content
author's profile photo Former Member
Former Member

Issue with Secondary list display in ALV BLocked List

Hi all,

I am using ALV Blocked List consissting of 3 blocks.

For my requirement, in the 1st block, I need to make a colum clickable, for which I have used the User_Command Event.

But this is not working. The second list is not gettin displayed.

Here'z my code:

CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT'

EXPORTING

i_callback_program = v_repid

  • i_callback_top_of_page = 'TOP-OF-PAGE' "see FORM

  • I_CALLBACK_PF_STATUS_SET = ' '

I_CALLBACK_USER_COMMAND = 'USER_COMMAND'

  • IT_EXCLUDING =

.

REFRESH: it_events[].

wa_events-name = slis_ev_top_of_list.

wa_events-form = 'FIRST_HEADING'.

APPEND wa_events TO it_events.

wa_events-name = slis_ev_user_command.

wa_events-form = 'USER_COMMAND'.

APPEND wa_events TO it_events.

CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'

EXPORTING

is_layout = v_layout

it_fieldcat = it_disptab_field[]

i_tabname = 'DISPTAB'

it_events = it_events[] " Call 1st BLOCK TO BE APPENDED For SALES ANALYSIS

  • IT_SORT =

  • I_TEXT = ' '

TABLES

t_outtab = it_disptab

EXCEPTIONS

program_error = 1

maximum_of_appends_reached = 2

OTHERS = 3.

CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_DISPLAY'.

FORM user_command USING r_ucomm LIKE sy-ucomm

rs_selfield TYPE slis_selfield.

CASE r_ucomm.

WHEN '&IC1'.

READ TABLE it_disptab INTO w_disptab INDEX rs_selfield-tabindex.

IF rs_selfield-fieldname = 'KUNAG'.

WRITE:/1 'invoice',

10 'Quantity in Base Unit',

20 'Base Unit',

30 'Qty in KL',

40 'Price'.

ENDIF.

ENDCASE.

ENDFORM. " USER_COMMAND

Please Help..

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Sep 28, 2011 at 08:18 AM
    For my requirement, in the 1st block, I need to make a colum clickable, for which I have used the User_Command Event.
    But this is not working. The second list is not gettin displayed.
    

    What is your exact problem ??

    Column click not working ?? 2nd list not visible ?? Is 2nd list visible if there is NO clickable column in 1st list ??

    In your pasted code, there is no code for 2nd ALV list ...

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi Ganesh,

      Thanks for your reply. I have already used hotspot on the fieldcat of the clickable field. But it seems that except for the hand cursor appearing only on that field, the other columns are also clickable.

      Moreover, only the fiirst block should be clickable but all the blocks are applying the user_command.

      This might be due to the REUSE_ALV_BLOCK_LIST_INIT Function Module, which applies to all the blocks.

      CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT'

      EXPORTING

      i_callback_program = v_repid

      • i_callback_top_of_page = 'TOP-OF-PAGE' "see FORM

      • I_CALLBACK_PF_STATUS_SET = ' '

      i_callback_user_command = 'USER_COMMAND'

      • IT_EXCLUDING =

      .

      In orser to avoid this, I am using the following code, which can be a temporary solution to the problem.

      FORM user_command USING r_ucomm LIKE sy-ucomm

      rs_selfield TYPE slis_selfield.

      DATA: row_count TYPE sy-lilli.

      CASE r_ucomm.

      WHEN '&IC1'.

      DESCRIBE TABLE it_disptab LINES row_count.

      READ TABLE it_disptab INTO w_disptab INDEX rs_selfield-tabindex.

      IF rs_selfield-tabindex LE row_count AND rs_selfield-tabindex ne 0 AND rs_selfield-tabname = 'DISPTAB'.

      PERFORM get_data.

      PERFORM build_fieldcat.

      PERFORM display_second_list.

      ELSE.

      EXIT.

      ENDIF.

      ENDCASE.

      ENDFORM. " USER_COMMAND

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.