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

Problem with PDF generation

Former Member
0 Likes
593

Hi,

I am using FM u2018u2019 to convert spool to PDF using below code:

CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'

EXPORTING

src_spoolid = v_sid u201Cspool id

no_dialog = c_x u201CX

dst_device = c_dest u201CLOCL

TABLES

pdf = it_pdf

EXCEPTIONS

err_no_abap_spooljob = 1

err_no_spooljob = 2

err_no_permission = 3

err_conv_not_possible = 4

err_bad_destdevice = 5

user_cancelled = 6

err_spoolerror = 7

err_temseerror = 8

err_btcjob_open_failed = 9

err_btcjob_submit_failed = 10

err_btcjob_close_failed = 11

OTHERS = 12.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

However, when I check the generated PDF table it is not in readable format:

ㄭ㌮਍쿣ී㈊〠漠橢਍圯湩湁楳湅潣楤杮਍湥潤橢਍u2033u2030扯൪㰊഼┊敄瑶灹⁥佐呓u2032u2020䘠湯⁴佃剕䕉⁒渠牯慭慌杮䔠ൎ⼊祔数⼠潆瑮਍匯扵祴数⼠祔数റ⼊慂敳潆瑮⼠潃

⤵਍䌯敲瑡牯⠠潆浲堠偟偁剅䔠⥎਍倯潲畤散⁲匨偁丠瑥敗癡牥㜠㄰⤠਍匥偁湩潦瑓牡⁴佔彁䅄䅒਍䘥乕呃佉㵎
u2020⤠਍䴥乁䅄呎⠽u2020⤠਍䐥䱅䑟呁㵅〨〰〰〰⤰਍匥偁

⠽u2020u2020u2020u2020u2020u2020u2020u2020u2020u2020u2020u2020u2020u2020u2020u2020u2020u2020u2020u2020ഩ┊但䵒剁䡃噉⠽u2020ഩ┊䕒䕓噒㵅
u2020u2020u2020u2020u2020u2020u2020u2020u2020u2020u2020u2020u2020ഩ┊低䥔㵚
u2020u2020u2020u2020u2020u2020u2020u2020u2020u2020u2020u2020u2020u2020u2020u2020u2020u2020u2020u2020u2020u2020u2020u2020u2020u2020u2020u2020u2020u2020u2020⤠਍ⴥ
u2020u2020u2020u2020u2020u2020u2020u2020u2020u2020u2020u2020u2020u2020u2020u2020u2020u2020u2020u2020u2020u2020u2020u2020u2020

u2020u2020u2020u2020u2020u2020u2020u2020u2020u2020u2020u2020u2020u2020u2020u2020u2020u2020u2020u2020u2020u2020u2020⤠਍ⴥ
u2020u2020u2020u2020u2020u2020u2020u2020u2020u2020u2020u2020u2020u2020u2020u2020u2020u2020u2020u2020u2020u2020u2020u2020u2020u2020u2020u2020u2020u2020u2020⤠਍匥偁湩潦湅⁤佔彁䅄䅒਍㸾਍湥潤橢਍‱u2030扯൪㰊഼⼊祔数⼠慐敧൳⼊楋獤਍嵛਍䌯畯瑮〠਍

獕乥湯൥㸊ാ攊摮扯൪砊敲൦《㘠਍〰〰〰〰〰㘠㔵㔳映਍〰〰〰㤰㈶〠〰〰渠਍〰〰〰〰㜱〠〰〰渠਍〰〰〰〰㈵〠〰〰渠਍〰〰〰㈰㔰〠〰〰渠਍〰〰〰

Can anyone tell me what I am doing wrong?

Regards,

Aleria

3 REPLIES 3
Read only

Former Member
0 Likes
537

Hi,

Can you debug the function module and cheke what data are you getting in it_pdf ?

Depend on the data in it_pdf can be decide further.

Regards,

Pravin

Read only

Former Member
0 Likes
537

Hi,

when you convert spool to PDF using the FM 'CONVERT_ABAPSPOOLJOB_2_PDF' after execuitng the FM the required table

it_PDF will get filled with junk character only. That is for 132 character will come after you need to convert it into 255 characters

after that only you can able to visble data. If you are sending as a mail attachments directly converted data you can pass into mail body that will work fine.

Regards

Thirupathy

Read only

Former Member
0 Likes
537

After converting PDF you can FM - QCE1_CONVERT to convert the Binary data in readble format. The FM also solve character lenght issue when character lenght is more then 132 characters