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: 

Regardin ALV

Former Member
0 Kudos

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

1 ACCEPTED SOLUTION

Former Member
0 Kudos

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.

7 REPLIES 7

Former Member
0 Kudos

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.

Former Member
0 Kudos

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

Former Member
0 Kudos

<b>reuse_alv_fieldcatalog_merge</b>

regards,

srinivas

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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

all the best

Regards,

aparna

Former Member
0 Kudos

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

Former Member
0 Kudos

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.