How to read the name of a PDF file? - function module

Hi,
I have <b>some individual pdf documents in my desktop</b>.I need to <b>bulk-upload it to the content server and document related information to the SAP-DB</b>.
Need your guidance.
Regards,
John.

try this code it will convert file to PDF file
REPORT  ZWARUN_CONVERSION_PDF                        .
***********Tables***************
TABLES:VBRK.
***********Data Declaration***************
DATA: LV_NUMBYTES TYPE I,
      LV_SPOOLNO TYPE TSP01-RQIDENT.
DATA:C_LAYOUT  LIKE PRI_PARAMS-PAART VALUE 'X_65_132', "Layout
      C_X       TYPE C VALUE 'X'.
DATA: NUMBYTES TYPE I,
       CANCEL.
***************Internal table of Pdf************
DATA: IT_PDF LIKE TLINE OCCURS 10 WITH HEADER LINE.
DATA:BEGIN OF IT_VBRK OCCURS 2,
     FKART LIKE VBRK-FKART,
     FKTYP LIKE VBRK-FKTYP,
     VBTYP LIKE VBRK-VBTYP,
     END OF IT_VBRK.
SELECTION-SCREEN BEGIN OF BLOCK BLK WITH FRAME.
SELECT-OPTIONS: S_BUKRS FOR VBRK-BUKRS,
                S_GJAHR FOR VBRK-GJAHR.
SELECTION-SCREEN END OF BLOCK BLK .
PARAMETERS:
spoolno like tsp01-rqident,
  DOWNLOAD AS CHECKBOX DEFAULT 'X',
  P_FILE LIKE RLGRAP-FILENAME DEFAULT 'C:\warun1.pdf'.
START-OF-SELECTION.
SELECT FKART
          FKTYP
          VBTYP
       INTO  TABLE IT_VBRK
       FROM VBRK
       WHERE  BUKRS IN S_BUKRS
          AND GJAHR IN S_GJAHR.
END-OF-SELECTION.
  DATA: LK_PARAMS TYPE PRI_PARAMS,
        LV_VALID.
if not p_mailid is initial.
All the parameters passed are constants, so exceptions
doesn't get raised
    CALL FUNCTION 'GET_PRINT_PARAMETERS'
      EXPORTING
        IMMEDIATELY    = ' '
        LAYOUT         = C_LAYOUT                           "'X_65_132'
        NO_DIALOG      = C_X
      IMPORTING
        OUT_PARAMETERS = LK_PARAMS
        VALID          = LV_VALID.
    IF LV_VALID <> SPACE .
      NEW-PAGE PRINT ON PARAMETERS LK_PARAMS NO DIALOG.
*--To display the final report
      PERFORM PRINT_REPORT.
      NEW-PAGE PRINT OFF.
*---To convert the download to PDF
      PERFORM CONV_TO_PDF_DOWNLOAD.
      PERFORM DOWNLOAD.
    ENDIF.
endif.
*--To display the final report
  PERFORM PRINT_REPORT.
*&      Form  print_report
FORM PRINT_REPORT .
*write:/ 'I will do it' color 4.
write:/ 'Yes' color 4.
write:/ 'we will do it' color 4.
write:/ 'lets talk abt changing life style' color 4.
write:/'By warun'.
LOOP AT IT_VBRK.
WRITE:/ IT_VBRK-FKART,IT_VBRK-FKTYP,IT_VBRK-VBTYP.
ENDLOOP.
ENDFORM.                    " print_report
*&      Form  conv_to_pdf_download
FORM CONV_TO_PDF_DOWNLOAD .
CLEAR IT_VBRK.
WAIT UP TO 2 SECONDS.
LV_SPOOLNO = SY-SPONO.
CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
   EXPORTING
     SRC_SPOOLID                    =  LV_SPOOLNO
    NO_DIALOG                      = ''
   DST_DEVICE                     =
   PDF_DESTINATION                =
  IMPORTING
    PDF_BYTECOUNT                  = LV_NUMBYTES
   PDF_SPOOLID                    = pdfspoolid
   LIST_PAGECOUNT                 =
   BTC_JOBNAME                    = jobname
   BTC_JOBCOUNT                   = jobcount
  TABLES
    PDF                            = IT_PDF.
ENDFORM.                    " conv_to_pdf_download
*&      Form  download
FORM DOWNLOAD .
download PDF file ***********
CHECK DOWNLOAD = 'X'.
CALL FUNCTION 'DOWNLOAD'
     EXPORTING
          BIN_FILESIZE = LV_NUMBYTES
          FILENAME     = P_FILE
          FILETYPE     = 'BIN'
     IMPORTING
          ACT_FILENAME = P_FILE
          FILESIZE     = LV_NUMBYTES
          CANCEL       = CANCEL
     TABLES
          DATA_TAB     = IT_PDF.
