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

retrieve picture path

Former Member
0 Likes
3,075

Hi all

how can I find the path where a picture I can see in se78 is stored?

thanks

gabriele

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,880

If you need the path to download the pic to your local disk, you better use this piece of code...no path needed -;)

P.S: I know that WS_DOWNLOAD is obsolet...but this code is kinda old and still working, and also I'm lazy to change it -:)


REPORT Z_DUMMY_ATG_3.

DATA : L_BYTECOUNT TYPE I,
       L_TDBTYPE   LIKE STXBITMAPS-TDBTYPE,
       L_CONTENT   TYPE STANDARD TABLE OF BAPICONTEN INITIAL SIZE 0.

DATA: GRAPHIC_SIZE TYPE I.

DATA: BEGIN OF GRAPHIC_TABLE OCCURS 0,
LINE(255) TYPE X,
END OF GRAPHIC_TABLE.

CALL FUNCTION 'SAPSCRIPT_GET_GRAPHIC_BDS'
  EXPORTING
    I_OBJECT       = 'GRAPHICS'
    I_NAME         = 'ZPRUEBA'
    I_ID           = 'BMAP'
    I_BTYPE        = 'BCOL'
  IMPORTING
    E_BYTECOUNT    = L_BYTECOUNT
  TABLES
    CONTENT        = L_CONTENT
  EXCEPTIONS
    NOT_FOUND      = 1
    BDS_GET_FAILED = 2
    BDS_NO_CONTENT = 3
    OTHERS         = 4.

CALL FUNCTION 'SAPSCRIPT_CONVERT_BITMAP'
  EXPORTING
    OLD_FORMAT               = 'BDS'
    NEW_FORMAT               = 'BMP'
    BITMAP_FILE_BYTECOUNT_IN = L_BYTECOUNT
  IMPORTING
    BITMAP_FILE_BYTECOUNT    = GRAPHIC_SIZE
  TABLES
    BDS_BITMAP_FILE          = L_CONTENT
    BITMAP_FILE              = GRAPHIC_TABLE
  EXCEPTIONS
    OTHERS                   = 1.

CALL FUNCTION 'WS_DOWNLOAD'
  EXPORTING
    BIN_FILESIZE            = GRAPHIC_SIZE
    FILENAME                = 'C:\FirmaAsociado.bmp'
    FILETYPE                = 'BIN'
  TABLES
    DATA_TAB                = GRAPHIC_TABLE
  EXCEPTIONS
    INVALID_FILESIZE        = 1
    INVALID_TABLE_WIDTH     = 2
    INVALID_TYPE            = 3
    NO_BATCH                = 4
    UNKNOWN_ERROR           = 5
    GUI_REFUSE_FILETRANSFER = 6.

IF SY-SUBRC <> 0.
  MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
          WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.

Greetings,

Blag.

9 REPLIES 9
Read only

Former Member
0 Likes
1,880

i worked a LOT with logo´s uploaded with se78, but i NEVER came across a requirement where i had to know the path of the file.

Why should someone need this?

I´m not sure, but i suspect this picture is not available anyway in a file path but beeing stored in database. At least that would hold some logic.

Read only

Former Member
0 Likes
1,880

Hi gabriele,

Once you upload picture through t-code SE78

then by using se78 you can view picture and not the path from where you have uploded that.

Hope your doubt.

Regards,

Vijay

Read only

0 Likes
1,880

hi I'll explain better:

I am using this code:

FORM set_logo .
  DATA url(256) TYPE c.
  c_service=>get_pic_tab(
    EXPORTING mime_url = '/SAP/BC/fp/graphics/FPsamples/Tatze.bmp'
    IMPORTING pic_tab  = pic_tab ).

  CALL FUNCTION 'DP_CREATE_URL'
    EXPORTING
      type    = 'IMAGE'
      subtype = 'GIF'
    TABLES
      data    = pic_tab
    CHANGING
      url     = url.

  CREATE OBJECT: logo_container EXPORTING container_name = logo_containter_name,
                logo EXPORTING parent = logo_container.

  l_alignment = cl_gui_control=>align_at_left   +
                cl_gui_control=>align_at_right  +
                cl_gui_control=>align_at_top    +
                cl_gui_control=>align_at_bottom.

  CALL METHOD logo->set_alignment
    EXPORTING
      alignment = l_alignment.

  CALL METHOD logo->set_3d_border
    EXPORTING
      border = 0.

  CALL METHOD logo->load_picture_from_url
    EXPORTING
      url    = url
    EXCEPTIONS
      OTHERS = 4.
ENDFORM.                    " SET_LOGO

for load an image in a dynpro custom control. and it works correctly for Tatze.bmp that is a demo image. Now I would like to use the logo I loaded with se78... but I cannot see how to put the correct path ..

Read only

Former Member
0 Likes
1,880

Hi ,

Path se78 -> stored on document Srver

expand

-> Graphics -> BAMP bit maps -> Doouble click

check this path and select your file path in right hand side screen.

before this you need to upload your graphic into srever using RSXLDMC program .

regards,

Rama reddy

Edited by: ram reddy on Jul 14, 2009 4:05 PM

Read only

Former Member
0 Likes
1,881

If you need the path to download the pic to your local disk, you better use this piece of code...no path needed -;)

P.S: I know that WS_DOWNLOAD is obsolet...but this code is kinda old and still working, and also I'm lazy to change it -:)


REPORT Z_DUMMY_ATG_3.

DATA : L_BYTECOUNT TYPE I,
       L_TDBTYPE   LIKE STXBITMAPS-TDBTYPE,
       L_CONTENT   TYPE STANDARD TABLE OF BAPICONTEN INITIAL SIZE 0.

