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

how to spilt ALV report

hi ,

my requirement is that i have to display the same report 2 times .

can i spilt the ALV ?

if yes can anyone tell me how to do it?

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • author's profile photo Former Member
    Former Member
    Posted on May 26, 2009 at 06:57 AM

    Hi,

    You can do this by creating a Screen Container, splitting it into 2 and putting and ALV Grid Control in each.

    See Programs under Transaction DWDM for Controls Examples:

    RSDEMO_CUSTOM_CONTROL or RSDEMO_DOCKING_CONTROL for creating the Screen Container

    RSDEMO_SPLITTER_CONTROL or RSDEMO_EASY_SPLITTER_CONTROL for splitting the container into 2.

    BCALV_GRID_DEMO for outputting an ALV grid to a container

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 26, 2009 at 06:58 AM

    Hi,

    For this u have to prepare blocked alv.

    Follow the code:

    tables: mara, makt, mard.

    *provide type-pools

    type-pools: slis.

    *Selection-screen details

    &----


    *& SELECTION-SCREEN

    &----


    selection-screen: begin of block b1 with frame title text-001.

    select-options: s_matnr for mara-matnr obligatory. "Material num

    selection-screen: end of block b1.

    &----


    *& TYPES DECLARATION

    &----


    *Declaring types for MARA.

    types : begin of t_mara,

    matnr type matnr, "Material num

    ersda type ersda, "Created on

    ernam type ernam, "Name of person who created

    laeda type laeda, "Date of last change

    end of t_mara.

    *Declaring types for MAKT.

    types :begin of t_makt,

    matnr type matnr, "Material num

    maktx type maktx, "Material Description (Short Text)

    maktg type maktg, "Material description in upper case for matchcodes

    end of t_makt.

    *Declaring types for MARD.

    types : begin of t_mard,

    matnr type matnr, "Material num

    werks type werks_d, "Plant det

    lgort type lgort_d, "Storage Location

    end of t_mard.

    &----


    *& DECLARING VARIABLES,INTERNAL TABLES & WORK AREAS

    &----


    data: v_repid type sy-repid, "varible for passing report name in FM.

    v_matnr type matnr, "For validating matnr

    wa_mara_field type slis_fieldcat_alv, "Work area for field catalog mara

    wa_makt_field type slis_fieldcat_alv, "Work area for field catalog makt

    wa_mard_field type slis_fieldcat_alv, "Work area for field catalog mard

    wa_mara type mara, "Work area for mara

    wa_makt type makt, "Work area for makt

    wa_mard type mard, "Work area for mard

    i_mara_field type slis_t_fieldcat_alv, "Internal table for fieldcatalog mara

    i_makt_field type slis_t_fieldcat_alv, "Internal table for fieldcatalog makt

    i_mard_field type slis_t_fieldcat_alv, "Internal table for fieldcatalog mard

    i_mara type table of t_mara, "Internal table for mara

    i_makt type table of t_makt, "Internal table for makt

    i_mard type table of t_mard, "Internal table for mard

    i_layout type slis_layout_alv, "Layout for blocks

    i_events type slis_t_event, "Internal table for events(MARA)

    wa_events type slis_alv_event, "Work area for events(MARA)

    i_events1 type slis_t_event, "Internal table for events(MAKT)

    wa_events1 type slis_alv_event, "Work area for events(MAKT)

    i_events2 type slis_t_event, "Internal table for events(MARD)

    wa_events2 type slis_alv_event. "Work area for events(MARD)

    &----


    *& INITIALIZATION

    &----


    initialization.

    v_repid = sy-repid.

    &----


    *& AT SELECTION SCREEN

    &----


    • Validatingj material num at selection-screen

    at selection-screen.

    select single matnr from mara into v_matnr

    where matnr in s_matnr.

    if sy-subrc ne 0.

    message text-004 type 'E'.

    endif.

    &----


    *& START-OF-SELECTION

    &----


    start-of-selection.

    perform field_cat. " For fieldcatalog

    perform events_top. " For events

    *Calling the function module to initialize block list output

    call function 'REUSE_ALV_BLOCK_LIST_INIT'

    exporting

    i_callback_program = v_repid.

    • Fetching final data for blocks

    perform select_data.

    *Calling the function module to append block mara

    call function 'REUSE_ALV_BLOCK_LIST_APPEND'

    exporting

    is_layout = i_layout

    it_fieldcat = i_mara_field[]

    i_tabname = 'MARA'

    it_events = i_events[]

    tables

    t_outtab = i_mara

    exceptions

    program_error = 1

    maximum_of_appends_reached = 2

    others = 3.

    *Calling the function module to append block mard

    call function 'REUSE_ALV_BLOCK_LIST_APPEND'

    exporting

    is_layout = i_layout

    it_fieldcat = i_makt_field

    i_tabname = 'MAKT'

    it_events = i_events1[]

    tables

    t_outtab = i_makt

    exceptions

    program_error = 1

    maximum_of_appends_reached = 2

    others = 3.

    *Calling the function module to append block mard

    call function 'REUSE_ALV_BLOCK_LIST_APPEND'

    exporting

    is_layout = i_layout

    it_fieldcat = i_mard_field

    i_tabname = 'MARD'

    it_events = i_events2[]

    tables

    t_outtab = i_mard

    exceptions

    program_error = 1

    maximum_of_appends_reached = 2

    others = 3.

    **Calling the function module to display blocks

    call function 'REUSE_ALV_BLOCK_LIST_DISPLAY'.

    &----


    *& Form TOP_PAGE

    &----


    • Providing heading for each block

    ----


    • Heading for block mara

    form top_page.

    write:/ 'BLOCK FOR MARA' color 7.

    endform. "TOP_PAGE

    • Heading for block makt

    form top_page1.

    write:/ 'BLOCK MAKT' color 4.

    endform. "TOP_PAGE1

    • Heading for block mard

    form top_page2.

    write:/ 'BLOCK FOR MARD' color 5.

    endform. "TOP_PAGE2

    &----


    *& Form FIELD_CAT

    &----


    • Preparing fields which we want to display in blocks

    ----


    form field_cat .

    • Preparing fieldcatalog for field material num

    wa_mara_field-col_pos = 1.

    wa_mara_field-fieldname = 'MATNR'.

    wa_mara_field-ref_tabname = 'MARA'.

    append wa_mara_field to i_mara_field.

    clear wa_mara_field.

    • Preparing fieldcatalog for field created on

    wa_mara_field-col_pos = 2.

    wa_mara_field-fieldname = 'ERSDA'.

    wa_mara_field-ref_tabname = 'MARA'.

    append wa_mara_field to i_mara_field.

    clear wa_mara_field.

    • Preparing fieldcatalog for field name of person created obj

    wa_mara_field-col_pos = 3.

    wa_mara_field-fieldname = 'ERNAM'.

    wa_mara_field-ref_tabname = 'MARA'.

    append wa_mara_field to i_mara_field.

    clear wa_mara_field.

    • Preparing fieldcatalog for field date of last change

    wa_mara_field-col_pos = 4.

    wa_mara_field-fieldname = 'LAEDA'.

    wa_mara_field-ref_tabname = 'MARA'.

    append wa_mara_field to i_mara_field.

    clear wa_mara_field.

    • Preparing fieldcatalog for field material num

    wa_makt_field-col_pos = '1'.

    wa_makt_field-fieldname = 'MATNR'.

    wa_makt_field-ref_tabname = 'MAKT'.

    append wa_makt_field to i_makt_field.

    clear wa_makt_field.

    • Preparing fieldcatalog for field material des

    wa_makt_field-col_pos = 2.

    wa_makt_field-fieldname = 'MAKTX'.

    wa_makt_field-ref_tabname = 'MAKT'.

    append wa_makt_field to i_makt_field.

    clear wa_makt_field.

    • Preparing fieldcatalog for field Material description in upper case for matchcodes

    wa_makt_field-col_pos = 3.

    wa_makt_field-fieldname = 'MAKTG'.

    wa_makt_field-ref_tabname = 'MAKT'.

    append wa_makt_field to i_makt_field.

    clear wa_makt_field.

    • Preparing fieldcatalog for field Material num

    wa_mard_field-col_pos = 1.

    wa_mard_field-fieldname = 'MATNR'.

    wa_mard_field-ref_tabname = 'MARD'.

    append wa_mard_field to i_mard_field.

    clear wa_mard_field.

    • Preparing fieldcatalog for field Plant

    wa_mard_field-col_pos = 2.

    wa_mard_field-fieldname = 'WERKS'.

    wa_mard_field-ref_tabname = 'MARD'.

    append wa_mard_field to i_mard_field.

    clear wa_mard_field.

    • Preparing fieldcatalog for field storage loc

    wa_mard_field-col_pos = 3.

    wa_mard_field-fieldname = 'LGORT'.

    wa_mard_field-ref_tabname = 'MARD'.

    append wa_mard_field to i_mard_field.

    clear wa_mard_field.

    endform. " FIELD_CAT

    &----


    *& Form SELECT_DATA

    &----


    • Fetching data from three tables(mara,makt,mard) based on selection-screen

    • material numbers

    ----


    form select_data .

    • Fetching data from mara table

    select matnr

    ersda

    ernam

    laeda

    from mara

    into table i_mara

    where matnr in s_matnr.

    • Fetching data from makt table

    select matnr

    maktx

    maktg

    from makt

    into table i_makt

    where matnr in s_matnr.

    • Fetching data from mard table

    select matnr

    werks

    lgort

    from mard

    into table i_mard

    where matnr in s_matnr.

    endform. " SELECT_DATA

    &----


    *& Form EVENTS_TOP

    &----


    • Preparing events for top-of-page for each block

    ----


    form events_top .

    • block mara

    wa_events-form = 'TOP_PAGE'.

    wa_events-name = 'TOP_OF_PAGE'.

    append wa_events to i_events.

    • block makt

    wa_events1-form = 'TOP_PAGE1'.

    wa_events1-name = 'TOP_OF_PAGE'.

    append wa_events1 to i_events1.

    • block mard

    wa_events2-form = 'TOP_PAGE2'.

    wa_events2-name = 'TOP_OF_PAGE'.

    append wa_events2 to i_events2.

    endform. " EVENTS_TOP

    Naveen M.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 26, 2009 at 07:11 AM

    Hi,

    Please follow the steps given below:

    1. You need to create a Control

    2. You need to Instantiate a Container Object if it is Custom and Split Containers, we need to specify the control which is created by us in Screen painter using the CREATE OBJECT

    3. You need to Instantiate an Object of the kind of report that has to be displayed it can be List, Grid or Tree). CREATE OBJECT .

    Now we need to specify the Parent Container so that it sits in that container.

    4. Finally we need to call tthe appropriate methods to display the report on the screen. CALL METHOD ->

    Regards,

    Jayanth G

    Add a comment
    10|10000 characters needed characters exceeded

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.