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: 

Is it possible to add top-of-page in internal table & process it to report ?

vinayad
Participant
0 Kudos

Let me know if it is possible other than, FM reuse_alv_grid_display

Code is like this,

METHOD set_column_names.
DATA ld_line TYPE REF TO data.

FIELD-SYMBOLS <fs_column_name> TYPE ANY.
FIELD-SYMBOLS <fv_name> TYPE ANY.
FIELD-SYMBOLS <fv_text_short> TYPE ANY.
FIELD-SYMBOLS <fv_text_medium> TYPE ANY.
FIELD-SYMBOLS <fv_text_long> TYPE ANY.
FIELD-SYMBOLS <fv_hide> TYPE ANY.

CREATE DATA ld_line LIKE LINE OF ct_table.
ASSIGN ld_line->* TO <fs_column_name>.

ASSIGN COMPONENT 'NAME' OF STRUCTURE <fs_column_name>
TO <fv_name>.
ASSIGN COMPONENT 'TEXT_SHORT' OF STRUCTURE <fs_column_name>
TO <fv_text_short>.
ASSIGN COMPONENT 'TEXT_MEDIUM' OF STRUCTURE <fs_column_name>
TO <fv_text_medium>.
ASSIGN COMPONENT 'TEXT_LONG' OF STRUCTURE <fs_column_name>
TO <fv_text_long>.

* ASSIGN COMPONENT 'HEAD' OF STRUCTURE <fs_header_name>
* TO <fv_head>.
*
* <fv_head> = 'SUMMARY'. (I want to add this on top of table)
* APPEND <fs_header_name> TO ct_table.

<fv_name> = 'COUNT'.
<fv_text_short> = 'Count'(c03).
<fv_text_medium> = 'Count'(c03).
<fv_text_long> = 'Count'(c03).

APPEND <fs_column_name> TO ct_table.

-

Any help would be appreciated!!

4 REPLIES 4

Sandra_Rossi
Active Contributor
0 Kudos

Do you ask "how to display a text above the table which is fixed whatever the table is scrolled"? Do you want the table uses the ALV Grid Control or uses the ABAP List? Without using reuse_alv_grid_display, do you want to use a class instead?

DoanManhQuynh
Active Contributor

internal table don't have top-of-page. you should read more about ALV (SAP List Viewer) because there are a lot of sample how to create top-of-page for ALV out there. if what you want is column header text then put it in ALV field catalog, not in the internal table you use to display data.

vinayad
Participant
0 Kudos

sandra.rossi
Thanks for your response!


Yes fixed value need to display, without using grid is it possible to display header ?

Jelena
Active Contributor

"Top of page" concept only exists in ALV and in ABAP List. Hence to the part "add top-of-page in internal table" part the answer is "not feasible" simply because there is no such concept in the internal table context.

The part "process it to report" I'm unable to understand at all, so can't answer anything.

Based on the shared code fragment, it appears you are trying to stuff some kind of a header record into an internal table. But because an internal table, just like a database table, consists of specific fields then the "header" also has to comply with the field structure.

If you want to combine completely different records in the same internal table (why?) then obviously the records can only be of some generic string or raw type, similar to how IDoc data is stored.

Please see this blog for suggestions on asking better questions to get better answers and, going forward, use the right terminology to avoid confusion.