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: 

Ordering columns in an ALV list

Former Member
0 Kudos

Hi ,

I am trying to make a particular column e.g. PERSA (Business Unit) in the following order in the ALV list but i still get it as the 1st column.

I have ordered it as such in the output table :

*--- Structure of output table

DATA: BEGIN OF outtab OCCURS 100, "N747328

pernr(8) TYPE c, "Pers.No File#

dt_sort(8) type n,

aedtm(12) TYPE c, "Action Date

mgtxt LIKE t530t-mgtxt, "Action reason(text)

persa LIKE t500p-persa, "Business Unit plstx_n LIKE t528t-plstx, "Position Title (text)

ansal(12) type c, "Annual Salary

betrg(7) type c, "Hrly rate*

END OF outtab.

I have even tried using col_pos in the fieldcatalog but it doesn't work.

when 'PERSA'.

ls_alv_field_catalog-ddictxt = 'M'.

ls_alv_field_catalog-seltext_m = 'Business Unit' .

ls_alv_field_catalog-col_pos = '3'.

The interesting thing is persa represents the code of business unit e.g.ETIT whereas earlier i had in the list t500p-name1 which is the description of the business unit. like Information Technology.When i had t500p-name1 i had no issues with the positioning. I don't think that matters.

Kindly suggest.Thanks in advance.

4 REPLIES 4

Former Member
0 Kudos

Comment the below statement for column PERSA [if you have it in your code].

ls_alv_field_catalog-KEY = 'X'.

also paste the code you've written for field catalog...

0 Kudos

No i don't have this setting.

0 Kudos

Paste the code you have for building field catalog.

0 Kudos

There was no ls_alv_field_catalog-KEY = 'X' bit of code but i added ls_alv_field_catalog-KEY = '' and it solved the problem. Thanks.