‎2008 Mar 14 9:48 AM
Hi all!
I'm need to create a FM to load graphics from presentation server into SAP Graphics (to use in sapscript/smartforms).
I've discovered the function called by transaction SE78, but those FM calls a screen (and it cannot appen!). MORE, those FM are created using GUI_UPLOAD.
My problem is that I'm trying to replicate that FM, but using OPEN DATASET. So far so good, but I need filesize!!!
In OPEN DATASET, how do I get/calculate file size???
Please Help, its urgent!
Thanks
Carlos
‎2008 Mar 14 11:28 AM
Hi use FM EPS_GET_DIRECTORY_LISTING and make sure u have authorization to the file. It will work.
DATA: it_dir TYPE STANDARD TABLE OF epsfili,
wa_dir TYPE epsfili.
PARAMETERS: p_file TYPE epsfilnam.
CALL FUNCTION 'EPS_GET_DIRECTORY_LISTING'
EXPORTING
dir_name = '/usr/sap/interface/'
file_mask = p_file
TABLES
dir_list = it_dir
EXCEPTIONS
invalid_eps_subdir = 1
sapgparam_failed = 2
build_directory_failed = 3
no_authorization = 4
read_directory_failed = 5
too_many_read_errors = 6
empty_directory_list = 7
OTHERS = 8.
READ TABLE it_dir INTO wa_dir WITH KEY name = p_file.
IF sy-subrc EQ 0.
WRITE:/ wa_dir-size.
ENDIF.
‎2008 Mar 14 5:28 PM
Thanks!
It kind of work... only problem with capital or small caps... It can be worked.
Now, another situation: after I get bitmap and size, I need to convert bitmap into the BDS format with FM 'SAPSCRIPT_CONVERT_BITMAP_BDS'. However, this FM is always exiting with exception:
"Bitmap file: Preliminary end of file, file contains errors
Message no. TD878 "
Any Ideas?!
Thanks
Carlos