11-15-2005 3:52 PM
Hi,
Am getting the field label name when i change the output lenght of alv list display instead of the sel_text name which i want to .
can any one help me in getting the sel_text name which is 20 char long.
early response is appreciated.
11-15-2005 3:56 PM
Syed
In the field Catalog, for the column u want to have a NAME of 20 chars, add the stmt
fieldcatlog-seltext = 'text to be displayed '
to the Field Catalog Internal Table.
Thanks
Kam.
11-15-2005 3:56 PM
Hi,
LW_FIELDCAT-FIELDNAME = '<field-name>'.
LW_FIELDCAT-SELTEXT_M = '<field-label>'.
LW_FIELDCAT-OUTPUTLEN = <field-length>."in your case its 20
APPEND LW_FIELDCAT TO W_FIELDCATALOG.
Hope this should work.
Don't forget to assign points if ur query solved
11-15-2005 3:59 PM
Set these fields to your label.
FS_FIELDCAT-REPTEXT_DDIC,
FS_FIELDCAT-SELTEXT_L,
FS_FIELDCAT-SELTEXT_M,
FS_FIELDCAT-SELTEXT_S
Srinivas
11-15-2005 3:57 PM
Hi,
if you are using FM REUSE_ALV_GRID_DISPLAY then change your field_catalog....
fc_tmp-reptext_ddic = 'COMPANY CODE'. " here you need to type column name what you want
fc_tmp-fieldname = 'BUKRS'. " here you need to type field name of the table.
form write_report.
perform build_field_catalog.
perform build_sort.
* CALL ABAP LIST VIEWER (ALV)
call function 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
it_fieldcat = fieldcat
it_sort = sort
TABLES
t_outtab = itab.
endform.
**********************************************************
*BUILD_FIELD_CATALOG
**********************************************************
form build_field_catalog.
data: fc_tmp type slis_t_fieldcat_alv with header line.
clear: fieldcat.
refresh: fieldcat.
clear: fc_tmp.
fc_tmp-reptext_ddic = 'COMPANY CODE'.
fc_tmp-fieldname = 'BUKRS'.
fc_tmp-tabname = 'ITAB'.
fc_tmp-outputlen = '20'.
fc_tmp-col_pos = 2.
append fc_tmp to fieldcat.
clear: fc_tmp.
fc_tmp-reptext_ddic = 'VENDOR NUMBER'.
fc_tmp-fieldname = 'LIFNR'.
fc_tmp-tabname = 'ITAB'.
fc_tmp-outputlen = '8'.
fc_tmp-col_pos = 3.
append fc_tmp to fieldcat.
ENDFORM.
**********************************************************
reward points for helpfull answers and close the thread if your question is solved.
regards,
venu.
11-15-2005 4:17 PM
w_fieldcat-fieldname = &1.
w_fieldcat-col_pos = &2.
w_fieldcat-ref_tabname = &3.
w_fieldcat-seltext_s = &4.
w_fieldcat-text_fieldname = &4.
w_fieldcat-outputlen = &5.
The above is macro which am using. For the ref_tabname am passing the table name and for the seltext_s the name of the field to be (e.g. Reward Fund Carton ),and the output length to 20. But it is picking the field label name which we can see by double clicking the field type in the table if the length exceeds the field length. The length of this field is 10 char.
Request an early response.
11-15-2005 4:26 PM
SYED,
Use the field <b>COLTEXT</b> to provide the Column Headings!!! The value present in this field will override the Standard one. U can pass a maximum of 40 char length text as the Column Heading.
Thanks
Kam
Note: Allot points for all worthful postings
11-16-2005 3:45 AM
Hi,
While Building fieldcatalog
data: fieldcatalog type slis_t_fieldcat_alv with header line.
fieldcatalog-fieldname = 'MATNR'.
fieldcatalog-<b>seltext_m</b> = 'Mat Number'.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
No need to specify the output length by default it will take the default length from dictionary.
Hope this helps u.
Reward points and close the thread if ur problem got solved.
11-16-2005 7:29 PM
Hi There,
The ALV work in such a way that by default they pick up the text defined at the data element level for the table field. The way in which you can override the data element text for the field is to use the felds:
seltext_l
seltext_m
seltext_s
of the field catalog in conjunction with the following field of the same structure:
<b>ddictxt</b>.
This is a single character field, and pass the type of text you wish to override((S)hort (M)iddle (L)ong).
This would definitely cater your requirement.
Cheers,
Naveen.
11-16-2005 7:45 PM
In alv Grid
DATA: IT_FIELDCAT TYPE LVC_T_FCAT,
X_FIELDCAT TYPE LVC_S_FCAT.
X_FIELDCAT-SCRTEXT_M = 'Material Number'(016). or X_FIELDCAT-COLTEXT = 'Material Number' (016).
X_FIELDCAT-FIELDNAME = 'MATNR'.
X_FIELDCAT-TABNAME = 'IT_FINAL'.
X_FIELDCAT-COL_POS = L_POS.
X_FIELDCAT-OUTPUTLEN = '20'.
APPEND X_FIELDCAT TO IT_FIELDCAT.
CLEAR X_FIELDCAT.
L_POS = L_POS + 1.
In alv Normal List
DATA: IT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV.
DATA: X_FIELDCAT TYPE SLIS_FIELDCAT_ALV.
X_FIELDCAT-Seltext_M = 'Material Number'(016). or X_FIELDCAT-COLTEXT = 'Material Number' (016).
X_FIELDCAT-FIELDNAME = 'MATNR'.
X_FIELDCAT-TABNAME = 'IT_FINAL'.
X_FIELDCAT-COL_POS = L_POS.
X_FIELDCAT-OUTPUTLEN = '20'.
APPEND X_FIELDCAT TO IT_FIELDCAT.
CLEAR X_FIELDCAT.
L_POS = L_POS + 1.
Regards
Vijay