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: 

Dynamic column heading in editable ALV

Former Member
0 Kudos

Hello Experts,

I am using editable ALV.

code for field catalog is:

gs_fldcat-fieldname = 'ZZYEAR4'.
gs_fldcat-tabname = 'ITAB'.
gs_fldcat-ref_fieldname = 'ZZYEAR4'.
gs_fldcat-ref_tabname = 'ZFI_FISCAL_YR'.
gs_fldcat-col_pos = 1.
gs_fldcat-seltext_m = fy1.
gs_fldcat-edit = 'X'.
gs_fldcat-do_sum = 'X'.
append gs_fldcat to gt_fldcat.
clear gs_fldcat.

Based on some logic column header must be dynamically set for this i am passing variable fy1 in seltext_m field.

As the ALV is editable for column of type 'currency' I am passing reference table and field name also for that column.

Problem is ALV is displaying with text as maintained in reference field but not as in seltext_m field.

How can I maintain dynamic column headers.

Please help.


1 ACCEPTED SOLUTION

former_member184675
Active Participant
0 Kudos

Hi,

Hi, assuming that you are building your ALV via FM REUSE_ALV_GRID_DISPLAY and using type pool SLIS,  try passing the fy1 variable to seltext_s, seltext_l and reptext_ddic too.

The ALV won't necessarly display the medium length column description.

Also your fy1 variable must be of char type.

Regards,

Andrei

3 REPLIES 3

former_member212005
Active Contributor
0 Kudos

I am not sure whether i understand correctly... correct me if I am wrong..

In the codes provided by u...you are displaying the fiscal year. So why passing reference fieldname and tablename for this column....?

Pass the reference field name and reference table name for the currency column!

Also...try out cfieldname and ctabname fields of fieldcatalog.....it should do the trick for currency fields.

Sorry if my understanding was wrong.

0 Kudos

Hi,

I am passing reference field name and table name because editable field in ALV is decimal(13,2) type.

If I stop passing these values editable field is behaving strangely as:

if I enter 5000 then upon clicking enter it converts to 50.00 due to this logic build on this field value showing wrong figures.

former_member184675
Active Participant
0 Kudos

Hi,

Hi, assuming that you are building your ALV via FM REUSE_ALV_GRID_DISPLAY and using type pool SLIS,  try passing the fy1 variable to seltext_s, seltext_l and reptext_ddic too.

The ALV won't necessarly display the medium length column description.

Also your fy1 variable must be of char type.

Regards,

Andrei