Application Development 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: 

Get size of pdf files in mail attachment . mail generated via cl_bcs.

shadab_sk
Participant
0 Kudos
1,315

HI experts,

I have a requirement to check the size of pdf attachments which I am sending via mail in sap. I am using cl_bcs to generate the mail. The pdf attachments are coming from application server.

I need to restrict attaching of pdf's to mail if the size exceeds 10 MB. Checking file size in app.server is not recommended.

Please advise. need urgent help.

thanks

shadab

5 REPLIES 5

pranay570708
Active Contributor
0 Kudos
381

Use FM 'IWB_KXF_CALC_FILESIZE'. Pass internal table and it will return you file size in byte.

Or,

DESCRIBE TABLE itab LINES l_lines.

doc_size = l_lines*255.

0 Kudos
381

Hi,

I have attachment data in binary format in my internal table , and the FM mentioned by you expects the importing table in char format. Any ideas on how the conversion can be done ? any FM..?

thanks

shadab

0 Kudos
381

Chintu6august
Contributor
0 Kudos
381

HI,

Use FM : IWB_KXF_CALC_FILESIZE

here you  need to pass our converted internal table


thanks!!

Tomas_Buryanek
Active Contributor
0 Kudos
381

How exactly are you working with that PDF binary data?

You should know its exact size while you are attaching it to mail.

BCS method add_attachment - parameter i_attachment_size.

-- Tomas --