DATA: GRAPHIC_SIZE TYPE I.

DATA: BEGIN OF GRAPHIC_TABLE OCCURS 0,
LINE(255) TYPE X,
END OF GRAPHIC_TABLE.

CALL FUNCTION 'SAPSCRIPT_GET_GRAPHIC_BDS'
  EXPORTING
    I_OBJECT       = 'GRAPHICS'
    I_NAME         = 'ZPRUEBA'
    I_ID           = 'BMAP'
    I_BTYPE        = 'BCOL'
  IMPORTING
    E_BYTECOUNT    = L_BYTECOUNT
  TABLES
    CONTENT        = L_CONTENT
  EXCEPTIONS
    NOT_FOUND      = 1
    BDS_GET_FAILED = 2
    BDS_NO_CONTENT = 3
    OTHERS         = 4.

CALL FUNCTION 'SAPSCRIPT_CONVERT_BITMAP'
  EXPORTING
    OLD_FORMAT               = 'BDS'
    NEW_FORMAT               = 'BMP'
    BITMAP_FILE_BYTECOUNT_IN = L_BYTECOUNT
  IMPORTING
    BITMAP_FILE_BYTECOUNT    = GRAPHIC_SIZE
  TABLES
    BDS_BITMAP_FILE          = L_CONTENT
    BITMAP_FILE              = GRAPHIC_TABLE
  EXCEPTIONS
    OTHERS                   = 1.

CALL FUNCTION 'WS_DOWNLOAD'
  EXPORTING
    BIN_FILESIZE            = GRAPHIC_SIZE
    FILENAME                = 'C:\FirmaAsociado.bmp'
    FILETYPE                = 'BIN'
  TABLES
    DATA_TAB                = GRAPHIC_TABLE
  EXCEPTIONS
    INVALID_FILESIZE        = 1
    INVALID_TABLE_WIDTH     = 2
    INVALID_TYPE            = 3
    NO_BATCH                = 4
    UNKNOWN_ERROR           = 5
    GUI_REFUSE_FILETRANSFER = 6.

IF SY-SUBRC <> 0.
  MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
          WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.

Greetings,

Blag.

Read only

0 Likes
1,880

I am not saving

I am loading image in dynpro. I think it's just path that miss.

Read only

0 Likes
1,880

Try this...I called the custom container on Dynpro "CUSTOM_ALV".


TYPES: BEGIN OF ty_graphic_table,
       line(255) TYPE x,
       END OF ty_graphic_table.

DATA: t_graphic_table TYPE STANDARD TABLE OF
ty_graphic_table.

DATA: ok_code TYPE sy-ucomm,
      url(255) TYPE c,
      container1 TYPE REF TO cl_gui_custom_container,
      picture TYPE REF TO cl_gui_picture,
      l_bytecount TYPE i,
      l_content TYPE STANDARD TABLE OF bapiconten INITIAL SIZE 0,
      graphic_size TYPE i.

START-OF-SELECTION.
  CALL SCREEN 0100.

MODULE status_0100 OUTPUT.
  SET PF-STATUS '100'.
  SET TITLEBAR '100'.
  PERFORM load_image.
ENDMODULE.                    "STATUS_0100 OUTPUT

MODULE user_command_0100 INPUT.
  ok_code = sy-ucomm.
  CLEAR sy-ucomm.
  CASE ok_code.
    WHEN 'BACK' OR 'STOP' OR 'CANCEL'.
      SET SCREEN 0.
      LEAVE SCREEN.
  ENDCASE.
ENDMODULE.                    "USER_COMMAND_0100 INPUT

FORM load_image.
  CREATE OBJECT: container1 EXPORTING container_name = 'CUSTOM_ALV',
                 picture EXPORTING parent = container1.

  CALL FUNCTION 'SAPSCRIPT_GET_GRAPHIC_BDS'
    EXPORTING
      i_object       = 'GRAPHICS'
      i_name         = 'ENJOY'
      i_id           = 'BMAP'
      i_btype        = 'BCOL'
    IMPORTING
      e_bytecount    = l_bytecount
    TABLES
      content        = l_content
    EXCEPTIONS
      not_found      = 1
      bds_get_failed = 2
      bds_no_content = 3
      OTHERS         = 4.

  CALL FUNCTION 'SAPSCRIPT_CONVERT_BITMAP'
    EXPORTING
      old_format               = 'BDS'
      new_format               = 'BMP'
      bitmap_file_bytecount_in = l_bytecount
    IMPORTING
      bitmap_file_bytecount    = graphic_size
    TABLES
      bds_bitmap_file          = l_content
      bitmap_file              = t_graphic_table
    EXCEPTIONS
      OTHERS                   = 1.
  CALL FUNCTION 'DP_CREATE_URL'
    EXPORTING
      type    = 'IMAGE'
      subtype = 'BMP'
    TABLES
      data    = t_graphic_table
    CHANGING
      url     = url.

  CALL METHOD picture->load_picture_from_url
    EXPORTING
      url = url.
  CALL METHOD picture->set_display_mode
    EXPORTING
      display_mode = picture->display_mode_fit_center.
ENDFORM.                    "LOAD_IMAGE

Greetings,

Blag.

Edited by: Alvaro Tejada Galindo on Jul 14, 2009 10:37 AM

Read only

0 Likes
1,880

thank you very much

it works PERFECTLY .. also better than sap demo examples!

best regards

gabriele

Read only

0 Likes
1,880

thank you very much

it works PERFECTLY .. also better than sap demo examples!

Woaw Grabiela! Thank you -:) First time someone told me something like that about my code -;) So glad I was helpful.

Greetings,

Blag.