Mailing the sapscript thru pdf file

Hi,
I want to send a sapscript thru pdf file, however, I have a problem with the parameters to set in my open_form when my DEVICE = 'MAIL' and I have to fetch the otf file in the close_form.
Can you help with the parameter I need to set up in the open form? What are the required parameters for this function?
Thanks a lot!
rgds,
Mark

Hi Mark Rennel Barrios  ,
        Here below is the Code for that Functionality :
REPORT ZGRESS1PRINT .
Tables: qmel,makt,qmfe.
parameters: input like QMEL-QMNUM.
    data var like makt-maktx.
DATA: BEGIN OF OPTIONS OCCURS 0.
        INCLUDE STRUCTURE ITCPO.
DATA: END OF OPTIONS.
DATA:  VAFILESIZE(10).
DATA: VAFILENAME(100) value 'test.pdf'.
DATA: OBJPACK LIKE SOPCKLSTI1 OCCURS 0 WITH HEADER LINE.
DATA: OBJHEAD LIKE SOLISTI1 OCCURS 1 WITH HEADER LINE.
DATA: OBJBIN LIKE SOLISTI1 OCCURS 0 WITH HEADER LINE.
DATA: OBJTXT LIKE SOLISTI1 OCCURS 10 WITH HEADER LINE.
DATA: RECLIST LIKE SOMLRECI1 OCCURS 0 WITH HEADER LINE.
DATA: DOC_CHNG LIKE SODOCCHGI1.
DATA: TAB_LINES LIKE SY-TABIX.
DATA: IOTF LIKE ITCOO OCCURS 0 WITH HEADER LINE.
DATA: ILINES1 LIKE TLINE OCCURS 0 WITH HEADER LINE.
        OPTIONS-TDDEST = 'LP01'.
        OPTIONS-TDIMMED = 'X'.
        OPTIONS-TDNEWID = 'X'.
        OPTIONS-TDNOPREV = 'X'.
        OPTIONS-TDLIFETIME = 2.
        OPTIONS-TDGETOTF = 'X'.
CALL FUNCTION 'OPEN_FORM'
EXPORTING
   DEVICE                            = 'PRINTER'
   DIALOG                            =  'X'
   FORM                              = 'ZGRESS1'
   OPTIONS                           =  OPTIONS
EXCEPTIONS
   CANCELED                          = 1
   DEVICE                            = 2
   FORM                              = 3
   OPTIONS                           = 4
   UNCLOSED                          = 5
   OTHERS                            = 11
IF SY-SUBRC <> 0.
Write:/ 'Error while open the form'.
ENDIF.
  CALL FUNCTION 'START_FORM'
       EXPORTING
            FORM   = 'ZGRESS1'
       EXCEPTIONS
            OTHERS = 1.
  IF SY-SUBRC <> 0.
    WRITE 'Error in start_form'.
    EXIT.
  ENDIF.
select * from qmel where qmnum = input.
select single maktx into (makt-maktx) from makt where matnr = qmel-matnr
and spras = 'EN'.
  CALL FUNCTION 'WRITE_FORM'
       EXPORTING
            ELEMENT  = 'ITEM1'
            FUNCTION = 'SET'
            TYPE     = 'BODY'
            WINDOW   = 'MAIN'
       EXCEPTIONS
            OTHERS   = 1.
  IF SY-SUBRC <> 0.
    WRITE 'Error in write_form printing top element of main'.
    EXIT.
  ENDIF.
ENDSELECT.
select * from qmfe where qmnum = input.
  CALL FUNCTION 'WRITE_FORM'
       EXPORTING
            ELEMENT  = 'ITEM2'
            FUNCTION = 'SET'
            TYPE     = 'BODY'
            WINDOW   = 'MAIN'
       EXCEPTIONS
            OTHERS   = 1.
  IF SY-SUBRC <> 0.
    WRITE 'Error in write_form printing top element of main'.
    EXIT.
  ENDIF.