IF CANCEL = SPACE.
  WRITE: / LV_NUMBYTES, P_FILE.
ENDIF.
ENDFORM.                    " download

Similar Messages

  • How to change the name of a pdf file in iBooks on ipad

    I have a number of appliance and tool manuals  as pdf files uploaded to my iPad. In order to identify them easier I would like to change the names of the files. I changed them in iTunes on my computer but they do not change on the iPad2 when I sync. Is there a  way to do this?

    Greg,
    I had been working on this a while and found what worked.  Save the pdf to your desktop with the file name as you want it.  Open up itunes on half of your monitor.  Drag the file to the library section of itunes (music, videos, books, movies etc...).  When you drag to the library section, it will put it the book section of itunes.  Sync and you will see the file in ibooks on your ipad.  Give it shot.
    Scott

  • URGENT: How to read the content of a PDF-file in Java?

    Hello
    What I need are some classes which can read a pdf and translate it in normal Text, so that I can write the content of the pdf in my database.
    Where can I find those classes? Or how else could I get there?

    www.lowagie.com/itext
    www.etymon.com/pj
    www.retep.org.uk/pdf
    www.pdflib.comwww.pdfzone.com
    www.planetpdf.com
    www.purepdf.com
    www.adobe.com
    www.pdfstore.com
    www.adobe.com/proindex/acrobat/formsresources.html
    www.partners.adobe.com/asn/developer/acrosdk/forms.html
    www.rrsys.com
    www.javafoundry.com/javapdf
    www.novagraphix.com/internet_publishing_with_acrobat/forms/forms_tutorial.html
    www.binarything.com

  • How to read the content of a text file (by character)?

    Guys,
    Good day!
    I'm back just need again your help. Is there anyone knows how to read the content of a text file not by line but by character.
    Please help me. Thank you so much in advance.
    Jojo

    http://java.sun.com/javase/6/docs/api/index.html
    package java.io
    InputStream.read(): int
    Reads the next byte of data from the input stream.
    Implementation:
    InputStreamReader
    An InputStreamReader is a bridge from byte streams to character streams: It reads bytes and decodes them into characters using a specified charset. The charset that it uses may be specified by name or may be given explicitly, or the platform's default charset may be accepted.

  • How to check the resolution of a pdf file using Acrobat 9 pro?

    How to check the resolution of a pdf file using Acrobat 9 pro?

    PDF files don't have one resolution, but may have none or many different resolutions, one per image. You can check the maximum/minimum resoluion with preflight in Acrobat Pro, but not in Adobe Reader.

  • How to download the script data into pdf file

    how to download the script data into pdf file
    i have one option to download the script data to pdf file --->rstxpdft4 program.
    i have one doubt how to use this proogram.or any function module to download the script data to pdf file.
    Thanks and regards,
    Sri.

    Hi      Sri Sai,
    I know one method to convert the sapscript to pdf file :
    first generate a Spool Request for the required Sapscript
    then goto transaction SP01 and copy the generated Spool Request number
    now execute the SAP report RSTXPDFT4
    here enter the copied Spool request number and the target directory into the parameters
    execute the report
    required pdf file will be generated into the target directory
    i hope it will help you out
    Please refer this simple program:
    http://www.sapdevelopment.co.uk/reporting/rep_spooltopdf.htm
    Reward points if found helpful....
    Cheers,
    Eshwar.

  • Pdf file is too big (7MB). Need a pdf file with max size 4MB. How to minimize the size of a pdf file?

    pdf file is too big (7MB). Need a pdf file with max size 4MB. How to minimize the size of a pdf file?

    The other alternative is the Save As Other>Reduce File Size. The PDF Optimizer gives you more control. You might also use the audit feature in the PDF Optimizer to see where the size problem is coming from. You might find that in the WORD file you can select and image and then go to the FORMAT (pictures) menu and select compress for all of the bitmaps in the file. That will typically use 150 dpi by default that is adequate for most needs.

  • How to read the content of ms-word file use pure java???

    how to read the content of ms-word file use pure java???

    hi,
    check this: http://jakarta.apache.org/poi/

  • How to Extract the Highlight Text in PDF File

    Hi Scripters,
    i want know, how to extract the hightlight text in pdf files for text only format for (*.txt) file extension save.
    regards
    baby

    Hi,
    Okay i'll try do best.
    thanks for your reply.
    Regards
    Baby

  • When I try to convert my .pdf to Word, I get a sidebar that has fields for: the name of my pdf file, the type of file I want to convert to (In my case, Word), and a button that says "Convert".  My problem is that the "convert to" field isn't active.  I ca

    When I try to convert my .pdf to Word, I get a sidebar that has fields for: the name of my pdf file, the type of file I want to convert to (In my case, Word), and a button that says "Convert".  My problem is that the "convert to" field isn't active.  I can see the words "Microsoft Word" in pale gray, but when I click on the field, nothing happens.

    You have posted in the wrong forum.  Try posting in the forum for the product you are trying to use.
    Here is a link to a page that has links to all Adobe forums... use the drop down list to see all.
    Forum links page:
    https://forums.adobe.com/welcome

  • How to embed the Word Document and PDF file into Crystal report?

    How to embed the Word Document and PDF file into Crystal report?
    I have word doc which having 10 pages. I need to show all of the 10 pages at a time. I tried OLE object but problem is it shows only one page.
    Is there any solution to show word doc / PDF file in CR?

    Symptom :
    When embedding a pdf document into a Crystal Report, only the one page shows.
    Reproducing the Issue
    Environment:
    Crystal Reports OLE object
    Cause
    An OLE object only displays the first page.
    Resolution
    Embed multiple objects, one for each page
    Or
    Use a hyperlink to the object instead
    Hope this helps!
    Regards,
    Vinay

  • How to Read the Digital Signature in PDF's.

    I want to read the digital signature in PDF. Is this possible?
    I dont know how could read the sign. I want to read and store into the database using vb6 form.
    Is possible to read the digital signature in binary format?
    Please tell me how to read whether binary or any other... I want to read and store into the database.
    Please help me
    This all i need to done in vb6 application.

    This all i need to done in vb6 application.
    For information about questions relating to VB6, please see here: 
    VB6 and older

  • Help on how to read the content of an XML file from the payload

    I have a receiver channel / mail adapter, that sends e-mails with a XML attachment.
    I’m trying to write a Bean, that should make it possible to rename the attached XML file dynamically.
    In the Bean I want to read the content of the attached XML file, it could be the “order number”.
    The filename should then be “Order number”.XML.
    <u><i>Can anyone help me with how to read the content of the XML file from the payload.</i></u>
    <i><b>Frank</b></i>

    hi,
    check this: http://jakarta.apache.org/poi/

  • How to read the content of this excel file in LV

    Hi could you please let me know how can I read the content of this excel file using the Read From Speardsheet function. It contains text and numbers
    Thanks
    The excel file is attached
    Attachments:
    Datalogging.zip ‏307 KB

    Check attached VI.
    I am not allergic to Kudos, in fact I love Kudos.
     Make your LabVIEW experience more CONVENIENT.
    Attachments:
    ReadFromExcel.vi ‏27 KB

  • How to read the contens of an ini-File

    How can I read the contens of an ini-File?

    Depends on what you have in the file - ini file with or without sections.
    Without sections: you may be able to read it as a property file.
    With sections: You'll have to implement a class to read and parse the file, and a class to hold the parsed results.
    If you have to build your own objects, I found the easiest way was to read each line and use the StringParser to pick it apart. My data holding object was pretty simple -
    o A Vector to hold Section objects.
    o A Section object with a Vector to hold each Entry object.
    o An Entry object
    o Appropriate getters and setters to look up stuff I wanted or to insert it.
    My model for the object was the Borland C++ IniFile object, but I separated the I/O so that I could read or write from any stream I wished, including just a long string.
    o an internal object for section, an internal object for entry

Maybe you are looking for

  • TS1538 after update on iphone 3g, phone only shows the itunes plug in symbol and isn't recognized by itunes.  What should I do?

    I was shown that I needed an update.  I logged into itunes and the update started.  can back 10 minutes later.  it said that my phone did not update and the phone was not recognized in itunes.  the phone only shows a plug into itunes icon and will no

  • Converting to MP4 from FCP 7, jerky at times.

    I am trying to create a HD MP4 file less than 4GB, to play my 6 min HD movie on PS3. I can not have file larger than 4GB as FAT32 will not allow it. 1. What is the max bit rate should I use? I used 9,000 kb/sec 2. I noticed jerky motion at times, its

  • How can i change analog waves into digital waves?

    we had labview lab last week.. were doing fine if we have instructions unfortunately the professor will give us an exercise regarding baseband signals spectra.. were trying to download a trial software but we dont have any luck. the question asks for

  • How do I get Photos to Completely  Fill TV Screen

    I have a 50" Samsung Plasma TV and a 40 G ATV. The pics look great but don't entirely fill the screen in Horizontal view. There is black on both sides of the pics. Is there a way to fix this so they fill the whole TV Screen? They are Hi-Res 2.5 to 3.

  • Problems auto-filling a text box

    Hi, I am trying to populate a text field with either "Yes" or "No" based on the value placed in another text field. If the value in [textfield 1] is greater than 0, I want a "No" to appear in [text field 2] and if the value of [textfield 1] = 0, I wa