cancel
Showing results for 
Search instead for 
Did you mean: 

ALV HEADINGS

Former Member
0 Kudos

Hi all,

i want to display the ALV field names of my own.What i mean is i want to set the field heading with out taking it from the DICTIONARY fields.Please help me to do this.Its urgent.Please tell me step by step is it possible or not.

Thank you,

Regards,

GIRI.

Accepted Solutions (0)

Answers (2)

Answers (2)

anversha_s
Active Contributor
0 Kudos

hi giri,

try this.

wa_fieldcat-fieldname = 'EBELN'.

<b> wa_fieldcat-scrtext_m = 'Purchase Order'.</b>

wa_fieldcat-col_pos = 0.

wa_fieldcat-outputlen = 10.

wa_fieldcat-emphasize = 'X'.

wa_fieldcat-key = 'X'.

APPEND wa_fieldcat TO it_fieldcat.

CLEAR wa_fieldcat.

wa_fieldcat-fieldname = 'EBELP'.

  wa_fieldcat-scrtext_m   = 'PO Item'.

wa_fieldcat-col_pos = 1.

APPEND wa_fieldcat TO it_fieldcat.

CLEAR wa_fieldcat.

wa_fieldcat-fieldname = 'STATU'.

  wa_fieldcat-scrtext_m   = 'Status'.

wa_fieldcat-col_pos = 2.

APPEND wa_fieldcat TO it_fieldcat.

CLEAR wa_fieldcat.

Regards

Anver

Former Member
0 Kudos

ALV field names? R u talking abt column headings or anything else?

If yes then you need to carete a fieldcatalogue and there u can specify th efield names.

FORM f2000_fieldcat_init CHANGING i_fieldcat TYPE slis_t_fieldcat_alv.

DATA: line_fieldcat TYPE slis_fieldcat_alv.

CLEAR line_fieldcat.

line_fieldcat-fieldname = 'QMNUM'. " The field name and the table

line_fieldcat-tabname = 'I_DATA'. " name are the two minimum req.

line_fieldcat-key = 'X'. " Specifies the column as a key (Blue)

<b> line_fieldcat-seltext_m = 'Notification No.'. " Column Header</b>

APPEND line_fieldcat TO i_fieldcat.

CLEAR line_fieldcat.

line_fieldcat-fieldname = 'QMART'.

line_fieldcat-ref_tabname = 'I_DATA'.

line_fieldcat-hotspot = 'X'. " Shows the field as a hotspot.

<b> line_fieldcat-seltext_m = 'Notif Type'.</b>

APPEND line_fieldcat TO i_fieldcat.

CLEAR line_fieldcat.

line_fieldcat-fieldname = 'QMTXT'.

line_fieldcat-tabname = 'I_DATA'.

<b> line_fieldcat-seltext_m = 'Description'.</b>

APPEND line_fieldcat TO i_fieldcat.

CLEAR line_fieldcat.

line_fieldcat-fieldname = 'WS_ROW'.

line_fieldcat-tabname = 'I_DATA'.

<b> line_fieldcat-seltext_m = 'Row Number'.</b>

APPEND line_fieldcat TO i_fieldcat.

CLEAR line_fieldcat.

line_fieldcat-fieldname = 'WS_CHAR'.

line_fieldcat-tabname = 'I_DATA'.

<b> line_fieldcat-seltext_l = 'Test Character Field'.</b>

line_fieldcat-datatype = 'CHAR'.

line_fieldcat-outputlen = '15'. " You can specify the width of a

APPEND line_fieldcat TO i_fieldcat. " column.

CLEAR line_fieldcat.

line_fieldcat-fieldname = 'CHK'.

line_fieldcat-tabname = 'I_DATA'.

<b> line_fieldcat-seltext_l = 'Checkbox'.</b>

line_fieldcat-checkbox = 'X'. " Display this field as a checkbox

line_fieldcat-edit = 'X'. " This option ensures that you can

" edit the checkbox. Else it will

" be protected.

APPEND line_fieldcat TO i_fieldcat.

ENDFORM. " f2000_fieldcat_init

I hope it helps.

Best Regards,

Vibha

*Please mark all the helpful answers

Former Member
0 Kudos

· seltext_l (long field label)

· seltext_m (medium field label)

· seltext_s (short field label)

· reptext_ddic(header) Analogous to the Data element main header

· Ddictxt (specify text) : You can specify with values 'L', 'M', and 'S', the keyword that should always be used as column header. If the column width changes, no attempt is made in this case to find an appropriate header for the new output width.

Value set: SPACE, 'L', 'M', and ‘S’.

ex----

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 = '8'.
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 = 2.

append fc_tmp to fieldcat.

kishan negi

null