2006 Mar 08 5:29 PM
Hello,
I am using an ALV grid to display inventory movement. Everything is working correctly, I just need to be able to display the columns in a different order than is currently display on the ALV. I have the internal table in the order that I want the information to be displayed, but it is not coming out that way. Any advice would be greatly appreciated.
Regards
2006 Mar 08 5:32 PM
Danielle,
The order of the fields is controlled by the fieldcatalog that gets built for the ALV. There should be a column position field that can be updated.
Either that or the user can change the layout themselves once in the Grid using the layout functions available.
Chris
Hello,
I am using an ALV grid to display inventory movement. Everything is working correctly, I just need to be able to display the columns in a different order than is currently display on the ALV. I have the internal table in the order that I want the information to be displayed, but it is not coming out that way. Any advice would be greatly appreciated.
Regards
2006 Mar 08 5:31 PM
2006 Mar 08 5:32 PM
2006 Mar 08 5:32 PM
Danielle,
The order of the fields is controlled by the fieldcatalog that gets built for the ALV. There should be a column position field that can be updated.
Either that or the user can change the layout themselves once in the Grid using the layout functions available.
Chris
2006 Mar 08 5:34 PM
Hi
The order of colunm depends of the position it's setted in catalog table.
You can change it updating the value of field col_pos of structure IT_FIELDCAT.
Fm REUSE_ALV_FIELDCATALOG_MERGE is usually used to build catalog table, you should have a code like this:
gt_repid = sy-repid.
call function 'REUSE_ALV_FIELDCATALOG_MERGE'
exporting
i_program_name = gt_repid
i_internal_tabname = 'T_OUTPUT'
i_inclname = gt_repid
changing
ct_fieldcat = gt_fieldcat[].
This fm results a catalog table where the colunms have the same order as internal table is defined.
So if you need change positions you can use a code like this:
loop at gt_fieldcat into ls_fieldcat.
case ls_fieldcat-fieldname.
when '......'. ls_fieldcat-col_pos = <pos>.
.............
endcase.
modify gt_fieldcat from ls_fieldcat.
endloop.
Max
P.s.: Have you solved your problem of yesterday?
2006 Mar 08 6:00 PM
Hi,
You can build your Field catalog as per your requirement.
Check the below code.
Data : WA_FLDCAT TYPE LVC_S_FCAT,
LT_FLDCAT TYPE LVC_T_FCAT.
WA_FLDCAT-COL_POS = '1'. <column position>
WA_FLDCAT-FIELDNAME = 'FINANCIER_ID'. <field name in the Internal table>
WA_FLDCAT-REF_TABLE = <Database Table Name>.
WA_FLDCAT-REF_FIELD = 'FINANCIER_ID'. <Field Name in Database>
WA_FLDCAT-TABNAME = 'LT_FINANCIER'. <Internal Table Name>
WA_FLDCAT-OUTPUTLEN = '20'. <output lenght>
WA_FLDCAT-NO_OUT = SPACE.
WA_FLDCAT-EDIT = 'X'. <to make field editable>
WA_FLDCAT-SCRTEXT_M = 'Financier ID'(006). <Header text>
WA_FLDCAT-F4AVAILABL = '1'. <to activate F4 help>
WA_FLDCAT-CHECKTABLE = '/ILAP/TRN_CLOSE'. <check table>
APPEND WA_FLDCAT TO LT_FLDCAT01.
CLEAR WA_FLDCAT.
Based on your requirement you can assign different column numbers to different fields in your internal table.
Regards,
Vara
2006 Mar 08 6:04 PM
hi,
i hope you are using the fm to populate the fieldcat.
in that case you need to modify the col_pos.
read the it_fieldcat with fieldname and modify the col_pos.
regards
vijay
2006 Mar 08 6:13 PM
Thanks for all your advice. I did have everything set up correctly and after a few debugging sessions, it was displaying the way the fields are set up in the ITAB. So everything is fine now.
Thanks again!
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |