Application Development 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: 

ALV blocked list - Dynamic

Former Member
0 Kudos

Hi experts,

My requirement is regarding interactive ALV list, with multiple lists ion secondary list.

I am going to display sales orders on the basic list as per the selection criteria.

When I select multiple sales orders on the basic list and press detail button it should display me the item details of each sales order in the secondary list. But the challenge is each sales order’s details should be in a different list (Blocked list).

Can any one help me kin this regard?

Thanks,

Mohammed.

1 REPLY 1

former_member386202
Active Contributor
0 Kudos

Hi,

Refer this code

&----


*& Form sub_alv_display *

&----


  • This form displays the output using REUSE_ALV_GRID_DISPLAY *

  • function module *

----


FORM sub_alv_display .

*--Local Variables

DATA : lv_index LIKE sy-tabix.

CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT'

EXPORTING

i_callback_program = v_repid.

wa_layout1-colwidth_optimize = 'X'.

CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'

EXPORTING

is_layout = wa_layout1

it_fieldcat = it_fieldcat[]

i_tabname = 'it_final'

it_events = it_events

TABLES

t_outtab = it_final

EXCEPTIONS

program_error = 1

maximum_of_appends_reached = 2

OTHERS = 3.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

LOOP AT it_fieldcat INTO wa_fieldcat.

lv_index = sy-tabix.

IF wa_fieldcat-fieldname = 'ERDAT'.

wa_fieldcat-fieldname = 'TITLE'.

wa_fieldcat-seltext_m = text-026.

wa_fieldcat-outputlen = 10.

ENDIF.

MODIFY it_fieldcat FROM wa_fieldcat INDEX lv_index TRANSPORTING

fieldname seltext_m outputlen.

CLEAR : wa_fieldcat.

ENDLOOP.

wa_layout2-no_colhead = 'X'.

wa_layout2-colwidth_optimize = 'X'.

CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'

EXPORTING

is_layout = wa_layout2

it_fieldcat = it_fieldcat[]

i_tabname = 'it_total'

it_events = it_event1

TABLES

t_outtab = it_total

EXCEPTIONS

program_error = 1

maximum_of_appends_reached = 2

OTHERS = 3.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

wa_layout3-no_colhead = 'X'.

CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'

EXPORTING

is_layout = wa_layout3

it_fieldcat = it_fieldcat2[]

i_tabname = 'it_ship'

it_events = it_event2

TABLES

t_outtab = it_ship

EXCEPTIONS

program_error = 1

maximum_of_appends_reached = 2

OTHERS = 3.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

IF NOT it_final IS INITIAL OR

NOT it_total IS INITIAL OR

NOT it_ship IS INITIAL.

CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_DISPLAY'

EXCEPTIONS

program_error = 1

OTHERS = 2.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

ENDIF.

ENDFORM. "sub_alv_display

also check this standard program

ALV Block List BALVBT01

regards,

Prashant