on 07-09-2009 7:08 AM
Hi experts,
I have created a new simple ALV report (it uses only internal tables, no structures). I would like to change the names of column headers in the ALV report. Is this possible? How can I do it?
Thanks in advanced.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for your reply,
I am trying to use the code mentioned in the link but I think that something
is missing, probably a CASE statement before WHEN in the LOOP.
Can you help me? What do I have to put before WHEN statement?
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = <program name>
i_structure_name = <DDIC structure>
i_bypassing_buffer = 'X'
CHANGING
ct_fieldcat = gi_fieldcat[]
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3. "#EC *
LOOP AT gi_fieldcat INTO wa_fieldcat.
WHEN 'XXXX'.
wa_fieldcat-seltext_s = 'Fac'.
wa_fieldcat-seltext_m = 'Factory'.
wa_fieldcat-seltext_l = 'Factory'.
wa_fieldcat-reptext_ddic = 'Factory'.
MODIFY gi_fieldcat FROM wa_fieldcat.
ENDLOOP.
You are on right path....
For example the above FM will give the names stored in the data elemnt of the structure.
Now if u want to change the nsame to Fac1, Factory1... Give that & modify.
LOOP AT gi_fieldcat INTO wa_fieldcat.
WHEN 'XXXX'.
wa_fieldcat-seltext_s = 'Fac'.
wa_fieldcat-seltext_m = 'Factory'.
wa_fieldcat-seltext_l = 'Factory'.
wa_fieldcat-reptext_ddic = 'Factory'.
MODIFY gi_fieldcat FROM wa_fieldcat.
ENDLOOP.
U will then pass the same to REUSE_ALV................
U shkd find the change.
Regards,
Bhargava
LOOP AT gi_fieldcat INTO wa_fieldcat.
case wa_fieldcat- fieldname.
WHEN 'XXXX'. " (This shld be the actual field name, U can see that in the Debgging)
wa_fieldcat-seltext_s = 'Fac'.
wa_fieldcat-seltext_m = 'Factory'.
wa_fieldcat-seltext_l = 'Factory'.
wa_fieldcat-reptext_ddic = 'Factory'.
MODIFY gi_fieldcat FROM wa_fieldcat.
endcase.
ENDLOOP.
Hello,
You can check field catalog properties for field names,
Usually the following properties are taken and required text is passed.
seltext_l like dd03p-scrtext_l, " long key word
seltext_m like dd03p-scrtext_m, " middle key word
seltext_s like dd03p-scrtext_s, " short key word
Check the field catalog properties.
Hope this would help
Regards,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
The name of columns come from the field catlog which is build & given as a input to FM- ALV.
U can change it there have that reflected.
Regards,
Bhargava
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.