sap- how to upload logo in se78

Consign Graphics from SE78 SAP Grade Graphics Administration using ABAP Plan

ABAP developers can consign graphics from SAP Class Graphics administration SE78 transaction using ABAP written report whose source codes are shared in this ABAP tutorial. Unfortunately in that location is not a single click solution on SE78 SAP transaction screen to export graphics, logos or export images from SAP BDS arrangement. This ABAP tutorial provides an easy program to extract bitmap images from SAP BDS (Concern Certificate Service) and save on a local folder as a bitmap .bmp paradigm file.

Besides as uploading bitmap images or graphics to SAP images document server, it is sometimes a requirement to download and export images from SAP document server where ABAP developers and SAP customization specialists manage using SE78 tcode.

In this SAP tutorial, I will show and demonstrate how y'all tin can export images (for this tutorial SAP LOGO BMP). This is a color bitmap image every bit shown in below SE78 transaction UI screenshot.

export graphics from SAP SE78 transaction using ABAP
Export images and graphics from SAP SE78 transaction

Let's commencement out tutorial by creating a new ABAP report using ABAP Workbench.

export graphics ABAP report

Kickoff, nosotros will start past building the selection-screen codes.
Here as you run across below, the ABAP report requests a file proper noun in an input text area.
An other parameter that the user volition provide is if the epitome is black and white bitmap image or a color bitmap image.
This parameter is displayed using a radiobutton group in the selection screen.

Selection-SCREEN: BEGIN OF Cake sel WITH FRAME TITLE text-000.

PARAMETERS: pa_image Like rstxt-tdname.

Selection-SCREEN Brainstorm OF LINE.
Selection-SCREEN POSITION xxx.
PARAMETERS: bw RADIOBUTTON Group icol DEFAULT '10'.
Selection-SCREEN Comment 35(30) text-001.
Selection-SCREEN END OF LINE.

SELECTION-SCREEN BEGIN OF LINE.
Option-SCREEN POSITION 30.
PARAMETERS: color RADIOBUTTON GROUP icol.
SELECTION-SCREEN COMMENT 35(30) text-002.
Option-SCREEN END OF LINE.

Option-SCREEN: END OF BLOCK sel.

Code

Higher up provided ABAP source codes of the SAP option screen generates the below screen for the user interface. This option screen enables the user to enter the proper name of the bitmap image which is desired to export from SAP system.

selection screen for ABAP report

To get the stored images in SAP BDS (Business Document Service), ABAP developers can call function module SAPSCRIPT_GET_GRAPHIC_BDS.
ABAP SAPSCRIPT_GET_GRAPHIC_BDS function module gets the binary data from SAP for a given specific bitmap paradigm uploaded to BDS (SE78 tcode).

Call FUNCTION 'SAPSCRIPT_GET_GRAPHIC_BDS'
EXPORTING
i_object = 'GRAPHICS' " STXBITMAPS-TDOBJECT
i_name = pa_image " STXBITMAPS-TDNAME, epitome name
i_id = 'BMAP' " STXBITMAPS-TDID
i_btype = lv_tdbtype " STXBITMAPS-TDBTYPE, black/white or color
IMPORTING
e_bytecount = lv_bytecount " I, size of binary prototype data
TABLES
content = lv_content " SBDST_CONTENT, binary data
EXCEPTIONS
not_found = one
bds_get_failed = two
bds_no_content = 3
OTHERS = 4.

Code

The next step in our sample ABAP code is to call part module "SAPSCRIPT_CONVERT_BITMAP" to convert the returned binary data into bitmap file.

ABAP function module SAPSCRIPT_CONVERT_BITMAP converts graphics in BDS file format into BMP bitmap image format. Here is how ABAP developers can use SAPSCRIPT_CONVERT_BITMAP office module.

Telephone call FUNCTION 'SAPSCRIPT_CONVERT_BITMAP'
EXPORTING
old_format = 'BDS' " source epitome file type
new_format = 'BMP' " target prototype file type => .bmp
bitmap_file_bytecount_in = lv_bytecount
IMPORTING
bitmap_file_bytecount = graphic_size
TABLES
bitmap_file = graphic_table
bds_bitmap_file = lv_content " SBDST_CONTENT
EXCEPTIONS
OTHERS = 1.

Code

After BDS file in lv_content is converted to bitmap epitome and returned within graphic_table internal table variable, we are at present ready to export bmp image to a predefined file folder. In order to export SAP BDS graphics file to a arrangement folder, ABAP developers can use WS_DOWNLOAD function module.

ABAP developers should prepare the filename parameter of the WS_DOWNLOAD ABAP function module in the format including the total file path.
In this ABAP tutorial sample case, I used a constant file folder to shop exported BDS images.
Mayhap information technology is a improve idea to use ABAP binder selector or Display File Dialog control using cl_gui_frontend_services=>FILE_SAVE_DIALOG method. But this is a topic of an other ABAP tutorial.

