DATA: ltmailrecipients TYPE STANDARD TABLE OF somlrec90 WITH HEADER LINE, ltmailtxt TYPE STANDARD TABLE OF soli WITH HEADER LINE, ltattachment TYPE STANDARD TABLE OF solisti1 WITH HEADER LINE, ltmailsubject TYPE sodocchgi1, ltpackinglist TYPE STANDARD TABLE OF sopcklsti1 WITH HEADER LINE, gvcnt TYPE i. DATA: ltmailrecipients TYPE STANDARD TABLE OF somlrec90 WITH HEADER LINE, ltmailtxt TYPE STANDARD TABLE OF soli WITH HEADER LINE, ltattachment TYPE STANDARD TABLE OF solisti1 WITH HEADER LINE, ltmailsubject TYPE sodocchgi1, ltpackinglist TYPE STANDARD TABLE OF sopcklsti1 WITH HEADER LINE, gvcnt TYPE i. Now, lets start formatting the mail. Add Recipients.
DATA: BEGIN OF ltpodatacons OCCURS 0, ebeln like ekpo -ebeln, ebelp like ekpo -ebelp, END OF ltpodatacons. SELECT ebeln ebelp INTO TABLE ltpodatacons UP TO 10 ROWS FROM ekpo. CLASS clabapcharutilities DEFINITION LOAD. CONCATENATE 'PO' 'PO Line' INTO ltattachment SEPARATED BY clabapcharutilities = & gt;horizontaltab. APPEND ltattachment. CLEAR ltattachment. LOOP AT ltpodatacons.
CONCATENATE ltpodatacons -ebeln ltpodatacons -ebelp INTO ltattachment SEPARATED BY clabapcharutilities = & gt;horizontaltab. CONCATENATE clabapcharutilities = & gt;newline ltattachment INTO ltattachment. APPEND ltattachment. CLEAR ltattachment. DATA: BEGIN OF ltpodatacons OCCURS 0, ebeln like ekpo-ebeln, ebelp like ekpo-ebelp, END OF ltpodatacons. SELECT ebeln ebelp INTO TABLE ltpodatacons UP TO 10 ROWS FROM ekpo.
CLASS clabapcharutilities DEFINITION LOAD. CONCATENATE 'PO' 'PO Line' INTO ltattachment SEPARATED BY clabapcharutilities=horizontaltab. APPEND ltattachment. CLEAR ltattachment. LOOP AT ltpodatacons. CONCATENATE ltpodatacons-ebeln ltpodatacons-ebelp INTO ltattachment SEPARATED BY clabapcharutilities=horizontaltab. CONCATENATE clabapcharutilities=newline ltattachment INTO ltattachment.
APPEND ltattachment. CLEAR ltattachment.
Batman the animated serie rmvb. Find great deals on eBay for batman the animated series batman and batman the animated series figure batman. Shop with confidence. Watch online and download Batman: The Animated Series cartoon in high quality. Various formats from 240p to 720p HD (or even 1080p). HTML5 available for. Due to the success of Batman: The Animated Series, many crew members went on to design and produce Superman: The Animated Series for The WB Network. During this time they created The New Batman Adventures, which featured the same streamlined animation style as Superman: The Animated Series, as well as numerous character re.
Pack the mail contents and attachment. Ltpackinglist -transfbin = space. Ltpackinglist -headstart = 1.
Ltpackinglist -headnum = 0. Ltpackinglist -bodystart = 1.
Ltpackinglist -bodynum = LINES ( ltmailtxt ). Ltpackinglist -doctype = 'RAW'. APPEND ltpackinglist. CLEAR ltpackinglist. Ltpackinglist -transfbin = 'X'. Ltpackinglist -headstart = 1. Ltpackinglist -headnum = 1.
Ltpackinglist -bodystart = 1. Ltpackinglist -bodynum = LINES ( ltattachment ). Ltpackinglist -doctype = 'XLS'. ' You can give RAW incase if you want just a txt file. Ltpackinglist -objname = 'data.xls'. Ltpackinglist -objdescr = 'data.xls'.
Ltpackinglist -docsize = ltpackinglist -bodynum. 255. APPEND ltpackinglist. CLEAR ltpackinglist. Ltmailsubject -objname = 'MAILATTCH'. Ltmailsubject -objlangu = sy -langu.
Ltmailsubject -objdescr = 'You have got mail'. Ltmailsubject -sensitivty = 'F'.
Gvcnt = LINES ( ltattachment ). Ltmailsubject -docsize = ( gvcnt - 1 ).
255 + STRLEN ( ltattachment ). Ltpackinglist-transfbin = space. Ltpackinglist-headstart = 1. Ltpackinglist-headnum = 0. Ltpackinglist-bodystart = 1. Ltpackinglist-bodynum = LINES( ltmailtxt ).
Ltpackinglist-doctype = 'RAW'. APPEND ltpackinglist. CLEAR ltpackinglist. Ltpackinglist-transfbin = 'X'. Ltpackinglist-headstart = 1. Ltpackinglist-headnum = 1.
Ltpackinglist-bodystart = 1. Ltpackinglist-bodynum = LINES( ltattachment ). Ltpackinglist-doctype = 'XLS'. ' You can give RAW incase if you want just a txt file. Ltpackinglist-objname = 'data.xls'.
Ltpackinglist-objdescr = 'data.xls'. Ltpackinglist-docsize = ltpackinglist-bodynum. 255. APPEND ltpackinglist.
CLEAR ltpackinglist. Ltmailsubject-objname = 'MAILATTCH'.
Ltmailsubject-objlangu = sy-langu. Ltmailsubject-objdescr = 'You have got mail'. Ltmailsubject-sensitivty = 'F'.
Gvcnt = LINES( ltattachment ). Ltmailsubject-docsize = ( gvcnt - 1 ). 255 + STRLEN( ltattachment ). Finally, send the mail out.
You are all done. Just call the function module to send the mail out. CALL FUNCTION 'SONEWDOCUMENTATTSENDAPI1' EXPORTING documentdata = ltmailsubject TABLES packinglist = ltpackinglist contentsbin = ltattachment contentstxt = ltmailtxt receivers = ltmailrecipients EXCEPTIONS toomanyreceivers = 1 documentnotsent = 2 documenttypenotexist = 3 operationnoauthorization = 4 parametererror = 5 xerror = 6 enqueueerror = 7 OTHERS = 8.
IF sy -subrc EQ 0. SUBMIT rsconn01 WITH mode = 'INT' AND RETURN. CALL FUNCTION 'SONEWDOCUMENTATTSENDAPI1' EXPORTING documentdata = ltmailsubject TABLES packinglist = ltpackinglist contentsbin = ltattachment contentstxt = ltmailtxt receivers = ltmailrecipients EXCEPTIONS toomanyreceivers = 1 documentnotsent = 2 documenttypenotexist = 3 operationnoauthorization = 4 parametererror = 5 xerror = 6 enqueueerror = 7 OTHERS = 8. IF sy-subrc EQ 0.
SUBMIT rsconn01 WITH mode = 'INT' AND RETURN. If this is complicated, there is a much, check for more.
Hi all, I'm currently using SONEWDOCUMENTATTSENDAPI1 to send out the email and together with a pdf attachment. However when I tried to open the attachment, it has the decoded incorrectly error.
What am I missing? Below is the code, this is just testing purposes. I apologized for the messy code. DATA: OBJPACK LIKE SOPCKLSTI1 OCCURS 2 WITH HEADER LINE. DATA: OBJHEAD LIKE SOLISTI1 OCCURS 1 WITH HEADER LINE. DATA: OBJBIN LIKE SOLISTI1 OCCURS 10 WITH HEADER LINE.
DATA: OBJTXT LIKE SOLISTI1 OCCURS 10 WITH HEADER LINE. DATA: RECLIST LIKE SOMLRECI1 OCCURS 5 WITH HEADER LINE. DATA: DOCCHNG LIKE SODOCCHGI1. DATA: TABLINES LIKE SY-TABIX. DATA: lfunctionmodule TYPE rs38lfnam.
DATA: lspoolid TYPE rspoid, lcontrolparameters TYPE ssfctrlop, loutputoptions TYPE ssfcompop, lusersettings TYPE tdbool VALUE ' ', ldocumentoutputinfo TYPE ssfcrespd, ljoboutputinfo TYPE ssfcrescl, ljoboutputoptions TYPE ssfcresop, lspooliddel TYPE rqident, lstatus TYPE sysubrc, litable01 TYPE TABLE OF YGLXXPDFSTABLE, lwtable01 LIKE YGLXXPDFSTABLE, bin TYPE xstring. DATA: iotfdata TYPE STANDARD TABLE OF itcoo INITIAL SIZE 0. DATA: lotfdata TYPE itcoo. DATA: lvbytes TYPE p, lvbinfile TYPE xstring, gtpdfdata TYPE STANDARD TABLE OF tline INITIAL SIZE 0, CONTENTOUT TYPE TABLE OF SOLISTI1. Data: begin of itab occurs 0, line(255) type c, end of itab. Creating the document to be sent DOCCHNG-OBJNAME = 'OFFER'.
DOCCHNG-OBJDESCR = 'Auction of a Picasso jr'. OBJTXT = 'Reserve price: $250000'.
APPEND OBJTXT. OBJTXT = 'A reproduction of the painting to be auctioned'. APPEND OBJTXT. OBJTXT = 'is enclosed as an attachment.' APPEND OBJTXT. DESCRIBE TABLE OBJTXT LINES TABLINES.
READ TABLE OBJTXT INDEX TABLINES. DOCCHNG-DOCSIZE = ( TABLINES - 1 ). 255 + STRLEN( OBJTXT ). Creating the entry for the compressed document CLEAR OBJPACK-TRANSFBIN. OBJPACK-HEADSTART = 1. OBJPACK-HEADNUM = 0.
OBJPACK-BODYSTART = 1. OBJPACK-BODYNUM = TABLINES.
OBJPACK-DOCTYPE = 'RAW'. APPEND OBJPACK. Creating the document attachment (PDF) Get Function Module of Smartform CALL FUNCTION 'SSFFUNCTIONMODULENAME' EXPORTING formname = 'YGLPAIDR' IMPORTING fmname = lfunctionmodule EXCEPTIONS noform = 1 nofunctionmodule = 2 OTHERS = 3. Set Print Parameters lcontrolparameters-langu = 'EN'.
Lcontrolparameters-nodialog = 'X'. Lcontrolparameters-getotf = 'X'. Loutputoptions-tddest = 'LOCL'. LOOP AT litable01 INTO lwtable01. Lwtable01-line = '0002'. APPEND lwtable01 TO litable01.
Call Smartform Function Module CALL FUNCTION lfunctionmodule EXPORTING controlparameters = lcontrolparameters outputoptions = loutputoptions usersettings = lusersettings pernr = '20' begda = sy-datum endda = '99991231' langu = sy-langu audience = ' data01 = ' data02 = ' data03 = ' data04 = ' data05 = ' IMPORTING documentoutputinfo = ldocumentoutputinfo joboutputinfo = ljoboutputinfo joboutputoptions = ljoboutputoptions TABLES table01 = litable01 EXCEPTIONS formattingerror = 1 internalerror = 2 senderror = 3 usercanceled = 4 OTHERS = 5. Populate OTF data table LOOP AT ljoboutputinfo-otfdata INTO lotfdata. APPEND lotfdata TO iotfdata. CLEAR lotfdata.
' LOOP AT touttab-otfdata Convert OTF into PDF CALL FUNCTION 'CONVERTOTF' EXPORTING format = 'PDF' IMPORTING binfilesize = lvbytes binfile = bin TABLES otf = iotfdata lines = gtpdfdata EXCEPTIONS errmaxlinewidth = 1 errformat = 2 errconvnotpossible = 3 OTHERS = 4. CALL FUNCTION 'SCMSXSTRINGTOBINARY' EXPORTING BUFFER = bin TABLES BINARYTAB = itab objbin = itab. APPEND objbin. DESCRIBE TABLE OBJBIN LINES TABLINES.OBJHEAD = 'attach.pdf'. APPEND OBJHEAD.
Creating the entry for the compressed attachment OBJPACK-TRANSFBIN = 'X'. OBJPACK-HEADSTART = 1. OBJPACK-HEADNUM = 1. OBJPACK-BODYSTART = 1. OBJPACK-BODYNUM = TABLINES. OBJPACK-DOCTYPE = 'PDF'.
OBJPACK-OBJNAME = 'ATTACHMENT'. OBJPACK-OBJDESCR = 'Attachment'. OBJPACK-DOCSIZE = TABLINES. 255.
APPEND OBJPACK. Entering names in the distribution list RECLIST-RECEIVER = '. RECLIST-RECTYPE = 'U'.
APPEND RECLIST. RECLIST-RECEIVER = 'DLI-NEUREICH'.
RECLIST-RECTYPE = 'P'. APPEND RECLIST. Sending the document CALL FUNCTION 'SONEWDOCUMENTATTSENDAPI1' EXPORTING DOCUMENTDATA = DOCCHNG PUTINOUTBOX = 'X' COMMITWORK = 'X' TABLES PACKINGLIST = OBJPACK OBJECTHEADER = OBJHEAD CONTENTSBIN = OBJBIN CONTENTSTXT = OBJTXT CONTENTSHEX = itab RECEIVERS = RECLIST EXCEPTIONS TOOMANYRECEIVERS = 1 DOCUMENTNOTSENT = 2 OPERATIONNOAUTHORIZATION = 4 OTHERS = 99. CASE SY-SUBRC. WRITE: / 'Result of the send process:'.
LOOP AT RECLIST. WRITE: / RECLIST-RECEIVER(48), ':'. IF RECLIST-RETRNCODE = 0. WRITE 'sent successfully'. WRITE 'not sent'. WRITE: / 'no authorization to send to the specified number of recipients!' WRITE: / 'document could not be sent to any of the recipients!'
WRITE: / 'no authorization to send!' WRITE: / 'error occurred during sending!' Hi all, I'm currently using SONEWDOCUMENTATTSENDAPI1 to send out the email and together with a pdf attachment. However when I tried to open the attachment, it has the decoded incorrectly error. What am I missing? Below is the code, this is just testing purposes.
I apologized for the messy code. DATA: OBJPACK LIKE SOPCKLSTI1 OCCURS 2 WITH HEADER LINE. DATA: OBJHEAD LIKE SOLISTI1 OCCURS 1 WITH HEADER LINE. DATA: OBJBIN LIKE SOLISTI1 OCCURS 10 WITH HEADER LINE. DATA: OBJTXT LIKE SOLISTI1 OCCURS 10 WITH HEADER LINE.
DATA: RECLIST LIKE SOMLRECI1 OCCURS 5 WITH HEADER LINE. DATA: DOCCHNG LIKE SODOCCHGI1. DATA: TABLINES LIKE SY-TABIX. DATA: lfunctionmodule TYPE rs38lfnam. DATA: lspoolid TYPE rspoid, lcontrolparameters TYPE ssfctrlop, loutputoptions TYPE ssfcompop, lusersettings TYPE tdbool VALUE ' ', ldocumentoutputinfo TYPE ssfcrespd, ljoboutputinfo TYPE ssfcrescl, ljoboutputoptions TYPE ssfcresop, lspooliddel TYPE rqident, lstatus TYPE sysubrc, litable01 TYPE TABLE OF YGLXXPDFSTABLE, lwtable01 LIKE YGLXXPDFSTABLE, bin TYPE xstring. DATA: iotfdata TYPE STANDARD TABLE OF itcoo INITIAL SIZE 0. DATA: lotfdata TYPE itcoo.
DATA: lvbytes TYPE p, lvbinfile TYPE xstring, gtpdfdata TYPE STANDARD TABLE OF tline INITIAL SIZE 0, CONTENTOUT TYPE TABLE OF SOLISTI1. Data: begin of itab occurs 0, line(255) type c, end of itab. Creating the document to be sent DOCCHNG-OBJNAME = 'OFFER'. DOCCHNG-OBJDESCR = 'Auction of a Picasso jr'. OBJTXT = 'Reserve price: $250000'. APPEND OBJTXT. OBJTXT = 'A reproduction of the painting to be auctioned'.
APPEND OBJTXT. OBJTXT = 'is enclosed as an attachment.' APPEND OBJTXT.
DESCRIBE TABLE OBJTXT LINES TABLINES. READ TABLE OBJTXT INDEX TABLINES. DOCCHNG-DOCSIZE = ( TABLINES - 1 ).
255 + STRLEN( OBJTXT ). Creating the entry for the compressed document CLEAR OBJPACK-TRANSFBIN. OBJPACK-HEADSTART = 1.
OBJPACK-HEADNUM = 0. OBJPACK-BODYSTART = 1.
OBJPACK-BODYNUM = TABLINES. OBJPACK-DOCTYPE = 'RAW'.
APPEND OBJPACK. Creating the document attachment (PDF) Get Function Module of Smartform CALL FUNCTION 'SSFFUNCTIONMODULENAME' EXPORTING formname = 'YGLPAIDR' IMPORTING fmname = lfunctionmodule EXCEPTIONS noform = 1 nofunctionmodule = 2 OTHERS = 3.
Set Print Parameters lcontrolparameters-langu = 'EN'. Lcontrolparameters-nodialog = 'X'.
Lcontrolparameters-getotf = 'X'. Loutputoptions-tddest = 'LOCL'. LOOP AT litable01 INTO lwtable01. Lwtable01-line = '0002'. APPEND lwtable01 TO litable01. Call Smartform Function Module CALL FUNCTION lfunctionmodule EXPORTING controlparameters = lcontrolparameters outputoptions = loutputoptions usersettings = lusersettings pernr = '20' begda = sy-datum endda = '99991231' langu = sy-langu audience = ' data01 = ' data02 = ' data03 = ' data04 = ' data05 = ' IMPORTING documentoutputinfo = ldocumentoutputinfo joboutputinfo = ljoboutputinfo joboutputoptions = ljoboutputoptions TABLES table01 = litable01 EXCEPTIONS formattingerror = 1 internalerror = 2 senderror = 3 usercanceled = 4 OTHERS = 5.
Populate OTF data table LOOP AT ljoboutputinfo-otfdata INTO lotfdata. APPEND lotfdata TO iotfdata.
CLEAR lotfdata. ' LOOP AT touttab-otfdata Convert OTF into PDF CALL FUNCTION 'CONVERTOTF' EXPORTING format = 'PDF' IMPORTING binfilesize = lvbytes binfile = bin TABLES otf = iotfdata lines = gtpdfdata EXCEPTIONS errmaxlinewidth = 1 errformat = 2 errconvnotpossible = 3 OTHERS = 4. CALL FUNCTION 'SCMSXSTRINGTOBINARY' EXPORTING BUFFER = bin TABLES BINARYTAB = itab objbin = itab. APPEND objbin.
DESCRIBE TABLE OBJBIN LINES TABLINES.OBJHEAD = 'attach.pdf'. APPEND OBJHEAD. Creating the entry for the compressed attachment OBJPACK-TRANSFBIN = 'X'. OBJPACK-HEADSTART = 1. OBJPACK-HEADNUM = 1. OBJPACK-BODYSTART = 1. OBJPACK-BODYNUM = TABLINES.
OBJPACK-DOCTYPE = 'PDF'. OBJPACK-OBJNAME = 'ATTACHMENT'. OBJPACK-OBJDESCR = 'Attachment'. OBJPACK-DOCSIZE = TABLINES. 255.
APPEND OBJPACK. Entering names in the distribution list RECLIST-RECEIVER = '. RECLIST-RECTYPE = 'U'. APPEND RECLIST. RECLIST-RECEIVER = 'DLI-NEUREICH'. RECLIST-RECTYPE = 'P'.
APPEND RECLIST. Sending the document CALL FUNCTION 'SONEWDOCUMENTATTSENDAPI1' EXPORTING DOCUMENTDATA = DOCCHNG PUTINOUTBOX = 'X' COMMITWORK = 'X' TABLES PACKINGLIST = OBJPACK OBJECTHEADER = OBJHEAD CONTENTSBIN = OBJBIN CONTENTSTXT = OBJTXT CONTENTSHEX = itab RECEIVERS = RECLIST EXCEPTIONS TOOMANYRECEIVERS = 1 DOCUMENTNOTSENT = 2 OPERATIONNOAUTHORIZATION = 4 OTHERS = 99.
CASE SY-SUBRC. WRITE: / 'Result of the send process:'. LOOP AT RECLIST. WRITE: / RECLIST-RECEIVER(48), ':'.
IF RECLIST-RETRNCODE = 0. WRITE 'sent successfully'. WRITE 'not sent'. WRITE: / 'no authorization to send to the specified number of recipients!' WRITE: / 'document could not be sent to any of the recipients!'
WRITE: / 'no authorization to send!' WRITE: / 'error occurred during sending!'
'Hi, I am using this function module to send multiple pdf attachments. I am able to open the first attachment but cant open the second one.
Here I have used tattachment1 for second attachment.how can I make these two attachments work using contentshex in FM? DATA: tpackinglist LIKE sopcklsti1 OCCURS 0 WITH HEADER LINE, tcontents LIKE solisti1 OCCURS 0 WITH HEADER LINE, treceivers LIKE somlreci1 OCCURS 0 WITH HEADER LINE, tattachment TYPE STANDARD TABLE OF solix INITIAL SIZE 0, tattachment1 TYPE STANDARD TABLE OF solix INITIAL SIZE 0,.added for second attachment tobjectheader LIKE solisti1 OCCURS 0 WITH HEADER LINE, wcnt TYPE i, wsentall(1) TYPE c, wdocdata LIKE sodocchgi1. DATA: lderror TYPE sy-subrc, ldreciever TYPE sy-subrc, ldmtitle LIKE sodocchgi1-objdescr, ldemail LIKE somlreci1-receiver, ldformat TYPE soobjtp, ldattdescription TYPE soobjnam, ldattdescription TYPE soobjdes, ldattfilename TYPE soobjdes,. ldattdescription1 TYPE soobjdes, ldattfilename1 TYPE soobjdes,. ldsenderaddress LIKE soextreci1-receiver, ldsenderaddresstype LIKE soextreci1-adrtyp, ldreceiver LIKE sy-subrc.
Data: n type i. Ldemail = pemail. Ldmtitle = pmtitle. Ldformat = pformat. Ldattdescription = pattdescription. Ldattfilename = pfilename.
parameters added -for second attachment. Data: ldformat1 TYPE soobjtp. Ldformat1 = p1format. Ldattdescription1 = pattdescription1.
Ldattfilename1 = pfilename1. ldsenderaddress = psenderaddress. Ldsenderaddresstype = psenderaddrestype. Itmessage = pitmessage.
Fill the document data. Wdocdata-docsize = 1.
Populate the subject/generic message attributes wdocdata-objlangu = sy-langu. Wdocdata-objname = 'SAPRPT'. Wdocdata-objdescr = ldmtitle. Wdocdata-sensitivty = 'F'. Fill the document data and get size of attachment CLEAR wdocdata. READ TABLE itattach INDEX wcnt.
Wdocdata-docsize = ( wcnt - 1 ). 255 + ( wcnt - 1 ).
255. Wdocdata-objlangu = sy-langu. Wdocdata-objname = 'SAPRPT'. Wdocdata-objdescr = ldmtitle. Wdocdata-sensitivty = 'F'. CLEAR tattachment.
REFRESH tattachment. Tattachment = pitattach.
for second attachemnt. Fill the document data and get size of attachment CLEAR wdocdata. READ TABLE itattach1 INDEX wcnt. Wdocdata-docsize = ( wcnt - 1 ). 255 + ( wcnt - 1 ). 255. Wdocdata-objlangu = sy-langu.
Wdocdata-objname = 'SAPRPT'. Wdocdata-objdescr = ldmtitle. Wdocdata-sensitivty = 'F'. CLEAR tattachment1.
REFRESH tattachment1. Tattachment1 = pitattach1. Describe the body of the message CLEAR tpackinglist. REFRESH tpackinglist. Tpackinglist-transfbin = space. Tpackinglist-headstart = 1.
Email With Pdf Attachment Virus
Tpackinglist-headnum = 0. Tpackinglist-bodystart = 1.
DESCRIBE TABLE itmessage LINES tpackinglist-bodynum. Tpackinglist-doctype = 'RAW'. APPEND tpackinglist.
Create attachment notification. for first attachment n = 1.
Tpackinglist-transfbin = 'X'. Tpackinglist-headstart = 1. Tpackinglist-headnum = 1. Tpackinglist-bodystart = 1. DESCRIBE TABLE tattachment LINES tpackinglist-bodynum.
Tpackinglist-doctype = ldformat. Tpackinglist-objdescr = ldattdescription. Tpackinglist-objname = ldattfilename. Tpackinglist-docsize = tpackinglist-bodynum.
255. APPEND tpackinglist. for second attachment n = 2. tpackinglist-transfbin = 'X'.
Tpackinglist-headstart = 2. Tpackinglist-headnum = 1.
Tpackinglist-bodystart = 2. tpackinglist-bodynum = 2. DESCRIBE TABLE tattachment1 LINES tpackinglist-bodynum. Tpackinglist-doctype = ldformat. Tpackinglist-objdescr = ldattdescription1.
Tpackinglist-objname = ldattfilename. Tpackinglist-docsize = tpackinglist-bodynum. 255. APPEND tpackinglist. Add the recipients email address CLEAR treceivers. REFRESH treceivers.
Treceivers-receiver = ldemail. Treceivers-rectype = 'U'. Treceivers-express = 'X'. Treceivers-comtype = 'INT'. Treceivers-notifdel = '. Treceivers-notifndel = 'X'. APPEND treceivers.
CALL FUNCTION 'SONEWDOCUMENTATTSENDAPI1' EXPORTING documentdata = wdocdata putinoutbox = 'X'. senderaddress = ldsenderaddress. senderaddresstype = ldsenderaddresstype commitwork = 'X' IMPORTING senttoall = wsentall TABLES packinglist = tpackinglist contentshex = tattachment contentstxt = itmessage receivers = treceivers EXCEPTIONS toomanyreceivers = 1 documentnotsent = 2 documenttypenotexist = 3 operationnoauthorization = 4 parametererror = 5 xerror = 6 enqueueerror = 7 OTHERS = 8. Thanks sandeep'.
'I am using the CONVERTABAPSPOOLJOB2PDF function module to convert a report in the 'spool' to a PDF file. When I use the DOWNLOAD function module, the resulting file can be opened in acrobat. I would like to email the report in PDF format as an attachment. I am trying to use function module SONEWDOCUMENTATTSENDAPI1 to create a SAP Office document with an attachment however the attached file is not being created correctly. I believe that somehow I am not using the SONEWDOCUMENTATTSENDAPI1 function module correctly. Has anyone used the CONVERTABAPSPOOLJOB2PDF and SONEWDOCUMENTATTSENDAPI1 function modules together like I am describing? Regards, Bob Schneider Infineon Technologies, Richmond '.
Hi Robert, I tried using the convertababspooljob2pdf function to convert a report output to PDF. Questasim linux crack. I pass a spool id and I get the converted data in tline(output internal table). Then i tried to download the data(using WSDOWNLOAD) to a.pdf file. But the file doesnt open in acrobat. It says file damaged and cannot be repaired. Donno where it is going wrong.
Any help is appreciated. Thanks Karthik From: '[email protected] via sap-r3-dev' Reply-To: [email protected] To: Karthikeyan SM Subject: sap-r3-dev SONEWDOCUMENTATTSENDAPI1 to send a PDF attachment Date: Fri, 7 Jun 2002 14:47:21 +0200 1000's of Security Documents – I am using the CONVERTABAPSPOOLJOB2PDF function module to convert a report in the 'spool' to a PDF file. When I use the DOWNLOAD function module, the resulting file can be opened in acrobat.
I would like to email the report in PDF format as an attachment. I am trying to use function module SONEWDOCUMENTATTSENDAPI1 to create a SAP Office document with an attachment however the attached file is not being created correctly. I believe that somehow I am not using the SONEWDOCUMENTATTSENDAPI1 function module correctly. Has anyone used the CONVERTABAPSPOOLJOB2PDF and SONEWDOCUMENTATTSENDAPI1 function modules together like I am describing? Regards, Bob Schneider Infineon Technologies, Richmond.Planning for Disaster Recovery?.
Quest Software Has You Covered.Archives:.Unsubscribe: mailto:[email protected] of Use:.Copyright (c) ITtoolbox and message author. No redistribution. MSN Photos is the easiest way to share and print your photos: http://photos.msn.com/support/worldwide.aspx.
Hope below mentioned coding will help u, call function 'GETPRINTPARAMETERS' exporting authority = space copies = '1' coverpage = space dataset = space department = space destination = space expiration = '1' immediately = space. inarchiveparameters = ' '. inparameters = ' ' layout = space mode = space newlistid = 'X' nodialog = 'X' user = sy-uname importing outparameters = mstrprintparms valid = mcvalid exceptions archiveinfonotfound = 1 invalidprintparams = 2 invalidarchiveparams = 3 others = 4.- Make sure that a printer destination has been set up.- If this is not done the PDF function module ABENDS if mstrprintparms-pdest = space. Mstrprintparms-pdest = 'SAPW'.- Explicitly set line width, and output format so that.- the PDF conversion comes out OK mstrprintparms-linsz = plinsz. Mstrprintparms-paart = ppaart.
Perform getspoolnumber using sy-repid sy-uname changing mirqident2. Submit (prepid) to sap-spool without spool dynpro spool parameters mstrprintparms. via selection-screen with mbudat in mbudat ' '7007319' WITH MGSBER IN GSBER and return.- Find out what the spool number is that was just created perform getspoolnumber using sy-repid sy-uname changing mirqident.- Convert Spool to PDF if mirqident2 mirqident. Call function 'CONVERTABAPSPOOLJOB2PDF' exporting srcspoolid = mirqident nodialog = space dstdevice = mstrprintparms-pdest importing pdfbytecount = mibytecount tables pdf = ltpdf exceptions errnoabapspooljob = 1 errnospooljob = 2 errnopermission = 3 errconvnotpossible = 4 errbaddestdevice = 5 usercancelled = 6 errspoolerror = 7 errtemseerror = 8 errbtcjobopenfailed = 9 errbtcjobsubmitfailed = 10 errbtcjobclosefailed = 11 others = 12. CHECK NOT ( LTPDF IS INITIAL ). Convert pdf itab to 255 line itab. Data:LVCOUNTER type i.
Data:LVFROM type i. Loop at LTPDF. Translate LTPDF using ' '. Concatenate ITATTACHMENTLONG LTPDF into itattachmentlong. Translate ITATTACHMENTLONG using ' '. Append ITATTACHMENTLONG. Clear: LVCOUNTER.
LVCOUNTER = strlen( ITATTACHMENTLONG ). If LVCOUNTER ge 255. ITATTACHMENT = ITATTACHMENTLONG(255). Append ITATTACHMENT.
SHIFT ITATTACHMENTLONG by 255 places. ITATTACHMENT = ITATTACHMENTLONG(lvcounter). Append ITATTACHMENT. Body of email LTOBJTXT = 'Enclosed as per attachment, please find the list of GRN pending for invoice.' APPEND LTOBJTXT.
LTOBJTXT = 'To scroll through the report you may use 'Page Down'.' APPEND LTOBJTXT. LTOBJTXT = 'For information and necessary action pl.'
APPEND LTOBJTXT. LTOBJTXT = 'Information Systems Department.' APPEND LTOBJTXT.
DESCRIBE TABLE LTOBJTXT LINES TABLINES. READ TABLE LTOBJTXT INDEX TABLINES. LVDOCUMENTDATA-DOCSIZE = ( TABLINES - 1 ). 255 + STRLEN( LTOBJTXT ). LVDOCUMENTDATA-objname = 'SpoolMail'. Title of the email as spool name LVDOCUMENTDATA-sensitivty = 'O'. LVDOCUMENTDATA-expirydat = SY-datum + 15.
e-mail body CLEAR LTOBJPACK. LTOBJPACK-headstart = 1. LTOBJPACK-headnum = 0. LTOBJPACK-bodystart = 1. LTOBJPACK-bodynum = TABLINES. LTOBJPACK-doctype = 'RAW'. LTOBJPACK-docsize = STRLEN( LTOBJTXT ).
APPEND LTOBJPACK. For e-mail attachment DESCRIBE TABLE ITATTACHMENT LINES LATTLINES. READ TABLE ITATTACHMENT INDEX LATTLINES.
CLEAR LTOBJPACK. LTOBJPACK-transfbin = 'X'. LTOBJPACK-headstart = 1.
LTOBJPACK-headnum = 1. LTOBJPACK-bodystart = 1.
LTOBJPACK-bodynum = LATTLINES. LTOBJPACK-doctype = 'PDF'. LTOBJPACK-objname = 'ATTACHMENT'.
LTOBJPACK-objdescr = 'ATTACHMENT'. LTOBJPACK-docsize = ( 255. ( LATTLINES - 1 ) ) + STRLEN( ITATTACHMENT-line ). APPEND LTOBJPACK. send mail with attachment CALL FUNCTION 'SONEWDOCUMENTATTSENDAPI1' EXPORTING documentdata = LVDOCUMENTDATA putinoutbox = 'X' COMMITWORK = 'X' TABLES packinglist = LTOBJPACK objectheader = LTOBJHEAD contentsbin = ITATTACHMENT contentstxt = LTOBJTXT receivers = LTRECLIST EXCEPTIONS toomanyreceivers = 1 documentnotsent = 2 documenttypenotexist = 3 operationnoauthorization = 4 parametererror = 5 xerror = 6 enqueueerror = 7 OTHERS = 8.-. FORM getspoolnumber.-. Get the most recent spool created by user/report.-.
FREPID. FUNAME. FRQIDENT.-. form getspoolnumber using frepid funame changing frqident. Data: lcrq2name like tsp01-rq2name. ' value 'ZMMIBGNSHA'.
Concatenate frepid+0(9) funame+0(3) into lcrq2name. Condense lcrq2name. Select. from tsp01 where rq2name = lcrq2name order by rqcretime descending. Frqident = tsp01-rqident.
If sy-subrc ne 0. Clear frqident. ' getspoolnumber With Regards Shantanu Modi. Shantanu, Thanks, but this code doesn't works fine. I don't know the parammeters.
If you have the wole code I'll be greatfull. Best regards. This should help you: Use your CONVERT FM, then add this bit of code to compress the resulting internal table: LOOP AT wpdf. TRANSLATE wpdf USING ' '. CONCATENATE wbuffer wpdf INTO wbuffer. TRANSLATE wbuffer USING ' '.
Irecord = wbuffer. APPEND irecord. SHIFT wbuffer LEFT BY 255 PLACES.
IF wbuffer IS INITIAL. Data definitions: wbuffer TYPE string, irecord LIKE solisti1 OCCURS 0 WITH HEADER LINE Then call SONEWDOCUMENTATTSENDAPI1 with the PDF as a BIN attachment. If you are unclear on how to use the FMs, the documentation for both is excellent. Kind Regards Rosie Brent ABAP Developer, SAP Analyst & BASIS Administrator ThyssenKrupp Automotive Tallent Chassis Newton Aycliffe, Co. Durham, England.Original Message- From: AlmirOliveira via sap-dev mailto:[email protected] Sent: 29 August 2007 20:21 To: Brent, Rosie Subject: RE:sap-dev SONEWDOCUMENTATTSENDAPI1 to send a PDF attachment Hy people, I have the same question: I have a PDF to attach to a e-mail, but I don't know how to do.
I think this problem was solved by someone here. Can you help me? -Original Message- I am using the CONVERTABAPSPOOLJOB2PDF function module to convert a report in the 'spool' to a PDF file. When I use the DOWNLOAD function module, the resulting file can be opened in acrobat.
I would like to email the report in PDF format as an attachment. I am trying to use function module SONEWDOCUMENTATTSENDAPI1 to create a SAP Office document with an attachment however the attached file is not being created correctly.
I believe that somehow I am not using the SONEWDOCUMENTATTSENDAPI1 function module correctly. Has anyone used the CONVERTABAPSPOOLJOB2PDF and SONEWDOCUMENTATTSENDAPI1 function modules together like I am describing? Regards, Bob Schneider Infineon Technologies, Richmond.
IMPORTANT NOTICE. This communication contains information, which is confidential and may also be privileged. It is for the exclusive use of the intended recipient(s). I f you are not the intended recipient(s) please note that any form of distri bution, copying or use of this communication or the information in it is st rictly prohibited and may be unlawful. If you have received this communication in error please return it to the se nder. We would be grateful if you would also copy the communication to is.t [email protected] then delete the email and destroy any copies of it. ThyssenKrupp Automotive Tallent Chassis Limited accepts no responsibility for any loss or damage resulting directly or indirectly from the use of thi s e-mail or its contents.
Any views expressed in this e-mail communication are those of the individua l sender and do not necessarily reflect the views of ThyssenKrupp Automotiv e Tallent Chassis Limited, and the company accepts no responsibility for th em. Hy people, I have the same question: I have a PDF to attach to a e-mail, but I don't know how to do. I think this problem was solved by someone here. Can you help me? -Original Message- I am using the CONVERTABAPSPOOLJOB2PDF function module to convert a report in the 'spool' to a PDF file. When I use the DOWNLOAD function module, the resulting file can be opened in acrobat.
I would like to email the report in PDF format as an attachment. I am trying to use function module SONEWDOCUMENTATTSENDAPI1 to create a SAP Office document with an attachment however the attached file is not being created correctly. I believe that somehow I am not using the SONEWDOCUMENTATTSENDAPI1 function module correctly. Has anyone used the CONVERTABAPSPOOLJOB2PDF and SONEWDOCUMENTATTSENDAPI1 function modules together like I am describing?
Regards, Bob Schneider Infineon Technologies, Richmond //.- INTERESTED IN THIS MESSAGE? RELATED CONTENT - eSubmissions Developer I - PDF whiz -.//. Maybe I can communicate with you in german?;) I have a problem converting a OTF-Spool into PDF in order to send this PDF-File with SONEWDOCUMENTATTSENDAPI1. You replied Almir to compress and decompress the table. How is your definition of table in an table out by compressing an decompressing? I can send the mail with pdf-attachment, but by trying to open the pdf-file in outlook I get an error telling me the pdf-file wasn't correctly decoded.
Hier my coding: data: mailanhang like soli occurs 0 with header line. Data: mailanhang1 like soli occurs 0 with header line.
Data: mailbin like solisti1 occurs 10 with header line. CALL FUNCTION 'RSPORETURNSPOOLJOB' EXPORTING rqident = '20573' desiredtype = 'PDF' TABLES buffer = mailanhang EXCEPTIONS OTHERS = 1. IF sy-subrc 0. MESSAGE ID '61' TYPE 'E' NUMBER '731' WITH 'RSPORETURNSPOOLJOB'. CALL FUNCTION 'TABLECOMPRESS' TABLES in = mailanhang out = mailanhang1 EXCEPTIONS other = 1. IF sy-subrc 0.
MESSAGE ID '61' TYPE 'E' NUMBER '731' WITH 'TABLECOMPRESS'. CALL FUNCTION 'TABLEDECOMPRESS' TABLES in = mailanhang1 out = mailbin EXCEPTIONS other = 1. IF sy-subrc 0. MESSAGE ID '61' TYPE 'E' NUMBER '731' WITH 'TABLEDECOMPRESS'.
Can you help me? Thank you very much. MM -Original Message- Hi Almir, I use SPORETURNSPOOLJOB to get the OTF data from spool into an internal table. Set the 'Desiredtype' to 'PDF'.
I then compress this table (TABLECOMPRESS), decompress (TABLEDECOMPRESS) it again (change of formats) and move the result to objbin for SONEWDOCUMENTATTSENDAPI1. Works for years now. Hi Marianne, of course we could communicate in german, but that would be unfair to all the other members out there:-)) I think the problem with your coding is the following: The FM RSPORETURNSPOOLJOB has a 'TABLES' parameter called 'BUFFERPDF'. This table will contain the proper pdf format for further processing. The table has format 'data: pdf like tline occurs 100 with header line'.
Use that table instead of your 'mailanhang' for the further processing. That should be it, the rest looks good to me. If you have other data than SAPSCRIPT or SMARTFORMS that you want to send out: I use fm 'CONVERTABAPSPOOLJOB2PDF' to fill the pdf table. All that is coding to send actual spool files. It looks a little bit different when you do not have a spoolfile and still want to send pdf-docs.
Marc -Original Message- From: MarianneM via sap-dev mailto:[email protected] Sent: Monday, October 01, 2007 9:48 AM To: Marc Hoffmann Subject: RE:sap-dev SONEWDOCUMENTATTSENDAPI1 to send a PDF attachment Hi Marc! Maybe I can communicate with you in german?;) I have a problem converting a OTF-Spool into PDF in order to send this PDF-File with SONEWDOCUMENTATTSENDAPI1. You replied Almir to compress and decompress the table. How is your definition of table in an table out by compressing an decompressing?
I can send the mail with pdf-attachment, but by trying to open the pdf-file in outlook I get an error telling me the pdf-file wasn't correctly decoded. Hier my coding: data: mailanhang like soli occurs 0 with header line. Data: mailanhang1 like soli occurs 0 with header line. Data: mailbin like solisti1 occurs 10 with header line.
CALL FUNCTION 'RSPORETURNSPOOLJOB' EXPORTING rqident = '20573' desiredtype = 'PDF' TABLES buffer = mailanhang EXCEPTIONS OTHERS = 1. IF sy-subrc 0. MESSAGE ID '61' TYPE 'E' NUMBER '731' WITH 'RSPORETURNSPOOLJOB'. CALL FUNCTION 'TABLECOMPRESS' TABLES in = mailanhang out = mailanhang1 EXCEPTIONS other = 1. IF sy-subrc 0. MESSAGE ID '61' TYPE 'E' NUMBER '731' WITH 'TABLECOMPRESS'. CALL FUNCTION 'TABLEDECOMPRESS' TABLES in = mailanhang1 out = mailbin EXCEPTIONS other = 1.
IF sy-subrc 0. MESSAGE ID '61' TYPE 'E' NUMBER '731' WITH 'TABLEDECOMPRESS'. Can you help me? Thank you very much. MM -Original Message- Hi Almir, I use SPORETURNSPOOLJOB to get the OTF data from spool into an internal table.
Set the 'Desiredtype' to 'PDF'. I then compress this table (TABLECOMPRESS), decompress (TABLEDECOMPRESS) it again (change of formats) and move the result to objbin for SONEWDOCUMENTATTSENDAPI1. Works for years now. Marc The information contained in this E-mail may be confidential and/or proprietary to Hot Stuff Foods, LLC and/or its affiliates.
The information transmitted herewith is intended only for use by the individual or entity to which it is addressed. If the reader of this message is not the intended recipient, you are hereby notified that any review, retransmission, dissemination, distribution, copying or other use of, or taking of any action in reliance upon this information is strictly prohibited. If you have received this communication in error, please contact the sender and delete the material from your computer. Thank your very much, it is working now. It was my first time asking for help in internet.
I didn't expected a quick answer;). I'm impressed. Marianne -Original Message- Hi Marianne, of course we could communicate in german, but that would be unfair to all the other members out there:-)) I think the problem with your coding is the following: The FM RSPORETURNSPOOLJOB has a 'TABLES' parameter called 'BUFFERPDF'. This table will contain the proper pdf format for further processing. The table has format 'data: pdf like tline occurs 100 with header line'. Use that table instead of your 'mailanhang' for the further processing. That should be it, the rest looks good to me.
If you have other data than SAPSCRIPT or SMARTFORMS that you want to send out: I use fm 'CONVERTABAPSPOOLJOB2PDF' to fill the pdf table. All that is coding to send actual spool files. It looks a little bit different when you do not have a spoolfile and still want to send pdf-docs.
Hello all, I have used SONEWDOCUMENTATTSENDAPI1 to send a PDF attachment. It is sent successfully but when i try to open the PDF attachment, it says 'There is an error opening the attachment. The file may be damaged and could not be repaired'. The attachment is basically output of a Smartform. Can you please let me know where the error can be?
I am also sending the code. Covert smartform to PDF format CALL FUNCTION 'CONVERTOTF' EXPORTING format = 'PDF' maxlinewidth = 255. ARCHIVEINDEX = ' '.
COPYNUMBER = 0. ASCIIBIDIVIS2LOG = ' '. PDFDELETEOTFTAB = ' ' IMPORTING binfilesize = lfwrksize. BINFILE = TABLES otf = gssformout-otfdata lines = gtlines EXCEPTIONS errmaxlinewidth = 1 errformat = 2 errconvnotpossible = 3 errbadotf = 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.
Pdf Attachment Settings
CALL FUNCTION 'QCE1CONVERT' TABLES tsourcetab = gtlines ttargettab = gtobjbin EXCEPTIONS convertnotpossible = 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. Get receiver list. SHIFT vbdka-adrnr LEFT DELETING LEADING '0'.
IF NOT vbdka-adrnr IS INITIAL. SELECT SINGLE smtpaddr FROM adr6 INTO gsreclist-receiver WHERE addrnumber = vbdka-adrnr. Gsreclist-comtype = 'INT'. Gsreclist-rectype = 'U'.
APPEND gsreclist TO gtreclist. Details needed for email function.
build body text CLEAR gsobjtxt. Gsobjtxt = 'Sir/Madam,'. APPEND gsobjtxt TO gtobjtxt. CLEAR gsobjtxt. Gsobjtxt = '. APPEND gsobjtxt TO gtobjtxt. CLEAR gsobjtxt.
CONCATENATE text-t01 text-t02 vbdka-vbeln INTO gsobjtxt. APPEND gsobjtxt TO gtobjtxt. CLEAR gsobjtxt. Gsobjtxt = '. APPEND gsobjtxt TO gtobjtxt. CLEAR gsobjtxt. Gsobjtxt = 'Thanks & Regards'.
APPEND gsobjtxt TO gtobjtxt. CLEAR gsobjtxt. Gsobjtxt = '.
Can't Open Pdf Attachment
APPEND gsobjtxt TO gtobjtxt. Build subject line gsdocudata-objname = 'Output'. Gsdocudata-objdescr = 'Customer Order acknowledgement'. DESCRIBE TABLE gtobjbin LINES lflines. Gsdocudata-docsize = ( lflines - 1 ). 255 + STRLEN( gsobjtxt ). Build control information CLEAR gspackinglist.
CLEAR gspackinglist-transfbin. Gspackinglist-headstart = 1. Gspackinglist-headnum = 0. Gspackinglist-bodystart = 1. Gspackinglist-bodynum = lflines. Gspackinglist-doctype = 'RAW'. APPEND gspackinglist TO gtpackinglist.
CLEAR gspackinglist. Gspackinglist-transfbin = 'X'. Gspackinglist-headstart = 1. Gspackinglist-headnum = 1. Gspackinglist-bodystart = 1. DESCRIBE TABLE gtobjtxt LINES lflines. DESCRIBE TABLE gtobjbin LINES lflines.
Gspackinglist-bodynum = lflines. Gspackinglist-doctype = 'PDF'. Gspackinglist-objname = 'Order'. Gspackinglist-objdescr = 'Customer Order'. Gspackinglist-docsize = lflines. 255.
Gspackinglist-docsize = gspackinglist-docsize + 100. APPEND gspackinglist TO gtpackinglist. Gsobjhead = 'Customer order.PDF'. APPEND gsobjhead TO gtobjhead. CALL FUNCTION 'SONEWDOCUMENTATTSENDAPI1' EXPORTING documentdata = gsdocudata putinoutbox = ' ' commitwork = 'X'.
IMPORTING. SENTTOALL =. NEWOBJECTID = TABLES packinglist = gtpackinglist objectheader = gtobjhead contentsbin = gtobjbin contentstxt = gtobjtxt. CONTENTSHEX =. OBJECTPARA =.
OBJECTPARB = receivers = gtreclist EXCEPTIONS toomanyreceivers = 1 documentnotsent = 2 documenttypenotexist = 3 operationnoauthorization = 4 parametererror = 5 xerror = 6 enqueueerror = 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. Tags:. abap.
Comments are closed.
|
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |