2018 Apr 18 1:12 PM
Hello,
My requirement is to print an image in Adobe form based on the RAWSTRING received from a front end non-SAP app.
The images are stored on the front end app and the converted RAWSTRING is sent back to SAP system based on user selection. SAP program receives the data as a 2000 character RAWSTRING format through a RFC call.
In Adobe form, I have created an image field and mapped to a graphics node in context menu. In code initialization section, RFC populates the XSTRING variable mapped to graphics node, however, image is not getting displayed on the form.
I tried to put an image in MIME and used it in form, and it worked.
I want your help to understand:
Thanks,
Alok
2018 Apr 18 2:23 PM
Hi Alok,
Try to upload graphics with transaction SE78 and then method below can help you.
CALL METHOD cl_ssf_xsf_utilities=>get_bds_graphic_as_bmp.
Regards,
2018 Apr 18 5:26 PM
"Is it required to convert RAWSTRING to XSTRING "
This question simply makes no sense.
Please look up the documentation about built-in dictionary types and ABAP types.
2019 Feb 04 10:09 PM
On the context, the graphic MIME type is 'IMAGE/BMP'?
Are you inserting an image field and marking the check box “Embed Image Data” on the forma layout?
Try to download the image and open It
Use the methods below: cl_gui_frontend_services=>file_save_dialog cl_document_bcs=>xstring_to_solix cl_gui_frontend_services=>gui_download
Sample code
" Download the image
DATA: lv_filename TYPE string,
lv_path TYPE string,
lv_fullpath TYPE string,
lv_user_action TYPE i.
CALL METHOD cl_gui_frontend_services=>file_save_dialog
EXPORTING
file_filter = '*.jpg'
default_extension = 'jpg'
default_file_name = 'file_name'
initial_directory = 'C:\TEMP\'
CHANGING
filename = lv_filename
path = lv_path
fullpath = lv_fullpath
user_action = lv_user_action
EXCEPTIONS
cntl_error= 1
error_no_gui = 2
invalid_default_file_name = 3
not_supported_by_gui = 4
OTHERS = 5.
DATA(lt_jpg_content) = cl_document_bcs=>xstring_to_solix( ip_xstring = <your xstring> ).
CALL METHOD cl_gui_frontend_services=>gui_download EXPORTING
filename = lv_filename
filetype = 'BIN'
CHANGING
data_tab = lt_jpg_content
EXCEPTIONS
file_not_found = 1
file_write_error = 2
filesize_not_allowed = 3
invalid_type = 4
no_batch = 5
gui_refuse_filetransfer = 8
OTHERS = 10.
2019 Feb 05 12:50 AM
1. RAWSTRING is equal to XSTRING in abap, you dont have to convert (unless your word "rawstring" mean difference). anyway, you could find alot of convert method from class CL_BCS_CONVERT if you need to.
2. idk if there is a way to check it, maybe not since that string could be anything and dont have syntax...idk.
3. it might be related to mime_type parameter, could you set a fixed mime type (like bmp => mime type = IMAGE/BMP...) and see what happend?