How to create spaces in a text file

Hi forum
           i am creating a text file with the GUI_DOWNLOAD function, my problem is that i need to create some lines with spaces at the end of the line. But i can´t, i had concatenate spaces and i have created structures but in the file doesn´t appear that spaces to the end of the line. example
-  line
  abcdefghij
- i need
  abcdefghij******************
= space
tghnks
Josue

Thnks Pawan, the correct code to append spaces to the end of line for save in a file is, this is an example:
   <b>DATA: space_character type c.</b>
   DATA: s_var1 type c(10).
*  Init the space character
   <b>space_character  = cl_abap_char_utilities=>minchar .</b>
   s_var1 = '123'.
*   we need seven spaces more to complete the length of s_var1, then :
* We need to concatenate into field
DO 7 TIMES.
    <b>CONCATENATE s_var1 space_character INTO s_var1.</b>
ENDDO.
* Move to the internal table for save the text in a file
MOVE s_var1 TO t_out-line.
APPEND t_out.
* Finally we call the GUI_DOWNLOAD function
  CALL FUNCTION 'GUI_DOWNLOAD'
    EXPORTING
      filename                        = fullpath
      filetype                        = 'ASC'
    TABLES
      data_tab                        = t_out
    EXCEPTIONS
      file_write_error                = 1
      no_batch                        = 2
      gui_refuse_filetransfer         = 3
      invalid_type                    = 4
      no_authority                    = 5
      unknown_error                   = 6
  IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
            WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  ENDIF.
