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 in column of type 'currency' I am passing reference table and field name.

Problem is ALV is now 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

Abhijit74
Active Contributor
0 Kudos

Hello,

I think you have not searched the forum correctly.

This is very basic. Why you are passing reference field and table name if you want to display as dynamic?

Keep only seltext_m.

Thanks,

Abhijit

7 REPLIES 7

Abhijit74
Active Contributor
0 Kudos

Hello,

I think you have not searched the forum correctly.

This is very basic. Why you are passing reference field and table name if you want to display as dynamic?

Keep only seltext_m.

Thanks,

Abhijit

Former Member
0 Kudos

Hello Abhilit,

Thank you for replying.

I am passing reference field and table because editable column in alv grid is of type currency and if I don't pass reference field and reference table then editable field is behaving strangely as:

if I had entered 5000 in editable cell then after pressing 'enter' it changes to 50. Due to this, logic built on this field is calculating wrong figures.

Hope I this answers your concern.

Regards,

Shubh

Abhijit74
Active Contributor
0 Kudos

Hello,

Don't give reference field name and reference table name instead of this use field name and Tabname (Your final output table which will be used in Reuse_alv_grid_display or Reuse_alv_list_display).

   ls_fieldcat-fieldname = 'Your field Name".

   ls_fieldcat-tabname   = 'Final Table' .

   ls_fieldcat-scrtext_l =  text-027.

   APPEND ls_fieldcat TO gt_fieldcat.

   CLEAR ls_fieldcat.

Hope this will work.

Thnaks,

Abhijit

Former Member
0 Kudos

Hi,

Field scrtext_l is not present in field catalog table. I am using SLIS_T_FIELDCAT_ALV as a table type.

I found the solution,actually I was passing values to only seltext_m, but values need to be passed to seltext_l,seltext_m,_seltext_s,reptext_ddic

Regards,

Shubh

Abhijit74
Active Contributor
0 Kudos

Hello,

It was a printing mistake. it was seltext_l.

Thanks,

Abhijit

Pawan_Kesari
Active Contributor
0 Kudos

Try using field COLTEXT of fieldcatelog

Former Member
0 Kudos

Hi Shubham,

Are you using two fieldcatalog ?i.e.

-> First one to add all the dynamic data to be shown fieldcatalog,and then reuse inorder to create

dynamic internal table.

->Second one to use in REUSE_ALV_GRID_DISPLAY.

If you are doing so,then might be you have misse to append scrtext_m ,to second fieldcatalog from first fieldcatalog.

Regards,

Roma Jhamb