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: 

upload graphics in to Report prog

Former Member
0 Kudos
155

Dear all,

Any can help me,How to upload graphics in my report programme.

Thanks,

Venkat

5 REPLIES 5

dani_mn
Active Contributor
0 Kudos
73

you can create a screen and use custom_container to add a graphics and also include your selection screen in that screen.

For upload graphic into system use tcode : SMW0

Code for display Graphics.

DATA query_table LIKE w3query OCCURS 1 WITH HEADER LINE.

DATA html_table LIKE w3html OCCURS 1.

DATA return_code LIKE w3param-ret_code.

DATA content_type LIKE w3param-cont_type.

DATA content_length LIKE w3param-cont_len.

DATA pic_data LIKE w3mime OCCURS 0.

DATA pic_size TYPE i.

IF container is initial.

CREATE OBJECT container

EXPORTING container_name = 'CUSTOM_CONTAINER'.

CREATE OBJECT picture

EXPORTING parent = container

EXCEPTIONS error = 1.

IF sy-subrc ne 0.

ENDIF.

ENDIF.

REFRESH query_table.

query_table-name = '_OBJECT_ID'.

query_table-value = 'ZDAT_TRANSFER'.

APPEND query_table.

CALL FUNCTION 'WWW_GET_MIME_OBJECT'

TABLES

query_string = query_table

html = html_table

mime = pic_data

CHANGING

return_code = return_code

content_type = content_type

content_length = content_length

EXCEPTIONS

OBJECT_NOT_FOUND = 1

parameter_not_found = 2

OTHERS = 3.

IF sy-subrc = 0.

pic_size = content_length.

ENDIF.

CALL FUNCTION 'DP_CREATE_URL'

EXPORTING

type = 'image'

subtype = cndp_sap_tab_unknown

size = pic_size

lifetime = cndp_lifetime_transaction

TABLES

data = pic_data

CHANGING

url = url

EXCEPTIONS

OTHERS = 1.

CALL METHOD picture->load_picture_from_url

EXPORTING url = url.

IF sy-subrc ne 0.

  • Fehlerbehandlung

ENDIF

Regards

Wasim Ahmed.

Former Member
0 Kudos
73

If you are using OO Approach , definitely possible. Few days back there was a similar post where Durairaj Athavan Raja has shared a code , how to use CL_GUI_PICTURE and a docking container to show pictures.

Take a look at this post:

or for alv..

poosible to insert graphic in ALV header using the following...

FORM TOP_OF_PAGE : This form will contain the top of page event for the report i.e header etc

Using the function module ‘REUSE_ALV_COMMENTARY_WRITE’, the internal table containing the headings for top of page event can be passed to the list output. Also, any logo specific to the report can be passed to the function module.

DATA: i_list_top_of_page TYPE slis_t_listheader.

CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'

EXPORTING

i_logo = 'ENJOYSAP_LOGO'

it_list_commentary = i_list_top_of_page.

You hav to fill i_list_top_of_page

Former Member
0 Kudos
73

Hi venkat,

See the Standard Report for graphics,

<b>REKH0004 --> </b> SAP demo program that shows how to do 2D, 3D, and 4D graphics.

Thanks

Sudheer

Former Member
0 Kudos
73

HI

GOOD

I DONT THINK IT IS POSSIBLE TO UPLOAD GRAPHICS INTO A REPORT PROGRAM,YES IT IS POSSIBLE IN THE ALV REPORT.

THANKS

MRUTYUN

former_member188685
Active Contributor
0 Kudos
73

Hi,

you can upload the images using OAER transaction.

these are the steps...

run it,

in the selection screen

Class name PICTURES

Class Type OT

Object key IMAGENAME

Objectname can be the name which you going to the store JPEG image.

then Run it.

and there you can see two screens from the Down screen choose the document type SCREEN, now right click on it ,and then press on IMPORT.

and choose correct file and say ok, JPEG file will be stored in IMAGENAME.

and once you upload you can show that image in the report using ALV. you have to use ALV then only you can show the images. to show the image you have to call this FM <b>REUSE_ALV_COMMENTARY_WRITE</b>


  CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
       EXPORTING
            I_LOGO             = 'IMAGENAME'
            IT_LIST_COMMENTARY = GT_LIST_TOP_OF_PAGE.

Regards

vijay