And it´s all... looks easy but many partner doesn`t know
Josué
Code Formatted by: Alvaro Tejada Galindo on Jan 18, 2010 3:34 PM

Similar Messages

  • How to create a tab-delimited text file?

    Hi,
    I need to create a tab-delimited text file at presentation server getting content from an internal table. My file should also have a header - also tab-delimited. Data for a header is stored in some work area.
    Any ideas how to add tab-delimiter into a text file? Or should I go for a HEX file and use
    CONSTANTS: c_tab TYPE x VALUE '09'.
    and separate my data with this constant instead?
    Any thoughts whould be appreciated.
    TIA
    Ivaylo Mutafchiev

    Hi Ivaylo,
    Refer sample code:
        IF i_final_head[] IS NOT INITIAL.
          CALL FUNCTION 'GUI_DOWNLOAD'
            EXPORTING
              filename                = lcl_filename
              filetype                = 'ASC'
              write_field_separator   = 'X'
            TABLES
              data_tab                = i_final_head
            EXCEPTIONS
              file_open_error         = 1
              file_read_error         = 2
              no_batch                = 3
              gui_refuse_filetransfer = 4
              invalid_type            = 5
              no_authority            = 6
              unknown_error           = 7
              bad_data_format         = 8
              header_not_allowed      = 9
              separator_not_allowed   = 10
              header_too_long         = 11
              unknown_dp_error        = 12
              access_denied           = 13
              dp_out_of_memory        = 14
              disk_full               = 15
              dp_timeout              = 16
              OTHERS                  = 17.
          IF sy-subrc <> 0.
            MESSAGE s000 WITH text-031.
            EXIT.
          ENDIF.
        ENDIF.
    Reward points if this helps.
    Manish
    Message was edited by: Manish Kumar

  • How to create printable (PDF?) text file in PSE 7

    Using slide show format it is possible to create a text file for use in the slide show. Is it possible to print that file (Slide)? How?

    You can output the slideshow as PDF also for publishing purpose. Here is the help link on how to do the same
    http://help.adobe.com/en_US/elementsorganizer/using/WS8346320B-3F64-46f6-AE4B-9FF4D934DB36 _WIN.html#WS28EB9511-B6BE-4abd-980B-59A6DDC877A6_WIN
    Also you can use Share->PDF Slideshow option to create pdf slideshow for your images.
    Hope it helps.
    Thanks,
    Gaurav

  • How to create space between Header text of Hierarchical ALV List.

    hi,
    I am display data using Hierarchical ALV List.
    In Perform of field catalog, I am writing this code:
    PERFORM fill_catalogue USING :
         'CHKBX'      'T_HEADER' 20  'Sess Decision Box'(t19) 'X',
          'SESS_NO'    'T_HEADER' 11  'Session'(t20)           ' ' ,
          'SESS_STAT'  'T_HEADER'  4  'Status'(t39)            ' ',
          'HOLD_STAT'  'T_HEADER'  4  'HOLD'(t52)              ' ',
          'ICON'       'T_HEADER'  9  'Tracking'(t21)          ' ' ,
          'CREATE_DT'  'T_HEADER' 10  'Archiving Date'(t22)    ' '  ,
          'AGING'      'T_HEADER' 50  'Aging'(t23)             ' ',
          'OBJECT'     'T_HEADER' 12  'Archive Obj'(t24)       ' ',
          'HOLD_INFO'  'T_HEADER' 100 'Hold Reason'            ' ' ,
          'YFY_DATA'   'T_HEADER' 4  'Data Fiscal Year'(t48)  ' ' ,
          'COMMENTS'   'T_HEADER' 50  'Session Notes'(t26)     ' ' ,
          'DATATYPE'   'T_HEADER' 50  'Archive Object Description'(t25) ' ',
          'APPR_STAT'    'T_ITEM' 16  'Approval Status'(t29)   ' ',
          'DESTR_DT_REV' 'T_ITEM' 10  'New Date'(t30)          ' ',
          'REJCT_REASON' 'T_ITEM' 60  'Rejection Reason'(t31)  ' '  .
    At output of this program , there are two rows in HEADER details.
    I want text 'Session notes' of 2nd row  under 'Archiving Date' of 1st row.
    For this i have to create space between 'Data Fiscal Year' & 'Session notes' text.
    How i can do this.
    Regards,
    Mamta

    Hi,
    You can use TOP-OF-PAGE event and pass this event to Hierarchical ALV FM.
    Thanks,
    Kartavya Kaushik.

  • How to create a mapping with text file as my target

    I need to create a mapping with source as a table and target as a text file.
    I am using OWB 10g R2. with database Oracle10g.
    Any one can help me to create a mapping with a text file as target.

    Hi,
    just create a File-Location and File-definition and use this file-operator as target object inside your mapping.
    Regards jwehner

  • How to create and handle a text file in CVI

    Is there any way to create and handle (like...open,write,read,truncate,close)  the .txt file in CVI?

    Sure. CVI is a regular C compiler and hence you can use all ANSI C functions. In addition you can use the File I/O functions from the utility library.

  • How to get the content of text file to write in JTextArea?

    Hello,
    I have text area and File chooser..
    i wanna the content of choosed file to be written into text area..
    I have this code:
    import java.awt.Container;
    import java.awt.FlowLayout;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.io.File;
    import javax.swing.JButton;
    import javax.swing.JFileChooser;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.*;
    public class Test_Stemmer extends JFrame {
    public Test_Stemmer() {
    super("Arabic Stemmer..");
    setSize(350, 470);
    setDefaultCloseOperation(EXIT_ON_CLOSE);
    setResizable(false);
    Container c = getContentPane();
    c.setLayout(new FlowLayout());
    JButton openButton = new JButton("Open");
    JButton saveButton = new JButton("Save");
    JButton dirButton = new JButton("Pick Dir");
    JTextArea ta=new JTextArea("File will be written here", 10, 25);
    JTextArea ta2=new JTextArea("Stemmed File will be written here", 10, 25);
    final JLabel statusbar =
                  new JLabel("Output of your selection will go here");
    // Create a file chooser that opens up as an Open dialog
    openButton.addActionListener(new ActionListener() {
       public void actionPerformed(ActionEvent ae) {
         JFileChooser chooser = new JFileChooser();
         chooser.setMultiSelectionEnabled(true);
         int option = chooser.showOpenDialog(Test_Stemmer.this);
         if (option == JFileChooser.APPROVE_OPTION) {
           File[] sf = chooser.getSelectedFiles();
           String filelist = "nothing";
           if (sf.length > 0) filelist = sf[0].getName();
           for (int i = 1; i < sf.length; i++) {
             filelist += ", " + sf.getName();
    statusbar.setText("You chose " + filelist);
    else {
    statusbar.setText("You canceled.");
    // Create a file chooser that opens up as a Save dialog
    saveButton.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent ae) {
    JFileChooser chooser = new JFileChooser();
    int option = chooser.showSaveDialog(Test_Stemmer.this);
    if (option == JFileChooser.APPROVE_OPTION) {
    statusbar.setText("You saved " + ((chooser.getSelectedFile()!=null)?
    chooser.getSelectedFile().getName():"nothing"));
    else {
    statusbar.setText("You canceled.");
    // Create a file chooser that allows you to pick a directory
    // rather than a file
    dirButton.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent ae) {
    JFileChooser chooser = new JFileChooser();
    chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
    int option = chooser.showOpenDialog(Test_Stemmer.this);
    if (option == JFileChooser.APPROVE_OPTION) {
    statusbar.setText("You opened " + ((chooser.getSelectedFile()!=null)?
    chooser.getSelectedFile().getName():"nothing"));
    else {
    statusbar.setText("You canceled.");
    c.add(openButton);
    c.add(saveButton);
    c.add(dirButton);
    c.add(statusbar);
    c.add(ta);
    c.add(ta2);
    public static void main(String args[]) {
    Test_Stemmer sfc = new Test_Stemmer();
    sfc.setVisible(true);
    }could you please help me, and tell me what to add or to modify,,
    Thank you..                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    realahmed8 wrote:
    thanks masijade,
    i have filter the file chooser for only text files,
    but i still don't know how to use FileReader to put text file content to the text area (ta) ..
    please tell me how and where to use it..How? -- See the IO Tutorials on Sun for the FileReader (and I assume you know how to call setText and append in the JTextArea).
    Where? -- In the actionPerformed method (better would be a separate thread that is triggered through the actionPerformed method, but that is probably beyond you at the moment), of course.
    Give it a try.

  • How to create a muli line text area using JavaFx

    Hi all,
    Since the preview SDK does not contain TextArea any more, I am wondering how to create a muli line text area using JavaFX. The behaviour of this text area/field should be somehow similar to JTextArea in Swing or StyledTextWidget in SWT.
    Does JavaFX have any support for this? What would be a sensible approach to create such a widget?
    Thanks for your suggestions,
    br michael

    This is a pretty old thread (I know I came across this while searching for something similar recently), but I figured I'd throw this out there in case other people might find this useful. As I write this, JavaFX's latest version is 1.3... which may have added the needed functionality since the last post.
    You can now create a multi-line text area using a TextBox and by specifying the nubmer of lines and setting the "multiline" value to true. It may not offer all of the same functionality as JTextArea, but it did the job for what I needed... newlines by pressing enter, scrollbar if text surpasses height, etc.
    Here's a simple example:
    Group {
       content: [
          TextBox {
             text: "This is a multi-line textbox"
             lines: 10  // <-- this may/may not be necessary depending on your situation. Default is 5.
             multiline: true
    }Edited by: loeschg on Jul 29, 2010 2:59 PM

  • How to create a table in the file using java code.?

    HI,
    I should export the data from the view objects to a word document. I have done that but I should
    display the data in the form of a table.
    Kindly come up with the necessary information on how to create a table in the file using java.
    Thanks,
    Phani

    Hi, Thank you for responding to my query.
    The below are the details of my code.
    DCBindingContainer dcBindings =
    (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
    DCIteratorBinding StudentDetailsContent =
    (DCIteratorBinding)dcBindings.get("StudentView1Iterator");
    OutputStreamWriter w = new OutputStreamWriter(outputStream, "UTF-8");
    Row currentRow =
    StudentDetailsContent.getRowSetIterator().first();
    Object a[]= currentRow.getAttributeValues();
    int i;
    for(i=0 ;i<=a.length;i++){
    w.write(a.toString());
    w.write(" ");
    w.flush();
    I am usning this coding to achieve the task of exporting data to file.
    I need to display this information in the table that is where I need help from you people.
    Thanks,

  • How to create Inbound Idoc from XML file-Need help urgently

    Hi,
    can any one tell how to create inbound Idoc from XML file.
    we have xml file in application server Ex. /usr/INT/SMS/PAYTEXT.xml'  we want to generate inbound idoc from this file.we are successfully able to generate outbound XML file from outbound Idoc by using the XML port. But not able to generate idoc from XML file by using we19 or we16.
    Please let me know the process to trigger inbound Idoc with out using  XI and any other components.
    Thanks in advance
    Dora Reddy

    Hi .. Did either of you get a result on this?
    My question is the same really .. I am testing with WE19 and it seems SAP cannot accept an XML inbound file as standard.
    I see lots of mention of using a Function Module.
    Am I correct in saying therefore that ABAP development is required to create a program to run the FM and process the idoc?
    Or is there something tht can be done with Standard SAP?
    Thanks
    Lee

  • Where are these unix executable files coming from and how do I recover the original text file?

    where are these unix executable files coming from and how do I recover the original text file?

    When you upgraded to Lion did you have AppleWorks installed on your mac?
    Most of the AW documents can be opened by Pages 09 or Numbers 09 with most of the orginal format in tact. (I do not know if previouse verision will work) just open the AW file with both and see which one works best.
    Text Edit will also open most of the AW files as well but will require a lot of work to restore them to their orginal format.
    If you have AW Database documents then they are not supported. 
    These document show up as "exec icons", Kind: Unix Executagle File.
    They also will show up as .cwk file if they are small files. I have a couple that were under 1mb that are shown as " Kind: AppleWorks Document" but will not open.
    The only option to open AW database is to have AW installed on a mac with a pre-Lion OS to recover the file.

  • How can u insert and retrieve text files in any format using forms6i.

    how can u insert and retrieve text files in any format using forms6i.
    can u give me an example of an insert statement, let's assume the file is located in the a:drive.
    and retrieving the files, i would give the user a list of all the files that are in the database, the user would select one, but what command(or piece of code) would open the file in its apppropriate editor.
    e.g .pdf formatted file would open in acrobat.
    any help would be appreciated.
    Thanks
    Hussein Saiger

    the filereference class is for downloading and uploading files.
    if you want to load xml, use the xml class.
    and, if you want to write to an xml file and don't want to use server-side code, wait.

  • How to create a table using Text Layout Framework?

    How to create a table using Text Layout Framework? I meen real tables - like in HTML.

    Cell as indipendant TLF should work, I have created my table using same approach and works fine for me ... this is where it is
    http://apps.live-documents.com/docs/openWebDoc.do?docId=1480607
    Regards
    Raf

  • How to eliminate spaces while reading a file in BPEL Process

    Hi All,
    How to eliminate space when reading a file which of fixedlength and inserting into database.
    Inserting some of columns sucessfully but there is a column where there is a space n front the value, how to eliminate the that space.
    I have a custom XSD and using out in the process. How to resolve this issue to get all rows sucessfully inserted into the database.
    Anyone hod gone through this kind of functionality.
    Regards,
    CH

    Hi,
    try to use XPath functions like 'normalize-space()', 'right-trim()', 'left-trim()' in your transformation.
    Regards,
    Martin.

  • How to create and manage the log file

    Hi,
    I want to trace and debug the program process.
    I write the code for creating log file and debugging the process.
    But i am not able get the result.
    please help me how to create and manage the log file.
    Here i post sample program
    package Src;
    import java.io.*;
    import org.apache.log4j.*;
    import java.util.logging.FileHandler;
    public class Mylog
         private static final Logger log = Logger.getLogger("Mylog.class");
         public static void main(String[] args) throws Exception {
         try {
           // Create an appending file handler
            boolean append = true;
            FileHandler handler = new FileHandler("debug.log", append);
            // Add to the desired logger
            Logger logger = Logger.getLogger("com.mycompany");
            System.out.println("after creating log file");     
              catch (IOException e)
                   System.out.println("Sys Err");
            }Please give the your valuable suggesstion... !
    Thanks
    MerlinRoshina

    Just i need to write a single line in log file.

Maybe you are looking for

  • Vendor Invoice posting error

    Dear All, I want to add transportation costs to material prices using MIRO with Material tab. While I insert data in material tab of MIRO, system is asking for tax code, but if we give tax code, while posting , system is giving error saying key tax i

  • CHARM: Activation of Different Land Scapes at different times

    Hi All, I am configuring ChaRM in solution manager. The requirement is mentioned below: We have 4 systems land scape: DEV, QA, PRD and TRN (training system) and all transports go into the systems in the following way: 1. DEV->QA 2. QA->PRD 3.QA->TRN

  • Processing IDOC Basic type ORDERS05 in CRM...

    I'm processing (via WE19) an IDOC (Basic type ORDERS05) to create a Sales order withing CRM. I'm getting there in that a sales order is being raised, although there is no item level details so far. I know that config of the system plays a big hand in

  • Web form integration error

    I am working on integrating a web form with Oracle CRM On-demand. This web form offers the ability for users to submit file attachments. Rether than submit the whole file as an attachments, we would like them to submit a URL to the attachment. I woul

  • Enable responses from 2 internet gateways on the same system

    Hello I tried this question in the Tiger Networking forum but didn't get a response so I'm giving it a shot here. I am hoping one of the network gurus here can help me out. I've spent quite a few hours trawling these forums and others online to try t