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

pdf attachment with SO_DOCUMENT_SEND_API1

Former Member
0 Likes
3,217

Hi Guys ,

I have a smartform from which i get the OTF . I convert the OTF to PDF using FM convert_otf.

If i send this file to spool and check it contents .. all is fine and the logo in the smartform appears fine as well .

Now my reqt is to send the PDF as attachment thru mail to user .

In the FM there is a logicwhere 132 long string is converted to 255

LOOP AT pt_payslip_pdf into wa_lines.

TRANSLATE wa_lines USING ' ~'.

CONCATENATE lf_buffer wa_lines INTO lf_buffer.

ENDLOOP.

TRANSLATE lf_buffer USING '~ '.

DO.

wa_attachment = lf_buffer.

APPEND wa_attachment to lt_attachment.

SHIFT lf_buffer LEFT BY 255 PLACES.

IF lf_buffer IS INITIAL.

EXIT.

ENDIF.

ENDDO.

now lt_attachment is sent as one of the parameters to

SO_DOCUMENT_SEND_API1

with wa_packing_list-doc_type = 'RAW'.

This works perfect in 46C . Now in ECC when i open the attachment in my mail .. I get a disfigured logo , sometimes i get 'error END of COLOR'.

If i remove logo everything is fine .. the contents of pdf is fine in attachment .

Could anyone help me in this regard as to what needs to be done to get logo and contents perfect as an attachment .

Thanks

Neelima

5 REPLIES 5
Read only

Former Member
0 Likes
1,623

Hi ,

If you have ECC installed ,

I think that the fastest way to solve your problem would be to replace the sending method

to the BCS interface introduced in ECC .

Just have a look at program BCS_EXAMPLE_6 .

You can copy the lines at the bottom .

I hope that it'll work for you because the ols function is a mess .

Best Regards .

Read only

0 Likes
1,623

thanks for replying Avi .

the pdf format that i get from convert_otf is of tyope tline .

when i try to use int he BCS code it expects an xstring .. any idea how to go about with this converstion ?

i am having problem to convert the pdf to compatible type for bcs asper example6.

thanks

Read only

0 Likes
1,623

Hi ,

I used the example code in ECC for forms that I created in Adobe forms(as the example does)

So I don't really know but I found a couple of functions like

SX_OBJECT_CONVERT_OTF_RAW

SX_OBJECT_CONVERT_OTF_PDF

SX_OBJECT_CONVERT*

The input data is very complex so I cannot test it , you should try them out .

maybe their output structures will be compatible with the one from the BCS .

Best regards .

Read only

0 Likes
1,623

Thanks for ur help ..

I tried using this logic ..If i remove the logo fromt he PDF then the mail goes fine .. if i get the logo back .. i get the issue .

This problem in ECC for logos is only when a logo is large .. small logos go thru ..

looks like there is some conversion issue when logo is converted into binary ..

Even debug cannot resolve whats missing in a binary file ( as its difficult to analyse a bin file )

Not sure if any body has faced this issue earlier

Read only

0 Likes
1,623

Thanks for ur help .. my problem is now resolved

using so_new_document_send_api