07-11-2011 5:43 AM
Hi,
In My Report I want to group the fields in ALV i found the attribute SP_GROUP to be set with value and the internal table IT_SPECIAL_GROUPS to be passed to set_table_for_first_display method. My requirement is such that i need few fields to be common to multiple groups so can i use multiple value to SP_GROUP attribute while defining field catalog..?? Or any other method is there please suggest me.
Thank's & Regard's
Girija
07-11-2011 6:39 AM
Hi,
Use sort instead, below is the sample code.
* Internal table for storing info. for ALV grid
data: i_sort2 TYPE LVC_T_SORT.
DATA: wa_sort2 LIKE LINE OF i_sort2.
wa_sort2-spos = 1.
wa_sort2-fieldname = 'EBELN'.
wa_sort2-up = 'X'.
wa_sort2-subtot = 'X'.
APPEND wa_sort2 TO i_sort2.
CLEAR wa_sort2.
wa_sort2-spos = 2.
wa_sort2-fieldname = 'EBELP'.
wa_sort2-up = 'X'.
wa_sort2-subtot = space.
APPEND wa_sort2 TO i_sort2.
CLEAR wa_sort2.
wa_sort2-spos = 3.
wa_sort2-fieldname = 'EINDT'.
wa_sort2-up = 'X'.
wa_sort2-subtot = space.
APPEND wa_sort2 TO i_sort2.
Now use I_sort2 table with changing parameter IT_SORT of method SET_TABLE_FOR_FIRST_DISPLAY
07-11-2011 7:28 AM
hi,
I din't understand your code how can i use this in Set_table_for_first _display method ..??
can you please be more Specific??
Regard's
Girija
07-11-2011 10:13 AM
07-12-2011 7:42 AM
Hi Girija;
You can read below link and then apply your program.
There are all details in this documents for OO ALV. You can find "Group" in this documents.
Best regards.
07-12-2011 8:02 AM
Hi ,
You can sort the field based on the group and pass it in it_sort in method set_table_for_first_display.
DATA:li_sort TYPE lvc_t_sort,
lwa_sort TYPE lvc_s_sort.
lwa_sort-fieldname = 'VBELN'.
lwa_sort-spos = 1.
lwa_sort-up = 'X'.
lwa_sort-group = 'UL'.
APPEND lwa_sort TO li_sort.
lwa_sort-fieldname = 'POSNR'.
lwa_sort-spos = 2.
lwa_sort-up = 'X'.
lwa_sort-group = 'UL'.
APPEND lwa_sort TO li_sort.
Pass ths internal table li_sort to it_sort in method set_table_for_first_display.
The output will be grouped according to VBELN and POSNR.
Regards,
Archna