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

Internal table PDF bytecount

Former Member
0 Likes
967

Hello Gurus,

I have a pdf file data in an internal table. How do I find the total bytecount of the data in the internal table. I am declaraing the pdf internal table as follows:

DATA: table_pdf TYPE table of tline.

Please help.

Regards,

Jainam.

1 ACCEPTED SOLUTION
Read only

former_member194669
Active Contributor
0 Likes
833

You may need to use

DESCRIBE FIELD TEXT LENGTH LEN in byte mode.

This returns the length of the field in bytes

and also check

http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb3145358411d1829f0000e829fbfe/content.htm

a®

5 REPLIES 5
Read only

former_member194669
Active Contributor
0 Likes
834

You may need to use

DESCRIBE FIELD TEXT LENGTH LEN in byte mode.

This returns the length of the field in bytes

and also check

http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb3145358411d1829f0000e829fbfe/content.htm

a®

Read only

0 Likes
833

Well I tried to do following, I get differnet length of pdf file in v_pdf_bytecount and calculated actually. The byte count done programatically doesn't match v_pdf_bytecount.

CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'

EXPORTING

src_spoolid = v_spoolid

no_dialog = ' '

IMPORTING

pdf_bytecount = v_pdf_bytecount

TABLES

pdf = it_pdf[].

data: len type i,

v_len type i.

loop at it_pdf into wa_pdf.

DESCRIBE FIELD wa_pdf LENGTH len IN BYTE mode.

v_len = len + v_len.

endloop.

Read only

0 Likes
833

Hi,

When the FM CONVERT_ABAPSPOOLJOB_2_PDF returns the pdf byte count why would you want to again calculate it based on the internal table?

Regards,

Vikranth

Read only

0 Likes
833

Thats a complete different story because I cannot pass the length of pdf file to custom function module since changes to custom function module export parameters will require a long approval process in our company...

Read only

0 Likes
833

if it's just politics, just use EXPORT TO MEMORY ID and IMPORT FROM MEMORY ID