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: 

Blocked ALV report

former_member209912
Participant
0 Kudos

Hello All

Good day to you. Now i have requiremnt of creating a blocked ALV report, i am having a final internal table with all customer related data with sales office value also. i want to display one sales office data in one block and i need to do the total values for some of the fields for that sales office.

I am trying to use blocked alv but it is not working out for me. what i have done is i have done a loop for the final internal table and i have create at new and at end events for using REUSE_ALV_BLOCK_LIST_APPEND. but still it is not working out for me.

I request you to please check and suggest me accordingly.

Regards

Raj

1 ACCEPTED SOLUTION

former_member182040
Active Contributor
0 Kudos

Refer the standard report BCALV_TEST_BLOCK_LIST

10 REPLIES 10

Former Member
0 Kudos

Hi Raj,

The block I copied from the standard program

CLEAR tl_xdata. LOOP AT xdata. APPEND xdata TO tl_xdata. "Append each row AT END OF carrid. CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND' EXPORTING it_fieldcat = xfield is_layout = x_layout i_tabname = 'XDATA' it_events = gt_xevents i_text = text-0b1 TABLES t_outtab = tl_xdata. "Instead of the main internal table, you can use the new internal table. May be field catalog will need adjustment REFRESH tl_xdata. ENDAT. ENDLOOP.

Hope it helps.

Sujay

Sujay

andreas_mann3
Active Contributor
0 Kudos

can you post your coding?

A.

Former Member
0 Kudos

Hi,

Its not working menas?? what problem exactly you have in that. Your not getting output itself or wat? Be much more clear

Thanks & Regards,

Vanitha P

Former Member
0 Kudos

Hi,

If in case your problem is like output is not being displayed and not showing any error then check out below one.

After using REUSE_ALV_BLOCK_LIST_APPEND have you called REUSE_ALV_BLOCK_LIST_DISPLAY Function module?? If not trying calling this Function module.

Regards,

Vanitha P

0 Kudos

Hello Suay

As per your instruciton i have modified the code and found that there are 2 blocks dispaying because i have only 2 entries in my internal table but there is no data displaying. only empty blocks are displaying.

I am here attaching my code , please check

SORT t_knkk BY vkbur.

clear t_knkk_temp.

LOOP AT t_knkk INTO wa_knkk.

move wa_knkk to wa_knkk_temp.

append wa_knkk_temp to t_knkk_temp.

at end of vkbur.

perform f_append_data_to_alv_block using 'T_KNKK_TEMP' t_knkk_temp.

ENDAT.

ENDLOOP.

FORM f_append_data_to_alv_block USING ix_itabname TYPE c

ix_iouttab TYPE STANDARD TABLE.

CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'

EXPORTING

is_layout = wa_layout

it_fieldcat = t_fieldcat[]

i_tabname = ix_itabname

it_events = t_events[]

  • IT_SORT =

  • I_TEXT = ' '

TABLES

t_outtab = ix_iouttab[]

EXCEPTIONS

program_error = 1

maximum_of_appends_reached = 2

OTHERS = 3.

REFRESH T_KNKK_temp.

ENDFORM. "f_append_data_to_alv_block

Former Member
0 Kudos

Hi Nagarjuna

what I have understood from your query is that you have a report in which you want to display your data in alv with Sales office specific. like

one sales office data in one block and the total on some fields and then again other sales office and its data.

if I am correct you can use the following solution.

define a sort table as mentioned below:

DATA: IT_SORT TYPE SLIS_T_SORTINFO_ALV, " For ALV Sorting.

WA_SORT TYPE SLIS_SORTINFO_ALV.

then form the sort table as below:

FORM SORT .

*For sorting and subtotal

WA_SORT-SPOS = 1.

WA_SORT-FIELDNAME = '<sales office field>'.

WA_SORT-TABNAME = 'IT_FINAL'. " to be displayed in ALV

WA_SORT-UP = 'X'.

APPEND WA_SORT TO IT_SORT.

CLEAR WA_SORT.

WA_SORT-SPOS = 2.

WA_SORT-FIELDNAME = '<field for total>'.

WA_SORT-TABNAME = 'IT_FINAL'.

WA_SORT-SUBTOT = 'X'.

WA_SORT-UP = 'X'.

APPEND WA_SORT TO IT_SORT.

CLEAR WA_SORT.

endform.

similarly you can add more fields for which you want to do the subtotal.

Pass this sort table in REUSE_ALV_GRID_DISPLAY.

i hope this will resolve your issue.

thanks

Lalit Gupta

0 Kudos

Hello

Thanks for your reply. They are asking to display each sales office specific data in one block. They had given FBL5N t.code and said they want the output as the output of that transaction. so i am using blocked ALV.

Please suggest. now my issue is i am able to display the blocks but data is not displaying.

Reg

Raj

0 Kudos

Hi Raj,

I checked and found that the REUSE_ALV_BLOCK_LIST_APPEND doesn't pull data when I called in the loop ( in the events or otherwise ) not as mentioned in my earlier post. Sorry about that . So, What I propose is, you could build internal table of various sales offices in the loop and add them to the block after the loop. But, Please be aware that we can have only 19 blocks only.

Also, the transaction FBL5N doesn't use blocked list. Instead uses normal list / grid only.

Hope it helps.

Sujay

0 Kudos

Hello

this is not going to work out for me because we will not be knowing the selection criteria right. so how can i build internal tables.

Anwyays, thanks for your suggestion.

so let me try out with grid disply.

Reg

Raj

former_member182040
Active Contributor
0 Kudos

Refer the standard report BCALV_TEST_BLOCK_LIST