ENDSELECT.
    CALL FUNCTION 'END_FORM'
       EXCEPTIONS
            OTHERS = 1.
  IF SY-SUBRC <> 0.
    WRITE 'Error in end_form'.
    EXIT.
  ENDIF.
  CALL FUNCTION 'CLOSE_FORM'
       TABLES
                  OTFDATA = IOTF
       EXCEPTIONS
            OTHERS = 1.
  IF SY-SUBRC <> 0.
    WRITE 'Error in close_form'.
    EXIT.
  ENDIF.
        CALL FUNCTION 'CONVERT_OTF'
            EXPORTING
                 FORMAT                = 'PDF'
            IMPORTING
                   BIN_FILESIZE          = VAFILESIZE
             TABLES
                  OTF                   = IOTF
                  LINES                 = ILINES1
            EXCEPTIONS
                 ERR_MAX_LINEWIDTH     = 1
                 ERR_FORMAT            = 2
                 ERR_CONV_NOT_POSSIBLE = 3
                 OTHERS                = 4
        IF SY-SUBRC <> 0.
        ENDIF.
        DOC_CHNG-OBJ_NAME = 'SAPSACRIPTMAIL'.
        DOC_CHNG-OBJ_DESCR = 'SAP_SACRIPT_MAIL.'.
        OBJTXT-LINE = 'This is a TestMail for Greetson'.
        APPEND OBJTXT.
        DESCRIBE TABLE OBJTXT LINES TAB_LINES.
        READ TABLE OBJTXT INDEX TAB_LINES.
        DOC_CHNG-DOC_SIZE = ( TAB_LINES - 1 ) * 255 + STRLEN( OBJTXT ).
        CLEAR OBJPACK-TRANSF_BIN.
        OBJPACK-HEAD_START = 1.
        OBJPACK-HEAD_NUM = 0.
        OBJPACK-BODY_START = 1.
        OBJPACK-BODY_NUM = TAB_LINES.
        OBJPACK-DOC_TYPE = 'RAW'.
        APPEND OBJPACK.
        CALL FUNCTION 'QCE1_CONVERT'
             TABLES
                  T_SOURCE_TAB         = ILINES1
                  T_TARGET_TAB         = OBJBIN
             EXCEPTIONS
                  CONVERT_NOT_POSSIBLE = 1
                  OTHERS               = 2.
        IF SY-SUBRC <> 0.
        ENDIF.
        DESCRIBE TABLE OBJBIN LINES TAB_LINES.
        OBJPACK-TRANSF_BIN = 'X'.
        OBJPACK-HEAD_START = 1.
        OBJPACK-HEAD_NUM = 1.
        OBJPACK-BODY_START = 1.
        OBJPACK-BODY_NUM = TAB_LINES.
        OBJPACK-DOC_TYPE = 'PDF'.
        OBJPACK-OBJ_NAME = 'test'.
        OBJPACK-OBJ_DESCR = VAFILENAME.
        OBJPACK-DOC_SIZE = TAB_LINES * 255.
        APPEND OBJPACK.
        OBJHEAD = 'test.PDF'.
        APPEND OBJHEAD.
        CLEAR OBJHEAD.
      VAFILENAME = 'Greetson'.
Creating the recipient list(ERS).
          RECLIST-RECEIVER = '<e-mail address>'.
          RECLIST-REC_TYPE = 'U'.
          APPEND RECLIST.
          CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
               EXPORTING
                    DOCUMENT_DATA              = DOC_CHNG
                    PUT_IN_OUTBOX              = 'X'
               TABLES
                    PACKING_LIST               = OBJPACK
                    OBJECT_HEADER              = OBJHEAD
                    CONTENTS_BIN               = OBJBIN
                    CONTENTS_TXT               = OBJTXT
                    RECEIVERS                  = RECLIST
               EXCEPTIONS
                    TOO_MANY_RECEIVERS         = 1
                    DOCUMENT_NOT_SENT          = 2
                    OPERATION_NO_AUTHORIZATION = 4
                    OTHERS                     = 99.
         IF SY-SUBRC <> 0.
        ENDIF.
        REFRESH RECLIST.
Hope it helps.
Thanks,
Greetson

