Application Development 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: 

ALV Problem

Former Member
0 Kudos

Hi Experts,

I have one query in ALV fieldcatalog.

I am using REUSE_ALV_FIELDCATALOG_MERGE & passing standard structure.

Now in that structure say ABC having field F1 having data type CHAR(10).

I wanted to increase the length of field F1 to 30. So, I have declared one field named say LV_F1 having length 30.

I have added appended that field i.e. LV_F1 in my fieldcatalog.

I have populated the data properly in my internal table ITAB.

After displaying output I am able to see field ABC-F1 in my output display.

If I change the layout & select my field LV_F1 i m getting dump.

Anybody will give me suggestion pls??

7 REPLIES 7

Former Member
0 Kudos

if u want to change the formatting u need to prepare fieldcatalog by yourself not using the FM.

Thanks

ANUPAM

Former Member
0 Kudos

Hi Gupta,

If u want to change the any existing options like size,color etc,then u need to develop the "Field catalog" manually like

FLDCAT-FIELDNAME = 'VBELN'.

FLDCAT-SELTEXT_M = 'Sales Document'.

FLDCAT-COL_POS = 0.

*FLDCAT-EMPHASIZE = 'C411'.

FLDCAT-OUTPUTLEN = 20.

FLDCAT-KEY = 'X'.

FLDCAT-ICON = 'X'.

*FLDCAT-NO_OUT = 'X'. "It hides the field from display

APPEND FLDCAT TO FLDCAT.

CLEAR FLDCAT.

FLDCAT-FIELDNAME = 'ERDAT'.

FLDCAT-SELTEXT_L = 'Record Date created'.

FLDCAT-COL_POS = 1.

FLDCAT-KEY = 'X'.

APPEND FLDCAT TO FLDCAT.

CLEAR FLDCAT.

FLDCAT-FIELDNAME = 'ERNAM'.

FLDCAT-SELTEXT_L = 'Cteated Object Person Name'.

FLDCAT-COL_POS = 2.

APPEND FLDCAT TO FLDCAT.

CLEAR FLDCAT.

FLDCAT-FIELDNAME = 'AUDAT'.

FLDCAT-SELTEXT_M = 'Document Date'.

FLDCAT-COL_POS = 3.

FLDCAT-EMPHASIZE = 'C110'.

APPEND FLDCAT TO FLDCAT.

CLEAR FLDCAT.

later pass this "FLDCAT" to parameter "IT_FIELDCAT" in FM "REUSE_ALV_GRID_DISPLAY".

If u hv any doubts regarding this,then feel free to ask.

Plz reward if it is useful.

Thank you,

chandu.

Former Member
0 Kudos

Hi Neha,

You have to create the field catalog manaually.

0 Kudos

Hi All,

Yes it can be done through manually. Actually if I create fieldcatalog manually then I need to do it for 200 fields.

Any other suggestion for this.

Former Member
0 Kudos

Hi neha,

1. I am not sure whether i understood properly.

2. If the field LV_F1,

is not there in the internal table,

then we should not add it in the field catalogue.

It will give error.

3. if u want to increase the field length (for display purpose),

u can modify the field catalogue (for that field)

fieldcatalogue-output_len = 30.

regards,

amit m.

Former Member
0 Kudos

Hi,

Delete the layout and create it again.

Beacuse the layout created might be before you increased the size of the field

Regards,

Rama.Pammi

Edited by: Rama Chary on Dec 27, 2007 7:19 PM

Former Member
0 Kudos

Hi,

I think there is no need to create a new field with 30 length, eventhough if you create a new field with 30 char you will popluated newly created with initial field values, so it will also contain 10 char values only.

You can do as below :

Once you have fieldcatalog merge FM.

loop at gt_fieldcat.

if gt_fieldcat-fieldname = 'F1'.

gt_fieldcat-outputlen = 30.

modify gt_fieldcat.

endif.

endloop.

Thanks,

Sriram Ponna.