Is word uppercase method

Is there a method for a String which checks if the first character in the string is uppercase? I could write a method something like "if the first character of the string is "A"|| "B"|| "C"|| "D"....etc, return true. But does anyone know of a faster way?

Take the first character and do:
if ((c >= 'A') && (c <= 'Z')) // uppercase A-Z
or
String string = "Hello";
char c = string.charAt(0);
if ( Character.isUpperCase(c) ) {
     // do stuff here
   }

Similar Messages

  • Word Count Method?

    Hey all. I am having a bit of an issue. I need to write a program to read a file and count how many words are in the file. So far I have the basis for the while loop to read a line from the file, but I can't seem to figure out how to code the loop to count the words. Java doesn't have a word count method does it? I have looked, but have been unable to find anything of the sort.
    I don't want you do do this for me, I just need some helpful hint/tips. Anything you can provide is appreciated. Thanks!

    I am now having this problem. Here is a code segment:
    void count(String newFileName) throws IOException
              fileName = newFileName;
              FileRead file = new FileRead(fileName);
              wordCount = 0;
              StringTokenizer st = new StringTokenizer(fileName);
              while (file.getLine() != null)
                 while ( st.hasMoreTokens() )
                    st.nextToken();
                    wordCount++;
         }I think it should be changed to StringTokenizer st = new StringTokenizer(file) but when I do so, I get the error "The constructor StringTokenizer(FileRead) is undefined". I assume this is because file is an object not a String variable. the current code has a problem because it only returns 1. Any ideas?
    Edited by: zcrane on Nov 1, 2007 3:40 PM

  • Output in word file: Methods or the class name required

    Hi Gurus,
    I am trying to get output of the program in a word document directly without any Script or Report in between.
    Steps i follow are:
    Fetching the data
    Invoking word
    Writing the data into the word file created using methods like 'tablegridlines', 'insert' etc.
    When i get this data in the word file , in between every two lines i get one empty (extra) line.
    What can i do to remove that extra line in between. Everything has to be done in my own program using methods.
    Is there any method to delete the line comming between two lines i have created.
    Is there any method to convert the layout of the word file created to "Landscape".
    I would appreciate if somebody could tell me the class which has the methods like 'tablegridlines'
    'insert' 'viewheaderfooter' etc which are used for word output in this case.
    The object that i have created is of the type ole2_object.
    Helpful answers would certainly be rewarded.
    Thanks
    Suruchi
    Edited by: Suruchi Mahajan on May 14, 2008 6:04 AM

    Hi All,
    For the possible methods ,search in table OLELOAD.
    Regards
    Suruchi

  • How to handle the word document which is already opened(Add content to it) using VbScript using "Word.Application" method

    Hello,
    I want to add some content to the word document which is opened already and active using vbscript.
    Here is the sample code to have an idea.Kindly Help.
    Set oWord = CreateObject("Word.Application")
    oWord.Documents.Open
    "c:\test.docx" ----->Here i dont want to open the Document as such as my document which is opened already,i have get the control over that document-I try to achive this by using HP UFT tool for word document automation
    oWord.Selection.EndKey
    6,0
    oWord.Selection.TypeText
    " This text has been entered by opening the exisitng document. "
    oWord.ActiveDocument.Save
    oWord.Quit
    Set oWord = Nothing

    Hello,
    Nice to see the Reply from you. I have done the same thing what you have suggested but unfortunately i am not achieving the result as expected.
    Here i explain you clearly,
    Business Scenario:
    Using an aplication we will create word documents-To do this we need to fill all the document properties and click on OK button-After this,Application automatically launches a Word Document with the File name given by itself as per the Configuration and
    it will be available for the Editing-After user add content,he has to check in the document in the application in order to replicate the changes made by user to the document-This is the Business process
    Here my Document actually resides in the Users Folder-"C:\Users\narayanasamy_r\Documentum\Checkout\" before checkin event happened,once i add content,save,close the document,i will navigate to the document in the application  and Do check-in
    operation.
    Interesting point is that,after i do check-in operation my actual document which was resided in "C:\Users\narayanasamy_r\Documentum\Checkout\" will not be available anymore
    So My logic Should be,
    1.identify that particular Document from the Folder and add content,save and close(Note:i dont want to open the document from "word.application" control here, as the application itself opens up the Document)
    Kindly Help On the same.
    Thanks,
    Narayan

  • Automatic creation of MS Word Documents within a Report

    Dear Experts,
    within my report which creates automatically activities in a background process I have to create MS Word Documents and
    attach this Word Documents to the Activity.
    The Word Document does have a Logo and the text is changing with every Activity created.
    What would be the best technical solution for the creation of this word documents for my report?
    Best Regards
    Oliver

    Hello, I have found out what was the problem. In the end I have used method EDITREPLACE and not WW2_EDITREPLACE and I put the method EDITREPLACE more to the end of my ABAP Code:
    REPORT  z_prueba_oliver.
    TYPES: BEGIN OF ty_partner,
                 nif            TYPE bu_partner,
                 name_org1      TYPE bu_nameor1,
                 conting_com    TYPE c LENGTH 2,
                 fecha_efecto   TYPE zbufecha_ef,
                 END OF ty_partner.
    DATA:  lt_partner1     TYPE TABLE OF ty_partner,
                 ls_partner1     TYPE ty_partner,
                 lv_file_save_as TYPE c LENGTH 40,
                 lv_contador     TYPE n LENGTH 3.
    * Include necesario para la declaracion de objetos OLE2
    INCLUDE ole2incl.
    * Declaraciones para la llamada a WORD.
    DATA zword TYPE ole2_object.
    CLEAR zword.
    ls_partner1-nif = 'X7510034M'.
    ls_partner1-name_org1 = 'Razon Social 1'.
    APPEND ls_partner1 TO lt_partner1.
    ls_partner1-nif = 'X7510034M'.
    ls_partner1-name_org1 = 'Razon Social 2'.
    APPEND ls_partner1 TO lt_partner1.
    ls_partner1-nif = 'X7510034M'.
    ls_partner1-name_org1 = 'Razon Social 3'.
    APPEND ls_partner1 TO lt_partner1.
    ls_partner1-nif = 'X7510035M'.
    ls_partner1-name_org1 = 'Razon Social 4'.
    APPEND ls_partner1 TO lt_partner1.
    ls_partner1-nif = 'X7510035M'.
    ls_partner1-name_org1 = 'Razon Social 5'.
    APPEND ls_partner1 TO lt_partner1.
    LOOP AT lt_partner1 INTO ls_partner1.
      AT FIRST.
        CREATE OBJECT zword 'WORD.BASIC'.
    * Se abre el fichero que contiene la plantilla de la carta
        CALL METHOD OF zword 'FILEOPEN'
          EXPORTING
          #1 = 'C:DOCSPRUEBA_1.DOC'.
      ENDAT.
    * Se selecciona todo el texto del archivo PRUEBA_1.DOC
      CALL METHOD OF zword 'EDITSELECTALL'.
    * Se copia el texto seleccionado al portapapeles
      CALL METHOD OF zword 'EDITCOPY'.
    * Se crea un documento nuevo, al que WORD llama documento1
      CALL METHOD OF zword 'FILENEW'.
    * Se pega el texto del portapapeles a documento1
      CALL METHOD OF zword 'EDITPASTE'.
    * Posicionar al principio del documento
      CALL METHOD OF zword 'STARTOFDOCUMENT'.
    * Posicionar al principio del documento
      CALL METHOD OF zword 'STARTOFDOCUMENT'.
    * Se selecciona todo
      CALL METHOD OF zword 'EDITSELECTALL'.
    * Se borra la selección
      CALL METHOD OF zword 'EDITCLEAR'.
    * Se incorpora el texto original de PRUEBA_1.DOC
      CALL METHOD OF zword 'EDITPASTE'.
    *IF ls_partner1-conting_com is initial.*
       *CALL METHOD OF zword 'EDITREPLACE'*
        *EXPORTING*
        *#01 = '#linea2y3#'*
        *#02 = 'de la cobertura de Accidentes de Trabajo, de los siguientes código de cuenta de cotización (CCC):'*
        *#03 = 0*
        *#04 = 0*
        *#05 = 0*
        *#06 = 0*
        *#07 = 0*
        *#08 = 0*
        *#09 = 0*
        *#10 = 1*
        *#11 = 0*
        *#12 = 1.*
    *else.*
         *CALL METHOD OF zword 'EDITREPLACE'*
        *EXPORTING*
        *#01 = '#linea2y3#'*
        *#02 = 'de la cobertura de Accidentes de Trabajo y Contingencias Comunes, de los siguientes código de cuenta de cotización (CCC):'*
        *#03 = 0*
        *#04 = 0*
        *#05 = 0*
        *#06 = 0*
        *#07 = 0*
        *#08 = 0*
        *#09 = 0*
        *#10 = 1*
        *#11 = 0*
        *#12 = 1.*
    *ENDIF.*
      *CALL METHOD OF zword 'EDITREPLACE'*
        *EXPORTING*
        *#01 = '#codprov#'*
        *#02 = ls_partner1-nif*
        *#03 = 0*
        *#04 = 0*
        *#05 = 0*
        *#06 = 0*
        *#07 = 0*
        *#08 = 0*
        *#09 = 0*
        *#10 = 1*
        *#11 = 0*
        *#12 = 1.*
      CALL METHOD OF zword 'EDITREPLACE'
        EXPORTING
        #01 = '#nomprov#'
        #02 = ls_partner1-name_org1
        #03 = 0
        #04 = 0
        #05 = 0
        #06 = 0
        #07 = 0
        #08 = 0
        #09 = 0
        #10 = 1
        #11 = 0
        #12 = 1.
    * Se reemplaza el campo #nomprov# con el valor de la tabla interna.
      CALL METHOD OF zword 'EDITREPLACE'
        EXPORTING
        #01 = '#FECHA_EFECTO#'
        #02 = '10 de Junio de 2010'
        #03 = 0
        #04 = 0
        #05 = 0
        #06 = 0
        #07 = 0
        #08 = 0
        #09 = 0
        #10 = 1
        #11 = 0
        #12 = 1.
      lv_contador = lv_contador + 1.
      CONCATENATE 'C:DOCS' 'PRUEBA' lv_contador '_' sy-datum '.DOC' INTO lv_file_save_as.
    * Se cierra el documento activo, documento1 con opción de salir sin salvar
      CALL METHOD OF zword 'FILESAVEAS' EXPORTING #1 = lv_file_save_as.
    * Se cierra el documento activo PRUEBA.DOC con opción salir sin salvar
      CALL METHOD OF zword 'DOCCLOSE' EXPORTING #1 = 2.
      AT LAST.
    *   Se cierra WORD
        CALL METHOD OF zword 'APPCLOSE'.
    *   Se libera el objeto ZWORD
        FREE OBJECT zword.
      ENDAT.
    ENDLOOP.

  • Data in report to word doc

    Hi all,
    I get only one field data(ie frm MANDT) from report to Word doc.
    How can i get the record of a table.
    REPORT  ZMGC_INT.
    INCLUDE OLE2INCL.
    DATA P_FWOR LIKE RLGRAP-FILENAME.
    DATA I_BUFFER TYPE .
    PERFORM LANZA_WORD.
    FORM LANZA_WORD.
    DATA: WORDAPP TYPE OLE2_OBJECT,
    DOCUMENT TYPE OLE2_OBJECT,
    SELECTION TYPE OLE2_OBJECT.
    Copia el contenido del buffer en el portapeles
                   CALL FUNCTION 'ZCLPB_EXPORT'
                     TABLES
                       DATA_TAB         = I_BUFFER
                     EXCEPTIONS
                       CLPB_ERROR       = 1
                       OTHERS           = 2.
                   IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
                   ENDIF.
    Abre Word
    CREATE OBJECT WORDAPP 'word.application'.
    IF SY-SUBRC NE 0.
    MESSAGE E398(00) WITH 'No se ha podido abrir el Word'.
    ENDIF.
    Lo pone en visible
    SET PROPERTY OF WORDAPP 'Visible' = 1.
    Cogemes el objeto documento
    CALL METHOD OF WORDAPP 'Documents' = DOCUMENT.
    Abrimos el fichero plantilla
    IF P_FWOR IS INITIAL.
    CALL METHOD OF DOCUMENT 'Add'.
    ELSE.
    CALL METHOD OF DOCUMENT 'Open' EXPORTING #1 = P_FWOR.
    IF SY-SUBRC NE 0.
    MESSAGE E398(00) WITH 'Error al leer el fichero plantilla'.
    ENDIF.
    ENDIF.
    Coge el objeto selección
    CALL METHOD OF WORDAPP 'Selection' = SELECTION.
    Pega el contenido del portapapeles
    CALL METHOD OF SELECTION 'Paste'.
    IF SY-SUBRC NE 0.
    WRITE 'PASTE'.
    ENDIF.
    Graba el fichero
    CALL METHOD OF WORDAPP 'ActiveDocument' = DOCUMENT.
    *CALL METHOD OF DOCUMENT 'SaveAs' EXPORTING #1 = P_FWOR.
    *IF SY-SUBRC NE 0.
    *MESSAGE E398(00) WITH 'Error al grabar el nuevo documento'.
    *ENDIF.
    Cierra Word
    CALL METHOD OF WORDAPP 'Quit'.
    IF SY-SUBRC NE 0.
    MESSAGE E398(00) WITH 'Error al cerrar Word'.
    ENDIF.
    ENDFORM. " LANZA_WORD

    Ranjith,
      Go to tcode SE83 -
    >CONTROLS---->BASICS----->Desktop Office Integration.
    Right side  examples .You will find the required code.
    Pls. Mark if useful

  • Create a Checkbox in a Word Document (OLE2)

    Hi @all,
    I want to create a WORD Document with ABAP. I created an OLE2 Object and now I want to generate a Checkbox in the WORD Document. My Syntax is the following:
    DATA: o_word TYPE ole2_object.
      CREATE OBJECT o_word 'Word.Basic'.
      CALL METHOD OF o_word 'FileNew'
        EXPORTING
        #1 = 'normal.dot'.
      CALL METHOD OF o_word 'AppShow'.
      CALL METHOD OF o_word 'CHECKBOX'.
    Now my Problem is, that the CheckBox doesn't appear and I really don't have any information about what Parameters the Method 'CHECKBOX' (Word.Basic) needs.
    Can anyone help me to create a CheckBox in a WORD Document and further where I can get some information about what Parameters the Word.Basic Methods need.
    Thanks a lot...
    Christian
    Message was edited by: Christian Kremer

    @ Rich:
    The Macro code to generate a CheckBox manually is:
    ActiveDocument.ToggleFormsDesign
        Selection.InlineShapes.AddOLEControl ClassType:="Forms.CheckBox.1"
    Can I also use Word.Application Objects instead of Word.Basic?
    Because the code I have posted here seems to be the syntax I must use with Word.Application
    Message was edited by: Christian Kremer
    Message was edited by: Christian Kremer

  • Copy and Paste from Safari to MS Word Text Form Field adds a trailing space

    I know this is just a minor issue, but an inconvenience for me nonetheless.
    When I go to the same page and copy and paste the same text from Firefox, the trailing space is not added.
    What I find puzzling is that when I paste the same copied text into notepad from Safari, it does not add the trailing space.
    So it is likely an issue with MS Word's method of pasting text, but strange to me that it does not happen from Firefox.
    Is there a way to inspect the exact contents of the clipboard to see if there are any differences?
    I just did a little bit more testing, and found that Word only adds an trailing space when I paste into a "Text Form Field" from only Safari.
    Maybe the solution is to stop using MS Word. (Ha, Ha)

    OK, I think I found another way to describe my issue:
    When I copy text from a webpage in Safari, some form of "meta-information", or formatting data, is kept, and when I paste into MS Word, the formatting from the webpage is retained. In my default setup of Firefox, this formatting meta-information is not retained, it only copies the plain-text.
    So my question is actualy: How do I prevent Safari from retaining formatting data, and only copy the plain-text?
    I have been testing some clipboard managers, and have yet to find one that will auto-filter out formatting data from text that I copy, but they can after interaction.
    The other, current, method I have been using is to:
    1. select and copy the text in Safari
    2. paste text into notepad
    3. select and copy text from notepad
    4. paste de-formatted text into MS Word
    Or in Firefox:
    1. select and copy the text in Firefox
    2. paste text into MS Word (no formatting retained)

  • ABAP OOP / Calling Method  ...Help

    Trying out few oop codes....
    While calling class instance methods and passing parameters, when to use the following syntax.
    data: cvar  type ref to class1.
             cvar->method( exporting variable1 = value )
           (or) some time i see sample codes with out key  word 'exporting'
                  cvar->method(  variable1 = value  ) .
           (or)
                  cvar->method(  value  ) .
           (or) some times with key word CALL  METHOD
       CREATE OBJECT cvar
       CALL METHOD cvar->method
       EXPORTING
       variable1 = value. 
    Tried out a uniform way of calling ,but getting errors.Any inputs please..
    Thanks,
    Bvan

    Bhavan,
      First  declare the class.
      Implement the class.
    Declare the Class reference variable
    Create the class object.
    call the method.
      data: cvar type ref to class1.
              CREATE OBJECT cvar
    Calling Methods
    To call a method, use the following statement:
    CALL METHOD <meth> EXPORTING... <ii> =.<f i>...
                       IMPORTING... <ei> =.<g i>...
                       CHANGING ... <ci> =.<f i>...
                       RECEIVING         r = h
                       EXCEPTIONS... <ei> = rc i...
    The way in which you address the method <method> depends on the method itself and from where you are calling it. Within the implementation part of a class, you can call the methods of the same class directly using their name <meth>.
    CALL METHOD <meth>...
    Outside the class, the visibility of the method depends on whether you can call it at all. Visible instance methods can be called from outside the class using
    CALL METHOD <ref>-><meth>...
    where <ref> is a reference variable whose value points to an instance of the class. Visible instance methods can be called from outside the class using
    CALL METHOD <class>=><meth>...
    where <class> is the name of the relevant class.
    When you call a method, you must pass all non-optional input parameters using the EXPORTING or CHANGING addition in the CALL METHOD statement. You can (but do not have to) import the output parameters into your program using the IMPORTING or RECEIVING addition. Equally, you can (but do not have to) handle any exceptions triggered by the exceptions using the EXCEPTIONS addition. However, this is recommended.
    You pass and receive values to and from methods in the same way as with function modules, that is, with the syntax:
    ... <Formal parameter> = <Actual parameter>
    after the corresponding addition. The interface parameters (formal parameters) are always on the left-hand side of the equals sign. The actual parameters are always on the right. The equals sign is not an assignment operator in this context; it merely serves to assign program variables to the interface parameters of the method.
    If the interface of a method consists only of a single IMPORTING parameter, you can use the following shortened form of the method call:
    CALL METHOD <method>( f).
    The actual parameter <f> is passed to the input parameters of the method.
    If the interface of a method consists only of IMPORTING parameters, you can use the following shortened form of the method call:
    CALL METHOD <method>(....<ii> =.<f i>...).
    Each actual parameter <f i > is passed to the corresponding formal parameter <i i >.
    Pls. mark if useful

  • Methods in JSP (repetitive things)

    I had posted this question before but didnt solve me problem.Here I ask it again.
    I alway thought that JSP should be used for display purpose.In that what to do if some lines of code are repeated many number of times,and since I cant have a method inside a JSP then I am wondering the solution will be to create a class and then write the output to the out variable.
    Please help.
    Thanks
    MS

    Coding to generate multiple table rows (or similar function) in a JSP should still be considered presentation-layer stuff. In other words, a method to repeatedly generate table rows is a display purpose, generally speaking. That said, custom tags go a long way to keeping your JSPs clean and pretty.

  • Transfering word data to word template report

    Hello,
    Could someone help me here please:  I have a draft report generated from an equipment (see attached document name draft report.doc). I need to transfer data from this draft to a template ( see attached doc named template. doc), and this should look like the final report (see attached doc named final report.doc).
    I tried this (see the attached code), it seems to work but I am not able to get transfer the image (the graph) and also I need the right formating as shown on the example of the attached final report.
    Any help will be appreciated.
    Attachments:
    Draft report.doc ‏39 KB
    word_report.vi ‏76 KB
    template.doc ‏35 KB

    For the formatting you can use the Set Font Report.vi with font settings calibri size 8. Extracting a picture from a Word document to insert it into another Word document is not a simple task that can be accomplish with the VIs of the Report Generation Toolkit. You will have to use Word ActiveX methods and properties. Attached is a vi that copy the first picture of the draft report and copy it to the Image1 bookmark (there are no Image bookmarks define in your template so you will have to add them) of the template report.
    Note, your template report should be a .dot file, not a .doc file.
    Ben64
    Attachments:
    Word Copy and Paste Picture.vi ‏22 KB

  • Exporting smartform into word document

    how to export smartform into word document . i tried converting into pdf and then download but it showing run time error that conversion is not possible and also it tells that otf command // missing. is it not possible to export directly to word document instead of pdf.plz give clear description of what to be done exactly with sample codes.
    marks will be rewarded.

    Hi Lavanya,
    Converting the output from Spool to Word is possible.
    Here is the sample code.
    I cut pasted a code from a link i got in the website, see if it helps.
    ZSPOOL2WORD
    Genera un fichero Word a partir de una orden de spool
    MÓDULO : FI *
    TIPO : Listado *
    TITULO : Generación fichero Word
    DESCRIPCION : Genera un fichero Word a partir de una orden de spool
    AUTOR: Andres Picazo FECHA: 24/03/2003 *
    MODIFICACIONES *
    FECHA NOMBRE DESCRIPCION *
    REPORT ZSPOOL2WORD
    NO STANDARD PAGE HEADING
    LINE-COUNT 065
    LINE-SIZE 080.
    INCLUDE OLE2INCL.
    *----TABLAS/ESTRUCTURAS--
    *----TABLAS INTERNAS--
    DATA I_BUFFER(132) OCCURS 1000000 WITH HEADER LINE.
    *----VARIABLES--
    *----PARAMETER/SELECT-OPTIONS EN PANTALLA--
    SELECTION-SCREEN BEGIN OF BLOCK BLK_PAR WITH FRAME TITLE TEXT-SEL. "Pará
    PARAMETERS: P_SPOOL LIKE TSP01-RQIDENT OBLIGATORY.
    SELECTION-SCREEN END OF BLOCK BLK_PAR.
    SELECTION-SCREEN BEGIN OF BLOCK BLK_WOR WITH FRAME TITLE TEXT-WOR.
    PARAMETERS: P_WORD AS CHECKBOX DEFAULT 'X'.
    PARAMETERS: P_FWOR LIKE RLGRAP-FILENAME DEFAULT 'C:MAYOR.DOC'.
    PARAMETERS: P_PLAN LIKE RLGRAP-FILENAME
    DEFAULT 'D:DATOSAPISMAYORPLANTILLA LIBRO MAYOR.DOC'.
    SELECTION-SCREEN END OF BLOCK BLK_WOR.
    SELECTION-SCREEN BEGIN OF BLOCK BLK_FIC WITH FRAME TITLE TEXT-FIC.
    PARAMETERS: P_CTXT AS CHECKBOX DEFAULT ''.
    PARAMETERS: P_FTXT LIKE RLGRAP-FILENAME DEFAULT 'C:MAYOR.TXT'.
    SELECTION-SCREEN END OF BLOCK BLK_FIC.
    LOGICA DEL PROGRAMA
    INITIALIZATION
    INITIALIZATION.
    START-OF-SELECTION.
    START-OF-SELECTION.
    PERFORM LEER_SPOOL.
    IF NOT P_CTXT IS INITIAL.
    PERFORM GRABA_FICHERO.
    ENDIF.
    IF NOT P_WORD IS INITIAL.
    PERFORM LANZA_WORD.
    ENDIF.
    FORMS ADICIONALES
    *& Form LEER_SPOOL
    Lee la orden de spool en el buffer
    FORM LEER_SPOOL.
    CALL FUNCTION 'RSPO_RETURN_ABAP_SPOOLJOB'
    EXPORTING
    RQIDENT = P_SPOOL
    FIRST_LINE = 1
    LAST_LINE = 9999999
    TABLES
    BUFFER = I_BUFFER
    EXCEPTIONS
    NO_SUCH_JOB = 1
    NOT_ABAP_LIST = 2
    JOB_CONTAINS_NO_DATA = 3
    SELECTION_EMPTY = 4
    NO_PERMISSION = 5
    CAN_NOT_ACCESS = 6
    READ_ERROR = 7
    OTHERS = 8.
    IF SY-SUBRC NE 0.
    MESSAGE E398(00) WITH 'Error' SY-SUBRC
    'al leer la orden de spool' P_SPOOL.
    ENDIF.
    ENDFORM. " LEER_SPOOL
    *& Form GRABA_FICHERO
    Graba el contenido del spool a fichero de texto.
    FORM GRABA_FICHERO.
    CALL FUNCTION 'WS_DOWNLOAD'
    EXPORTING
    BIN_FILESIZE = ' '
    CODEPAGE = ' '
    FILENAME = P_FTXT
    FILETYPE = 'ASC'
    MODE = ' '
    WK1_N_FORMAT = ' '
    WK1_N_SIZE = ' '
    WK1_T_FORMAT = ' '
    WK1_T_SIZE = ' '
    COL_SELECT = ' '
    COL_SELECTMASK = ' '
    NO_AUTH_CHECK = ' '
    IMPORTING
    FILELENGTH =
    TABLES
    DATA_TAB = I_BUFFER
    FIELDNAMES =
    EXCEPTIONS
    FILE_OPEN_ERROR = 1
    FILE_WRITE_ERROR = 2
    INVALID_FILESIZE = 3
    INVALID_TABLE_WIDTH = 4
    INVALID_TYPE = 5
    NO_BATCH = 6
    UNKNOWN_ERROR = 7
    GUI_REFUSE_FILETRANSFER = 8
    OTHERS = 9.
    IF SY-SUBRC NE 0.
    MESSAGE E398(00) WITH 'Error' SY-SUBRC
    'al grabar el fichero' P_FTXT.
    ENDIF.
    ENDFORM. " GRABA_FICHERO
    *& Form LANZA_WORD
    Abre la plantilla de Word y pega el contenido del portapapeles.
    FORM LANZA_WORD.
    DATA: WORDAPP TYPE OLE2_OBJECT,
    DOCUMENT TYPE OLE2_OBJECT,
    SELECTION TYPE OLE2_OBJECT.
    Copia el contenido del buffer en el portapeles
    CALL FUNCTION 'CLPB_EXPORT'
    TABLES
    DATA_TAB = I_BUFFER
    EXCEPTIONS
    CLPB_ERROR = 1
    OTHERS = 2.
    Abre Word
    CREATE OBJECT WORDAPP 'word.application'.
    IF SY-SUBRC NE 0.
    MESSAGE E398(00) WITH 'No se ha podido abrir el Word'.
    ENDIF.
    Lo pone en visible
    SET PROPERTY OF WORDAPP 'Visible' = 1.
    Cogemes el objeto documento
    CALL METHOD OF WORDAPP 'Documents' = DOCUMENT.
    Abrimos el fichero plantilla
    IF P_PLAN IS INITIAL.
    CALL METHOD OF DOCUMENT 'Add'.
    ELSE.
    CALL METHOD OF DOCUMENT 'Open' EXPORTING #1 = P_PLAN.
    IF SY-SUBRC NE 0.
    MESSAGE E398(00) WITH 'Error al leer el fichero plantilla'.
    ENDIF.
    ENDIF.
    Coge el objeto selección
    CALL METHOD OF WORDAPP 'Selection' = SELECTION.
    Pega el contenido del portapapeles
    CALL METHOD OF SELECTION 'Paste'.
    IF SY-SUBRC NE 0.
    MESSAGE E398(00) WITH 'Error al pegar contenido del portapapeles'.
    ENDIF.
    Graba el fichero
    CALL METHOD OF WORDAPP 'ActiveDocument' = DOCUMENT.
    CALL METHOD OF DOCUMENT 'SaveAs' EXPORTING #1 = P_FWOR.
    IF SY-SUBRC NE 0.
    MESSAGE E398(00) WITH 'Error al grabar el nuevo documento'.
    ENDIF.
    Cierra Word
    CALL METHOD OF WORDAPP 'Quit'.
    IF SY-SUBRC NE 0.
    MESSAGE E398(00) WITH 'Error al cerrar Word'.
    ENDIF.
    ENDFORM. " LANZA_WORD
    check this also.................
    By using FM RSPO_RETURN_ABAP_SPOOLJOB you will be able to get the ASCII text of your Spool, which you can download to your local HD and open with M$ Word.
    Check the function module
    CALL FUNCTION 'RSPO_DOWNLOAD_SPOOLJOB'
         EXPORTING
              id    = p_spool
              fname = p_file.
    Give the file extn as .DOC. it will downlaod it as a
    Word doc.But I fear you wont get the table formats and
    all.
    ~~Guduri

  • Agentry First letter uppercase rule

    Hi,
    is there a (not too complex) way to convert an uppercase string to a string where only the first characters of the words are upper case?
    The field contains multiple words and every word should begin with a capital.
    There are only string rules for all uppercase or all lowercase strings..

    Hi Dieter,
    This can be done using the JAVASCRIPT function. You can write javascript code to do the work and call that code from within an Agentry rule.
    For example, the following rule (paste into your editor) is using the Javascript code on the City property  to make the first characters of the words uppercase and the rest lowercase.
    (@JAVASCRIPT ((*argv[0].toLowerCase$28$$29$.replace$28$ /$28$^|\s$29$$28$[a-z]$29$/g , function$28$m,p1,p2$29${ return p1+p2.toUpperCase$28$$29$; } $29$;)) :>12"City")

  • Macros with WORD.BASIC (MS WORD 2003)

    Hi:
       I have created a program linked with Microsoft Word with WORD.BASIC object. The program run correctly with MS Word 2002 executing all the methods
    CREATE OBJECT h_word 'WORD.BASIC' LANGUAGE 'e'
    CALL METHOD OF h_word 'APPSHOW' EXPORTING #1 = 'Microsoft Word'
    CALL METHOD OF h_word 'FILENEW' EXPORTING #1 = file
    CALL METHOD OF h_word 'TOOLSMACRO' EXPORTING 
                                        #1   'MACRO1'
                                        #2 = 'RUN'.
    my serious problem is that the macros include don´t run properly in Microsoft Office Word 2003. Can someone hep me with this issue, please?
    Thanks in advance
    Abel

    check out the following function module.
    RH_START_EXCEL_WITH_DATA
    though this dosent deal with word, you can get the basic idea as to how to handle macro by following the code in this fm.
    Regards
    Raja

  • Detecting the source of a method invocation.

    Within a given method, is there a way to detect what class/method made the invocation call?
    I need to find a way to modify instance variables within a method, based on the invoking class ... I thought of navigating back through the Stack, but I am working with a multi-threaded application so I fear that I cannot absolutely depend on the last Stack call being the actual invoking class/method. Any ideas? - please help.
    Many thanks,
    Thomas

    How does one access the method invocation stack?I'm not sure if an easier way exists, but you can extend SecurityManager to fetch the Class context of the current Thread, which will provide you with an array of Class obejcts, ordered according to the method invocation stack. Thus, you can determine what Class invoked a particular method, but you can not determine what Object (not via the SecurityManager funcationality).
    Here is a simple class I often use for such a need (excuse any formating issues- or misspellings in the documenation)... ... although, it should be stated, this class may not work in certain environments- specifically ones that deny permission "createSecurityManager".
    * This class provides static utility methods for retrieving information
    * on the class context.  The methods in this class can provide a
    * resource with a list of the classes that invoked it, thus allowing
    * clases to determine if a particular method is being accessed by
    * the proper caller or allow Class variables to be initialized statically,
    * with out having to instantiate the type.
    * <p>This class is meant to provide simple functionality in familiar
    * environments.  Its funcationality may not work properly when executing
    * in an enviroment with strigent security permissions.  Specifically, if
    * permission is denied to construct a new SecurityManager instance, the
    * methods of this class will fail.
    * @author: Sean Flanerry
    public final class ClassLookup extends SecurityManager {
      private static final ClassLookup instance = new ClassLookup();
      private ClassLookup() { }
      * This method returns the class context for the current thread in format
      * <ul>
      * <li>Class for currently executing method
      * <li>Class that invoked the above method
      * <li>Class that invoked the above method...
      * </ul>
      * The first two elements in the returned array will be of type ClassLookup.
      * @see java.lang.SecurityManager#getClassContext()
      public static Class [] fetchClassContext() {
        return instance.getClassContext();
      * This method returns the Class that invoked this method.  This method
      * is used primarily by static initializers that have to retrieve a handle
      * to the java.lang.Class instance that wraps the current type, but that
      * can not instantiate the current type, eg <br>
      * <code>public static final Class currentClass = ClassLookup.getCallingClass();
      public static Class getCallingClass() {
        return instance.getClassContext()[3];
      * This returns the Class that invoked the current method on the calling
      * Class.  If for example, Race.startRace() invokes Runner.sprint(), Runner.sprint()
      * can determine what class invoked it by calling this method.  In other
      * words, this method lets other methods determine which class invoked
      * it.
      * <p>Remember that this method returns a Class instance for which
      * ever type contains the method which invoked the caller so the
      * Object returned by this method might be the caller's type if the
      * caller was spawned by a method with in the same class.  Consider,
      * <ul>
      * <li>Race.start() invokes
      * <li>Runner.sprint() which invokes
      * <li>Runner.fatigue()
      * </ul>
      * If Runner.fatigue() invokes this method, an instance of Runner.class will
      * be returned, <b>not</b> Race.class because fatigue was invoked by sprint.
      * <p>This method is typically used by resources that wish to determine
      * if the current method is being invoked via the proper context, ie the
      * invoking class is a trused resource.
      public static Class getInvokingClass() {
        return instance.getClassContext()[4];
      public static void main(String args[]) {
        Class [] c = fetchClassContext();
        for (int i = 0; i < c.length; i++) {
          System.out.println(c.getName());

Maybe you are looking for

  • 5.0.1 update won't finish ?!?!

    I've been trying to update my ipod touch 4g allll day. it went through the download, but when the backup starts, the loading bar will just disappear and it wont finish. I tried everything, restarting my computer, restarting my ipod, updating itunes a

  • PO approval workflow customization

    we want to send email notification to supplier upon approval of PO approval. Is there any default functionality available or we have to customize a PO approval workflow.

  • My local skype to go number (Chile) is not working

    Hi,  i am paying monthly for my local skype number 56 02 570 9567 and it seems that now it is no a functioning number, here. There was a recent change in dialing codes here and i am not sure if that has something to with it. Please help me reset or m

  • Oracle 10g Paremeter to Auto Roll Back uncommited transanctions

    Hi all In SME Segment - People donot affort having Oracle Dba and at the same time less experienced persons keep making their own tests Situation goes as under :- a) Oracle 10g Windows 2003 64 Bit version on Branded HP Server with 8GB Ram having arou

  • Change E-mail content for collaboration New item

    Hello, We are e-mailing collaboration News items to our users. When we use "Send To" option to e-mail News as link, there are 2 default links in the e-mail. One for the news itself and the other for the Details on this News item. How can I modify the