Similar Messages

  • Would like the take a look at the innards of PDF files

    I just armed myself with sufficient audacity to start looking at the contents of PDF files, using PDFSpy, CosEdit, and -most interestingly- good old 'vi'.
    There are (at least) two factors that prevent clear text readability.
    (1) What is the deal with those lone ^M characters all over the place? First I was tempted to strip them, but that would mess up the offsets. So, I wrote an utility to convert every '\r' into a space, provided that is not followed by a '\n'. Comments?
    (2) The compressed stuff. Is there any way to instruct Acrobat Pro not to generate compressed data, or perhaps some tool to "uncompress" such files?
    TIA,
    -RFH

    >(1) What is the deal with those lone ^M characters all over the place?
    Legal line endings are CR, CRLF, and LF. CRLF matches the Windows line
    ending, the other two match the Unix and Macintosh line endings. Note
    that LFCR is two line endings, while CRLF is one.
    > First I was tempted to strip them, but that would mess up the offsets. So, I wrote an utility to convert every '\r' into a space, provided that is not followed by a '\n'. Comments?
    Bad thing to do. This is invalid after the keyword stream, and
    randomly you will break compressed data. Better to learn to ignore
    them, or use a more capable viewer.
    >(2) The compressed stuff. Is there any way to instruct Acrobat Pro not to generate compressed data, or perhaps some tool to "uncompress" such files?
    Early versions of Acrobat could generate ASCII PDFs, but no longer,
    and they still compressed page streams.
    If you have Acrobat Pro, you might be interested in the plug-in PDF
    CanOpener.
    Aandi Inston

  • How can i change the size of PDF files ?

    how can i change the size of PDF files? when i convert documents in the acrobat browser it seems the files become larger then normal pdf files, this is, i compare with other files that people send to me and i realise that they are smaller than my converted files, even if they have more pages.

    A lot depends on the form of the PDF. Is it graphics, a scan of a text file, pure text, or other? What version of Acrobat are you working with.
    You can do a save as to get a WORD file, but do not expect great results. The ability to get a decent WORD file depends on what the form of PDF you are working from. If it was created from WORD with tags and all, you might get good results. If not, you might get a lot of messed up results.
    Explain what you are starting with and your ultimate goal. Also check the audit of the file (should be under PDF Optimize) to see where the file information is concentrated (text, fonts, graphics, other).

  • The printing of .pdf file from Project 2013 stops when the file name should be written. Project 2013 crashes. Does someone know what is wrong between Project 2013 and Adobe Acrobat 9?

    The printing of .pdf file from Project 2013 stops when the file name should be written. Project 2013 crashes. Does someone know what is wrong between Project 2013 and Adobe Acrobat 9?

    The Acrobat 9.x product family passed into "End of Support" mid-year of 2013.
    Acrobat 9 support of MS Project via PDFMaker stops with Office 2007.
    For Office 2013 support you must use Acrobat XI (11.0.1) or newer. 
    A good to have reference:
    https://helpx.adobe.com/acrobat/kb/compatible-web-browsers-pdfmaker-applications.html
    Acrobat Pro and Standard DC are what are currently available for purchase. 
    Be well...

  • Read the text in pdf file

    Dear all,
    I have checked a lot of post about reading pdf in this forum. However, is it possible to read the text in pdf file. In my case, I need to read the content of pdf to do further process. Could anybody give me some suggestions. Thank you.

    I have a similar problem, can anybody help us....

  • When i convert any file to pdf, date is automatically added in the header in pdf file. How to change

    When i convert any file to pdf, date is automatically added in the header in pdf file. How to change that?*

    heres a screenshot
    heres a screenshot of how i convert them

  • Changing the setting from PDF file to a  JPEG file.

    Is there a way I can change the scan setting on my printer. It is a HP Deskjet F4480. I want to change the setting from PDF file to a JPEG file. I want to scan them so I can see them on my screen saver.

    This has nothing to do with Acrobat. See the documentation for the scanner software that came with your scanner.

  • How can I perform the conversion of pdf files in Cyrillic script to Word files in Cyrillic script. The pdf file is too small for me to read right now. Julyan Watts

    How can I perform the conversion of .pdf files in Cyrillic script to Word files in Cyrillic script. The .pdf file is too small for me to read without a magnifying glass, and the document is more than one thousand pages.

    This answer was not helpful. First of all, I could not find "tech specs"
    anywhere on the Acrobat 11 homepage. And secondly I purchased this software
    for the specific purpose of converting .pdf files to Word. It was only
    after I had completed the purchase that I learnt that Acrobat does not
    permit the conversion of .pdf files in Cyrillic to Word files  in Cyrillic.
    I feel that Acrobat should have provided this crucial information before I
    allowed my credit card to be debited. That is why I  am now asking for my
    money back. But thanks for your attempt to solve my problem, even if it was
    not successful.
    Julyan Watts

  • How can i remove the protection in Pdf file

    how can i remove the protection in pdf file so i can convert it to word

    You can't remove password protection (if that is what you are talking about) using Adobe Reader. That would require Acrobat.

  • What web service & xml will be used for deleting the packged epub/pdf file from Admin Console

    What web service & xml will be used for deleting the packged epub/pdf file from Admin Console?
    I am able to delete the files from Admin console directy but not able to get which web service is calling on deleting the file from admin console:
    Mangal

    Hi Jim,
    I tired following web service and xml to delete the packaged ebook but it is giving me error instead of response:
    Web Service & XML
    http://myserver_url/admin/ManageResourceKey
    <request action="delete" auth="builtin" xmlns="http://ns.adobe.com/adept">
    <nonce>" . $nonce . "</nonce>
    <expiration>'. $expiration .'</expiration>
    <resourceKey>
    <resource>resource_id</resource>
    <resourceItem>1</resourceItem>
    </resourceKey>
    </request>
    Error Message
    <error xmlns="http://ns.adobe.com/adept"
    data="E_ADEPT_DATABASE http://myserver_url/admin/ManageResourceKey
    Cannot%20delete%20or%20update%20a%20parent%20row:%20a%20foreign%20key%20constraint%20fails %20(`adept`.`distributionrights`,%20CONSTRAINT%20`distributionrights_ibfk_2`%20FOREIGN%20K EY%20(`resourceid`)%20REFERENCES%20`resourcekey`%20(`resourceid`))"/>
    Magal Varshney

  • How to remove the entries of the names of the previously read PDF files in order to not to leak privacy

    How to remove the entries of the names of the previously read PDF files in order to not to leak privacy

    Bear in mind that the files will ALSO be in Windows or Mac's recent document list, and even if they weren't, the files will still be around and available. If they are not available, then just the name may not be much of a security bit (unless the file is called my_secret_bid_for_ibm.pdf or some such).

  • I've been attaching pdf's to emails forever.  All of the sudden my pdf files won't attach to any email.  I have tried from home, work, different providers, etc.  Nothing is working.  What could the problem be?

    I have been attaching pdf files to emails forever.  All of the sudden my pdf files won't attach to an email.  It just sits there and spins like it's trying to attach but quits half way through.  What could the problem be?

    Please try repairing Reader installation on your machine. Do you get any error message while attaching the pdf file?
    Regards,
    Deepak

  • "  Displaying the Report in PDF file Format "

    Hai Friend's,
    I have Developed a Report in Web-Intelligence .My Report is having 50 Collums and 600 Rows. The Report is too big Report. when the Save the Report in PDF File format, The PDF file Format Report is Consisting of 10 Pages, The Report Output is not coming in One Page. But my user want the Report  all the Field's :: Collumms,Rows in one Page.can Anybody let me know the solution.

    Hi Ashok,
    You can change the page size and orientation in the web.xml in the following folder.
    Web Intelligence default Page size Modification u2013 Follow these steps:
    1. Open the defaultconfig.xml file found in the following directory:
    servername\Program Files\Business Objects\Tomcat\webapps\businessobjects\enterprise115\desktoplaunch\webiApplet\AppletConfig
    2. Look for the following code near the top of the page:
    <KEY VALUE="page*default">
    <FORMAT NAME="A4" ORIENTATION="portrait" />
    </KEY>
    3. Change this to:
    <KEY VALUE="page*default">
    <FORMAT NAME="LETTER" ORIENTATION="portrait" />
    </KEY>
    4. Save the file.
    All the Best,
    Madhu...

  • Does Acrobat Pro read the content in pdf file and transforms it?

    Does Acrobat Pro read the content in pdf file and transforms it to xls file without the need for much changes or manual work?

    Acrobat X (Standard and Pro) will save tabular data to XLS or XLSX format, provided it can recognize the table as being a table. If the PDF has missing or incorrect structure tags, Acrobat will try to guess the table layout by the position of text and lines on the page - this works well for basic formatting but if the table has complex styling, spanned cells etc. it can lead to problems.
    Acrobat X will even attempt to export a table within a scanned document, by applying OCR during the export stage - though again this relies on the table being visually identified.
    See http://www.adobe.com/products/acrobatpro/pdf-to-word-excel-converter.html and this article on how to extract one table from a larger document.

  • I'm getting error as adobe Illustrator crashes while loading the multiple pages PDF file. Please help me. Thanks in advance.

    Hi,
    I'm getting error as adobe Illustrator crashes while loading the multiple pages PDF file.
    Please help me. Thanks in advance.

    Hi Monika,
    I have downloaded the script to load the multiple page of pdf file.
    I tried loading the multiple page PDF file via File Menu -> Scripts -> Other Script...
    After executing the script file -> Browse and enter the page number - > OK
    The PDF file is looks like created from word document. There are total 120 pages in this file.
    PDF file size is 20 MB.
    I'm still searching for the solutions. Please help me.
    Thanks,
    Lavprasad

