Posted: Sat Sep 13, 2008 7:36 pm Post subject: Export graphic object from SE78
Author: Keerthi Hiremath
In release 46C, the transaction code SE78, used for storing graphic objects, does not provide a way to extract the objects once stored. I needed to get the logos out of SAP. Yeah, I could have scanned it again, but where is the fun in that? Here is the code. It is very simple - cobbled together from SAP function modules. It is released under the GPL license - just kidding.
Code:
*&---------------------------------------------------------------------*
*& 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-screen: begin 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-screen: end of block b01.
selection-screen: begin of block b02 with frame title text-b02.
parameters : p_file like rlgrap-filename.
selection-screen: end 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
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG. SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG. Every effort is made to ensure content integrity. Use information on this site at your own risk.