Skip to Content
author's profile photo Former Member
Former Member

Dynamic column heading in editable ALV

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.


Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    Posted on Mar 07, 2013 at 03:34 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Mar 07, 2013 at 03:15 PM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      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.

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.