‎2009 Feb 10 3:39 PM
This gets the alv to popular without any errors but the column names are blank on top. Any ideas?
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = sy-repid
i_structure_name = 'ZFI_CONTRACT'
i_inclname = sy-repid
CHANGING
ct_fieldcat = it_fieldcat
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = 'ZFAP008Q'
it_fieldcat = it_fieldcat[]
TABLES
t_outtab = wa_zfi_contract
EXCEPTIONS
program_error = 1
OTHERS = 2.
‎2009 Feb 10 3:40 PM
check if the it_fieldcat is populated with the correct long medium and short descriptions... looks like you are using a Zstructure... did you use any custom data elements? for which you did not maintain description
‎2009 Feb 10 3:40 PM
check if the it_fieldcat is populated with the correct long medium and short descriptions... looks like you are using a Zstructure... did you use any custom data elements? for which you did not maintain description
‎2009 Feb 10 3:46 PM
Yea I think that's it. The custom tables use a 'Built-in Type' for the fields in the table. Is there another way to pull the descriptions?
‎2009 Feb 10 3:51 PM
make your own description...
read your field catalog table with field names and popoulate the descrption manually:
READ TABLE g_fieldcat_tab INTO w_fieldcat_tab WITH KEY fieldname = 'PS_PSP_PNR'.
if sy-subrc eq 0.
w_fieldcat_tab-ref_tabname = <table name> like vbak vbap...
w_fieldcat_tab-ROUNDFIELDNAME = vblen posnr etc...
endif.or
READ TABLE g_fieldcat_tab INTO w_fieldcat_tab WITH KEY fieldname = 'POSNR'.
if sy-subrc eq 0.
w_fieldcat_tab-SELTEXT_L = 'Sales Document Item'.
w_fieldcat_tab-SELTEXT_M = 'Item'.
w_fieldcat_tab-SELTEXT_S = 'Item'.
endif. "keep going for all fields..Edited by: J@Y on Feb 10, 2009 10:51 AM
‎2009 Feb 10 3:52 PM
Hi,
There is no other when you use the Internal table to built the Field Catalog. You need to loop the Fieldcat table and update the Short. Long text in the Fieldcat table.
‎2009 Feb 10 4:08 PM
Another way
Create a structure as same as your custom table with proper data elements/domains and use it in fm FIELD CATALOG MERGE
a®
‎2009 Feb 10 4:11 PM
It's just easier to maunally make a field catalog it sounds like then try to get the already populated SE11 Short decription (ddtext) out of SAP. It's a shame that's the case but thanks for the help. We'll just hard-cord the field catalog in the programs since it doesn't sounds like there's any other way to dynamically write it.
‎2009 Feb 10 4:33 PM
May be declare the internal table as same your custom table with proper like data element/domains then try to use
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = lv_program_name
i_internal_tabname = lv_internal_tabname " <<<<<
i_inclname = lv_program_name "<<<<<<
CHANGING
ct_fieldcat = lt_fcat
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3.
PS I am not 100% sure about this
a®