Maybe you are looking for

  • Up the Creek Without a Photo Stream

    Is it possible to get video files taken with my iPhone into Photo Stream or does it only work with photos?  Is their an easy alternative to get videos from the iPhone to a Mac?  The only options in the iPhone are email, YouTube or text message.  None

  • Does anyone know how to install Windows 8 on a late 2008 Macbook Pro without a previous copy of Windows 7?

    So, I'm trying to do a direct install of Windows 8 on my old Macbook Pro, but my machine isn't officially supported for Windows 8; I get an error message every time I try to use boot camp. I previously had Windows 8 running, but that was because I ha

  • How to populate one array without running the entire VI

    I'm trying to populate a complex array that I built that reads from a spreadsheet file.  The company I am building it for only has labview run time on the PXI test equipment that I am working with.  I am having to fix the VI On my computer then build

  • Where can I find an up to date IMAQ manual?

    I'm writing software to control a camera with high framerate (~100 fps) for scientific research. I've made some VI's that illustrate the basic principles using the IMAQ High Level VI's, but to save the data at high speed and trigger the acquisition p

  • Dynamic text element (Text Symbols)

    Hi, How can we make text element dynamic? Ex: If I want a text "Consider date g_date" where g_date is populated from program. Can I pass g_text like <b>text-001 g_text</b>? Thanks.