cancel
Showing results for 
Search instead for 
Did you mean: 

Downloading Images from SMARTFORM

Former Member
0 Kudos

Hi Friends,

My requirement is to copy a SMARTFORM from existing 4.7 to ECC 6.0.

I am able to download the SMARTFORM from 4.7 and upload the same in ECC 6.0 but the logo is not getting uploaded.

Now I need to download the logo from the 4.7 and upload the same onto ECC 6.0.

Can anyone suggest how I can download an existing logo?

I know that to upload an image we do the same in SE78 but to download an already existing image whats is the way out ?

<MOVED BY MODERATOR TO THE CORRECT FORUM>

Thanks.

Regards

R Adarsh

Edited by: Alvaro Tejada Galindo on Sep 28, 2011 3:59 PM

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Adarsh,

Please check this post

U can export (download) logos from OAER transaction

Also Please check transaction SMW0. There select Binary data for webRFC application radio button and Execute.

there u can Import and Export the Logos.

Best regards,

raam

Answers (2)

Answers (2)

freising
Discoverer
0 Kudos

Hi,

I didnt get TA OAER and SMW0 to work.

I used the program in link from Adarsh and changed the download form from ws_download to gui_download:

*&---------------------------------------------------------------------*
*& Report YSTEST_RF14_DOWNLOADGRAPHICS
*&---------------------------------------------------------------------*
*&
*&---------------------------------------------------------------------*
REPORT ystest_rf14_downloadgraphics.
*&---------------------------------------------------------------------*
*&   This program exports logos from SE78 to a pc file in .bmp format  *
*&                                                                     *
*&---------------------------------------------------------------------*

*-----------------------------------------------------------------------
* Description: This program extracts graphic logos from the BDS and
*              saves it as a .bmp file on the pc.  Transaction SE78
*              does not provide a way to export logos.
* Author     : Keerthi Hiremath, Updated by Rene Freising(July 2021)
* Date       : 15JAN2003
*-----------------------------------------------------------------------
*@DAT                         D A T A
*-----------------------------------------------------------------------
TYPE-POOLS: sbdst .
DATA : git_content TYPE sbdst_content.
DATA : git_rawdata     TYPE w3mime OCCURS 0,
       g_bitmaptypeout TYPE c.
DATA : g_bytecount TYPE i.

*-----------------------------------------------------------------------
*@SSL             S E L E C T I O N   S C R E E N
*-----------------------------------------------------------------------
SELECTION-SCREEN: BEGIN OF BLOCK b01 WITH FRAME TITLE TEXT-b01.
PARAMETERS      : p_obj TYPE stxbitmaps-tdobject DEFAULT 'GRAPHICS',
                  p_nam TYPE stxbitmaps-tdname,
                  p_id  TYPE stxbitmaps-tdid     DEFAULT 'BMAP',
                  p_ref TYPE stxbitmaps-tdbtype  DEFAULT 'BCOL'.
SELECTION-SCREEN: END   OF BLOCK b01.

SELECTION-SCREEN: BEGIN OF BLOCK b02 WITH FRAME TITLE TEXT-b02.
PARAMETERS      : p_path TYPE string,
                  p_file TYPE rlgrap-filename.
SELECTION-SCREEN: END   OF BLOCK b02.

INITIALIZATION.
  PERFORM get_upload_download_path.


START-OF-SELECTION.

  PERFORM sapscript_get_graphic_bds.
  PERFORM sapscript_convert_bitmap.
  PERFORM gui_download.


*-----------------------------------------------------------------------
*               A T   S E L E C T I O N   S C R E E N
*-----------------------------------------------------------------------
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_nam.

  RANGES: r_obj FOR stxbitmaps-tdobject.
  DATA: l_bitmaps TYPE TABLE OF stxbitmaps WITH HEADER LINE.
  DATA: lit_scrfields TYPE TABLE OF dynpread WITH HEADER LINE.

  r_obj-sign = 'I'.
  r_obj-option = 'EQ'.
  r_obj-low = 'GRAPHICS'.
  APPEND r_obj.

  CALL FUNCTION 'SAPSCRIPT_SEARCH_GRAPHIC_BDS'
    EXPORTING
      selection_screen   = 'X'
      select_entry       = 'X'
      selection_show     = 'X'
    IMPORTING
      e_object           = p_obj
      e_id               = p_id
      e_name             = p_nam
      e_btype            = p_ref
    TABLES
      t_objects          = r_obj
*     T_IDS              = R_IDS
*     T_BTYPES           = R_REFS
      t_selections       = l_bitmaps
    EXCEPTIONS
      nothing_found      = 1
      selection_canceled = 2
      internal_error     = 3
      OTHERS             = 4.
  IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
              WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  ELSE.
    lit_scrfields-fieldname = 'P_ID'.
    lit_scrfields-fieldvalue = p_id.
    APPEND lit_scrfields.
    CALL FUNCTION 'DYNP_VALUES_UPDATE'
      EXPORTING
        dyname               = 'YSTEST_RF14_DOWNLOADGRAPHICS'
        dynumb               = '1000'
      TABLES
        dynpfields           = lit_scrfields
      EXCEPTIONS
        invalid_abapworkarea = 1
        invalid_dynprofield  = 2
        invalid_dynproname   = 3
        invalid_dynpronummer = 4
        invalid_request      = 5
        no_fielddescription  = 6
        undefind_error       = 7
        OTHERS               = 8.

    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.