Phone call FUNCTION 'WS_DOWNLOAD'
EXPORTING
bin_filesize = graphic_size
filename = lv_export_file_name " 'u:\export.bmp'
filetype = 'BIN'
TABLES
data_tab = graphic_table
EXCEPTIONS
invalid_filesize = 1
invalid_table_width = two
invalid_type = three
no_batch = iv
unknown_error = 5
gui_refuse_filetransfer = 6.

Code

After recognizing the ABAP function modules that the developers tin use in their ABAP programs to export SE78 images from Business Document Service (BDS), I can share the all source codes of the sample ABAP report Z_EXPORT_GRAPHICS created for this tutorial.

Report z_export_graphics.

SELECTION-SCREEN: BEGIN OF BLOCK sel WITH FRAME TITLE text-000.

PARAMETERS: pa_image LIKE rstxt-tdname.

Selection-SCREEN Begin OF LINE.
Pick-SCREEN POSITION 30.
PARAMETERS: bw RADIOBUTTON Grouping icol DEFAULT 'X'.
SELECTION-SCREEN COMMENT 35(30) text-001.
Pick-SCREEN END OF LINE.

SELECTION-SCREEN BEGIN OF LINE.
Selection-SCREEN POSITION 30.
PARAMETERS: colour RADIOBUTTON GROUP icol.
SELECTION-SCREEN COMMENT 35(30) text-002.
Selection-SCREEN END OF LINE.

Option-SCREEN: END OF BLOCK sel.

CHECK pa_image IS NOT INITIAL.

Data :
lv_bytecount TYPE i,
lv_tdbtype Similar stxbitmaps-tdbtype,
lv_content Blazon STANDARD TABLE OF bapiconten INITIAL SIZE 0.

DATA: graphic_size TYPE i.

DATA:
Begin OF graphic_table OCCURS 0,
line(255) TYPE x,
Stop OF graphic_table.

DATA: lv_export_file_name Blazon RLGRAP-FILENAME.

CONCATENATE 'u:\' pa_image '.bmp' INTO lv_export_file_name.

IF bw EQ 'Ten'.
lv_tdbtype = 'BMON'. " Black and White Bitmap Image
ELSE.
lv_tdbtype = 'BCOL'. " Colour Bitmap Image
ENDIF.

*** get binary data from SAP BDS for specific graphics image
CALL Part 'SAPSCRIPT_GET_GRAPHIC_BDS'
EXPORTING
i_object = 'GRAPHICS' " STXBITMAPS-TDOBJECT
i_name = pa_image " STXBITMAPS-TDNAME
i_id = 'BMAP' " STXBITMAPS-TDID
i_btype = lv_tdbtype " STXBITMAPS-TDBTYPE
IMPORTING
e_bytecount = lv_bytecount " I
TABLES
content = lv_content " SBDST_CONTENT
EXCEPTIONS
not_found = 1
bds_get_failed = ii
bds_no_content = three
OTHERS = 4.

CHECK sy-subrc IS INITIAL.

*** convert graphics in BDS file format to BMP bitmap image format
Telephone call FUNCTION 'SAPSCRIPT_CONVERT_BITMAP'
EXPORTING
old_format = 'BDS' " source paradigm file type
new_format = 'BMP' " target image file type => .bmp
bitmap_file_bytecount_in = lv_bytecount
IMPORTING
bitmap_file_bytecount = graphic_size
TABLES
bitmap_file = graphic_table
bds_bitmap_file = lv_content " SBDST_CONTENT
EXCEPTIONS
OTHERS = 1.

CHECK sy-subrc IS INITIAL.

CALL FUNCTION 'WS_DOWNLOAD'
EXPORTING
bin_filesize = graphic_size
filename = lv_export_file_name " 'u:\export.bmp'
filetype = 'BIN'
TABLES
data_tab = graphic_table
EXCEPTIONS
invalid_filesize = ane
invalid_table_width = ii
invalid_type = three
no_batch = four
unknown_error = 5
gui_refuse_filetransfer = vi.

IF sy-subrc <> 0.
Message ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.

Code

After you activate your ABAP report, you tin now export SAP logo from SAP BDS arrangement. If you lot run the ABAP program z_export_graphics and enter "SAP LOGO BMP" every bit the name of the bitmap epitome and choose Color Bitmap Paradigm option and execute the report, a graphics file volition be created in the target binder with the aforementioned prototype name.

export SAP logo from BDS - SE78 transaction

gambleammed1960.blogspot.com

Source: https://www.kodyaz.com/sap-abap/export-graphics-se78-using-abap-code.aspx

0 Response to "sap- how to upload logo in se78"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel