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
Refer the standard report BCALV_TEST_BLOCK_LIST
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
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
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
Add a comment