cancel
Showing results for 
Search instead for 
Did you mean: 

how to upload logo in alv

Former Member
0 Kudos

Hello,

i'm an abap trainee. could anybody tell me how to upload the logo from presentation layer to application server and make available of this logo to the program when doing it with the function module . iknow the function module used is reuse_alv_commentary_write.

thanks

Accepted Solutions (1)

Accepted Solutions (1)

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

Upload via SE78. Check out this example program for adding the logo to the top of your ALV grid.



REPORT ZRICH_0002
       NO STANDARD PAGE HEADING.

* Global ALV Data Declarations
TYPE-POOLS SLIS.

DATA: BEGIN OF I_ALV OCCURS 0,
      FLD1 type c,
      END OF I_ALV.


* Miscellanous Data Declarations
DATA: FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
      EVENTS   TYPE SLIS_T_EVENT,
      LIST_TOP_OF_PAGE TYPE SLIS_T_LISTHEADER,
      TOP_OF_PAGE  TYPE SLIS_FORMNAME VALUE 'TOP_OF_PAGE'.

SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
PARAMETERS: P_check type c.
SELECTION-SCREEN END OF BLOCK B1.


START-OF-SELECTION.

  PERFORM INITIALIZATION.

  PERFORM CALL_ALV.

END-OF-SELECTION.

************************************************************************
*  Form  Initialization
************************************************************************
FORM INITIALIZATION.

  CLEAR I_ALV.       REFRESH I_ALV.

  PERFORM EVENTTAB_BUILD USING EVENTS[].

ENDFORM.

************************************************************************
*  CALL_ALV
************************************************************************
FORM CALL_ALV.

data: repid type sy-repid.

repid = sy-repid.

  PERFORM BUILD_FIELD_CATALOG.

  PERFORM COMMENT_BUILD USING LIST_TOP_OF_PAGE[].

* Call ABAP List Viewer (ALV)
  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
            IT_FIELDCAT        = FIELDCAT
            I_CALLBACK_PROGRAM = REPID
            IT_EVENTS          = EVENTS[]
            I_SAVE             = 'U'
       TABLES
            T_OUTTAB           = I_ALV.

ENDFORM.

************************************************************************
* EVENTTAB_BUILD
************************************************************************
FORM EVENTTAB_BUILD USING EVENTS TYPE SLIS_T_EVENT.

* Registration of events to happen during list display
  DATA: TMP_EVENT TYPE SLIS_ALV_EVENT.

  CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
       EXPORTING
            I_LIST_TYPE = 0
       IMPORTING
            ET_EVENTS   = EVENTS.
  READ TABLE EVENTS WITH KEY NAME = SLIS_EV_TOP_OF_PAGE
                           INTO TMP_EVENT.
  IF SY-SUBRC = 0.
    MOVE TOP_OF_PAGE TO TMP_EVENT-FORM.
    APPEND TMP_EVENT TO EVENTS.
  ENDIF.

ENDFORM.

************************************************************************
* BUILD_FIELD_CATALOG
************************************************************************
FORM BUILD_FIELD_CATALOG.

  DATA: TMP_FC TYPE SLIS_FIELDCAT_ALV.

  CLEAR: FIELDCAT. REFRESH: FIELDCAT.


  TMP_FC-REPTEXT_DDIC = 'Field1'.
  TMP_FC-FIELDNAME    = 'FLD1'.
  TMP_FC-TABNAME      = 'I_ALV'.
  TMP_FC-OUTPUTLEN    = 10.
  APPEND TMP_FC TO FIELDCAT.

ENDFORM.


************************************************************************
* COMMENT_BUILD
************************************************************************
FORM COMMENT_BUILD USING LIST_TOP_OF_PAGE TYPE
                                        SLIS_T_LISTHEADER.
  DATA: TMP_LINE TYPE SLIS_LISTHEADER.

  CLEAR TMP_LINE.
  TMP_LINE-TYP  = 'H'.
  TMP_LINE-INFO = 'Test'.
  APPEND TMP_LINE TO LIST_TOP_OF_PAGE.

ENDFORM.


************************************************************************
* TOP_OF_PAGE
************************************************************************
FORM TOP_OF_PAGE.

  CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
       EXPORTING
            I_LOGO             = 'ENJOYSAP_LOGO'
            IT_LIST_COMMENTARY = LIST_TOP_OF_PAGE.

ENDFORM.

Regards,

Rich Heilman

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

See this

  call function 'REUSE_ALV_COMMENTARY_WRITE'
       exporting
            it_list_commentary = t_header.
            i_logo             = 'Z_LOGO'.
endform.

Can see this link

http://www.sapdevelopment.co.uk/reporting/alv/alvgrid_enhanced.htm

Upload Logo for REUSE_ALV_COMMENTARY_WRITE

For those who wish to upload and use a picture in your ALV abap reports.

Steps for uploading Logo :-:

1. Goto the transaction OAER

2. Enter the class name as 'PICTURES'

3. Enter the class type as 'OT'

4. Enter the object key as the name of the logo you wish to give

5. Execute

6. Then in the new screen select Standard doc. types in bottom window

Click on the Screen icon

Now, it will ask for the file path where you have to upload the logo

7. Now you can use this logo in REUSE_ALV_COMMENTARY_WRITE

or

Import Logo and Background Picture for Reporting

In this step, you can import a customer-specific logo and a background picture into the R/3 System. These will be displayed in the header area of reports in HR Funds and Position Management.

From the SPRO:

HR Funds and Position Management --> Dialog Control --> Customize Reporting Interface --> Import Logo and Background Picture for Reporting.

Activities

1. Enter the Name of your logo/background picture as an object key in the initial screen.

2. Make sure that the class name is PICTURES, and the class type is OT.

3. Choose Execute.

4. Double-click the document type Picture on the Create tab page. A dialog box will appear in which you can enter the path in which the logo/background picture can be found.

5. Enter the path and choose Open. The logo will be uploaded into the current R/3 System. If the logo/background picture is to be transported into other systems as well, choose Transport.

6. Return to the initial screen and repeat the procedure after having entered the Name of your background picture as an object key.

Please note that the logo/background picture can only be displayed in ALV-based reports with an HTML header. Manually programmed reports such as business distribution plans are not based on the ALV.

If you have selected several initial objects, ALV-based reports in HR Funds and Position Management will automatically use a hiearchical-sequential display. A logo is not displayed here either. Note also that the logo cannot be printed (see print preview in program).

Make sure that the logo does not exceed a height of 100 pixels because it would mean that the header of the report will be scrollable.

Hope this helps.

Kindly reward points and close the thread if ur problem got solved.

andreas_mann3
Active Contributor
0 Kudos

Hi,

look here:

Andreas

Former Member
0 Kudos

Hi,

Check th link,

<u>http://www.sap-img.com/fu002.htm

http://www.sap-img.com/abap/alv-logo.htm</u>;

<u>http://www.sapdevelopment.co.uk/reporting/alv/alvgrid_rephead.htm</u>

hope it helps u.

Thanks&Regards,

Ruthra.R