Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Column Name missing

Former Member
0 Likes
1,284

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.

1 ACCEPTED SOLUTION
Read only

former_member156446
Active Contributor
0 Likes
1,140

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

7 REPLIES 7
Read only

former_member156446
Active Contributor
0 Likes
1,141

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

Read only

0 Likes
1,140

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?

Read only

0 Likes
1,140

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

Read only

0 Likes
1,140

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.

Read only

0 Likes
1,140

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®

Read only

0 Likes
1,140

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.

Read only

0 Likes
1,140

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®