Application Development and Automation 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: 
Read only

ALV Group rows on editable grid

Former Member
0 Likes
1,125

Hello,

I need to able to group rows in an editable grid(OO based).I can group rows by setting sort properties for the field.But when I make a field editable, I lose the grouping on the rows. Any ideas on how can edit aswell as group rows?

Here's a sample grid.

Period Prod Qty2

Jan_05 ABC 10

XYZ 20

A12 05

B12 03

Feb_05 ABC 09

XYZ 20

Code for sorting

**********************

ls_sort-spos = '2' .

ls_sort-fieldname = 'PERIOD' .

ls_sort-up = 'X' .

ls_sort-down = space .

ls_sort-group = 'X' .

APPEND ls_sort TO sort_cat .

Hello,

I need to able to group rows in an editable grid(OO based).I can group rows by setting sort properties for the field.But when I make a field editable, I lose the grouping on the rows. Any ideas on how can edit aswell as group rows?

Here's a sample grid.

Period Prod Qty2

Jan_05 ABC 10

XYZ 20

A12 05

B12 03

Feb_05 ABC 09

XYZ 20

Code for sorting

**********************

ls_sort-spos = '2' .

ls_sort-fieldname = 'PERIOD' .

ls_sort-up = 'X' .

ls_sort-down = space .

ls_sort-group = 'X' .

APPEND ls_sort TO sort_cat .

6 REPLIES 6
Read only

jayanthi_jayaraman
Active Contributor
0 Likes
842

Hi,

You have to make the edit = 'X' in fieldcatalog.

DATA lw_fieldcat TYPE lvc_s_fcat.

LOOP AT p_fieldcat INTO lw_fieldcat.

CASE lw_fieldcat-fieldname.

WHEN 'ZMATNR'.

lw_fieldcat-edit = c_x.

....

ENDCASE.

MODIFY p_fieldcat FROM lw_fieldcat.

ENDLOOP.

Read only

Former Member
0 Likes
842

Hi,

Check this link

http://www.sapdevelopment.co.uk/reporting/alv/alvscr.htm

Thanks & Regards,

Judith.

Read only

0 Likes
842

Hi,

Sorry - Probably I didnt state my issue clearly. The issue is not "How to make a grid editable?". The grid is editable. The problem is when, the grid is editable, the rows that are merged from sorting is lost. I want the users to see the rows merged and be able to edit the grid.

HD

Read only

0 Likes
842

Hi...

Did you get this issue resolved. If so please let me know the way you solved this as i am struck with the same situation.

Thanks in Advance.

~Kamal

Read only

0 Likes
842

You might give this a try.

gs_layout-cell_merge = 'N'. " This stops the Cell Merging

Edited by: Paul Chapman on Apr 9, 2008 5:17 PM

Read only

0 Likes
842

Hi,

Thx for ur immediate response. But i am still facing the same problem.

Regards,

Kamal