Skip to Content
avatar image
Former Member

Regardin ALV

I have created two internal tableS . How to export those two internal table in single function "REUSE_ALV_GRID_DISPLAY"

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

7 Answers

  • Best Answer
    avatar image
    Former Member
    Aug 17, 2007 at 09:44 AM

    Hi,

    You can't import two internal tables directly to the Function Module.

    Create a one common structure and final internal table and then pass the Internal Table to the FM.

    Thanks.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 17, 2007 at 09:45 AM

    <b>reuse_alv_fieldcatalog_merge</b>

    regards,

    srinivas

    <b>*reward for useful answers*</b>

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 17, 2007 at 09:52 AM

    For using this function module you have to get data in one table .What you can do is to apply a loop in the main table and inside that table you can read the values of other table by comparing keys .Hope this will help

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 17, 2007 at 09:45 AM

    Hi

    u can create a field catalog such that both the internal table are added to it

    or

    u should create 2 alv's

    Regards,

    Prasant

    • reward if helpful

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 17, 2007 at 09:57 AM

    see balvhd01.. here he would have merged two tables into one alv

    all the best

    Regards,

    aparna

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 17, 2007 at 10:00 AM

    but the structure that is used in the fm should be in the ddic table.. to avoid that u can use this approach explained in the following link..

    http://www.sap-img.com/abap/reincarnation-of-reuse-alv-fieldcatalog-merge.htm

    Regargs,

    Aparna

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 17, 2007 at 01:56 PM

    hi,

    if you use two internal table in ALV,it will be very complicated..

    just merge these two internal tables into one and then build fieldcatalogue and eventcatalogue for that...

    say suppose,

    you are having itab1---> header internal table.

    itab2----> line atom(details for the header) table.

    itab3---> internal table that has all the feilds in itab1,itab2.

    and for every value of itab1 one can fetch many records in itab2(ie, one to many relationship)..follow the code below,

    loop at itab2 into wa_itab2.

    read table itab1 into wa_itab1 with key ebeln = wa_itab2-ebeln.

    move-corresponding wa_itab1 to wa_itab3.

    move-corresponding wa_itab2 to wa_itab3.

    append wa_itab3 to itab3.

    endloop.

    NOTE: "with key ebeln = wa_itab2-ebeln" used just for example,

    use only the keyfield of the itab2 (gives the details for itab1).

    hence you will get a merged table called itab3.

    NOTE: here, wa_itab1--->header workarea.

    wa_itab2---->details for the header workarea.

    wa_itab3---->workarea for the internal table itab3 which we are using for the merging purpose.

    Add comment
    10|10000 characters needed characters exceeded