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: 

How to keep hotspot on a diagram ?

Former Member
0 Kudos

Hi,

I am having an interactive report where in my basic list i kept a clipart(diagram which is been uploaded by Txcode - smw0) my requirement is when i am double clicking on that clipart(diagram) i have to get the secondary list pretaining to that diagram.

Helpful answers will be rewared for sure. Its urgent task please help me to achieve this.

Thks

3 REPLIES 3

Former Member
0 Kudos

Register event PICTURE_DBLCLICK of class cl_gui_picture. Whenever a doubleclick happens on the picture, control is returned to your program. You can then show the secondary list.

0 Kudos

Hello Keerthi,

Thks for the answer but i am not having any concept i mean i am totally new to the OO-ABAP concept.

I got one code just copy and exceute the code......

  • START OF DO NOT CHANGE----------------------------------*

DATA: docking TYPE REF TO cl_gui_docking_container,

picture_control_1 TYPE REF TO cl_gui_picture,

url(256) TYPE c .

DATA: query_table LIKE w3query OCCURS 1 WITH HEADER LINE,

html_table LIKE w3html OCCURS 1,

return_code LIKE w3param-ret_code,

content_type LIKE w3param-cont_type,

content_length LIKE w3param-cont_len,

pic_data LIKE w3mime OCCURS 0,

pic_size TYPE i.

TABLES: SPFLI.

DATA ITAB LIKE SPFLI OCCURS 0 WITH HEADER LINE.

SELECT SINGLE * FROM SPFLI INTO ITAB.

FORMAT HOTSPOT ON.

SKIP 9.

FORMAT COLOR 7.

WRITE:/25 ITAB-CONNID.

FORMAT HOTSPOT OFF.

AT SELECTION-SCREEN OUTPUT.

  • PERFORM show_pic.

START-OF-SELECTION.

PERFORM show_pic.

*&----


*& Form show_pic

*&----


FORM show_pic.

DATA: repid LIKE sy-repid.

repid = sy-repid.

CREATE OBJECT picture_control_1 EXPORTING parent = docking.

CHECK sy-subrc = 0.

CALL METHOD picture_control_1->set_3d_border

EXPORTING

border = 5.

CALL METHOD picture_control_1->set_display_mode

EXPORTING

display_mode = cl_gui_picture=>display_mode_stretch.

CALL METHOD picture_control_1->set_position

EXPORTING

height = 50

left = 40

top = 50

width = 190.

CHANGE POSITION AND SIZE ABOVE****************

IF url IS INITIAL.

REFRESH query_table.

query_table-name = '_OBJECT_ID'.

*CHANGE IMAGE NAME BELOW UPLOADED ******************

query_table-value = 'ENJOYSAP_LOGO'.

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.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

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.

ENDIF.

CALL METHOD picture_control_1->load_picture_from_url

EXPORTING

url = url.

*Syntax for URL

*url = 'file://D:\corp-gbanerji\pickut\cartoon_184.gif'.

*url = 'http://l.yimg.com/a/i/ww/beta/y3.gif'.

ENDFORM. "show_pic

INITIALIZATION.

TABLES : SFLIGHT, SBOOK.

DATA STAB LIKE SFLIGHT OCCURS 0 WITH HEADER LINE.

DATA BTAB LIKE SBOOK OCCURS 0 WITH HEADER LINE.

DATA : CONID LIKE STAB-CONNID,

LNO LIKE SY-LILLI,

CID LIKE STAB-FLDATE.

AT LINE-SELECTION.

CASE SY-LSIND.

WHEN 1.

READ LINE SY-LILLI FIELD VALUE ITAB-CONNID.

SELECT * FROM SFLIGHT INTO TABLE STAB WHERE CONNID = ITAB-CONNID.

LOOP AT STAB.

WRITE 😕 SY-TABIX CENTERED ,10 STAB-CARRID.

FORMAT HOTSPOT ON COLOR 6.

WRITE : 20 STAB-CONNID.

FORMAT HOTSPOT OFF COLOR 4.

WRITE : 30 STAB-SEATSMAX,40 STAB-SEATSOCC,50 STAB-PRICE.

FORMAT HOTSPOT ON COLOR 7.

WRITE: 75 STAB-FLDATE .

FORMAT HOTSPOT OFF COLOR 4.

HIDE STAB-FLDATE.

ENDLOOP.

WHEN 2.

SELECT * FROM SBOOK INTO TABLE BTAB WHERE FLDATE = STAB-FLDATE AND

CONNID = STAB-CONNID .

LOOP AT BTAB.

FORMAT COLOR 1.

WRITE : /3 BTAB-CONNID,15 BTAB-CARRID .

FORMAT COLOR 6.

WRITE : 30 BTAB-FLDATE .

FORMAT COLOR 1.

WRITE : 45 BTAB-BOOKID,50 BTAB-CUSTOMID ,60 BTAB-WUNIT.

ENDLOOP.

ENDCASE.

TOP-OF-PAGE DURING LINE-SELECTION.

CASE SY-LSIND.

WHEN 1.

FORMAT COLOR 5.

WRITE 😕 'SLNO',10 'CARRID',20 'CONNID',30 'SEATSMAX',40 'SEATSOCC',

60

'PRICE',80 'FLDATE'.

ULINE.

WHEN 2.

FORMAT COLOR 2.

WRITE : /3 'CONNID',15 'CARRID' ,30 'FLDATE' ,45

'BOOKID',50 'CUSTOMID' ,60 'WUNIT'.

ENDCASE.

Here you can see i have brought the value of a basic list to the clip art by changeing the position and when i am clicking on that color only it is going to the secondary list and one more thing is i have to remove the clipart in the secondary list which is not happening here. But i dont want to click on the color indication rather on the Picture. Please if you are having any code or if you can change my code and revert me i will be very happy since it is the important task assigned to me and i have to do it please understand and help me.

Waiting for the answer.

Thks

0 Kudos

Hi Venkateshwara,

Check out the examples in tcode DWDM, specifically report SAP_PICTURE_DEMO. This report has an example of registering events, especially the DOUBLECLICK event.

You really need to understand the OO concepts to work with controls. Classical ABAP is a grandson of COBOL - a procedural language. ABAP has now mutated into JABOL - a strange mixture of Java and Cobol and all the new-age products are increasingly written in OO languages.