cancel
Showing results for 
Search instead for 
Did you mean: 

col_pos in alv not do the job , why ?

Former Member
0 Kudos

i write dynamic alv and i want to set the columns order ,

so i add code like this :

READ TABLE IT_PERIOD_ZFBDT WITH KEY MONTH_BEGIN = '10' .

LS_FCAT-COL_POS = IT_PERIOD_ZFBDT-COL_POS + 3.

CONCATENATE

IT_PERIOD_ZFBDT-YEAR

'_'

IT_PERIOD_ZFBDT-MONTH_BEGIN

'_'

IT_PERIOD_ZFBDT-MONTH_END

INTO FIELD .

LS_FCAT-COLTEXT = FIELD . "

  • LS_FCAT-COLTEXT = TEXT-007 .

CLEAR LS_FCAT-REF_TABLE.

LS_FCAT-INTTYPE = 'P' .

LS_FCAT-DATATYPE = 'QUAN'.

LS_FCAT-DO_SUM = 'X'.

LS_FCAT-TABNAME = 'IT_AGENT_BLNCE'.

LS_FCAT-FIELDNAME = 'PERIOD_10_12'.

LS_FCAT-REF_FIELD = 'PERIOD_10_12'.

MODIFY IT_COLUM_HEADER FROM LS_FCAT.

---

still , the order when the report display is not the

order that i build by COL_POS

thanks .

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

thanks ,

in the end it was layout that was hold the columne position .

thanks any one .

former_member188685
Active Contributor
0 Kudos

Hi,

you might used the same col_pos more than once.

if that is the case it will not work. if you are changing one position means , you should change 2 more positions.

try to change the other two positions also,

regards

vijay

Former Member
0 Kudos

Be sure that each position no is only used once in resulting fieldcat.

athavanraja
Active Contributor
0 Kudos

the alv is displayed, and user hits a button and now you are trying to reposition the columns? if yes

if you are using cl_gui_alv_grid you have to refresh the table display.

<instance of CL_GUI_ALV_GRID>->REFRESH_TABLE_DISPLAY

Regards

Raja

hymavathi_oruganti
Active Contributor
0 Kudos

is it inside loop and endloop?