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 header

roberto_falk
Product and Topic Expert
Product and Topic Expert
0 Likes
1,315

Hello All

I need to show in a screen 3 alvs and some information. I have an example that shows the information exactly the way that I need, but in this example, just one alv is showed, and I need to show 3 alvs.

Someone know some way to do that? I could show the information as a header of the first alv, but I don't know how to do that or if this is a good idea...

Thanks a lot your help.

Roberto Falk

1 ACCEPTED SOLUTION
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
1,286

Hi robert, please have a look at this weblog which explains what needs to be done in order to put a header on your alv grid, which if you may notice, is not really putting a header on the ALV grid, but simply using another container and putting a document within it.

/people/vijaybabu.dudla/blog/2006/07/21/topofpage-in-alv-using-clguialvgrid

Regards,

Rich Heilman

12 REPLIES 12
Read only

Former Member
0 Likes
1,286

Hi,

You can create BLOCK alv by using the fm REUSE_ALV_BLOCK_LIST_APPEND to have multiple alvs..

Check this link for a sample program

https://wiki.sdn.sap.com/wiki/display/Snippets/ABAP-ProgramforALVBlocklist

Thanks

Naren

Read only

Former Member
0 Likes
1,286

Hi,

u can go through this and try to make the best of it.

REPORT zr_ara01_query NO STANDARD PAGE HEADING LINE-SIZE 250

MESSAGE-ID 38.

TABLES: sflight.

TYPE-POOLS: slis.

TYPES: BEGIN OF header,

datum TYPE sy-datum,

name(30) TYPE C,

text(30) TYPE C,

END OF header.

DATA: itab_header TYPE STANDARD TABLE OF header,

gwa_header TYPE header.

DATA: itab TYPE STANDARD TABLE OF sflight,

gwa_itab TYPE sflight.

DATA : alv_fc TYPE slis_t_fieldcat_alv.

DATA : alv_ly TYPE slis_layout_alv.

*Screen Display ++++++++++++++++++++++++++++++++++++

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE title_01.

SELECT-OPTIONS: carrid FOR sflight-carrid,

connid FOR sflight-connid,

fldate FOR sflight-fldate,

price FOR sflight-price.

SELECTION-SCREEN END OF BLOCK b1.

*End of Selection screen +++++++++++++++++++++++++++++++++

INITIALIZATION.

title_01 = 'Customer daten'.

*Selection +++++++++++++++++++++++++++++++++++++++++++++

START-OF-SELECTION.

  • LOOP AT itab_header INTO gwa_header.

gwa_header-datum = sy-datum.

gwa_header-name = 'My name'.

gwa_header-text = 'ALV header test'.

APPEND gwa_header TO itab_header.

  • ENDLOOP.

SELECT * FROM sflight

INTO CORRESPONDING FIELDS OF gwa_itab

WHERE carrid IN carrid AND

connid IN connid AND

fldate IN fldate AND

price IN price.

ENDSELECT.

APPEND gwa_itab TO itab.

IF sy-subrc NE 0.

MESSAGE i100 WITH 'Keine Datensatz gefunden'.

ENDIF.

*

PERFORM top_of_page.

PERFORM ausgabe.

END-OF-SELECTION.

*END-OF-SELECTION. +++++++++++++++++++++++++++++++++++++++

----


  • FORM Ausgabe *

----


  • ........ *

----


FORM ausgabe.

DATA: repid TYPE sy-repid.

repid = sy-repid.

----


CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'

EXPORTING

i_program_name = repid

i_internal_tabname = 'ITAB'

i_inclname = repid

CHANGING

ct_fieldcat = alv_fc

EXCEPTIONS

inconsistent_interface = 1

program_error = 2

OTHERS = 3.

*----


Displaying the Data

  • alv_ly-box_fieldname = 'FLAG'.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

i_grid_title = 'Sflight Query'

i_structure_name = 'SFLIGHT'

it_fieldcat = alv_fc

i_callback_program = repid

i_callback_top_of_page = 'TOP_OF_PAGE'

i_callback_user_command = 'ITAB_USER_COMMAND'

is_layout = alv_ly

i_save = 'X'

TABLES

t_outtab = itab

EXCEPTIONS

program_error = 1

OTHERS = 2.

ENDFORM.

----


  • FORM top_of_page *

----


  • ........ *

----


FORM top_of_page.

DATA: t_header TYPE slis_t_listheader,

lwa_header TYPE slis_listheader,

day(2) TYPE c,

month(2) TYPE c,

year(4) TYPE c.

CLEAR: t_header, lwa_header.

day = sy-datum+6(2).

month = sy-datum+4(2).

year = sy-datum+0(4).

lwa_header-typ = 'H'.

CONCATENATE 'Date:' ' ' day '.' month '.' year INTO lwa_header-info .

APPEND lwa_header TO t_header.

CLEAR lwa_header.

lwa_header-typ = 'H'.

lwa_header-info = gwa_header-name.

APPEND lwa_header TO t_header.

CLEAR lwa_header.

lwa_header-typ = 'H'.

lwa_header-info = gwa_header-text.

APPEND lwa_header TO t_header.

CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'

EXPORTING

it_list_commentary = t_header.

ENDFORM.

Give points if and mark answered if your question is answered!!

Blacky

Read only

roberto_falk
Product and Topic Expert
Product and Topic Expert
0 Likes
1,286

Hello BlackMoses,

This example is almost what I need, but, I need to use another 2 alvs in the same dynpro... I don't know if I can create this alv not using the full screen mode. I've take a printscreen of my page to try to exemplify my problem.

link: http://roberto.falk.googlepages.com/alvs or http://roberto.falk.googlepages.com/3alv.JPG

Thanks all the help.

Roberto Falk

Read only

former_member194669
Active Contributor
0 Likes
1,286

Hi,

You can do it thru using class cl_gui_docking_container and cl_gui_textedit.

aRs

Read only

Former Member
Read only

roberto_falk
Product and Topic Expert
Product and Topic Expert
0 Likes
1,286

Yes, I could use this alv, but I need to put more 2 alvs without header in the same dynpro (screen) is this possible?

Thanks

Roberto Falk

Read only

roberto_falk
Product and Topic Expert
Product and Topic Expert
0 Likes
1,286

Which is the alv class that alow you to put that header?

Thanks

Roberto Falk

Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
1,287

Hi robert, please have a look at this weblog which explains what needs to be done in order to put a header on your alv grid, which if you may notice, is not really putting a header on the ALV grid, but simply using another container and putting a document within it.

/people/vijaybabu.dudla/blog/2006/07/21/topofpage-in-alv-using-clguialvgrid

Regards,

Rich Heilman

Read only

roberto_falk
Product and Topic Expert
Product and Topic Expert
0 Likes
1,286

What is a document? D you have an example of it?

Thanks your help.

Roberto Falk

Read only

0 Likes
1,286

Read the blog man.

Regards,

Rich Heilman

Read only

roberto_falk
Product and Topic Expert
Product and Topic Expert
0 Likes
1,286

I'm reading... I wrote the post before start to read it... sorry.

Thanks your help (and patience ;o))

Roberto Falk

Read only

roberto_falk
Product and Topic Expert
Product and Topic Expert
0 Likes
1,286

Thanks a lot, I'm gonna work with it now.

Thanks everybody.

Roberto Falk