cancel
Showing results for 
Search instead for 
Did you mean: 

Smartforms to PDF without saving dialogbox and the PDF have attachment Icon

Former Member
0 Kudos

Hi Guru's,

   I have the requirement like smartform to pdf conversion without asking save dialog box and the pdf must have attachment icon. I have tryed 'SSFCOMP_PDF_PREVIEW' this function module but that pdf doesnt contains attachment icon. can you please give the valueable solution.

Thanks & Regards,

Dhina..

Accepted Solutions (0)

Answers (4)

Answers (4)

0 Kudos

Do you know PDF! Functionality .

You can generate PDF while Print Preview of Smartform, Simply write PDF! at Command Field.

Refer code,

call function 'SSFCOMP_PDF_PREVIEW'
            exporting  i_otf    = otf[]
            exceptions convert_otf_to_pdf_error = 1
                       cntl_error               = 2
                       others                   = 3.

Former Member
0 Kudos

Hi,

You can use the concept of Spool here. The spool request will contain the data (which you want to convert into PDF), i.e., SUBMIT <program generating the smartform> to SAP-SPOOL...before submitting, get the print parameters using FM GET_PRINT_PARAMETERS.

Read the spool(using FM RSPO_GET_PAGES_SPOOLJOB) and do accordingly..like if you want to mail or display.

Regards,

Koushik.

Former Member
0 Kudos

Hi Koushik,

  Can please explain briefly..

This was my requirement actually once my driver program run the output will directly show in pdf format. it can be achieve using the function module 'SSFCOMP_PDF_PREVIEW'. But the enduser wants that pdf contains Attachment icon
once press the attachment icon it will show the some other PDF file like that my requirement.

Thanks,
Dhina.

Former Member
0 Kudos

Hi Dhina,

So you want to display the document in PDF format. you can use the FM HR_EFI_SHOW_PDF_FORM, this will accept the OTF data and display(as popup) the document in PDF format,like a normal PDF file..to which you can attach as u like.

Regards,

Koushik.

Former Member
0 Kudos

Hi Koushik,

I am using the function moule ''HR_EFI_SHOW_PDF_FORM" but its displaying normal pdf file but I need the attachment icon on the pdf file. if any other function module or class can achieve this?

Thanks,

Dhina..

Former Member
0 Kudos

Hi Dhina,

You will get attachment icon(depending on the version of Adobe reader). but that is to display the attachments with the respective file. in order to attach files to the PDF file after it has been displayed, you need Adobe Acrobat X(it will help you to edit the document and attaching files to it is a form of editing the file), because that will be the functionality of Adobe reader.once displayed you cannot control it from ABAP.

If i have misunderstood your requirement, correct me.

Regards,

Koushik

Former Member
0 Kudos

Hi Koushik,

I have the version in my system because Once i am using method gui_download it will download and using the method 'Execute' it will display into pdf format with having attachment icon but i dont want to save the pdf in local disk.

how can i achieve that?

Thanks,
Dhina..

0 Kudos

Hmm,

Why don't you use same code save in TMP Folder...

Don't open Save Dialog and Open PDF File with use of GUI_RUN Function Module.

If you want to open it directly.

Former Member
0 Kudos

Hi Dhina,

What you want to acheive with the attachment-icon? if i am not mistaken, you want to attach a file?but then what? like the file is getting displayed only. and as a matter of fact use Adobe Reader X(v. 9 and above), this will give you an attachment icon.

But as i have already told you that is for displaying the attachments already present with the document. if you want to attach any files after it is displayed, you need Adobe Acrobat X (otherwise you cannot edit a PDF file,and creating attachment is a form of EDIT mode)

Do tell what is your exact requirement..

Regards,

Koushik

Former Member
0 Kudos

Hi,

  1. Before you call your smartform, make sure you set this - ssfctrlop-getotf = 'X'.
  2. Pass job_output_info-otfdata to FM - CONVERT_OTF_2_PDF to get the PDF lines in LINES table.
  3. Pass the lines table, filename to FM - GUI_DOWNLOAD with a file extension as BIN.
  4. Make sure that while selecting your filename from selection screen don't forget to give extension as .PDF.

Regards,

Danish

Former Member
0 Kudos

Hi Danish,

  once you use the FM - GUI_DOWNLOAD it will ask for path to save the file but in my requirment dont want to save the pdf file.

Thanks,
Dhina.

Former Member
0 Kudos

Hi Dhina,

Are yuo going to send the PDF in EMAIL . If So follow the below steps

Steps:

1. While calling the Smartform Function set the CONTROL_PARAMETERS-GETOTF = 'X'.

after the execution of the FM u will get the OTF data in the Imp[ort Parameter:

JOB_OUTPUT_INFO-OTFDATA.

2. Now pass this OTFDATA to the FM CONVERT_OTF_AND_MAIL. in this pass the Sender Receiver etc.

Hope This helps u.

Former Member
0 Kudos

Hi Seenu,

  This was my requirement actually once my driver program run the output will directly show in pdf format.
it can be atcheave using the function module 'SSFCOMP_PDF_PREVIEW'. But the enduser wants that pdf contains Attachment icon
once press the attachment icon it will show the some other pdf file like that my requirement.

  I am not sending any emails and all.


Thanks,
Dhina.