Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Open dataset filesize

Former Member
0 Likes
1,130

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

2 REPLIES 2
Read only

asik_shameem
Active Contributor
0 Likes
663

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.

Read only

0 Likes
663

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