*&---------------------------------------------------------------------*
*&      Form  SAPSCRIPT_GET_GRAPHIC_BDS
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  -->  p1        text
*  <--  p2        text
*----------------------------------------------------------------------*
FORM sapscript_get_graphic_bds.
*
  CALL FUNCTION 'SAPSCRIPT_GET_GRAPHIC_BDS'
    EXPORTING
      i_object       = p_obj
      i_name         = p_nam
      i_id           = p_id
      i_btype        = p_ref
    IMPORTING
      e_bytecount    = g_bytecount
    TABLES
      content        = git_content
    EXCEPTIONS
      not_found      = 1
      bds_get_failed = 2
      bds_no_content = 3
      OTHERS         = 4.
  IF sy-subrc <> 0.
    WRITE: 'Fehler Baustein SAPSCRIPT_GET_GRAPHIC_BDS,sy-subrc = ', sy-subrc.
    STOP.
  ENDIF.

ENDFORM.                    " SAPSCRIPT_GET_GRAPHIC_BDS

*&---------------------------------------------------------------------*
*&      Form  SAPSCRIPT_CONVERT_BITMAP
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  -->  p1        text
*  <--  p2        text
*----------------------------------------------------------------------*
FORM sapscript_convert_bitmap.
*                                                assign
  CALL FUNCTION 'SAPSCRIPT_CONVERT_BITMAP '
    EXPORTING
      old_format               = 'BDS'
      new_format               = 'BMP'
      bitmap_file_bytecount_in = g_bytecount
      itf_bitmap_type_in       = '*'
    IMPORTING
      bitmap_file_bytecount    = g_bytecount
      itf_bitmap_type_out      = g_bitmaptypeout
    TABLES
      bitmap_file              = git_rawdata
      bds_bitmap_file          = git_content
    EXCEPTIONS
      no_bitmap_file           = 1
      format_not_supported     = 2
      bitmap_file_not_type_x   = 3
      no_bmp_file              = 4
      bmperr_invalid_format    = 5
      bmperr_no_colortable     = 6
      bmperr_unsup_compression = 7
      bmperr_corrupt_rle_data  = 8
      bmperr_eof               = 9
      bdserr_invalid_format    = 10
      bdserr_eof               = 11
      OTHERS                   = 12.
  IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
       WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  ENDIF.

ENDFORM.                    " SAPSCRIPT_CONVERT_BITMAP
*&---------------------------------------------------------------------*
*       Standardpfad holen
*----------------------------------------------------------------------*
FORM get_upload_download_path .
  DATA l_pfad TYPE string.

* Standardpfad
  CLEAR l_pfad.
  CALL METHOD cl_gui_frontend_services=>get_upload_download_path
    CHANGING
      upload_path                 = l_pfad
      download_path               = l_pfad
    EXCEPTIONS
      cntl_error                  = 1
      error_no_gui                = 2
      not_supported_by_gui        = 3
      gui_upload_download_path    = 4
      upload_download_path_failed = 5
      OTHERS                      = 6.

* Standardpfadname, wenn Fehler aufgetreten
  IF sy-subrc <> 0 OR l_pfad IS INITIAL.
    l_pfad = 'C:\TEMP\' ##NO_TEXT.
  ENDIF.
  p_path = l_pfad.
ENDFORM.                    " GET_UPLOAD_DOWNLOAD_PATH

*&---------------------------------------------------------------------*
*&      Form  gui_download
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  -->  p1        text
*  <--  p2        text
*----------------------------------------------------------------------*
FORM gui_download.
  DATA: l_file     TYPE string.

  l_file = p_path && p_file.

  CALL FUNCTION 'GUI_DOWNLOAD'
    EXPORTING
      bin_filesize            = g_bytecount
      filename                = l_file
      filetype                = 'BIN'
*     APPEND                  = ' '
*     WRITE_FIELD_SEPARATOR   = ' '
*     HEADER                  = '00'
*     TRUNC_TRAILING_BLANKS   = ' '
*     WRITE_LF                = 'X'
*     COL_SELECT              = ' '
*     COL_SELECT_MASK         = ' '
*     DAT_MODE                = ' '
*     confirm_overwrite       = 'X'
*     NO_AUTH_CHECK           = ' '
*     CODEPAGE                = ' '
*     IGNORE_CERR             = ABAP_TRUE
*     REPLACEMENT             = '#'
*     WRITE_BOM               = ' '
*     TRUNC_TRAILING_BLANKS_EOL       = 'X'
*     WK1_N_FORMAT            = ' '
*     WK1_N_SIZE              = ' '
*     WK1_T_FORMAT            = ' '
*     WK1_T_SIZE              = ' '
*     WRITE_LF_AFTER_LAST_LINE        = ABAP_TRUE
      show_transfer_status    = abap_true
*     VIRUS_SCAN_PROFILE      = '/SCET/GUI_DOWNLOAD'
* IMPORTING
*     FILELENGTH              =
    TABLES
      data_tab                = git_rawdata
*     FIELDNAMES              =
    EXCEPTIONS
      file_write_error        = 1
      no_batch                = 2
      gui_refuse_filetransfer = 3
      invalid_type            = 4
      no_authority            = 5
      unknown_error           = 6
      header_not_allowed      = 7
      separator_not_allowed   = 8
      filesize_not_allowed    = 9
      header_too_long         = 10
      dp_error_create         = 11
      dp_error_send           = 12
      dp_error_write          = 13
      unknown_dp_error        = 14
      access_denied           = 15
      dp_out_of_memory        = 16
      disk_full               = 17
      dp_timeout              = 18
      file_not_found          = 19
      dataprovider_exception  = 20
      control_flush_error     = 21
      OTHERS                  = 22.
  IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
            WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  ENDIF.
*
ENDFORM.                    " gui_download
former_member188829
Active Contributor
0 Kudos