Skip to Content
author's profile photo
Former Member

REGARDING ALV BLOCK DISPLAY AND GRID DISPLAY

HI FRIENDS,

I HAVE A TROUBLE IN DISPLAYNG TWO TABLES TOGETHER IN THE GRID DISPLAY, BUT I CAN DISPLAY USING BLOCKS. I DONT WANT TO USE JOIN STATEMENT IN THE SELECT QUERY.

HELP WITH BY DISPLAYING THE RESPECTIVE CODES FOR THAT.

THANK U IN ADVANCE

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

3 Answers

  • Posted on Jul 18, 2007 at 02:12 PM

    If you want to use the Block list

    then you need 3 Function modules.

    1. Block list initialization

    (This will be called once)

    REUSE_ALV_BLOCK_LIST_INIT

    2. Block List Append

    REUSE_ALV_BLOCK_LIST_APPEND

    (This will be called n times, if you have n tables)

    3. Block list Display

    (this will be called once)

    REUSE_ALV_BLOCK_LIST_DISPLAY

    Check BALVBT01 program

    Regards

    Vijay

    Add comment
    10|10000 characters needed characters exceeded

  • Posted on Jul 18, 2007 at 02:13 PM

    Hi,

    Append the data of 2nd table into 1st table & then pass the 1st table to ALV Grid FM.

    Else.

    Use two containers on a screen & pass table to each container.

    Best regards,

    Prashant

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Posted on Jul 18, 2007 at 02:39 PM

    hi,

    type-pools : slis,icon.

    data : gd_repid like sy-repid.

    data : d_fieldcat type slis_t_fieldcat_alv,

    d_fieldcat_wa type slis_fieldcat_alv.

    data : begin of itab_mara occurs 0,

    matnr like mara-matnr,

    ernam like mara-ernam,

    end of itab_mara.

    data : begin of itab_marc occurs 0,

    matnr like marc-matnr,

    werks like marc-werks,

    end of itab_marc.

    data : begin of itab_final occurs 0,

    matnr like mara-matnr,

    ernam like mara-ernam,

    werks like marc-werks,

    end of itab_final.

    gd_repid = sy-repid.

    loop at itab_emp.

    itab_final-matnr = itab_emp-matnr.

    itab_final-ernam = itab_emp-ernam.

    append itab_emp.

    clear itab_emp.

    endloop.

    d_fieldcat_wa-fieldname = 'MATNR'.

    d_fieldcat_wa-seltext_l = 'material number'.

    d_fieldcat_wa-col_pos = 1.

    append d_fieldcat_wa to d_fieldcat.

    clear d_fieldcat_wa.

    d_fieldcat_wa-fieldname = 'ERNAM'.

    d_fieldcat_wa-seltext_l = 'created by'.

    d_fieldcat_wa-col_pos = 2.

    append d_fieldcat_wa to d_fieldcat.

    clear d_fieldcat_wa.

    d_fieldcat_wa-fieldname = 'WERKS'.

    d_fieldcat_wa-seltext_l = 'plant number'.

    d_fieldcat_wa-col_pos = 1.

    append d_fieldcat_wa to d_fieldcat.

    clear d_fieldcat_wa.

    call function module 'REUSE_ALV_GRID_DISPLAY'.

    Reward with points if helpful.

    Add comment
    10|10000 characters needed characters exceeded