Attach Pdf output into transaction FB03
Hi experts,
My requirement is to attach Pdf output coming from FM CONEVRT_ABAPSPOOLJOB_2_PDF
into transaction FB03 (SERVICE attachment list)
Needs pointers for this.
thanks
Manish Puri
Hi
ZPO_PDF is the transaction code.
You can create this transaction code using transaction SE93 and assigning the program RSTXPDFT4 to it.
Thanks & Regards
Kishore
Similar Messages
-
Can no longer attach pdf files into email.
I recently purchased a new computer with Windows 8.1 as the OS. Seems that I am no longer able to attach PDF files into any email. Any clues as to what has gone wrong?
Thanks for the help. Seems I had a failed Windows update several weeks past I had forgottent about. Had to do a restore to the prior date to get back to the right configuration. Did an online session with Mircosoft, reinitiated the update, and it seems as if the issue is resolved. We were able to re-test attaching and send pdf files. Seems there is still some slight issue with IE, but you appear to be on the right track about focusing on Web Outlook if the problem continues to surface. Thanks again.
-
PDF Output into a specified folder
Hi,
Is is possible to automatically deliver PDF output into a specified folder(directory) on a hard drive? What settings need to be done in order to achieve this?
ThanksHi Sasha,
You can use the Bursting option to do that.
Thanks,
Machaan -
Save pdf output into db WITHOUT hardcoding username password in desname
We are trying to use pluggable destination (Blobdestination) to save our reports in pdf format into the database. Our security policies dictate that we cannot hardcode
the database username password in the URL or in the code.
What are our options? Can we use the OC4J datasources?
ThanksWe tried using utl_http, but face two issues.
1. When we used https and provided wallet, failure
happened.Why would you want the overhead of https between your db and your report server? The db should be inside a firewall and ideally, your report server would be too.
2. When the report runs for a long time time out
issues were happening.The default for utl_http is 60 seconds. You just have to change it:
utl_http.set_transfer_timeout(60); -- default
utl_http.set_transfer_timeout(3600); -- 1 hour -
How to attach pdf data into SRM ?
we have a report which sends out a smartform purchaseorder as a pdf to a vendor by email.
Now the requirement is to connect the sent pdf into srm in order to be visible for checking the billing.
it is easy to attach an external file into srm but now I already have alle the data available in sap after sending the pdf as attachment in the mail.
is it also possible to directly transfer this data directly into srm with for instance BAPI_DOCUMENT_CREATE ??
or is another step in between necessary ?
this is the coding for sending the email
CALL FUNCTION 'SX_OBJECT_CONVERT_OTF_PDF'
EXPORTING
format_src = 'OTF'
format_dst = 'PDF'
devtype = 'MAIL'
* FUNCPARA =
CHANGING
transfer_bin = xtransfer_bin
content_txt = t_cont_txt
content_bin = t_cont_bin
objhead = objhead_att
len = tabsize
EXCEPTIONS
err_conv_failed = 1.
DESCRIBE TABLE t_cont_bin LINES tablines.
MOVE i_attach_head TO t_objhead.
APPEND t_objhead.
* Objectpack opbouwen voor attachment
t_objpack-transf_bin = 'X'.
t_objpack-head_start = 1.
t_objpack-head_num = 1.
t_objpack-body_start = 1.
t_objpack-body_num = tablines.
t_objpack-obj_name = i_attach_name.
t_objpack-obj_descr = i_attach_descr.
t_objpack-doc_type = 'PDF'.
t_objpack-doc_size = tablines * 255.
APPEND t_objpack.
* Ontvangerlijst opbouwen
LOOP AT t_receiver.
MOVE-CORRESPONDING t_receiver TO trcv.
MOVE 'U' TO trcv-rec_type. " Extern mailadres
APPEND trcv.
ENDLOOP.
DESCRIBE TABLE trcv LINES h_lines.
IF h_lines = 0.
RAISE no_receiver.
EXIT.
ENDIF.
* Zender
IF i_sender IS INITIAL.
so_sender = sy-uname.
so_sendertype = 'B'.
ELSE.
so_sender = i_sender.
so_sendertype = 'INT'.
ENDIF.
* Mail verzenden
CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
EXPORTING
document_data = s_docdata
put_in_outbox = 'X'
sender_address = so_sender
sender_address_type = so_sendertype
commit_work = i_commit_work
* IMPORTING
* SENT_TO_ALL =
* NEW_OBJECT_ID =
* SENDER_ID =
TABLES
packing_list = t_objpack
object_header = t_objhead " Mailheader
* CONTENTS_BIN = T_OBJBIN " Binaire data (attach)
contents_txt = t_doctxt " ASCII-data
contents_hex = t_cont_bin " Hex-data
* OBJECT_PARA =
* OBJECT_PARB =
receivers = trcv
EXCEPTIONS
too_many_receivers = 1
document_not_sent = 2
document_type_not_exist = 3
operation_no_authorization = 4
parameter_error = 5
x_error = 6
enqueue_error = 7
OTHERS = 8.
IF sy-subrc NE 0.
RAISE mail_not_sent.
ENDIF.
I have also found this thread but also no answer there to this as it seems simple requirement ??
PDF Creation + connection to DMS
kind regards
Arthur de Smidt
Edited by: A. de Smidt on May 17, 2011 2:43 PMok solved it myself by using cl_gui_frontend_services=>gui_download with
BAPI_DOCUMENT_CREATE2 -
Error in attach PDF file into email
Hi, currently i have problem in sending out email as i try to go through the <b>Offline Interactive PDF Form Using E-Mail</b> and also <b>Uploading and Downloading Files in Web Dynpro Java</b> and then i manage to get the file that i want to upload into the filedownload UI
but then the problem is i cannot map the context of the FILEDOWNLOAD UI data source to the attachment email
which is as below the code
multipart.addBodyPart(messageBodyPart);
messageBodyPart = new MimeBodyPart();
messageBodyPart.setDataHandler(new DataHandler(new MemoryDataSource(wdContext.currentContextElement().getPdfSource())));
messageBodyPart.setFileName(wdContext.currentContextElement().getFileUploadUI().getResourceName());
messageBodyPart.setHeader("Content-Type","application/pdf");
multipart.addBodyPart(messageBodyPart);
message.setContent(multipart);
Transport.send(message);
wonder anyone know where is the problem or mistake or anyone has the idea of doing itHi, currently i have problem in sending out email as i try to go through the <b>Offline Interactive PDF Form Using E-Mail</b> and also <b>Uploading and Downloading Files in Web Dynpro Java</b> and then i manage to get the file that i want to upload into the filedownload UI
but then the problem is i cannot map the context of the FILEDOWNLOAD UI data source to the attachment email
which is as below the code
multipart.addBodyPart(messageBodyPart);
messageBodyPart = new MimeBodyPart();
messageBodyPart.setDataHandler(new DataHandler(new MemoryDataSource(wdContext.currentContextElement().getPdfSource())));
messageBodyPart.setFileName(wdContext.currentContextElement().getFileUploadUI().getResourceName());
messageBodyPart.setHeader("Content-Type","application/pdf");
multipart.addBodyPart(messageBodyPart);
message.setContent(multipart);
Transport.send(message);
wonder anyone know where is the problem or mistake or anyone has the idea of doing it -
Can I convert from pdf output into excellsheet in smartforms
My smartform output is in pdf form now .Can i convert it into excellsheet by using save option.
Moderator message: please do some own research before asking.
Edited by: Thomas Zloch on Feb 21, 2011 12:49 PMVideo into PDF? Sounds reasonably strange. In any case, the only way to use such files would be to extract the components in Acrobat. Select the actual video with the Touchup Object tool, righ-click, save to disk. Depending oin the specifics of the PDF fiel this may not work, though.
Mylenium -
Error while opening an attached FI Document in transaction FB03.
Hi Gurus,
I have to open the attached documents in trasaction FB03 but I am recieving the following Error.
ERROR: Error calling application via OLE ALVIEWER.APP.
Thanks and Regards,
Amit.Hi Amit,
Thanks for the help.
I had one more problem now.
A link is being created in the tcode FB03 when I execute FM ARCHIV_CREATE_TABLE, but when open that link there is no data present inside the document.
If you have an example for the same, It will surely be a great help to me.
Please help.
Regards,
Amit. -
Insert attachment (PDF doc) into workflow
Hi.
I want to insert an attachment into a workflow. Via a webpage, the user upload the file (BIN format) and call a RFC. This RFC must start a workflow via an event. I think i can get the workitem so then, i can attach the BIN to the workflow.
Finally, the approver will have this document in the Business Workplace.
My problem is that i'm in a 4.6c SAP version and must use SO_DOCUMENT_INSERT or similar. Another problem is that i don't know if this function module is the correct one and also don't know how to fill its parameters.
Thank you for your help.
Kind regards,
Inigo.Via a webpage
Taking into assumption that you are uploading the attachment from a webdynpro application, As I am not aware of Webdynpro's but when you use the UPLOAD element of the WD's then the uplaodded content will be in the BIN format and in the WD App you can make use of the FM SAP_WAPI_START_WORKFLOW Fm to call the workflow and pass the content to the workflow.
In the workflow create a Activity step and a Z Bo and Z method where you will be creating the attachment by using another FM SAP_WAPI_ATTACHMENT_ADD and pass the result back to task from method and from task to workflow and attahc the object to the item , for which you are sending to the agents so that he can be able to view the Attachment. -
Transaction code to convert output into PDF
Hi Friends,
Can anybody please let me know the SAP transaction code to convert the PO output into PDF format?
Thanks & Regards
SatyaHi
ZPO_PDF is the transaction code.
You can create this transaction code using transaction SE93 and assigning the program RSTXPDFT4 to it.
Thanks & Regards
Kishore -
Sending PDF output attachment in e-mail to external users from BSP
Hi All,
Please gothrough the below requirement details :
Requirement Details:
Need to achieve the functionality of sending a PDF attachment of invoice to an external
e-mail address from the BSP Application.
Implementation Details:
The Print out Output determination is already done in the system. We are using SAP R/3 4.7 (620)
In the Transaction VF03 in the initial screen there is a menubar "Billing document" and underneath that menu there is a menu item called "Issue". If we click the "Issue" menu item all the output that are already proposed will be visible and we can select the printout Output determination and can issue a printout.
I had created a FM to call from BSP and that function module will take the Invoice number as input and will call the "VF03" transaction using BDC and will trigger the Sapscript Printout . I see the the sapscript in the spool after I call the Function module .
But I don't know how I can get the Spool request number for that Function module call from BSP page ????
I got struck in this approach...
If I know the Spool number after calling the function module the it's very easy to call the following FM's for sending a e-mail with the Invoice PDF attachment.
CONVERT_OTFSPOOLJOB_2_PDF
QCE1_CONVERT
SO_NEW_DOCUMENT_ATT_SEND_API1
Please let me know if anyone can help me in this ...
Please reply ASAP.
Thanks,
GreetsonCheck out these weblogs.
/people/sap.user72/blog/2004/11/10/bsphowto-generate-pdf-output-from-a-bsp
/people/thomas.jung3/blog/2004/09/08/sending-e-mail-from-abap--version-610-and-higher--bcs-interface
Regards
Raja -
Sending smartform output as mail attachment (PDF)
Hi,
I am trying to send a smartform output in PDF format as a mail attachment. This has to be fired in the save of a Invoice.. configured by the output type.
Here is the code which i have .. and it does not work.
DATA: ls_bil_invoice TYPE lbbil_invoice.
tables: nast.
DATA: i_otf TYPE itcoo OCCURS 0 WITH HEADER LINE,
i_tline TYPE TABLE OF tline WITH HEADER LINE,
i_receivers TYPE TABLE OF somlreci1 WITH HEADER LINE,
i_record LIKE solisti1 OCCURS 0 WITH HEADER LINE,
Objects to send mail.
i_objpack LIKE sopcklsti1 OCCURS 0 WITH HEADER LINE,
i_objtxt LIKE solisti1 OCCURS 0 WITH HEADER LINE,
i_objbin LIKE solisti1 OCCURS 0 WITH HEADER LINE,
i_reclist LIKE somlreci1 OCCURS 0 WITH HEADER LINE,
Work Area declarations
wa_objhead TYPE soli_tab,
w_ctrlop TYPE ssfctrlop,
w_compop TYPE ssfcompop,
w_return TYPE ssfcrescl,
wa_doc_chng typE sodocchgi1,
w_data TYPE sodocchgi1,
wa_buffer TYPE string,"To convert from 132 to 255
Variables declarations
v_form_name TYPE rs38l_fnam,
v_len_in LIKE sood-objlen,
v_len_out LIKE sood-objlen,
v_len_outn TYPE i,
v_lines_txt TYPE i,
v_lines_bin TYPE i.
call function 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = 'ZSDDLB_BIL_INVOICE'
IMPORTING
fm_name = v_form_name
EXCEPTIONS
no_form = 1
no_function_module = 2
others = 3.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
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'
is_bil_invoice = ls_bil_invoice
is_nast = nast
is_repeat = 'X'
IMPORTING
job_output_info = w_return
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
i_otf[] = w_return-otfdata[].
call function 'CONVERT_OTF'
EXPORTING
format = 'PDF'
max_linewidth = 132
IMPORTING
bin_filesize = v_len_in
TABLES
otf = i_otf
lines = i_tline
EXCEPTIONS
err_max_linewidth = 1
err_format = 2
err_conv_not_possible = 3
others = 4.
if sy-subrc EQ 0.
endif.
Convert PDF from 132 to 255.
loop at i_tline.
translate i_tline using '~'.
concatenate wa_buffer i_tline into wa_buffer.
endloop.
translate wa_buffer using '~'.
do.
i_record = wa_buffer.
append i_record.
shift wa_buffer left by 255 places.
if wa_buffer is initial.
exit.
endif.
enddo.
refresh:
i_reclist,
i_objtxt,
i_objbin,
i_objpack.
clear wa_objhead.
Object with PDF.
i_objbin[] = i_record[].
DESCRIBE TABLE i_objbin LINES v_lines_bin.
Object with main text of the mail.
i_objtxt = 'Find attached the output of the smart form.'.
APPEND i_objtxt.
DESCRIBE TABLE i_objtxt LINES v_lines_txt.
Document information.
wa_doc_chng-obj_name = 'Smartform'.
wa_doc_chng-expiry_dat = sy-datum + 10.
wa_doc_chng-obj_descr = 'Smart form output'.
wa_doc_chng-sensitivty = 'F'. "Functional object
wa_doc_chng-doc_size = v_lines_txt * 255.
Pack to main body as RAW.
Obj. to be transported not in binary form
CLEAR i_objpack-transf_bin.
Start line of object header in transport packet Smart Forms
i_objpack-head_start = 1.
Number of lines of an object header in object packet
i_objpack-head_num = 0.
Start line of object contents in an object packet
i_objpack-body_start = 1.
Number of lines of the object contents in an object packet
i_objpack-body_num = v_lines_txt.
Code for document class
i_objpack-doc_type = 'RAW'.
APPEND i_objpack.
Packing as PDF.
i_objpack-transf_bin = 'X'.
i_objpack-head_start = 1.
i_objpack-head_num = 1.
i_objpack-body_start = 1.
i_objpack-body_num = v_lines_bin.
i_objpack-doc_type = 'PDF'.
i_objpack-obj_name = 'Smartform'.
CONCATENATE 'Smartform_output' '.pdf'
INTO i_objpack-obj_descr.
i_objpack-doc_size = v_lines_bin * 255.
APPEND i_objpack.
Document information.
CLEAR i_reclist.
e-mail receivers.
i_reclist-receiver = '[email protected]'.
i_reclist-express = 'X'.
i_reclist-rec_type = 'U'. "Internet address
APPEND i_reclist.
call function 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = wa_doc_chng
put_in_outbox = 'X'
TABLES
packing_list = i_objpack
object_header = wa_objhead
CONTENTS_BIN = i_objbin
contents_txt = i_objtxt
receivers = i_reclist
EXCEPTIONS
too_many_receivers = 1
document_not_sent = 2
document_type_not_exist = 3
operation_no_authorization = 4
parameter_error = 5
x_error = 6
enqueue_error = 7
others = 8.
IF sy-subrc EQ 0.
ENDIF.Hi Aviroop,
Compare your part of code with the below given code.
*& Report YSSN_SIMPLE_SMARTFORM *
report zhr_bhaskar_pdf_to_email message-id zmsg.
parameters: p_vbeln type vbak-vbeln default '35'.
data: it_items type table of vbap,
v_fm_name type rs38l_fnam,
v_tot_lines type i,
v_sy_tabix type i,
output_data type ssfcrescl. " To hold Output information
constants:
c_sep type c value '-', " Value -
c_x type c value 'X', " Value X
c_space type c value ' '. " Space
*****MAIL START
include .
data: g_mail_rec_obj type swotobjid,
g_mail_sen_obj type swotobjid,
g_mail_app_obj type swotobjid,
g_cont_par type ssfctrlop,
folder type swc_object,
begin of sofmfol_key,
foldertype like sofm-foltp,
folderyear like sofm-folyr,
foldernumber like sofm-folno,
type like sofm-doctp,
year like sofm-docyr,
number like sofm-docno,
forwarder like soub-usrnam,
end of sofmfol_key,
bor_key like swotobjid-objkey,
g_mail TYPE ppfdmailad VALUE '[email protected]',
g_mail type so_name value '[email protected]',
g_mail TYPE ppfdmailad VALUE '[email protected]' ,
g_mail TYPE ppfdmailad VALUE '[email protected]' ,
g_rectype type so_escape value 'U'. " 'B'.
data: job_output_info type ssfcrescl,
hotfdata like itcoo occurs 1 with header line,
htline like tline occurs 1 with header line,
x_objcont like soli occurs 1 with header line,
ld_packing_list like soxpl occurs 1 with header line,
x_object_hd_change like sood1 occurs 1 with header line,
x_objhead like soli occurs 1 with header line,
x_receivers like soos1 occurs 1 with header line,
format_pdf(10) value 'PDF',
doc_size(12) type c,
hltlines type i,
htabix like sy-tabix,
fle1(2) type p,
fle2(2) type p,
off1 type p,
hfeld(500) type c.
tables: soud.
*****MAIL END
select *
into table it_items
from vbap
where vbeln = p_vbeln.
if it_items[] is initial.
exit.
endif.
perform call_smartform.
*& Form call_smartform
text
--> p1 text
<-- p2 text
form call_smartform .
*DATA: lx_control_parameters TYPE SSFCTRLOP,
lx_OUTPUT_OPTIONS type SSFCOMPOP.
lx_OUTPUT_OPTIONS-TDIMMED = ' '.
lx_OUTPUT_OPTIONS-TDfinal = 'X'.
lx_OUTPUT_OPTIONS-TDDELETE = 'X'.
lx_CONTROL_PARAMETERS-NO_CLOSE = 'X'.
lx_CONTROL_PARAMETERS-NO_OPEN = ' '.
data: x_ssfcompop type ssfcompop,
x_ssfctrlop like ssfctrlop,
x_ssfcrescl type ssfcrescl.
**MAIL
g_cont_par-langu = sy-langu.
g_cont_par-no_dialog = 'X'.
g_cont_par-getotf = 'X'.
g_cont_par-device = 'MAIL'.
Get BOR-Objects for Recipient, Sender und Applikation
perform mail_recipient_object changing g_mail_rec_obj.
perform mail_sender_object changing g_mail_sen_obj.
perform mail_appl_object changing g_mail_app_obj.
**MAIL
*--Internal table is having more than 1 record
if v_tot_lines gt 1.
if v_sy_tabix = 1.
*--For first record of table
x_ssfctrlop-no_open = c_space.
x_ssfctrlop-no_close = c_x.
elseif v_sy_tabix = v_tot_lines.
*--For last record of table
x_ssfctrlop-no_open = c_x.
x_ssfctrlop-no_close = c_space.
else.
x_ssfctrlop-no_open = c_x.
x_ssfctrlop-no_close = c_x.
endif.
endif.
IF r_previ = c_x.
x_ssfctrlop-preview = c_x.
x_ssfctrlop-getotf = c_x.
ENDIF.
call function 'SSF_FUNCTION_MODULE_NAME'
exporting
formname = 'YSSN_SMARTFORM'
VARIANT = ' '
DIRECT_CALL = ' '
importing
fm_name = v_fm_name
EXCEPTIONS
NO_FORM = 1
NO_FUNCTION_MODULE = 2
OTHERS = 3
if sy-subrc <> 0.
message i000 with 'Smart form module name failure'.
exit.
endif.
CALL FUNCTION '/1BCDWB/SF00000199'
call function v_fm_name
exporting
ARCHIVE_INDEX =
ARCHIVE_INDEX_TAB =
ARCHIVE_PARAMETERS =
control_parameters = g_cont_par
mail_appl_obj = g_mail_app_obj
mail_recipient = g_mail_rec_obj
mail_sender = g_mail_sen_obj
OUTPUT_OPTIONS = lx_OUTPUT_OPTIONS
USER_SETTINGS = 'X'
t_vbap = it_items
IMPORTING
DOCUMENT_OUTPUT_INFO =
job_output_info = job_output_info
JOB_OUTPUT_OPTIONS =
EXCEPTIONS
FORMATTING_ERROR = 1
INTERNAL_ERROR = 2
SEND_ERROR = 3
USER_CANCELED = 4
OTHERS = 5
perform send_pdf_mail.
endform. " call_smartform
*& Form send_pdf_mail
text
--> p1 text
<-- p2 text
form send_pdf_mail .
data ld_binfile type xstring.
pdf_table type rcl_bag_tline,
data: ld_originator like soos1-recextnam.
convert form
loop at job_output_info-otfdata into hotfdata.
append hotfdata.
endloop.
call function 'CONVERT_OTF'
exporting
format = format_pdf
max_linewidth = 132
importing
bin_filesize = doc_size
bin_file = ld_binfile
tables
otf = output_data-otfdata
lines = htline
exceptions
err_max_linewidth = 1
err_format = 2
err_conv_not_possible = 3
others = 4.
*-Itab 134 Zeichen nach 255 Zeichen überführen
describe table htline lines hltlines.
describe field htline length fle1 in character mode.
describe field x_objcont length fle2 in character mode.
loop at htline.
htabix = sy-tabix.
move htline to hfeld+off1.
if htabix = hltlines.
fle1 = strlen( htline ).
endif.
off1 = off1 + fle1.
if off1 ge fle2.
clear x_objcont.
x_objcont = hfeld(fle2).
append x_objcont.
shift hfeld by fle2 places.
off1 = off1 - fle2.
endif.
if htabix = hltlines.
if off1 gt 0.
clear x_objcont.
x_objcont = hfeld(off1).
append x_objcont.
endif.
endif.
endloop.
x_object_hd_change-objnam = 'EMAIL'.
x_object_hd_change-objdes = 'Smart Form'.
x_object_hd_change-objla = sy-langu.
x_object_hd_change-objsns = 'O'.
x_object_hd_change-objlen = doc_size.
x_object_hd_change-file_ext = 'TXT'.
ld_packing_list-transf_bin = 'X'.
ld_packing_list-head_start = 1.
ld_packing_list-head_num = 0.
ld_packing_list-body_start = 1.
describe table x_objcont lines ld_packing_list-body_num.
ld_packing_list-objtp = 'EXT'.
ld_packing_list-objdes = 'Smart Form'.
ld_packing_list-objla = sy-langu.
ld_packing_list-objlen = doc_size.
ld_packing_list-file_ext = 'PDF'.
append ld_packing_list.
x_receivers-recextnam = g_mail.
x_receivers-recesc = 'E'.
x_receivers-sndart = 'INT'.
append x_receivers.
ld_originator = '[email protected]'.
ld_originator = FSABE-USRNAM.
call function 'SO_OBJECT_SEND'
exporting
object_hd_change = x_object_hd_change
object_type = 'RAW'
originator_type = 'B' "Einfügen
originator = ld_originator "Einfügen
tables
objcont = ld_text
receivers = x_receivers
packing_list = ld_packing_list
att_cont = x_objcont
att_head = x_objhead
exceptions
active_user_not_exist = 1
communication_failure = 2
component_not_available = 3
folder_not_exist = 4
folder_no_authorization = 5
forwarder_not_exist = 6
note_not_exist = 7
object_not_exist = 8
object_not_sent = 9
object_no_authorization = 10
object_type_not_exist = 11
operation_no_authorization = 12
owner_not_exist = 13
parameter_error = 14
substitute_not_active = 15
substitute_not_defined = 16
system_failure = 17
too_much_receivers = 18
user_not_exist = 19
x_error = 20
others = 21.
endform. " send_pdf_mail
*& Form mail_sender_object
text
<--P_G_MAIL_SEN_OBJ text
form mail_sender_object changing p_mail_sen_obj.
call function 'CREATE_SENDER_OBJECT_PPF'
exporting
ip_sender = sy-uname
importing
ep_sender_id = p_mail_sen_obj
exceptions
invalid_sender = 1
others = 2.
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
endform. " mail_sender_object
*& Form mail_appl_object
text
<--P_G_MAIL_APP_OBJ text
form mail_appl_object changing p_mail_app_obj.
SELECT * FROM soud WHERE sapnam LIKE sy-uname AND deleted = ' '.
ENDSELECT.
IF sy-subrc NE 0.
call function 'SO_USER_AUTOMATIC_INSERT'
exporting
sapname = sy-uname
exceptions
no_insert = 1
sap_name_exist = 2
x_error = 3
others = 4.
if sy-subrc ne 0.
clear soud.
else.
select * from soud where sapnam like sy-uname and deleted = ' '.
endselect.
endif.
ENDIF.
clear sofmfol_key.
sofmfol_key-type = 'FOL'.
sofmfol_key-year = soud-inbyr.
sofmfol_key-number = soud-inbno.
bor_key = sofmfol_key.
if not bor_key is initial.
swc_create_object folder 'SOFMFOL' bor_key.
if sy-subrc = 0.
swc_object_to_persistent folder p_mail_app_obj.
if sy-subrc ne 0.
clear p_mail_app_obj.
endif.
endif.
else.
clear p_mail_app_obj.
endif.
endform. " mail_appl_object
*& Form mail_recipient_object
text
<--P_G_MAIL_REC_OBJ text
form mail_recipient_object changing p_mail_rec_obj.
call function 'CREATE_RECIPIENT_OBJ_PPF'
exporting
IP_COUNTRY =
IP_FAXNO =
ip_mailaddr = g_mail
ip_type_id = g_rectype " 'U'
importing
ep_recipient_id = p_mail_rec_obj
EP_ADDRESS =
ET_RECIPIENT =
exceptions
invalid_recipient = 1
others = 2.
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
endform. " mail_recipient_object
I hope this code should definitely work and helps you a lot.
Do reward me if it helps you.
Cheers,
Sampath -
How to create a multiple PDF-form outputs into one PDF?
Hi,
I`d like to create a PDF document with a few pages in it, build from different PDF-forms using many form-function calls. Where each PDF-form can use its own interface.
I`ve made a simple programme, but as the result I have a few separated documents with scrolling tab instead of one document with all pages in it.
What am I doing wrong?
*& Report ZZ_TEST_PDF_MULTY
REPORT zz_test_pdf_multy.
PARAMETERS:
p_page TYPE i DEFAULT 2,
p_row TYPE i DEFAULT 4.
END-OF-SELECTION.
DATA:
tb_itf TYPE tsftext,
s_itf TYPE tline.
DATA:
c_fmname TYPE rs38l_fnam,
s_outputparams TYPE sfpoutputparams,
s_docparams TYPE sfpdocparams,
s_formoutput TYPE fpformoutput,
s_sfpjoboutput TYPE sfpjoboutput,
c_page TYPE string,
c_row TYPE string.
CALL FUNCTION 'FP_FUNCTION_MODULE_NAME'
EXPORTING
i_name = 'FP_TEST_00'
IMPORTING
e_funcname = c_fmname.
s_outputparams-nodialog = 'X'.
s_outputparams-device = 'PRINTER'.
s_outputparams-preview = 'X'.
s_outputparams-dest = 'PDF'.
s_outputparams-getpdf = ' '.
s_outputparams-title = sy-title.
* s_outputparams-bumode = 'M'.
CALL FUNCTION 'FP_JOB_OPEN'
CHANGING
ie_outputparams = s_outputparams
EXCEPTIONS
cancel = 1
usage_error = 2
system_error = 3
internal_error = 4
OTHERS = 5.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
s_docparams-langu = 'R'.
s_docparams-country = 'RU'.
DO p_page TIMES.
MOVE sy-index TO c_page.
REFRESH tb_itf.
DO p_row TIMES.
MOVE sy-index TO c_row.
c_row = sy-index.
CONCATENATE
'page' c_page 'row' c_row
INTO s_itf-tdline SEPARATED BY space.
APPEND s_itf TO tb_itf.
ENDDO.
CALL FUNCTION c_fmname
EXPORTING
/1bcdwb/docparams = s_docparams
textlines = tb_itf
IMPORTING
/1bcdwb/formoutput = s_formoutput
EXCEPTIONS
usage_error = 1
system_error = 2
internal_error = 3.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDDO.
CALL FUNCTION 'FP_JOB_CLOSE'
IMPORTING
e_result = s_sfpjoboutput
EXCEPTIONS
usage_error = 1
system_error = 2
internal_error = 3
OTHERS = 4.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.Sorry, but making single PDF from many smartforms is not what I want to achieve. I wold like to know how to get one PDF document made by ALC-forms.
In my example I have many PDF documents. So, how to get (or put) them all in one PDF?
ps: the way to get one PDF from smartforms is also here:
"Combining Multiple Smartform Outputs Into One PDF file"
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/62ae7fcd-0b01-0010-3e9d-a54f26944450 -
Converting smartforms output into PDF
Hi ALL,
How to convert the smartforms output into PDF based form. After executing the form, it should directly open in PDF. How to do this?
Points will be awarded.
Thanks and regards,
vinoth.Hi Vinoth Kumar,
Please go throuh the below procedure and sample Code, this might help you.
Procedure
When we activate the Smartform the system generates a Function Module. The function module name we can get from Smartfrom screen from menubar
Environment => Function Module_Name . In a report we can get this Function module name by calling a Function Module standard SSF_FUNCTION_MODULE_NAME. This function module at runtime calls the FM generated by smartform, which in turn is then used to pass data from the report to Smartform. In the report given below the FM generated is /1BCDWB/SF00000152 . In this FM we can see CONTROL_PARAMETERS in import tab. This is of type SSFCTRLOP. We need to set the GETOTF of this to be X. Setting this field will activate the OTF field in smartform.
In export tab of the FM generated by smartform we can see a parameter JOB_OUTPUT_INFO which is of type SSFCRESCL. The SSFCRESCL is a structure of having one of fields as OTFDATA. OTFDATA in turn is a table of type ITCOO. ITCOO has two fields TDPRINTCOM and TDPRINTPAR. TDPRINTCOM represents command line of OTF format data and TDPRINTPAR contains command parameters of OTF format data.
In every Smartform output in OTF format, TDPRINTCOM begins and ends with //. EP represents the end-of-page value for TDPRINTCOM field.
In addition we need to set few fields at the place where we call this FM(generated by smartform) in our program. While calling this FM we should set control_parameters, output_options, user_settings and job_putput_info fields as shown in program.
Once these settings are done we can call Function Module CONVERT_OTF to convert the OTF data of smartfrom output to PDF data format. Once these are done we can call method cl_gui_fronted_services=>file_save_dialog to specify the directory path where we want to save the output PDF file. After this we can call Function Module GUI_DOWNLOAD to download the PDF file on our local system.
Here is a sample code of program to perform the function.
SAMPLE CODE
*& Report ZAMIT_SMART_FORM_PDF *
REPORT ZAMIT_SMART_FORM_PDF .
data: carr_id type sbook-carrid,
cparam type ssfctrlop,
outop type ssfcompop,
fm_name type rs38l_fnam.
DATA: tab_otf_data TYPE ssfcrescl,
pdf_tab LIKE tline OCCURS 0 WITH HEADER LINE,
tab_otf_final TYPE itcoo OCCURS 0 WITH HEADER LINE,
file_size TYPE i,
bin_filesize TYPE i,
FILE_NAME type string,
File_path type string,
FULL_PATH type string.
parameter: p_custid type scustom-id default 1.
select-options: s_carrid for carr_id default 'LH' to 'LH'.
parameter: p_form type tdsfname default 'ZAMIT_SMART_FORM'.
data: customer type scustom,
bookings type ty_bookings,
connections type ty_connections.
start-of-selection.
suppressing the dialog box for print preview****************************
outop-tddest = 'LP01'.
cparam-no_dialog = 'X'.
cparam-preview = SPACE.
cparam-getotf = 'X'.
select single * from scustom into customer where id = p_custid.
check sy-subrc = 0.
select * from sbook into table bookings
where customid = p_custid
and carrid in s_carrid
order by primary key.
select * from spfli into table connections
for all entries in bookings
where carrid = bookings-carrid
and connid = bookings-connid
order by primary key.
call function 'SSF_FUNCTION_MODULE_NAME'
exporting formname = p_form
variant = ' '
direct_call = ' '
importing fm_name = fm_name
exceptions no_form = 1
no_function_module = 2
others = 3.
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
exit.
endif.
Hope this resolves your query.
Reward all the helpful answers.
Regards
calling the generated function module
call function fm_name
exporting
archive_index =
archive_parameters =
control_parameters = cparam
mail_appl_obj =
mail_recipient =
mail_sender =
output_options = outop
user_settings = SPACE
bookings = bookings
customer = customer
connections = connections
importing
document_output_info =
job_output_info = tab_otf_data
job_output_options =
exceptions formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
others = 5.
if sy-subrc <> 0.
error handling
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
tab_otf_final[] = tab_otf_data-otfdata[].
CALL FUNCTION 'CONVERT_OTF'
EXPORTING
format = 'PDF'
max_linewidth = 132
ARCHIVE_INDEX = ' '
COPYNUMBER = 0
ASCII_BIDI_VIS2LOG = ' '
IMPORTING
bin_filesize = bin_filesize
BIN_FILE =
TABLES
otf = tab_otf_final
lines = pdf_tab
EXCEPTIONS
err_max_linewidth = 1
err_format = 2
err_conv_not_possible = 3
err_bad_otf = 4
OTHERS = 5
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL METHOD cl_gui_frontend_services=>file_save_dialog
EXPORTING
WINDOW_TITLE =
DEFAULT_EXTENSION =
DEFAULT_FILE_NAME =
FILE_FILTER =
INITIAL_DIRECTORY =
WITH_ENCODING =
PROMPT_ON_OVERWRITE = 'X'
CHANGING
filename = FILE_NAME
path = FILE_PATH
fullpath = FULL_PATH
USER_ACTION =
FILE_ENCODING =
EXCEPTIONS
CNTL_ERROR = 1
ERROR_NO_GUI = 2
NOT_SUPPORTED_BY_GUI = 3
others = 4
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
************downloading the converted PDF data to your local PC*******
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
bin_filesize = bin_filesize
filename = FULL_PATH
filetype = 'BIN'
APPEND = ' '
WRITE_FIELD_SEPARATOR = ' '
HEADER = '00'
TRUNC_TRAILING_BLANKS = ' '
WRITE_LF = 'X'
COL_SELECT = ' '
COL_SELECT_MASK = ' '
DAT_MODE = ' '
CONFIRM_OVERWRITE = ' '
NO_AUTH_CHECK = ' '
CODEPAGE = ' '
IGNORE_CERR = ABAP_TRUE
REPLACEMENT = '#'
WRITE_BOM = ' '
TRUNC_TRAILING_BLANKS_EOL = 'X'
IMPORTING
filelength = file_size
TABLES
data_tab = pdf_tab
FIELDNAMES =
EXCEPTIONS
file_write_error = 1
no_batch = 2
gui_refuse_filetransfer = 3
invalid_type = 4
no_authority = 5
unknown_error = 6
header_not_allowed = 7
separator_not_allowed = 8
filesize_not_allowed = 9
header_too_long = 10
dp_error_create = 11
dp_error_send = 12
dp_error_write = 13
unknown_dp_error = 14
access_denied = 15
dp_out_of_memory = 16
disk_full = 17
dp_timeout = 18
file_not_found = 19
dataprovider_exception = 20
control_flush_error = 21
OTHERS = 22
IF sy-subrc <> 0.
ENDIF. -
How to view the content of Documents attached in Transaction FB03.
Hi Gurus,
I want to view / download the content of an attachment, attached in transaction FB03.
I am not able to view them directly due to some application error.
I need to check whether a document which is in the attachment list is having any data or not.
If there is any FM to do this, please let me know.
Regards,
Amit.I do not know the answer to that. But you can use ssltap (More info in [http://www.mozilla.org/projects/security/pki/nss/tools/ssltap.html|http://www.mozilla.org/projects/security/pki/nss/tools/ssltap.html]) to see the exact request and response being sent to and from the server.
Maybe you are looking for
-
Report Designer - Error while opening a saved report
Hi, I am not sure if this is an authorization issue or configuration issue. When I try to open a saved report on Report designer, I keeping getting an error: Report Version is invalid: "0". Has anybody faced similar problem? We are on SP09. Regards,
-
How to store Comma Seperated Value in a File with Jsp
Hai friends, I need to get all the filed values like Empname,salary ,location.......... and at the end of jsp page i have to put a browse button when i choose a file using theis browse button the total content in the form shoud store in that file as
-
Planned update has been changed from 2.3.4 to 2.3.5
As the 2.3.4 beta ended over a month ago, they began the 2.3.5 Gingerbread beta tests, which was leaked earlier within a week this time unlike previous leaks. (keep in mind you receive no updates during the phases on leaks, take risks and void warre
-
I keep trying to sign in to PSN but I get this error code: 80710736. I do not understand this. Can anyone explain?
-
Transport Filters of Integrated Planning
Dear Experts, we have created a couple of filters with the planning modeler of integrated planning. Now we would like to transport these to the P-System but there is no object type 'filters' in the transport connection in opposite to other objects li