10-12-2005 9:56 PM
We are using SAP version ECC 5.0. We want to convert SAP PO into PDF format and attached it in an email and send it to vendor. Please give me some tips to achieve this?
Thanks in advance!
Mrudula
10-12-2005 10:00 PM
10-12-2005 10:02 PM
Hi Mrudula
You should generate a spool and so convert this spool into PDF.
Here you can see an abap program:
http://www.sapdevelopment.co.uk/reporting/rep_spooltopdf.htm
In that example it use CONVERT_ABAPSPOOLJOB_2_PDF, but you should used CONVERT_OTFSPOOLJOB_2_PDF instead of that. Infact before you create the spool (print PO using a message) and then convert it.
Max
Message was edited by: max bianchi
10-13-2005 2:30 AM
Hi!
The way to achieve your goal depends on how you get PO printed - by sapscript, smartform or abap list.
As have been mentioned you can create spool request and process it. But for sapscript and smartform you can proceed without spool request - just get back OTF data from corresponding FM and convert it to PDF.
In case of smartform:
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = 'ZFORMNAME'
IMPORTING
fm_name = v_form_name
EXCEPTIONS
no_form = 1
no_function_module = 2
OTHERS = 3.
w_ctrlop-getotf = 'X'.
w_ctrlop-no_dialog = 'X'.
w_compop-tdnoprev = 'X'.
CALL FUNCTION v_form_name
EXPORTING
control_parameters = w_ctrlop
output_options = w_compop
user_settings = 'X'
IMPORTING
job_output_info = w_return
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5.
i_otf[] = w_return-otfdata[].
In case of sapscript:
options-tdgetotf = 'X'.
CALL FUNCTION 'OPEN_FORM'
EXPORTING
options = options
...
CALL FUNCTION 'CLOSE_FORM'
IMPORTING
RESULT =
RDI_RESULT =
TABLES
otfdata = i_otf
EXCEPTIONS
unopened = 1
bad_pageformat_for_print = 2
send_error = 3
spool_error = 4
OTHERS = 5.
Then convert to PDF
DATA:
pdf LIKE tline OCCURS 100 WITH HEADER LINE,
v_len_in LIKE sood-objlen.
CALL FUNCTION 'CONVERT_OTF'
EXPORTING
format = 'PDF'
max_linewidth = 132
ARCHIVE_INDEX = ' '
IMPORTING
bin_filesize = v_len_in
TABLES
otf = i_otf
lines = pdf
EXCEPTIONS
err_max_linewidth = 1
err_format = 2
err_conv_not_possible = 3
OTHERS = 4
.
Then send as attachment as Max proposed.
Regards,
Maxim.
10-13-2005 3:00 AM
Hi Mrudula,
This is supported with stanadrad output control . You can do this using your sapscript or smartform. Just see if your output type has a processing routine & smartform defined for medium "5" external send . It can be the same print program and routine you use for printing .
Now create a condition record for output medium "5" .
Also make sure that email is maintained in Vendor Master .
Cheers
04-19-2007 2:13 PM
Hi Sanjay,
I am using standard print program : RLB_INVOICE and layout LB_BIL_INVOICE for sending the Invoice to the customer via e-mail.
I am trying through a standard output type MAIL.
I have also maintained the email settings .
Can you please elobarate on how to attach the print program and layout to the output type?
10-13-2005 1:44 PM
Thanks to all of you for your quick replies and suggestions. I would look at them and would see if I need more information or help from you guys.
Thanks again!
Mrudula