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

INSERT PICTURE USING ABAP OBJECTS

Former Member
0 Likes
1,213

Hello friends ,

can any1 of u tel hw come can i insert a desktop picture in to the abap list using abap objecs apart frm se78...

sakthi

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
743

CALL METHOD PIC_OBJ->LOAD_PICTURE_FROM_URL

EXPORTING

URL = 'file://C:\FINAL\Main.BMP'

  • IMPORTING

  • RESULT =

EXCEPTIONS

ERROR = 1

OTHERS = 2

.

IF SY-SUBRC <> 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF

5 REPLIES 5
Read only

Former Member
0 Likes
743

Check the below link :

Thanks

Seshu

Read only

Former Member
0 Likes
743

Hi Sakthi vel,

Here is a sample program for displaying the picture. I think which will be usefull to u to meet ur requirement.

REPORT zalv440.

TABLES : mara.

TYPES: BEGIN OF t_mara,

matnr TYPE mara-matnr,

END OF t_mara.

DATA : gi_mara TYPE STANDARD TABLE OF t_mara,

gs_mara TYPE t_mara,

GW_VALUE_MATERIAL type matnr.

*--- Custom container instance reference

DATA gw_container TYPE REF TO cl_gui_custom_container.

*Declaration for ALV Header

DATA:

gw_picture TYPE REF TO cl_gui_picture.

DATA: graphic_url(255),

g_result TYPE i.

----


  • SELECTION SCREEN DEFINITION *

----


SELECTION-SCREEN BEGIN OF BLOCK b1.

SELECT-OPTIONS : s_matnr FOR mara-matnr NO INTERVALS.

SELECTION-SCREEN END OF BLOCK b1.

----


  • START-OF-SELECTION *

----


START-OF-SELECTION.

SELECT single

matnr

FROM mara

INTO gs_mara

WHERE matnr IN s_matnr.

IF sy-dbcnt NE 0.

GW_VALUE_MATERIAL = gs_mara-matnr.

graphic_url = 'file://D:\A320.JPG'.

CALL SCREEN 0002.

ENDIF.

*&----


*

*& Module STATUS_0001 OUTPUT

*&----


*

  • text

*----


*

MODULE status_0002 OUTPUT.

SET PF-STATUS '0001'.

SET TITLEBAR '001'.

PERFORM display.

ENDMODULE. " STATUS_0001 OUTPUT

*&----


*

*& Module USER_COMMAND_0001 INPUT

*&----


*

  • text

*----


*

MODULE user_command_0002 INPUT.

CASE sy-ucomm.

WHEN 'EXIT'.

LEAVE TO SCREEN 0.

WHEN 'SAVE'.

LEAVE TO SCREEN 0.

WHEN 'BACK'.

LEAVE TO SCREEN 0.

ENDCASE.

ENDMODULE. " USER_COMMAND_0001 INPUT

*&----


*

*& Form build_alv_display

*&----


*

  • text

*----


*

  • --> p1 text

  • <-- p2 text

*----


*

FORM display .

PERFORM create_picture.

ENDFORM. " build_alv_display

*&----


*

*& Form create_alv_grid

*&----


*

  • text

*----


*

  • --> p1 text

  • <-- p2 text

*----


*

FORM create_picture.

IF gw_container IS INITIAL.

CREATE OBJECT gw_container

EXPORTING

container_name = 'CC_PICTURE'.

  • Display ALV grid

IF NOT gw_container IS INITIAL.

CREATE OBJECT gw_picture

EXPORTING

parent = gw_container.

CALL METHOD gw_picture->load_picture_from_url

EXPORTING

url = graphic_url

IMPORTING

RESULT = g_result.

ENDIF.

ENDIF.

ENDFORM. " create_alv_grid

If u have further queries regarding this, let me know.

Reward points if helpfull.

Read only

Former Member
0 Likes
743

check in SE38 for RSDEMO* and BCALV* if you are going with oops

Read only

Former Member
0 Likes
744

CALL METHOD PIC_OBJ->LOAD_PICTURE_FROM_URL

EXPORTING

URL = 'file://C:\FINAL\Main.BMP'

  • IMPORTING

  • RESULT =

EXCEPTIONS

ERROR = 1

OTHERS = 2

.

IF SY-SUBRC <> 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF

Read only

0 Likes
743

hey buddy thanks for helpful answer.