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 Bac

0 Likes
469

I want to put a tiled image as background in the header of an ALV. I'm using the function REUSE_ALV_COMMENTARY_WRITE to put a title but i_logo parameter don't give this efect.

Best Regards.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
440

Hi Jose,

Check this program for your reference.


REPORT  ZDE_EVENT_SAMPLE.
tables: vbak, vbap.
type-pools: slis.

types: begin of ty_vbak.
INCLUDE STRUCTURE VBAK.
TYPES: end of ty_vbak.


DATA : i_list_top_of_page TYPE slis_t_listheader.


data: i_vbak type table of ty_vbak.
data: w_vbak type ty_vbak.


data : i_fieldcat type slis_t_fieldcat_alv,
       w_fieldcat type slis_fieldcat_alv,
       i_event type slis_t_event.


data: w_layout TYPE slis_layout_alv.


constants: C_FORMNAME_top_OF_PAGE TYPE SLIS_FORMNAME value 'TOP_OF_PAGE'.



selection-screen begin of block b1.
select-options: cust for vbak-kunnr.
selection-screen end of block b1.



select vbeln from vbak into CORRESPONDING FIELDS OF table i_vbak where kunnr in cust.

perform fieldcat USING I_FIELDCAT.
perform layout.

PERFORM EVENT_BUILD USING I_EVENT.

perform top_of_page. "USING I_LIST_TOP_OF_PAGE.

perform display. "using backid.


form display. "using backid type IBIPPARMS-PATH.

                CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
                 EXPORTING
                   I_INTERFACE_CHECK                 = sy-repid
*                   I_BYPASSING_BUFFER                = 'X'
*                   I_BUFFER_ACTIVE                   = 'X'
                   I_CALLBACK_PROGRAM                = sy-repid
*                   I_CALLBACK_TOP_OF_PAGE            = 'DISPLAY_LOGO'
                   IS_LAYOUT                         = w_layout
                   IT_FIELDCAT                       = i_fieldcat
                   IT_EVENTS                         = i_event[]
                  TABLES
                    t_outtab                          = i_vbak[].
endform.                    " display


form layout .
  w_layout-zebra             = 'X'.
  w_layout-get_selinfos      = 'X'.
endform.                    " layout





FORM top_of_page.
data: w_LIST_TOP_OF_PAGE type slis_listheader.
clear I_LIST_TOP_OF_PAGE.
w_LIST_TOP_OF_PAGE-typ = 'H'.
w_LIST_TOP_OF_PAGE-info = text-002.
append w_LIST_TOP_OF_PAGE to I_LIST_TOP_OF_PAGE.
  CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
    EXPORTING
      it_list_commentary = i_list_top_of_page
      i_logo             = 'ENJOYLOGO'
      i_alv_form         = 'X'.

ENDFORM.                    "DISPLAY_LOGO


*&---------------------------------------------------------------------*
*&      Form  fieldcat
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  -->  p1        text
*  <--  p2        text
*----------------------------------------------------------------------*
form fieldcat USING I_FIELDCAT TYPE slis_t_fieldcat_alv.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
 EXPORTING
   I_PROGRAM_NAME               = sy-repid
   I_INTERNAL_TABNAME           = 'I_VBAK'
   I_STRUCTURE_NAME             = 'VBAK'
  CHANGING
    ct_fieldcat                  = i_fieldcat.

endform.                    " fieldcat
*&---------------------------------------------------------------------*
*&      Form  EVENT_BUILD
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*      -->P_I_EVENT  text
*----------------------------------------------------------------------*
form EVENT_BUILD using p_i_event TYPE SLIS_T_EVENT.
DATA: ls_event TYPE slis_alv_event.


CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
 EXPORTING
   I_LIST_TYPE           = 4
 IMPORTING
   ET_EVENTS             = P_I_EVENT
          .
  READ TABLE p_I_event WITH KEY name = slis_ev_top_of_page INTO ls_event.

  IF sy-subrc = 0.
    MOVE c_formname_top_of_page TO ls_event-form.

    APPEND ls_event TO I_event.
  ENDIF.

endform.                    " EVENT_BUILD

Reward points if useful.

Cheers,

Swamy Kunche

3 REPLIES 3
Read only

Former Member
0 Likes
441

Hi Jose,

Check this program for your reference.


REPORT  ZDE_EVENT_SAMPLE.
tables: vbak, vbap.
type-pools: slis.

types: begin of ty_vbak.
INCLUDE STRUCTURE VBAK.
TYPES: end of ty_vbak.


DATA : i_list_top_of_page TYPE slis_t_listheader.


data: i_vbak type table of ty_vbak.
data: w_vbak type ty_vbak.


data : i_fieldcat type slis_t_fieldcat_alv,
       w_fieldcat type slis_fieldcat_alv,
       i_event type slis_t_event.


data: w_layout TYPE slis_layout_alv.


constants: C_FORMNAME_top_OF_PAGE TYPE SLIS_FORMNAME value 'TOP_OF_PAGE'.



selection-screen begin of block b1.
select-options: cust for vbak-kunnr.
selection-screen end of block b1.



select vbeln from vbak into CORRESPONDING FIELDS OF table i_vbak where kunnr in cust.

perform fieldcat USING I_FIELDCAT.
perform layout.

PERFORM EVENT_BUILD USING I_EVENT.

perform top_of_page. "USING I_LIST_TOP_OF_PAGE.

perform display. "using backid.


form display. "using backid type IBIPPARMS-PATH.

                CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
                 EXPORTING
                   I_INTERFACE_CHECK                 = sy-repid
*                   I_BYPASSING_BUFFER                = 'X'
*                   I_BUFFER_ACTIVE                   = 'X'
                   I_CALLBACK_PROGRAM                = sy-repid
*                   I_CALLBACK_TOP_OF_PAGE            = 'DISPLAY_LOGO'
                   IS_LAYOUT                         = w_layout
                   IT_FIELDCAT                       = i_fieldcat
                   IT_EVENTS                         = i_event[]
                  TABLES
                    t_outtab                          = i_vbak[].
endform.                    " display


form layout .
  w_layout-zebra             = 'X'.
  w_layout-get_selinfos      = 'X'.
endform.                    " layout





FORM top_of_page.
data: w_LIST_TOP_OF_PAGE type slis_listheader.
clear I_LIST_TOP_OF_PAGE.
w_LIST_TOP_OF_PAGE-typ = 'H'.
w_LIST_TOP_OF_PAGE-info = text-002.
append w_LIST_TOP_OF_PAGE to I_LIST_TOP_OF_PAGE.
  CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
    EXPORTING
      it_list_commentary = i_list_top_of_page
      i_logo             = 'ENJOYLOGO'
      i_alv_form         = 'X'.

ENDFORM.                    "DISPLAY_LOGO


*&---------------------------------------------------------------------*
*&      Form  fieldcat
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  -->  p1        text
*  <--  p2        text
*----------------------------------------------------------------------*
form fieldcat USING I_FIELDCAT TYPE slis_t_fieldcat_alv.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
 EXPORTING
   I_PROGRAM_NAME               = sy-repid
   I_INTERNAL_TABNAME           = 'I_VBAK'
   I_STRUCTURE_NAME             = 'VBAK'
  CHANGING
    ct_fieldcat                  = i_fieldcat.

endform.                    " fieldcat
*&---------------------------------------------------------------------*
*&      Form  EVENT_BUILD
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*      -->P_I_EVENT  text
*----------------------------------------------------------------------*
form EVENT_BUILD using p_i_event TYPE SLIS_T_EVENT.
DATA: ls_event TYPE slis_alv_event.


CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
 EXPORTING
   I_LIST_TYPE           = 4
 IMPORTING
   ET_EVENTS             = P_I_EVENT
          .
  READ TABLE p_I_event WITH KEY name = slis_ev_top_of_page INTO ls_event.

  IF sy-subrc = 0.
    MOVE c_formname_top_of_page TO ls_event-form.

    APPEND ls_event TO I_event.
  ENDIF.

endform.                    " EVENT_BUILD

Reward points if useful.

Cheers,

Swamy Kunche

Read only

Former Member
0 Likes
440

Hi Jose,

Before using the function module you should do a small configuration in OAER i.e, goto OAER and give class name = PICTURES and class type as OT and execute and select the logo you wanted and double click it. It will display in the below block, check it.

And then use it in the program. But some times you may even face the problem because of some problem in the image.

Then Use,

FORM display_logo. "#EC CALLED

CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'

EXPORTING

it_list_commentary = i_list_top_of_page

i_logo = 'SAPLOGO_DEMO1' " Logo name

i_alv_form = 'X'.

ENDFORM. "DISPLAY_LOGO

Reward points if helpful.

Thanks,

Khan.

Read only

Former Member
0 Likes
440

Hi,

did you upload your Image In OAER transaction.?

If not, first upload your image in OAER transaction.

Then only ALV recognizes that Image.

Regards

Sandeep REddy