05-07-2010 11:57 AM
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
05-07-2010 12:09 PM
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
05-07-2010 12:28 PM
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
05-07-2010 12:38 PM
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