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: 

How to use AT END OF logic in ALV reports?

former_member305388
Active Contributor
0 Kudos

Hi Experts!!

I have a requirement which is given below and the same should be the output of an alv report. I have all the data in one itab which has ields as matnr, sl.no, name and place. And I have the itab values as

MATNR SL.NO NAME PLACE

134 1 ABCD INDIA

134 2 XYZ US

134 3 QWERT GERMANY

256 4 FDGHS CNTRY1

256 5 GVHB CNTRY2

256 6 GHI CNTRY3

256 7 YGJN CNTRY4

256 8 ESEGVU CNTRY5

Now I need the alv output as the below:

Sl.No. Name Place

MATNR: 134

1 ABCD INDIA

2 XYZ US

3 QWERT GERMANY

MATNR: 256

5 FDGHS CNTRY1

6 GVHB CNTRY2

7 GHI CNTRY3

8 YGJN CNTRY4

9 ESEGVU CNTRY5

In normal classic report, I can achieve this by using AT END OF MATNR, and then printing. But how can i achieve the same in ALV report?

Kindly suggest me the normal ALV method, istead of OOPS concepts. I don't ant to consider OOPS, if this is possible by normal ALVs.

Thanks a lot in advance.

Regards,

Seenu

3 REPLIES 3

Former Member
0 Kudos

HI,

You can use the ALV block list.

this will give you the data in block list. Only thing is you cannot get this with GRID display.

Only thing is, it will work fine for LIST BLOCK

you can use the function modules,

REUSE_ALV_BLOCK_LIST_APPEND ( this is to append the blocks)

and REUSE_ALV_BLOCK_LIST_DISPLAY to display the data

You can see the output of FBL5N where the data will be printed according to the Customer.

Regards,

Venkatesh

0 Kudos

Hi,

Thanks for the reply. I checked the FBL5N t-code, but couldn't find those FMs being used. Whatever, I tried with the FMs that are mentioned but in vain. Can anybody suggest some other t-code or any other solution to get this done?

Thanks a lot.

Regards,

Seenu

Former Member
0 Kudos

Hi,

Try this:

data: h_alv_sorttab type slis_t_sortinfo_alv.

h_alv_sorttab-fieldname = 'matnr'.

h_alv_sorttab-tabname = 'it_data'.

h_alv_sorttab-up = 'x'.

h_alv_sorttab-subtot = 'x'.

append h_alv_sorttab.

call function 'reuse_alv_grid_display'

exporting

i_background_id = 'alv_background'

i_callback_program = g_repid

is_layout = gs_layout

it_fieldcat = gt_fieldcat[]

it_sort = h_alv_sorttab

i_save = g_save

is_variant = g_variant

it_events = gt_events[]

i_default = 'x'

tables

t_outtab = it_data.

Hope this information is help to you.

Regards,

José