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

Change column headings

Hi,

I am using ALV Grid display for a report. The column headings are comming from the table, but the user wanted me to change the column names of 2 columns from default names. I changed it in FORM sub_modify_field_cat. It is displaying new column headings(Credit Memo, Acct. Docu) now, but when I adjust the column it is going back to default headings(Sales Docu, Fallow on Docu). How can I change this, so that the program displays only new column headings(Credit Memo, Acct. Docu).

Thanks,

FORM sub_modify_field_cat.

LOOP AT it_alv_field_cat INTO w_fieldcat.

CASE w_fieldcat-fieldname.

WHEN 'VBELN'.

w_fieldcat-seltext_s = 'Credit Memo'(017).

w_fieldcat-seltext_m = 'Credit Memo'(17m).

w_fieldcat-seltext_l = 'Credit Memo'(17l).

w_fieldcat-just = 'L'.

WHEN 'ACDOC'.

w_fieldcat-seltext_s = 'Acct. Doc'(010).

w_fieldcat-seltext_m = 'Acct. Doc'(10m).

w_fieldcat-seltext_l = 'Acct. Doc'(10l).

w_fieldcat-just = 'L'.

ENDCASE.

MODIFY it_alv_field_cat FROM w_fieldcat . "Modify fieldcatalog

ENDLOOP.

ENDFORM. " sub_modify_field_cat

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Oct 18, 2007 at 05:53 PM

    Populate ddictxt parameter in your fieldcatalog.

    WHEN 'VBELN'.

    w_fieldcat-seltext_s = 'Credit Memo'(017).

    w_fieldcat-seltext_m = 'Credit Memo'(17m).

    w_fieldcat-seltext_l = 'Credit Memo'(17l).

    <b>w_fieldcat-ddictxt = 'L'.</b>

    ddictxt (specify text)

    value set: SPACE, 'L', 'M', 'S'

    You can specify with values 'L', 'M', and 'S', the keyword that should always be used as column header. If the column width changes, no attempt is made in this case to find an appropriate header for the new output width.

    Hope this helps.

    ashish

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 18, 2007 at 05:50 PM

    Hi,

    You can use below code :

            w_fieldcat-coltext   = 'Credit Memo'(140).
            w_fieldcat-scrtext_s = 'Credit Memo'.
            w_fieldcat-scrtext_m = 'Credit Memo'.
            w_fieldcat-scrtext_l = 'Credit Memo'.
            w_fieldcat-reptext   = 'Credit Memo'.
            w_fieldcat-seltext   = 'Credit Memo'.
            w_fieldcat-just = 'L'.

    Do similarly for other also.

    Thanks,

    Sriram Ponna.

    Add a comment
    10|10000 characters needed characters exceeded

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.