Skip to Content
0
Former Member
Jul 16, 2012 at 04:35 PM

Field catalog merge for alv grid OOPS not getting modified???

760 Views

I am having an ALV grid for which i am using field catlog merge method to populate the catlog.

But when i loop and try to change the headings it is not getting changed.

code here

CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'

EXPORTING

i_structure_name = gs_report

i_bypassing_buffer = 'X'

CHANGING

ct_fieldcat = itab_fcat

EXCEPTIONS

inconsistent_interface = 1

program_error = 2

OTHERS = 3.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

LOOP AT itab_fcat INTO wa_fcat.

CASE wa_fcat-fieldname.

WHEN 'NISTM'.

wa_fcat-do_sum = 'X'.

wa_fcat-reptext = 'Quantity'.

MODIFY itab_fcat FROM wa_fcat.

WHEN 'BENUM'.

wa_fcat-reptext = 'PO #'.

MODIFY itab_fcat FROM wa_fcat.

WHEN 'LIFNR'.

wa_fcat-reptext = 'Vendor #'.

MODIFY itab_fcat FROM wa_fcat.

WHEN 'NAME1'.

wa_fcat-reptext = 'Name'.

MODIFY itab_fcat FROM wa_fcat.

WHEN 'BDATU'.

wa_fcat-reptext = 'TO creation date'.

MODIFY itab_fcat FROM wa_fcat.

WHEN 'BNAME'.

wa_fcat-reptext = 'User'.

MODIFY itab_fcat FROM wa_fcat.

WHEN 'NLENR'.

wa_fcat-reptext = 'Storage unit'.

MODIFY itab_fcat FROM wa_fcat.

WHEN 'POSNR'.

wa_fcat-reptext = 'Item'.

MODIFY itab_fcat FROM wa_fcat.

WHEN 'KUNNR'.

wa_fcat-reptext = 'Customer #'.

MODIFY itab_fcat FROM wa_fcat.

WHEN 'NAME2'.

wa_fcat-reptext = 'Name'.

MODIFY itab_fcat FROM wa_fcat.

WHEN 'MEINS'.

wa_fcat-reptext = 'Unit'.

MODIFY itab_fcat FROM wa_fcat.

ENDCASE.

ENDLOOP.

Once i change it it is getting changed in itab_fcat but not which getting displayed..its is still taking from structure only for few fields..i passed..

How to do it please help me out??