Application Development and Automation 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: 
Read only

ALV Simple Tree

Former Member
0 Likes
318

Hi guys im using an ALV Simple tree to display the contents of an internal table that has its type declared in the program.

My problem is that the ALV tree cannot set up column headers properly. I get nothing instead of the column names.

I have built a field catalog manually but this does not help.

DATA catalog_row TYPE lvc_s_fcat.

catalog_row-row_pos = 0.

catalog_row-col_pos = 1.

catalog_row-fieldname = 'ID'.

catalog_row-tabname = 1.

APPEND catalog_row TO gt_fieldcatalog.

CLEAR catalog_row.

catalog_row-row_pos = 0.

catalog_row-col_pos = 2.

catalog_row-fieldname = 'MESSAGE'.

catalog_row-tabname = 1.

How do I manually set the column headers???

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
272

Hello James,

U can use this code

DATA: GT_HEADER TYPE TABLE OF SLIS_LISTHEADER WITH HEADER LINE,

CLEAR GT_HEADER.

GT_HEADER-TYP = 'H'.

GT_HEADER-INFO = TEXT-007.

APPEND GT_HEADER.

CLEAR GT_HEADER.

GT_HEADER-TYP = 'S'.

GT_HEADER-KEY = TEXT-008.

GT_HEADER-INFO = TEXT-009.

APPEND GT_HEADER.

CALL METHOD TREE1->SET_TABLE_FOR_FIRST_DISPLAY

EXPORTING

IT_LIST_COMMENTARY = GT_HEADER[]

I_BACKGROUND_ID = 'ALV_BACKGROUND'

IS_LAYOUT = GS_LAYOUT_TREE

CHANGING

IT_SORT = GT_SORT[]

IT_OUTTAB = IT_TREE_TAB[]

IT_FIELDCATALOG = GT_FIELDCAT_LVC[].

If useful reward the points.

Regards,

vasanth

1 REPLY 1
Read only

Former Member
0 Likes
273

Hello James,

U can use this code

DATA: GT_HEADER TYPE TABLE OF SLIS_LISTHEADER WITH HEADER LINE,

CLEAR GT_HEADER.

GT_HEADER-TYP = 'H'.

GT_HEADER-INFO = TEXT-007.

APPEND GT_HEADER.

CLEAR GT_HEADER.

GT_HEADER-TYP = 'S'.

GT_HEADER-KEY = TEXT-008.

GT_HEADER-INFO = TEXT-009.

APPEND GT_HEADER.

CALL METHOD TREE1->SET_TABLE_FOR_FIRST_DISPLAY

EXPORTING

IT_LIST_COMMENTARY = GT_HEADER[]

I_BACKGROUND_ID = 'ALV_BACKGROUND'

IS_LAYOUT = GS_LAYOUT_TREE

CHANGING

IT_SORT = GT_SORT[]

IT_OUTTAB = IT_TREE_TAB[]

IT_FIELDCATALOG = GT_FIELDCAT_LVC[].

If useful reward the points.

Regards,

vasanth