메뉴 건너뛰기

SAP 한국 커뮤니티

Z_EXPORT_GRAPHIC_FROM_SE78

sapjoy 2011.03.29 06:21 조회 수 : 4447

 

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

REPORT  z_export_graphic_from_se78    .

*
*-----------------------------------------------------------------------
* 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
* Date       : 15JAN2003
* Request    :
* Design doc :
*
*
*-----------------------------------------------------------------------
*                 M O D I F I C A T I O N    L O G
*-----------------------------------------------------------------------
*-----------------------------------------------------------------------
*@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 : BEGIN OF git_bitmap OCCURS 0,
             line(1000),
       END   OF git_bitmap.
DATA : g_bytecount TYPE i.
*-----------------------------------------------------------------------
*@SSL             S E L E C T I O N   S C R E E N
*-----------------------------------------------------------------------
SELECTION-SCREENBEGIN OF BLOCK b01 WITH FRAME TITLE text-b01.
PARAMETERS      : p_obj LIKE stxbitmaps-tdobject DEFAULT 'ZOGLGRPOBJ',
                  p_nam LIKE stxbitmaps-tdname,
                  p_id  LIKE stxbitmaps-tdid DEFAULT 'ZC',
                  p_ref LIKE stxbitmaps-tdbtype DEFAULT 'BMON'.
SELECTION-SCREENEND   OF BLOCK b01.
SELECTION-SCREENBEGIN OF BLOCK b02 WITH FRAME TITLE text-b02.
PARAMETERS      : p_file LIKE rlgrap-filename.
SELECTION-SCREENEND   OF BLOCK b02.
*-----------------------------------------------------------------------
*@INI                 I N I T I A L I Z A T I O N.
*-----------------------------------------------------------------------
INITIALIZATION.
*

*-----------------------------------------------------------------------
*@SOS             S T A R T   O F   S E L E C T I O N
*-----------------------------------------------------------------------
START-OF-SELECTION.
*
  PERFORM sapscript_get_graphic_bds.
  PERFORM sapscript_convert_bitmap.
  PERFORM ws_download.
*
*-----------------------------------------------------------------------
*@EOS                E N D   O F   S E L E C T I O N
*-----------------------------------------------------------------------
END-OF-SELECTION.
*

*-----------------------------------------------------------------------
*@TOP                   T O P   O F   P A G E
*-----------------------------------------------------------------------
TOP-OF-PAGE.
*

*-----------------------------------------------------------------------
*               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.
*
  DATA: l_return TYPE i.
  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 = 'ZOGLGRPOBJ'.
  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                     = 'Z_EXPORT_GRAPHIC_FROM_SE78'
        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.

*
*-----------------------------------------------------------------------
*@FOR                          F O R M S
*-----------------------------------------------------------------------
*
*
*&---------------------------------------------------------------------*
*&      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.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  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

*&---------------------------------------------------------------------*
*&      Form  WS_DOWNLOAD
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  -->  p1        text
*  <--  p2        text
*----------------------------------------------------------------------*
FORM ws_download.
*
  CALL FUNCTION 'WS_DOWNLOAD'
       EXPORTING
            bin_filesize            = g_bytecount
            filename                = p_file
            filetype                = 'BIN'
       TABLES
            data_tab                = git_rawdata
       EXCEPTIONS
            file_open_error         = 1
            file_write_error        = 2
            invalid_filesize        = 3
            invalid_type            = 4
            no_batch                = 5
            unknown_error           = 6
            invalid_table_width     = 7
            gui_refuse_filetransfer = 8
            customer_error          = 9
            OTHERS                  = 10.
  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.                    " WS_DOWNLOAD
번호 제목 글쓴이 날짜 조회 수
411 REPORT Z02_16. sapjoy 2012.07.31 1511
410 REPORT z02_15. sapjoy 2012.07.31 1621
409 REPORT z02_14. sapjoy 2012.07.31 1538
408 REPORT z02_13. sapjoy 2012.07.31 1690
407 REPORT z02_12. sapjoy 2012.07.31 1619
406 REPORT z02_11. sapjoy 2012.07.31 1717
405 REPORT z02_10. sapjoy 2012.07.31 1609
404 REPORT z02_09. sapjoy 2012.07.31 1586
403 REPORT z02_08. sapjoy 2012.07.31 1843
402 REPORT z02_07. sapjoy 2012.07.31 1786
401 REPORT z02_06. sapjoy 2012.07.31 1658
400 REPORT z02_05. sapjoy 2012.07.31 1863
399 REPORT z02_04. sapjoy 2012.07.31 1953
398 REPORT z02_03 sapjoy 2012.07.31 1805
397 REPORT z02_01. sapjoy 2012.07.31 1788
396 REPORT Z_WHEREUSEDLIST [4] sapjoy 2011.03.29 3215
» Z_EXPORT_GRAPHIC_FROM_SE78 [1] sapjoy 2011.03.29 4447
394 REPORT ZSMARTFORMS_03. sapjoy 2008.11.28 3345
393 REPORT zfalv_011. sapjoy 2011.02.16 3627
392 <b>easy abap 소스 전체 파일 입니다. [188] file sapjoy 2008.05.02 10149