10-07-2010 7:26 AM
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
10-07-2010 12:06 PM
10-07-2010 8:07 AM
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
10-07-2010 8:16 AM
10-07-2010 9:24 AM
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
10-07-2010 9:31 AM
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
10-07-2010 10:04 AM
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
10-07-2010 10:16 AM
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
10-07-2010 10:22 AM
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
10-07-2010 10:55 AM
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
10-07-2010 11:36 AM
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
10-07-2010 12:06 PM