2005 Dec 16 9:59 AM
Friends,
Can anyone please suggest a function module that displays a picture from the document server on to a screen.
Regards,
Kanthimathi
Friends,
Can anyone please suggest a function module that displays a picture from the document server on to a screen.
Regards,
Kanthimathi
2005 Dec 16 10:01 AM
Hi,
You can
Check the Controls examples..
DWDM is transaction to find programs....
also try the FM's
FM UPC_FW_SET_DEFAULT_SCR_PICTURE
RSSM_MAINTAIN_PICTURES
Hope it helps....
Lokesh
Pls. reward appropriate points
Message was edited by: Lokesh Aggarwal
2005 Dec 16 10:43 AM
Hi Mathi,
Check these standard programs.May be you will get some idea.
RSDEMO_PICTURE_CONTROL
SAP_PICTURE_DEMO
DEMO_PICTURE_CONTROL
2005 Dec 16 10:03 AM
se38>environment>control examples.
this will shows u a list of programs.
reward points if its helpful.
2005 Dec 16 10:06 AM
2005 Dec 16 10:07 AM
I have already checked the Control Programs. As of my knowledge none of the programs displays picture stored on the document server
2005 Dec 16 10:25 AM
Hi,
U can show the picture in the top of page event in the alv fm 'reuse_alv_grid_display'.
rgds
p.kp
2005 Dec 16 10:31 AM
HI,
In the top of page, while using alv 'reuse_alv_grid_display' u can display by using
reuse_alv_commentary_write.
rgds
p.kp
2005 Dec 16 10:32 AM
HI,
In the top of page, while using alv 'reuse_alv_grid_display' u can display by using
reuse_alv_commentary_write.
rgds
p.kp
2005 Dec 16 10:34 AM
HI,
In the top of page, while using alv 'reuse_alv_grid_display' u can display by using
reuse_alv_commentary_write.
rgds
p.kp
2005 Dec 16 10:35 AM
HI,
In the top of page, while using alv 'reuse_alv_grid_display' u can display by using
reuse_alv_commentary_write.
rgds
p.kp
2005 Dec 16 10:37 AM
HI,
In the top of page, while using alv 'reuse_alv_grid_display' u can display by using
reuse_alv_commentary_write.
rgds
p.kp
2005 Dec 16 10:48 AM
The data comes from the application server itself. you dont need to specify the path. it will get the data automatically. you can create ur own logos thru tcode:OAOR to create logos and u can see the preview also
2005 Dec 16 10:49 AM
The data comes from the application server itself. you dont need to specify the path. it will get the data automatically. you can create ur own logos thru tcode:OAOR to create logos and u can see the preview also
2005 Dec 16 11:02 AM
HI,
In the top of page, while using alv 'reuse_alv_grid_display' u can display by using
reuse_alv_commentary_write.
rgds
p.kp
2005 Dec 16 11:14 AM
HI,
In the top of page, while using alv 'reuse_alv_grid_display' u can display by using
reuse_alv_commentary_write.
rgds
p.kp
2005 Dec 16 11:14 AM
HI,
In the top of page, while using alv 'reuse_alv_grid_display' u can display by using
reuse_alv_commentary_write.
rgds
p.kp
2005 Dec 16 11:50 AM
Friends,
1) I am not using ALV.
2) The picture should be displayed on the screen which contains a container control
3) This picture should be taken from the document server and not from any database..
4) I have already gone thro' the code in the control example, as of my knowledge they don't take the picture from the document server.
Please help me to acheive my requirement
2006 Jan 31 11:05 AM
Dear Kanthimathi Krishnan,
If your problem is not already solved, check this out:
data container_top TYPE REF TO cl_gui_container,
create the container
CREATE OBJECT picture
EXPORTING parent = container_top.
METHOD fill_picture.
TYPES ty_graphic_line(255) TYPE x.
DATA graphic_table TYPE TABLE OF ty_graphic_line.
DATA graphic_line TYPE ty_graphic_line.
DATA: l_graphic_xstr TYPE xstring,
l_graphic_conv TYPE i,
l_graphic_offs TYPE i,
graphic_url(255),
graphic_size TYPE i,
graphic_refresh(1).
CALL METHOD cl_ssf_xsf_utilities=>get_bds_graphic_as_bmp
EXPORTING
p_object = 'GRAPHICS'
p_name = 'Z200000AD901'
"p_name is any bmp available in SE78
p_id = 'BMAP'
p_btype = 'BCOL' "BMON if monochrome
RECEIVING
p_bmp = l_graphic_xstr
EXCEPTIONS
not_found = 1
internal_error = 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.
graphic_size = XSTRLEN( l_graphic_xstr ).
CHECK graphic_size > 0.
l_graphic_conv = graphic_size.
l_graphic_offs = 0.
WHILE l_graphic_conv > 255.
graphic_line = l_graphic_xstr+l_graphic_offs(255).
APPEND graphic_line TO graphic_table.
l_graphic_offs = l_graphic_offs + 255.
l_graphic_conv = l_graphic_conv - 255.
ENDWHILE.
graphic_line = l_graphic_xstr+l_graphic_offs(l_graphic_conv).
APPEND graphic_line TO graphic_table.
CALL FUNCTION 'DP_CREATE_URL'
EXPORTING
type = 'IMAGE'
subtype = 'GIF'
TABLES
data = graphic_table
CHANGING
url = graphic_url.
CALL METHOD picture->load_picture_from_url
EXPORTING
url = graphic_url.
CALL METHOD picture->set_display_mode
EXPORTING
display_mode = picture->display_mode_fit_center.
ENDMETHOD. "FILL_PICTURE
Hope this helps,
Tim van Steenbergen
2006 Apr 25 9:23 PM
Tim,
I'm having a similar issue. I tried using your code to get a BMP file to display on my custom screen, but when I do a syntax check I get the message "Obligatory parameter CLSID has no value" (the cursor stops at the statement for creating the container_top object). Any ideas why I'm getting this message? I didn't see that parameter listed in your "create object" statements.
Thanks,
April King
2006 Jan 31 12:23 PM
Hi,
Your code was really helpful.
I added a container control, created container & picture object, uploaded a bmp graphics using SE78 (Colour) & used the logic provided by you for displaying the picture, but I am unable to see it in the screen. I don't know where I am going wrong, can you please help me out?
Note: I can view the uploaded image in SE78
Thanks,
2006 Jan 31 2:02 PM
The easiest way to help you is to give you the entire code of the program:
PROGRAM zemo_abap_objects_split_screen.
Classes *****************************************************
CLASS screen_init DEFINITION CREATE PRIVATE.
PUBLIC SECTION.
CLASS-METHODS init_screen.
METHODS constructor.
PRIVATE SECTION.
DATA: splitter_h TYPE REF TO cl_gui_splitter_container,
splitter_v TYPE REF TO cl_gui_splitter_container,
picture TYPE REF TO cl_gui_picture,
tree TYPE REF TO cl_gui_simple_tree.
METHODS: fill_tree,
fill_picture.
ENDCLASS. "SCREEN_INIT DEFINITION
*
CLASS screen_handler DEFINITION.
PUBLIC SECTION.
METHODS: constructor IMPORTING container
TYPE REF TO cl_gui_container,
handle_node_double_click
FOR EVENT node_double_click
OF cl_gui_simple_tree
IMPORTING node_key.
PRIVATE SECTION.
DATA: html_viewer TYPE REF TO cl_gui_html_viewer,
list_viewer TYPE REF TO cl_gui_alv_grid.
METHODS: fill_html IMPORTING carrid TYPE spfli-carrid,
fill_list IMPORTING carrid TYPE spfli-carrid
connid TYPE spfli-connid.
ENDCLASS. "SCREEN_HANDLER DEFINITION
*
CLASS screen_init IMPLEMENTATION.
METHOD init_screen.
DATA screen TYPE REF TO screen_init.
CREATE OBJECT screen.
ENDMETHOD. "INIT_SCREEN
METHOD constructor.
DATA: events TYPE cntl_simple_events,
event LIKE LINE OF events,
event_handler TYPE REF TO screen_handler,
container_left TYPE REF TO cl_gui_container,
container_right TYPE REF TO cl_gui_container,
container_top TYPE REF TO cl_gui_container,
container_bottom TYPE REF TO cl_gui_container.
CREATE OBJECT splitter_h
EXPORTING
parent = cl_gui_container=>screen0
rows = 1
columns = 2.
CALL METHOD splitter_h->set_border
EXPORTING
border = cl_gui_cfw=>false.
CALL METHOD splitter_h->set_column_mode
EXPORTING
mode = splitter_h->mode_absolute.
CALL METHOD splitter_h->set_column_width
EXPORTING
id = 1
width = 107.
container_left = splitter_h->get_container( row = 1 column = 1 ).
container_right = splitter_h->get_container( row = 1 column = 2 ).
CREATE OBJECT splitter_v
EXPORTING
parent = container_left
rows = 2
columns = 1.
CALL METHOD splitter_v->set_border
EXPORTING
border = cl_gui_cfw=>false.
CALL METHOD splitter_v->set_row_mode
EXPORTING
mode = splitter_v->mode_absolute.
CALL METHOD splitter_v->set_row_height
EXPORTING
id = 1
height = 160.
container_top = splitter_v->get_container( row = 1 column = 1 ).
container_bottom = splitter_v->get_container( row = 2 column = 1 ).
CREATE OBJECT picture
EXPORTING parent = container_top.
CREATE OBJECT tree
EXPORTING parent = container_bottom
node_selection_mode =
cl_gui_simple_tree=>node_sel_mode_single.
CREATE OBJECT event_handler
EXPORTING container = container_right.
event-eventid = cl_gui_simple_tree=>eventid_node_double_click.
event-appl_event = ' '. "system event, does not trigger PAI
APPEND event TO events.
CALL METHOD tree->set_registered_events
EXPORTING
events = events.
SET HANDLER event_handler->handle_node_double_click FOR tree.
CALL METHOD: me->fill_picture,
me->fill_tree.
ENDMETHOD. "CONSTRUCTOR
METHOD fill_picture.
TYPES ty_graphic_line(255) TYPE x.
DATA graphic_table TYPE TABLE OF ty_graphic_line.
DATA graphic_line TYPE ty_graphic_line.
DATA: l_graphic_xstr TYPE xstring,
l_graphic_conv TYPE i,
l_graphic_offs TYPE i,
graphic_url(255),
graphic_size TYPE i,
graphic_refresh(1).
CALL METHOD cl_ssf_xsf_utilities=>get_bds_graphic_as_bmp
EXPORTING
p_object = 'GRAPHICS'
p_name = 'Z200000AD001'
p_id = 'BMAP'
p_btype = 'BCOL'
RECEIVING
p_bmp = l_graphic_xstr
EXCEPTIONS
not_found = 1
internal_error = 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.
graphic_size = XSTRLEN( l_graphic_xstr ).
CHECK graphic_size > 0.
l_graphic_conv = graphic_size.
l_graphic_offs = 0.
WHILE l_graphic_conv > 255.
graphic_line = l_graphic_xstr+l_graphic_offs(255).
APPEND graphic_line TO graphic_table.
l_graphic_offs = l_graphic_offs + 255.
l_graphic_conv = l_graphic_conv - 255.
ENDWHILE.
graphic_line = l_graphic_xstr+l_graphic_offs(l_graphic_conv).
APPEND graphic_line TO graphic_table.
CALL FUNCTION 'DP_CREATE_URL'
EXPORTING
type = 'IMAGE'
subtype = 'GIF'
TABLES
data = graphic_table
CHANGING
url = graphic_url.
CALL METHOD picture->load_picture_from_url
EXPORTING
url = graphic_url.
CALL METHOD picture->set_display_mode
EXPORTING
display_mode = picture->display_mode_fit_center.
ENDMETHOD. "FILL_PICTURE
METHOD fill_tree.
DATA: node_table TYPE TABLE OF abdemonode,
node TYPE abdemonode,
spfli_wa TYPE spfli,
spfli_tab TYPE SORTED TABLE OF spfli
WITH UNIQUE KEY carrid connid.
SELECT carrid connid
FROM spfli
INTO CORRESPONDING FIELDS OF TABLE spfli_tab.
node-hidden = ' '. " All nodes are visible,
node-disabled = ' '. " selectable,
node-isfolder = 'X'. " a folder,
node-expander = ' '. " have no '+' sign for expansion.
LOOP AT spfli_tab INTO spfli_wa.
AT NEW carrid.
node-node_key = spfli_wa-carrid.
CLEAR node-relatkey.
CLEAR node-relatship.
node-text = spfli_wa-carrid.
node-n_image = ' '.
node-exp_image = ' '.
APPEND node TO node_table.
ENDAT.
AT NEW connid.
CONCATENATE spfli_wa-carrid spfli_wa-connid INTO node-node_key.
node-relatkey = spfli_wa-carrid.
node-relatship = cl_gui_simple_tree=>relat_last_child.
node-text = spfli_wa-connid.
node-n_image = '@AV@'. "AV is the internal code
node-exp_image = '@AV@'. "for an airplane icon
ENDAT.
APPEND node TO node_table.
ENDLOOP.
CALL METHOD tree->add_nodes
EXPORTING
table_structure_name = 'ABDEMONODE'
node_table = node_table.
ENDMETHOD. "FILL_TREE
ENDCLASS. "SCREEN_INIT IMPLEMENTATION
*
CLASS screen_handler IMPLEMENTATION.
METHOD constructor.
CREATE OBJECT: html_viewer EXPORTING parent = container,
list_viewer EXPORTING i_parent = container.
ENDMETHOD. "CONSTRUCTOR
METHOD handle_node_double_click.
DATA: carrid TYPE spfli-carrid,
connid TYPE spfli-connid.
carrid = node_key(2).
connid = node_key+2(4).
IF connid IS INITIAL.
CALL METHOD: fill_html EXPORTING carrid = carrid,
html_viewer->set_visible EXPORTING visible = 'X',
list_viewer->set_visible EXPORTING visible = ' '.
ELSE.
CALL METHOD: fill_list EXPORTING carrid = carrid
connid = connid,
list_viewer->set_visible EXPORTING visible = 'X',
html_viewer->set_visible EXPORTING visible = ' '.
ENDIF.
CALL METHOD cl_gui_cfw=>flush.
ENDMETHOD. "HANDLE_NODE_DOUBLE_CLICK
METHOD fill_html.
DATA url TYPE scarr-url.
SELECT SINGLE url
FROM scarr
INTO url
WHERE carrid = carrid.
CALL METHOD html_viewer->show_url
EXPORTING
url = url.
ENDMETHOD. "FILL_HTML
METHOD fill_list.
DATA: flight_tab TYPE TABLE OF demofli,
BEGIN OF flight_title,
carrname TYPE scarr-carrname,
cityfrom TYPE spfli-cityfrom,
cityto TYPE spfli-cityto,
END OF flight_title,
list_layout TYPE lvc_s_layo.
SELECT SINGLE ccarrname pcityfrom p~cityto
INTO CORRESPONDING FIELDS OF flight_title
FROM ( scarr AS c
INNER JOIN spfli AS p ON ccarrid = pcarrid )
WHERE p~carrid = carrid AND
p~connid = connid.
SELECT fldate seatsmax seatsocc
INTO CORRESPONDING FIELDS OF TABLE flight_tab
FROM sflight
WHERE carrid = carrid AND connid = connid
ORDER BY fldate.
CONCATENATE flight_title-carrname
connid
flight_title-cityfrom
flight_title-cityto
INTO list_layout-grid_title SEPARATED BY space.
list_layout-smalltitle = 'X'. "The list title has small fonts,
list_layout-cwidth_opt = 'X'. "the column width is adjusted,
list_layout-no_toolbar = 'X'. "the toolbar is suppressed.
CALL METHOD list_viewer->set_table_for_first_display
EXPORTING
i_structure_name = 'DEMOFLI'
is_layout = list_layout
CHANGING
it_outtab = flight_tab.
ENDMETHOD. "FILL_LIST
ENDCLASS. "SCREEN_HANDLER IMPLEMENTATION
Program execution ************************************************
LOAD-OF-PROGRAM.
CALL SCREEN 100.
Dialog Modules PBO
MODULE status_0100 OUTPUT.
SET PF-STATUS 'SCREEN_100'.
SET TITLEBAR 'TIT_100'.
CALL METHOD screen_init=>init_screen.
ENDMODULE. "STATUS_0100 OUTPUT
Dialog Modules PAI
MODULE cancel INPUT.
LEAVE PROGRAM.
ENDMODULE. "CANCEL INPUT
Also create a screen 0100 for this program. The screen can be empty.
Good luck!
Tim van Steenbergen
2006 Apr 26 8:39 AM
Sorry, no idea. But I can give an alternative code:
module Z_FILL_PICTUREFRAME output.
TYPES ty_graphic_line(255) TYPE x.
DATA picture TYPE REF TO cl_gui_picture.
DATA container TYPE REF TO cl_gui_custom_container.
DATA gv_picturename TYPE tdobname.
DATA graphic_table TYPE TABLE OF ty_graphic_line.
DATA graphic_line TYPE ty_graphic_line.
DATA: l_graphic_xstr TYPE xstring,
l_graphic_conv TYPE i,
l_graphic_offs TYPE i,
graphic_url(255),
graphic_size TYPE i,
graphic_refresh(1).
create object container exporting container_name = 'PICTURE_FRAME'.
CREATE OBJECT picture EXPORTING parent = container.
gv_picturename = 'ZDEMOPICTURE'.
CALL METHOD cl_ssf_xsf_utilities=>get_bds_graphic_as_bmp
EXPORTING
p_object = 'GRAPHICS'
p_name = gv_picturename
p_id = 'BMAP'
p_btype = 'BCOL'
RECEIVING
p_bmp = l_graphic_xstr
EXCEPTIONS
not_found = 1
internal_error = 2
OTHERS = 3.
IF sy-subrc <> 0.
CALL METHOD cl_ssf_xsf_utilities=>get_bds_graphic_as_bmp
EXPORTING
p_object = 'GRAPHICS'
p_name = 'ZNOPICTURE'
p_id = 'BMAP'
p_btype = 'BCOL'
RECEIVING
p_bmp = l_graphic_xstr
EXCEPTIONS
not_found = 1
internal_error = 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.
ENDIF.
graphic_size = XSTRLEN( l_graphic_xstr ).
CHECK graphic_size > 0.
l_graphic_conv = graphic_size.
l_graphic_offs = 0.
WHILE l_graphic_conv > 255.
graphic_line = l_graphic_xstr+l_graphic_offs(255).
APPEND graphic_line TO graphic_table.
l_graphic_offs = l_graphic_offs + 255.
l_graphic_conv = l_graphic_conv - 255.
ENDWHILE.
graphic_line = l_graphic_xstr+l_graphic_offs(l_graphic_conv).
APPEND graphic_line TO graphic_table.
CALL FUNCTION 'DP_CREATE_URL'
EXPORTING
type = 'IMAGE'
subtype = 'GIF'
TABLES
data = graphic_table
CHANGING
url = graphic_url.
CALL METHOD picture->load_picture_from_url
EXPORTING
url = graphic_url.
CALL METHOD picture->set_display_mode
EXPORTING
display_mode = picture->display_mode_fit_center.
endmodule. " Z_FILL_PICTUREFRAME OUTPUT
This needs a screen with a picture element named PICTURE_FRAME and a picture.
Good luck,
Tim
2006 Apr 27 3:40 PM
Tim,
Thanks for the new code. Where I seem to be running into problems now is with "cl_ssf_xsf_utilities". If I'm going to call a method from that class, don't I need to create an object with a reference to that class? I tried looking up the class in SE24 and couldn't find it. I did a search on the method as well and couldn't find that either. I'm on R/3, version 4.6C. Do the class and method exist in that version?
Thanks,
April
2006 Apr 27 3:48 PM
Dear April King,
Alas, no. These methodes and classes are introduced in 4.7.
Best regards,
Tim "December Servant" van Steenbergen.
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |