Payslip distribution (in pdf format) via email
Dear All,
Please help with the configuration steps to distribute payslip in PDF Format to their official email.Kindly suggest the steps to configure the same.
Best Regards,
Hi Bobby
As soon as User execute payslip. The payslip will get generated and an email will be sent to respective employee in PDF format.
How about Posting. Without Bank Transfer How can User send Payslip that will be the main question arises from User. In cases of wrong entries or reversal posting how would you manage?
The finance department should confirm that there is Bank Transfer Once there done with Bank Transfer An email should be trigerred
Similar Messages
-
Sending attached pdf format via email
Hi,
i got one requirement. i have one program. When i execute the program it has to send the
Employee1, Employee2,employee3 data to Manager1 email id via email. The employee1, employee2, employee3 data should be stored in one folder and send it via email. I can send it individually like employee1 data manager1,again employee2 data to manager1 and again employee3 data to manager1.
But what i want is i have to store all these three pdf data in one folder and send at one time.
similarly i have manager2,manager3...under managers some employess are there?
is it possible? if yes, could you please help me in this regard? Thanks in advance.HI,
Please find below sample code..it may help you..but you need to do bit modification
DATA : LS_DOCDATA LIKE SODOCCHGI1,
LT_DOCDATA TYPE STANDARD TABLE OF SODOCCHGI1, " Table for subject
LS_CONTENTS_MSG LIKE SOLISTI1,
LT_CONTENTS_MSG TYPE STANDARD TABLE OF SOLISTI1, " table for attachement
LS_PACKING_LIST LIKE SOPCKLSTI1,
LT_PACKING_LIST TYPE STANDARD TABLE OF SOPCKLSTI1, " Table for Document type and length
LS_OBJECT_HEADER LIKE SOLISTI1,
LT_OBJECT_HEADER TYPE STANDARD TABLE OF SOLISTI1, " Table for Header
LS_CONTENTS_TXT LIKE SOLISTI1,
LT_CONTENTS_TXT TYPE STANDARD TABLE OF SOLISTI1, " Table for mail contents
LS_RECEIVERS LIKE SOMLRECI1,
LT_RECEIVERS TYPE STANDARD TABLE OF SOMLRECI1, " Table for receiver,
Subject line
LS_DOCDATA-OBJ_LANGU = sy-langu.
LS_DOCDATA-OBJ_NAME = text-002.
LS_DOCDATA-OBJ_DESCR = 'bunu'.
LS_CONTENTS_MSG-LINE = 'BUNOO' .
APPEND LS_CONTENTS_MSG TO LT_CONTENTS_MSG.
LS_CONTENTS_TXT-LINE = text-009.
APPEND LS_CONTENTS_TXT TO LT_CONTENTS_TXT.
clear LS_CONTENTS_TXT.
BREAK-POINT.
Content structure
LS_PACKING_LIST-TRANSF_BIN = space.
LS_PACKING_LIST-HEAD_START = 1.
LS_PACKING_LIST-HEAD_NUM = 0.
LS_PACKING_LIST-BODY_START = 1.
DESCRIBE TABLE LT_CONTENTS_TXT LINES LS_PACKING_LIST-BODY_NUM .
LS_PACKING_LIST-DOC_TYPE = 'RAW'.
append LS_PACKING_LIST to Lt_PACKING_LIST.
Create attachment notification
LS_PACKING_LIST-TRANSF_BIN = 'X'.
LS_PACKING_LIST-HEAD_START = 1.
LS_PACKING_LIST-HEAD_NUM = 1.
LS_PACKING_LIST-BODY_START = 1.
DESCRIBE TABLE LT_CONTENTS_MSG LINES LS_PACKING_LIST-BODY_NUM.
LS_PACKING_LIST-DOC_TYPE = 'PDF'.
LS_PACKING_LIST-OBJ_DESCR = 'PDF ATTACHEMENT'.
LS_PACKING_LIST-OBJ_NAME = 'DEMO'.
LS_PACKING_LIST-DOC_SIZE = LS_PACKING_LIST-BODY_NUM * 255.
APPEND LS_PACKING_LIST TO Lt_PACKING_LIST.
LS_RECEIVERS-RECEIVER = 'WRITE THE MAIL ID HERE'.
LS_RECEIVERS-REC_TYPE = 'U'.
APPEND LS_RECEIVERS TO LT_RECEIVERS.
LS_RECEIVERS-RECEIVER = 'WRITE THE MAIL ID HERE' TO SEND IN CC FIELD' .
LS_RECEIVERS-REC_TYPE = 'U'.
LS_RECEIVERS-COPY = 'X'.
APPEND LS_RECEIVERS TO LT_RECEIVERS.
Send mail
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
DOCUMENT_DATA = LS_DOCDATA
PUT_IN_OUTBOX = 'X'
COMMIT_WORK = 'X'
IMPORTING
SENT_TO_ALL =
NEW_OBJECT_ID =
TABLES
PACKING_LIST = Lt_PACKING_LIST
OBJECT_HEADER =
CONTENTS_BIN = LT_CONTENTS_MSG
CONTENTS_TXT = LT_CONTENTS_TXT
CONTENTS_HEX =
OBJECT_PARA =
OBJECT_PARB =
RECEIVERS = LT_RECEIVERS
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 <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Regards
Ansumesh -
Send spool list ceated by Job (SM36) as pdf-file via email
We are running the report RM06EFLB (Transaktion ME84 - "Create Releases") in the background.
The Job is creating a spool list with 17 pages.
I want to send this 17 pages (in a readable form) to a number of persons.
This did I try so far:
- Distribution list with Recipient type "via Internet" as Spool list recipients in the Job. (Tried different formats for ABAP List in Transaction SCOT)
=> Email is send to recipients, attachment is readable depending on format.
Problem: attachment is not complete, it contains only about 15 pages (985 rows).
- Distribution list with Recipient type "Internal User - SAP-Office" as Spool list recipients in the Job.
=> Document is sent to Business Workplace
Problem: attachment is not complete, it contains only about 15 pages
Any ideas how to get the complete spool list?
Is there mayby a report around that is sending a spool list as pdf-file via email to a number of recipients?
(Would like to maintain this Report as an additional step in the job. The spool-number should be selected from the previous step.)
Thank you for your help.
JensOh sorry - here is the coding which is used in that program:
First use function module 'CONVERT_ABAPSPOOLJOB_2_PDF' to convert the spool entry into pdf.
Loop at output table PDF and concatenate all lines into a string. Convert string to xstring.
Then call mail class:
DATA: lv_pdf_x TYPE xstring,
lv_subject TYPE string,
lv_doc_desc TYPE so_obj_des,
lv_mail_body TYPE soli_tab.
DATA: ls_atta TYPE rcf_s_att4mail_hex,
lt_atta TYPE rcf_t_att4mail_hex.
* -- Fill parameter
lv_subject = 'Requested Report'."#EC NOTEXT
lv_doc_desc = 'Report XXL'."#EC NOTEXT
* lv_mail_body = ?
ls_atta-name = lv_doc_desc.
ls_atta-extension = 'PDF'.
ls_atta-content = p_pdf_x. <- This is your xstring
APPEND ls_atta TO lt_atta.
TRY.
CALL METHOD cl_hrrcf_services_mail=>send_web_mail
EXPORTING
p_subject = lv_subject
p_receiver = p_receiver->email_address
pt_atta_hex = lt_atta
p_sender = p_sender->email_address
p_body_c = lv_mail_body.
CATCH cx_hrrcf.
ENDTRY.
I hope that you have the above mentioned class in your system but it should work with other email functions as well.
Regards
Nicola -
To send output as a PDF attachment via email
Hi experts
I have the (smartform) output data in OTF format..and displaying it in PDF form with FM 'HR_EFI_SHOW_PDF_FORM' .
Now the requirement is <b>to send this output as a PDF attachment via email</b>.
Please help me with sample code to perform this.
Regards,
Matt.Hi,
Check this links,
/people/sap.user72/blog/2004/11/10/bsphowto-generate-pdf-output-from-a-bsp
Also for email:
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/8cd6adbb-0301-0010-39ba-938c601d5db9
Refer the following link for more details:
http://www.sapdevelopment.co.uk/reporting/rep_spooltopdf.htm
Thanks,
Reward If Helpful. -
How to...download the SVG Graph in PDF format or Email it
I have generated a line chart using SVG Graph, I need to download it in PDF format and email it.
Please help, How do I do that ?FYI, Adobe has announced it will no longer support the SVG Viewer as of Jan 1st, 2009 (link), so you should probably switch over to flash charts in APEX (introduced in 3.0).
BI Publisher supports charts embedded in PDFs. You can also have the PDF automatically emailed via this technique.
Tyler
Message was edited by:
Tyler -
Report in PDF format and email it to some clients, using Database Trigger
Hi
Is it possible to run a report in PDF format ad email it to some clients after a specific event through Database Trigger. For example whenever a client makes an entry into order entry table (through entry form), a trigger should execute on Orders table, this trigger should execute or generate a PDF formatted report and finally mail it to Sales team?
I have
ORAS 10g(10.1.2.0.2)
utl_mail configured.In Reportsconfig.properties file the http port is 7778,
now the output is like this...
SQL> /
* WELCOME TO EVENT-BASED-REPORTING API *
* API-Version : 9i *
* (C) Oracle Corporation, 2000 - 2002 *
* Debugging turned ON **************************
*** Length of Paramlist : 1
OK : Parameter added : GATEWAY=http://myserver.com:7778/reports/rwservlet
*** Length of Paramlist : 2
OK : Parameter added : SERVER=rep_myserver_oracleas2
*** Length of Paramlist : 3
OK : Parameter added : REPORT=D:\Reports\emp.rdf
*** Length of Paramlist : 4
OK : Parameter added : USERID=abc/xyz@mydb
*** Length of Paramlist : 5
OK : Parameter added : DESTYPE=mail
*** Length of Paramlist : 6
OK : Parameter added : DESFORMAT=PDF
*** Length of Paramlist : 7
OK : Parameter added : [email protected]
Starting run_report: building url
*** Building URL (RUN_REPORT)
OK : URL built :
http://myserver.com:7778/reports/rwservlet?SERVER=rep_myserver_oracleas2&REPO
RT=D%3A%CReports%5Cemp.rdf&USERID=abc%2Fxyz%40mydb&DESTYPE=mail&D
ESFORMAT=PDF&DESNAME=khan.emran84%40gmail.com&statusformat=xml
*** Submitting HTTP Request
*** using URL
:http://myserver.com:7778/reports/rwservlet?SERVER=rep_myserver_oracleas2&REP
ORT=D%3A%5CReports%5Cemp.rdf&USERID=abc%2Fxyz%40mydb&DESTYPE=mail&
DESFORMAT=PDF&DESNAME=khan.emran84%40gmail.com&statusformat=xml
OK : Request submitted - Return stream : <?xml version = '1.0' encoding =
'ISO-8859-1' standalone = 'yes'?>
<serverQueues>
<error code="50159"
component="REP" message="Executed successfully but there were some errors when
distribute the output"/>
<
OK : Request submitted - Length of stream : 229
*** XML-Parsed - Following Structure discovered :
*** Checking elements!
serverQueues ()
*** Checking attributes!
error
*** Checking attributes!
__code = 50159
__component = REP
__message = Executed successfully but there were some errors when distribute the
output
*** Finished Parsing XML
Getting value for element: job
Getting value for element: error
*** Requesting value for Attribute error.component [REP]
Getting value for element: error
*** Requesting value for Attribute error.code [50159]
Getting value for element: error
*** Requesting value for Attribute error.message [Executed successfully but
there were some errors when distribute the output]
REP-50159:Executed successfully but there were some errors when distribute the
output
declare
ERROR at line 1:
ORA-20999:
ORA-06512: at "NRSP.SRW", line 264
ORA-06512: at "NRSP.SRW", line 799
ORA-06512: at line 15 -
Error when Broadcasting PDF format to email
Hi,
The template is getting executed properly through WAD. Even, in portal the report is being generated correctly. The problem is when I try to broadcast PDF format to Email.
I am receiving the following error when attempting to broadcast a query as PDF - Error: com.sap.ip.bi.base.exception.BIBaseRuntimeException.
Please suggest me the solution.Hi Lavanya
I strongly recommend you to be on latest Java patches for your SPS from the service market place.
Also please check whether the note 1052659 - Requirements for customer messages concerning export to PDF is helpful to you.
Especially check this portion of the note is relevant to you.
" The following entry is in the trace:
"Invalid Response Code: (401) Unauthorized.
com.sap.ip.bi.base.exception.BIBaseRuntimeException com.sap.tc.webdynpro.pdfobject.core.PDFObjectRuntimeException: Service call exception; nested exception is: com.sap.engine.services.webservices.jaxrpc.exceptions.InvalidResponseCodeException: "Invalid Response Code: (401) Unauthorized. The requested URL was:"http://<your host>:<yourport>/AdobeDocumentServices/Config?style=document" at com.sap.tc.webdynpro.pdfobject.core.PDFObject.doSoapCall(PDFObject.java:405)
See Note 934276 " Print preview in SAP NetWeaver 2004s BI does not work".
See the "II Web Dynpro for Java" section in Note 944221."
If not can you let me know the detailed error you are getting.
Thank you.
Regards
Suresh -
I have been able to open pdfs created in older versions of adobe, but not the newest version. Is anyone having issues opening PDFs sent via email created in version 9? If so, what was your solution? I have PDF reader app as well.
Can you open the files in Preview?
-
I cannot send a Pages document, Word via email if the doc contains a picture. If I email a Pages doc without a pic in Word format or pdf with a pic it with go through to sender? Not sure why Pages won't send Word doc with a picture in it. I check the security on the email recipient and the email doesn't get blocked or throw in the junk box?
thanks,
drainguy41If you have upgraded to Mountain Lion, Save As… has returned to the File menu when you hold down the Option/alt key. But you don't really "save" as other file types, you translate & export as Word or RTF or text or PDF & that is easily done by going to File > Export or Share > Export.
Also, please do us all a favor & don't use all capitals in your posts, either the body of the post or the title. All caps is the internet equivalent of shouting & is very hard to read. -
When sending output via email in HTML format (from rtf template), all the formating is lost, layout just expands horizontally.
Output is correct when displayed in pdf format.
Also occurs when previewing the output.
Further information:
This is purely a custom rtf template created for remittance report. In the rtf template we have used the filler, we have kept many conditions like if the data spills over to next page based on number of lines,and if the number of data lines is less then also it should align and fit to the table /page etc.
If we remove the filler the output will shrink to half page in HTML page and WE DO NOT want this kind of report output. We need the report output in HTML which should fir to paper size(A4 size) even we have less number of data rows.
Any assistance would be appreciated.
Thanks
SarahThanks for your response.
The customer has updated with the following:
The problem here is the standard program "IBY_FD_SRA_FORMAT module: Send Separate Remittance Advices" sets the output type to HTML if the remittance advice delivery method is "MAIL". Below is the extract from the log file of the program "IBY_FD_SRA_FORMAT module: Send Separate Remittance Advices"
******** EXTRACT BEGIN ********
Since the delivery method is EMAIL, the XML Publisher output type is set to be html.
********* EXTRACT END *********
This causes the following issue: -
The concurrent program ends without generating a pdf output and hence cannot be emailed out as a pdf document.
Action required from you: -
[1] Ensure that the standard program does not default the output type to HTML for email. This should be PDF instead.
[2] Ensure that IBY XDO Delivery, sends the PDF output as an attachment. -
No Payment document attachement (PDF) sent via email
Hi,
We have been running the auto-email with PDF payment attachement via F110 for quite some times. Recently my user feedback that some of the vendors receive the email sent by SAP system, however, no attachement being sent to them.
I have checked the F110 log, which the requested email is generated successfully. However, i couldn't check whether there is email attachement being to them via SOST.
We are in ECC6. The reported cases are perhaps 5% of the batch payment document running affected with no pdf file attachement sent via email.
I have been searching around any similar case and how we trace the problem. Can someone share on it?
Thank you very much in advance.Hi
Ask to these vendor what kind of software they have to avoid SPAM, or if they manage black lists, 'grey' list. There are other software tools managing these messages. Sometimes these tools remove the attachments.
I hope this helps you
Regards
Eduardo
Edited by: E_Hinojosa on Dec 16, 2011 10:22 AM -
How Can I Disallow Sending a PDF Document via Email?
http://www.tek-tips.com/viewthread.cfm?qid=1528701&page=1
nha khoa.com/showthread.php?t=145
I'm using Adobe Acrobat 8 Standard.
I've gotten the test document setup in such a way that at least the typical person could not print it, send it as an email attachment, nor save the file within Adobe Reader 8.
However, if that same person were to open the file with Foxit PDF reader, they could email it as an attachment (though they can't do the others).
What I want to know is if there is a way to specifically disallow a pdf file from being sent as an attachment from within the pdf application? For Adobe, I just had to check the box next to "hide menu bar" and "hide tool bars", but leave "hide window controls" unchecked.
But of course, Foxit reader, and I'd imagine others, don't recognize the code for the display defaults. So for those, I'd need something else. I did not see an option under security for disabling email. Is there any way to do so?
The PDF files will be shared via a SharePoint site. So if there is some other better way of locking them down via SharePoint, that'd be fine as well.
I'll post more detail if need be. Thanks for any suggestions.
"If to err is human, then I must be some kind of human!" -MeThere's no way to prevent someone attaching a PDF to an email (or any other file-level operation on it) - to view a PDF it MUST be downloaded to the client's computer, and once there it's a regular file just like any other. There is no "streaming" concept within PDF.
You can secure the PDF so only certain people can open it (for example using certificate policies or even DRM) but they can still move the file about - it's only at the stage of opening it where the security control starts.
And you're correct - non-DRM 'permissions' security on a PDF is largely just smoke and mirrors for anyone who can open the file, as removing your print/edit/display preferences is a 10-second job. The only real case of a PDF being "uncrackable" is if the document has a very long OPEN password and the user doesn't know what it is. If they can get as far as seeing the pages on their screen, they can do pretty much anything with it. -
I sent a PDF file to someone via email, they were able to fill out the form but they cannot save the file to send back, I have checked the security properties and there were no restrictions. Do I need to save the PDF a specific way? I have sent it to others that have Acrobat Pro and are able to save but those without Acrobat are unable to save. Please advise!
Thank you!Hi MSMistry1,
Users with Adobe Reader 8 and later will be able to save form data if you save the form as a Reader Extended PDF with Enable Additional Features selected. See http://help.adobe.com/en_US/acrobat/X/pro/using/WS58a04a822e3e50102bd615109794195ff-7e0d.w .html
a 'C' student -
How do I send entire pdf form via email from web browser
How do you send a pdf completed form on your web browser via email to email address?
Hello Wayne, see no offense in this message
There is a faster scheme.
Copy the range of cells to send (it may be an entire table)
Enter the application entitled Preview.
File > Create a new doc from the clipboard
File > Send the selected PDF document (I'm not sure of the exact wording).
It's the highlighted one.
Bingo, it will create a mail with the PDF embedded.
Yvan KOENIG (VALLAURIS, France) jeudi 3 novembre 2011 22:32:21
iMac 21”5, i7, 2.8 GHz, 4 Gbytes, 1 Tbytes, mac OS X 10.6.8 and 10.7.2
My iDisk is : <http://public.me.com/koenigyvan>
Please : Search for questions similar to your own before submitting them to the community -
Smartforms to pdf format while emailing
Hi All,
My requirement is (Smartforms):
I want to send the smartform print values to some email id in pdf format .
How to do that .....
Ashok..Below code will help you to get the smartfrom output in pDF format and Send it across email.
Create a samrtfrom according to your requirement and follow the below code to generate PDF and send it across the Email
*& Report YSMARTFORM_EMAIL
REPORT YSMARTFORM_EMAIL.
TABLES: VBAK.
Constants *
CONSTANTS:
C_X TYPE C VALUE 'X', " Value X
C_0 TYPE C VALUE '0', " Value 0
C_1 TYPE C VALUE '1'. " Value 1
Work Variables declaration *
DATA:
W_UCOMM LIKE SY-UCOMM, " Function code
W_TABLN TYPE I, " Lines
W_LINE TYPE SO_TEXT255, " Line of text
W_EADDR(60) TYPE C. " FieldLength for Email
DATA: VBAP_TAB LIKE VBAP OCCURS 0 WITH HEADER LINE.
DATA: W_FUNMOD TYPE RS38L_FNAM.
Structure to hold the Attributes of new Document
DATA: FS_DOCDATA TYPE SODOCCHGI1.
Internal table for storing OTF data form Smart-Form
DATA: BEGIN OF FS_OTF_DATA.
INCLUDE STRUCTURE ITCOO.
DATA: END OF FS_OTF_DATA,
T_OTF_DATA LIKE STANDARD TABLE OF FS_OTF_DATA.
Internal table for storing PDF data form Smart-Form
DATA: BEGIN OF FS_PDF_DATA.
INCLUDE STRUCTURE TLINE.
DATA: END OF FS_PDF_DATA,
T_PDF_DATA LIKE STANDARD TABLE OF FS_PDF_DATA.
Internal table to hold the attachment data text of the email
DATA: BEGIN OF FS_ATTACH_DATA.
INCLUDE STRUCTURE SOLISTI1.
DATA: END OF FS_ATTACH_DATA,
T_ATTACH_DATA LIKE STANDARD TABLE OF FS_ATTACH_DATA.
Internal table to hold Message body of the email
DATA: BEGIN OF FS_MESSBODY.
INCLUDE STRUCTURE SOLISTI1.
DATA: END OF FS_MESSBODY,
T_MESSBODY LIKE STANDARD TABLE OF FS_MESSBODY.
Internal table for packing list for main document
DATA: BEGIN OF FS_OBJPACK.
INCLUDE STRUCTURE SOPCKLSTI1.
DATA: END OF FS_OBJPACK,
T_OBJPACK LIKE STANDARD TABLE OF FS_OBJPACK.
Internal table for header text of the attachment
DATA: BEGIN OF FS_OBJHEAD.
INCLUDE STRUCTURE SOLISTI1.
DATA: END OF FS_OBJHEAD,
T_OBJHEAD LIKE STANDARD TABLE OF FS_OBJHEAD.
Internal table receiver information
DATA: BEGIN OF FS_RECEIVER.
INCLUDE STRUCTURE SOMLRECI1.
DATA: END OF FS_RECEIVER,
T_RECEIVER LIKE STANDARD TABLE OF FS_RECEIVER.
*Internal table to store data upto 255 lines
DATA: BEGIN OF FS_OBJCONT.
INCLUDE STRUCTURE SOLI.
DATA: END OF FS_OBJCONT,
T_OBJCONT LIKE STANDARD TABLE OF FS_OBJCONT.
*DATA : P_VBELN LIKE VBAK-VBELN.
DATA: P_EADDR(60) TYPE C
VALUE '[email protected]'.
PARAMETERS : P_VBELN LIKE VBAK-VBELN.
*PARAMETERS:
P_EADDR(60) TYPE C. " Email address
SELECT SINGLE *
FROM VBAK
WHERE VBELN EQ P_VBELN.
SELECT *
FROM VBAP
INTO TABLE VBAP_TAB
WHERE VBELN EQ P_VBELN.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
FORMNAME = 'YSMARTFORM_EMAIL'
VARIANT = ' '
DIRECT_CALL = ' '
IMPORTING
FM_NAME = W_FUNMOD
EXCEPTIONS
NO_FORM = 1
NO_FUNCTION_MODULE = 2
OTHERS = 3 .
IF SY-SUBRC <> 0.
Do nothing
ENDIF.
DATA: FS_CONT_PARM TYPE SSFCTRLOP,
T_JOB_INFO TYPE SSFCRESCL.
CLEAR FS_CONT_PARM.
FS_CONT_PARM-GETOTF = 'X'.
FS_CONT_PARM-NO_DIALOG = 'X'.
FS_CONT_PARM-PREVIEW = ''.
CALL FUNCTION W_FUNMOD
EXPORTING
ARCHIVE_INDEX =
ARCHIVE_INDEX_TAB =
ARCHIVE_PARAMETERS =
CONTROL_PARAMETERS = FS_CONT_PARM
MAIL_APPL_OBJ =
MAIL_RECIPIENT =
MAIL_SENDER =
OUTPUT_OPTIONS =
USER_SETTINGS = 'X'
VBAK = VBAK
IMPORTING
DOCUMENT_OUTPUT_INFO =
JOB_OUTPUT_INFO = T_JOB_INFO
JOB_OUTPUT_OPTIONS =
TABLES
VBAP = VBAP_TAB
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.
PERFORM CONVERT_OTF_TO_PDF.
*& Form convert_otf_to_pdf
text
--> p1 text
<-- p2 text
FORM CONVERT_OTF_TO_PDF .
DATA: LV_BYTES TYPE P.
IF FS_CONT_PARM-GETOTF EQ 'X'.
REFRESH T_OTF_DATA.
CLEAR FS_OTF_DATA.
LOOP AT T_JOB_INFO-OTFDATA INTO FS_OTF_DATA.
APPEND FS_OTF_DATA TO T_OTF_DATA.
CLEAR FS_OTF_DATA.
ENDLOOP. " LOOP AT t_outtab-otfdata
CALL FUNCTION 'CONVERT_OTF'
EXPORTING
FORMAT = 'PDF'
MAX_LINEWIDTH = 255
IMPORTING
BIN_FILESIZE = LV_BYTES
TABLES
OTF = T_OTF_DATA
LINES = T_PDF_DATA
EXCEPTIONS
ERR_MAX_LINEWIDTH = 1
ERR_FORMAT = 2
ERR_CONV_NOT_POSSIBLE = 3
OTHERS = 4.
IF SY-SUBRC EQ 0 AND LV_BYTES IS NOT INITIAL.
PERFORM TABLE_SHIFT.
To send the output by email
PERFORM SET_UP_EMAIL.
PERFORM SEND_MAIL.
ENDIF. " IF sy-subrc EQ space.
ENDIF. " IF gs_control_pars-getotf
ENDFORM. " convert_otf_to_pdf
Form set_up_email *
This subroutine is used to set mail attributes *
There are no interface parameters to be passed to this subroutine. *
FORM SET_UP_EMAIL .
To setup attributes of the document
PERFORM SET_EMAIL_HEADER.
To set body of email
PERFORM SET_EMAILBODY.
To convert output table data with tab delimiter
PERFORM PREPARE_OUTPUT_DATA_FOR_ATTACH.
To set the Receipents
PERFORM SET_RECEIPENTS.
ENDFORM. " Set_up_email
Form set_email_header *
This subroutine is used to Setup the attributes of the Document *
There are no interface parameters to be passed to this subroutine. *
FORM SET_EMAIL_HEADER.
CONSTANTS :
LC_P TYPE C VALUE 'P', " Production system name
LC_F TYPE C VALUE 'F', " Sensitivity
LC_OBJNAME(6) TYPE C " Object name
VALUE 'SAPRPT'.
CLEAR FS_DOCDATA.
Populate the subject/generic message attributes
FS_DOCDATA-DOC_SIZE = 1.
FS_DOCDATA-OBJ_LANGU = SY-LANGU.
FS_DOCDATA-OBJ_NAME = LC_OBJNAME.
FS_DOCDATA-SENSITIVTY = LC_F.
IF SY-SYSID+0(1) NE LC_P.
CONCATENATE 'Test mail'(003)
'Sales Order Details'(002)
INTO FS_DOCDATA-OBJ_DESCR
SEPARATED BY SPACE.
ELSE.
MOVE TEXT-002 TO FS_DOCDATA-OBJ_DESCR.
ENDIF. " IF sy-sysid+0(1)...
ENDFORM. " Set_email_header
Form set_emailbody *
This subroutine is used to set body of an email *
There are no interface parameters to be passed to this subroutine. *
FORM SET_EMAILBODY.
CONSTANTS:
LC_DOC_TYPE(3) TYPE C VALUE 'RAW'. " Document type
REFRESH : T_OBJPACK,
T_MESSBODY.
CLEAR : FS_OBJPACK,
FS_MESSBODY.
MOVE:
'Hi,'(004) TO FS_MESSBODY-LINE.
APPEND FS_MESSBODY TO T_MESSBODY.
CLEAR FS_MESSBODY.
MOVE:
'The attachment contains sales order details.'(005)
'www.google.com'
TO FS_MESSBODY-LINE.
APPEND FS_MESSBODY TO T_MESSBODY.
CLEAR W_TABLN.
DESCRIBE TABLE T_MESSBODY LINES W_TABLN.
CLEAR FS_MESSBODY.
READ TABLE T_MESSBODY INTO FS_MESSBODY INDEX W_TABLN.
FS_DOCDATA-DOC_SIZE = ( W_TABLN - 1 ) * 255 + STRLEN( W_LINE ).
MOVE:
SPACE TO FS_OBJPACK-TRANSF_BIN,
C_1 TO FS_OBJPACK-HEAD_START,
C_0 TO FS_OBJPACK-HEAD_NUM,
C_1 TO FS_OBJPACK-BODY_START,
W_TABLN TO FS_OBJPACK-BODY_NUM,
LC_DOC_TYPE TO FS_OBJPACK-DOC_TYPE.
APPEND FS_OBJPACK TO T_OBJPACK.
ENDFORM. " Set_emailbody
Form prepare_output_data_for_attach *
To convert the output table data with comma delimiter *
There are no interface parameters to be passed to this subroutine. *
FORM PREPARE_OUTPUT_DATA_FOR_ATTACH.
CONSTANTS:
LC_DOC_TYPE(3) TYPE C VALUE 'PDF', " Document type
LC_OBJNAME(6) TYPE C VALUE 'SAPRPT'. " Object name
REFRESH T_OBJHEAD.
REFRESH T_ATTACH_DATA[].
CLEAR FS_ATTACH_DATA.
T_ATTACH_DATA[] = T_OBJCONT[].
DESCRIBE TABLE T_ATTACH_DATA LINES W_TABLN.
FS_DOCDATA-DOC_SIZE = ( W_TABLN - 1 ) * 255 + STRLEN( W_LINE ).
FS_OBJPACK-BODY_NUM = W_TABLN.
FS_OBJPACK-DOC_SIZE = W_TABLN * 255.
FS_OBJPACK-TRANSF_BIN = C_X.
FS_OBJPACK-HEAD_START = C_1.
FS_OBJPACK-HEAD_NUM = C_1.
FS_OBJPACK-BODY_START = C_1.
FS_OBJPACK-DOC_TYPE = LC_DOC_TYPE.
FS_OBJPACK-OBJ_NAME = 'Attachment'.
FS_OBJPACK-OBJ_DESCR = 'Sales Order Details.PDF'(007).
APPEND FS_OBJPACK TO T_OBJPACK.
ENDFORM. " Prepare_output_data_for_attach
Form set_receipents *
This subroutine is used to set the Receipents *
There are no interface parameters to be passed to this subroutine. *
FORM SET_RECEIPENTS .
CONSTANTS
LC_REC_TYPE TYPE C VALUE 'U'. " Receipent type
REFRESH T_RECEIVER.
IF P_EADDR IS NOT INITIAL.
MOVE:
P_EADDR TO FS_RECEIVER-RECEIVER,
LC_REC_TYPE TO FS_RECEIVER-REC_TYPE.
APPEND FS_RECEIVER TO T_RECEIVER.
ENDIF. " IF P_EMAIL IS NOT.....
ENDFORM. " Set_receipents
Form send_mail *
This subroutine is used to send output by email *
There are no interface parameters to be passed to this subroutine. *
FORM SEND_MAIL.
CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
EXPORTING
DOCUMENT_DATA = FS_DOCDATA
PUT_IN_OUTBOX = C_X
SENDER_ADDRESS = SY-UNAME
SENDER_ADDRESS_TYPE = 'B'
COMMIT_WORK = C_X
TABLES
PACKING_LIST = T_OBJPACK
OBJECT_HEADER = T_OBJHEAD
CONTENTS_BIN = T_ATTACH_DATA
CONTENTS_TXT = T_MESSBODY
RECEIVERS = T_RECEIVER
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.
MESSAGE I007(CLAIM).
ELSE.
MESSAGE S592(EI).
ENDIF. " IF sy-subrc NE 0.
ENDFORM. " Send_mail
*& Form table_shift
The PDF file that is generated out of the above function module
cannot be transported as it needs to be of 255 chars.Hence
converting the file to get a 255 char single line,internal table.
*There are no interface parameters to be passed to this subroutine
FORM TABLE_SHIFT .
CONSTANTS:
CNV_HEXCONST_ZERO TYPE X VALUE '00'.
DATA:
LV_BIG_LINES(268) TYPE C
OCCURS 0 WITH HEADER LINE.
DATA:
LFL_FLAG TYPE C,
LV_LEFT_T(268) TYPE C,
LV_LEFT_I TYPE I,
TV_LEFT_I TYPE I,
LV_CURR_I TYPE I.
FIELD-SYMBOLS: <F>.
Get the lines into a table of 268 char as the first step to put it in
the pdf file of 255 chars
CLEAR LFL_FLAG.
LOOP AT T_PDF_DATA INTO FS_PDF_DATA.
IF LFL_FLAG EQ ' '.
CLEAR LV_BIG_LINES WITH CNV_HEXCONST_ZERO.
ASSIGN LV_BIG_LINES(134) TO <F>.
<F> = FS_PDF_DATA.
LFL_FLAG = 'X'.
ELSE.
LV_BIG_LINES+134 = FS_PDF_DATA.
APPEND LV_BIG_LINES.
CLEAR: LFL_FLAG.
ENDIF. " If lfl_flag = ''..
ENDLOOP. " Loop at t_pdf
IF LFL_FLAG EQ 'X'.
APPEND LV_BIG_LINES.
ENDIF. " If lflf_flag eq 'X'..
Next fill it into a 255 char table
CLEAR: LV_LEFT_T, LV_LEFT_I, TV_LEFT_I.
LV_CURR_I = 255.
LOOP AT LV_BIG_LINES.
IF LV_LEFT_I NE 0.
IF LV_CURR_I NE 0.
FS_OBJCONT(LV_LEFT_I) = LV_LEFT_T(LV_LEFT_I).
FS_OBJCONT+LV_LEFT_I(LV_CURR_I) = LV_BIG_LINES(LV_CURR_I).
ELSE.
FS_OBJCONT = LV_LEFT_T(LV_LEFT_I).
ENDIF. " IF lv_curr_i NE 0
ELSE.
FS_OBJCONT = LV_BIG_LINES(LV_CURR_I).
ENDIF. " IF lv_left_i NE 0
APPEND FS_OBJCONT TO T_OBJCONT.
TV_LEFT_I = 268 - LV_CURR_I.
IF TV_LEFT_I > 255.
FS_OBJCONT = LV_BIG_LINES+LV_CURR_I(255).
APPEND FS_OBJCONT TO T_OBJCONT.
LV_LEFT_I = TV_LEFT_I - 255.
TV_LEFT_I = 255 + LV_CURR_I.
LV_CURR_I = 255 - LV_LEFT_I.
LV_LEFT_T = LV_BIG_LINES+TV_LEFT_I.
ELSE.
LV_LEFT_T = LV_BIG_LINES+LV_CURR_I.
LV_LEFT_I = 268 - LV_CURR_I.
LV_CURR_I = 255 - LV_LEFT_I.
ENDIF. " IF tv_left_i > 255
ENDLOOP. " LOOP AT lv_big_lines.
CLEAR FS_OBJCONT WITH CNV_HEXCONST_ZERO.
ASSIGN FS_OBJCONT(LV_LEFT_I) TO <F>.
<F> = LV_LEFT_T(LV_LEFT_I).
APPEND FS_OBJCONT TO T_OBJCONT.
ENDFORM. " Table_shift
Maybe you are looking for
-
Has anyone tried the "Table Filters" with Numbers 3.0 (Maverick).
I use the formula If(isblank(A5),"","Data"). the previous version of Numbers treated the "" as a blank cell and the Table Filters did not display that row if I had the "Reorginize" filter set to "Is Not Blank". The Maverick version treats the "" as t
-
I have a dynamic select list populated by site names and URLs from a map; when a user clicks on an entry the site name and URL will fill two text boxes. There are also buttons to add, update, and delete entries. These buttons lead to actions within m
-
The new timeline in photoshop cs6 is weird but I don't understand how I can use it for animating. I use photoshop for frame-by-frame animaiton (Not flash) and the new Timeline is confusing me. How do I use this new time line for frame-by-frame anima
-
Ora-12514 - sqlnet.log states ora-12564
Oracle 8.1.5 w/Patch level 02 applied I have come to the end of my rope. I have tried and tried to connect to my database using the following: sqlplus system/manager@mydbname and always get ora-12514. When I look at the sqlnet.log file I find: Tns er
-
OK, I'll ask. What are we doing wrong in our deployments? We do use a custom model that leverages xml files for....many things. Steps to reproduce: Deploy a Workspace that dependeds on xml for a workspace that contains a Lvproj that does not use DOM