Formatting the text file

hi folks,
I have an text file with records, each record has several field values  and there is blank space between them, I need to remove the blank spaces, is there a way that i can do with all records at one stretch? Instead doing it for each record.
I know it is not related to SAP but I need some help in this regard as there are  a lot of records and formatting each record manually is extremely painful. This is a corrected  file manually on a spreadsheet and converted into the text file from thereon.
Any help is really appreicated.
Thanks,
SK

Hi,
What you are trying to do with the text file after removing the spaces?
Are you going to use in SAp Upload? or just to remove the spaces in text fiel?
If you are using it for other purposes, you should not remove the spaces, because for that particular field no data will be entered.
(generally we remove the other chars's like " by Find and Replace method)
Generally we format the text files from the Excel to utilise it somewhere?
And we won't remove the spaces for surther uses.
Regards,
Anji

Similar Messages

  • Formatting lost in the text file, got after zipping.

    Hello ABAP gurus,
    A text file has to be zipped .I have used the class method CL_ABAP_ZIP-SAVE() to create a zip file in the application server.    The zip file is double clicked and the text file is opened.
    The formatting is lost in the text file, got after zipping.
    Please let me know how I maintain the formatting in the zip file.
    Thanks.
    Edited by: GVVisweswara . on May 5, 2011 5:17 PM

    Hi.,
    Check this link: [Zip text file using Cl Zip|http://www.saptutor.org/?p=59]
    also this wiki., http://wiki.sdn.sap.com/wiki/display/ABAP/CL_ABAP_ZIPusage-ZippingABAPreportoutput
    hope this helps u.,
    Thanks & Regards
    Kiran

  • How to extract  different date format in text file

    well, iam new for using regex api(regular expression), In my project i want to extract the different format of date from the text file... date format will be 3rd june 2004, 03-06-2004, june 3rd and so on....
    can any body give me regular expression to extract the date from the text file...
    i will be very grateful..
    kareem

    date format will be 3rd june 2004, 03-06-2004, june 3rd and so on....The only way to do this (without implementing a "mind reader") is to determine in advance all the possible date formats that are possible in your input, and try to interpret each date using each of those formats until one of them passes.
    It's easy enough to handle june 3rd vs 3 june vs 3rd june, but 6/3 vs 3/6, of course, is ambiguous.

  • Error in Downloading the Text file on Application Server

    Hi All,
              I am working on ECC6.0. I have written a program in whcih I am downloading the text file on
              application server in UTF-8 format. However when I am opening this file in Excel I am getting
              garbage value for some characters(as Excel does not support UTF-8 format). So now I
              want to download the data on application server in text file in non unicode format(Like ANSI or
              other non unicode format) which is supported by excel. When I am writing the code as
              OPEN DATASET DN_FILE FOR OUTPUT IN LEGACY TEXT MODE it is giving me dump saying
              CHARACTER CONVERSION FROM CODE PAGE '4102' to CODEPAGE '1100' NOT POSSIBLE.
              Same in case if I add the code OPEN DATASET DN_FILE FOR OUTPUT IN LEGACY TEXT
              MODE CODE PAGE '8000' is also giving dump.
              So please let me know how can I download the file in non unicode format ?
              Any help would be greatly appricated.
    Thanks & Regards
    Jitendra Gujarathi.

    OPEN DATASET l_filename FOR INPUT IN TEXT MODE  ENCODING NON-UNICODE IGNORING CONVERSION ERRORS.
    CHECK sy-subrc EQ 0.
      DO.
        CLEAR wa_file_content.
        READ DATASET l_filename INTO wa_file_content.
        IF sy-subrc EQ 0.
          APPEND wa_file_content TO it_file_content.
        ELSE.
          EXIT.
        ENDIF.
      ENDDO.
      CLOSE  DATASET l_filename.
      t_filedata[] = it_file_content[].
    can you use like this.

  • How to format a text file

    Hello I'm generating a text file in tab delimited format of frequency vs intensity. I wish to format it and save it in another text file. I'm getting my data in this format in the text file...
    1312500000.00    -6.69
    1375000000.00    -6.25
    1437500000.00    -5.94
    1500000000.00    -5.66
    1562500000.00    -5.89
    1625000000.00    -6.29
    1687500000.00    -6.45
    1750000000.00    -6.28
    1812500000.00    -5.59
    Now I'm trying to format this data into different coloums...like after every 201,401,601 or 1601(a control which tells this to vi)...I should jump to new set of coloumns, like:
    Frequency             Int.       Frequency             int.
    1312500000.00    -6.69    1312500000.00     -7.71        ...                ...               ...             ...   
    1375000000.00    -6.25
        1375000000.00    -6.55        ...               ...                ...           ...
    1437500000.00    -5.94
        1437500000.00    -7.94
    1500000000.00    -5.66
        1500000000.00    -7.66
    1562500000.00    -5.89
        1562500000.00    -4.89
    1625000000.00    -6.29     625000000.00      -9.09
    1687500000.00    -6.45
        1687500000.00    -6.40
    1750000000.00    -6.28
        1750000000.00    -6.88
    1812500000.00    -5.59
        1812500000.00    -5.89
    1375000000.00    -6.25
        1375000000.00    -5.25
    1437500000.00    -5.94     12500000.00        -5.59
    ...till 201 rows(If I input 201 in a control)
    I'm facing some problems with editing can anyone help me around.
    Attached my text file for reference
    Looking for help,
    Regards
    Attachments:
    Rohit.txt ‏2821 KB

    I don't think you need any loops and there is certainly no need o convert to numbers and back!
    (scanning and formatting operations are expensive!)
    Read the file as a plain string, then convert it to a 1D array of strings, one line per array element.
    Reshape to a 2D array of proper dimensions and transpose to fill columns first.
    Use spreadsheet string to array (now with tab as delimiter) to generate the desired string.
    Write the string to a new file.
    Here's a simple draft (LabVIEW 8.0). Look ma, no loops!
    Modify as needed.
    Message Edited by altenbach on 06-15-2007 03:29 PM
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    columnwrapper.png ‏10 KB
    ColumnWrapper.vi ‏13 KB

  • Problem reading external HTML format from text file

    I have a text file containing html formatted text which I try to get into a textfield.
    All works fine locally and even on my localhost test server, but when uploading to the real server - I get a blank.
    Anyone have any ideas? THANKS
    The text file :
    &t2=<TEXTFORMAT LEADING="2"><P ALIGN="LEFT"><FONT FACE="Comic Sans MS" SIZE="14" COLOR="#FF0000" LETTERSPACING="0" KERNING="0">Some text here</FONT></P></TEXTFORMAT><TEXTFORMAT LEADING="2"><P ALIGN="LEFT"><FONT FACE="Comic Sans MS" SIZE="14" COLOR="#FF0000" LETTERSPACING="0" KERNING="0">One more line</FONT></P></TEXTFORMAT><TEXTFORMAT LEADING="2"><P ALIGN="LEFT"><FONT FACE="Comic Sans MS" SIZE="14" COLOR="#FF0000" LETTERSPACING="0" KERNING="0">And more text here</FONT></P></TEXTFORMAT>
    and the AS code in the movie:
    viewData.onPress = function() {
         //get text
         loadText()
    var tz
    function loadText() {
    var my_lv:LoadVars = new LoadVars();
    my_lv.onLoad = function(success:Boolean) {
      if (success) {
      //trace(this.toString())
      mytext.htmlText= this.t2;
      } else {
      //trace("Error loading/parsing LoadVars.");
    my_lv.load("myfile.txt");

    Thanks kglad, I did it and it made me find the real problem:
    The text file is generated by PHP script that gets an html formated text from flash (it is an online editing part of an application):
    the AS code to call the php:
    var send_lv:LoadVars = new LoadVars();
    send_lv.t1 = "&t2="+editor.t1.htmlText+"&";
    send_lv.sendAndLoad("write.php", res_lv, "POST");
    the PHP:
    <?php
    $mydata = $_POST["t1"];
    $myFile = "recipe.txt";
    $fh = fopen($myFile, 'w') or die("can't open file");
    fwrite($fh, $mydata);
    fclose($fh);
    print "&done=done";
    ?>
    From some reason the online server adds \ before any " , but WAMP doesn't.
    here is the text generated on localhost (WAMP)
    &t2=<TEXTFORMAT LEADING="2"><P ALIGN="LEFT"><FONT FACE="Comic Sans MS" SIZE="14" COLOR="#FF0000" LETTERSPACING="0" KERNING="0">local text</FONT></P></TEXTFORMAT>&
    online server:
    &t2=<TEXTFORMAT LEADING=\"2\"><P ALIGN=\"LEFT\"><FONT FACE=\"Comic Sans MS\" SIZE=\"14\" COLOR=\"#FF0000\" LETTERSPACING=\"0\" KERNING=\"0\">online text</FONT></P></TEXTFORMAT>&
    I know its not a Flash problem now, but do you have any idea?
    Thanks

  • I'm creating an epk and I need to add a bio to the menu.  Can I import the text file or do I need to retype the bio somewhere?  What is the best way to proceed?

    I'm creating an epk and I need to add a bio to the menu.  Can I import the text file or do I need to retype the bio somewhere?  What is the best way to proceed?

    Electronic Press Kit.
    Usually in the form of video outtakes, movie trailers, cast and crew interviews. Basically, the stuff that gets bunged onto commercial DVDs as extras or ends up on late night TV "Making Of..." shows.
    To answer the OP, you want a button on the menu that leads to a still image, or series of them, set up as a slide show. You can copy/paste the text in DVD Studio and then add formatting via the Text menu. (Highlight the text and right click to access formatting controls). Or do it in a graphics application using the appropriate video image preset.

  • PE 13 crashes due to incompatible video driver detected. Running on Win 7 SP1 with ATI 540v video card/driver.  Deleting bad driver file in adobe program data does not fix the problem,  it simply replaces the text file and crashes again.  My video driver

    PE 13 crashes due to incompatible video driver detected. Running on Win 7 SP1 with ATI 540v video card/driver.  Deleting bad driver file in adobe program data does not fix the problem,  it simply replaces the text file and crashes again.  My video driver is just fine.  Any help out there?

    rb
    Your video card driver may be fine for something, but just not compatible with Premiere Elements 13/13.1.
    For those with the display card error, the answers include
    a. assure your video card/graphics card driver version is up to date according to the web site of the manufacturer of the card -
    if necessary consider a driver roll back.
    b. determine in Device Manager/Display Adapters if the computer is using 2 cards instead of 1
    c. delete the BadDrivers.txt file
    the rationale for that deletion is found in post 10 of the following older post...principle applies to 13 as well as 9.
    Re: Premiere Elements 9 Tryout Serious Display Problem
    Have you looked for computer ATI card settings that might be more compatible with Premiere Elements 13/13.1?
    When is the program crashing - just opening a new project or rather crashing if editing a particular video format at the Timeline level?
    ATR

  • Send numeric value in relative time format to text file

    Hi, I'm trying to send a numeric value to a text file (.txt). However, this value must be in Relative Time format, which is displayed correctly in my front panel but not in my text file. The text file displays  it as an integer-.
    I know that this can be achieved by sending a string instead of a numeric value, but the thing is, I'm sending other numeric values along with this one, which means ALL the data must be numeric in order for Labview to send it, since it does not seem to accept a polimorphic array of data.
    Any suggestions?

    Here the resaved Write to Spreadsheet File.vi for writing String arrays.
    - Partha
    LabVIEW - Wires that catch bugs!
    Attachments:
    Write To Spreadsheet File_String.vi ‏58 KB

  • Problen when Sending the text file as attachment to the external mail

    HI,
    I am sending the text file as an attachment to a aexternal mai. mailing is going with text file attachment, but text file is empty. No information in the file is going, only empty text file is going. I am sending the code  iam using. Please suggest, if I need to change any passing parameters orany other other solution.
    tables: knb1,kna1,adr6,ITEMSET,bsid,TSP01.
               INTERNAL TABLES
    DATA: BEGIN OF it_kna1 occurs 0,
            KUNNR LIKE KNA1-KUNNR,
            ADRNR LIKE KNA1-ADRNR,
          END OF it_kna1.
    DATA: BEGIN OF it_email occurs 0,
            ADDRNUMBER LIKE ADR6-ADDRNUMBER,
            SMTP_ADDR LIKE ADR6-SMTP_ADDR,
          END OF it_email.
    DATA: BEGIN OF it_bsid occurs 0,
           KUNNR LIKE BSID-KUNNR,
           BUKRS LIKE BSID-BUKRS,
         END OF it_bsid.
    DATA: BEGIN OF it_final occurs 0,
            KUNNR LIKE KNA1-KUNNR,
            ADRNR LIKE ADR6-ADDRNUMBER,
            EMAIL LIKE ADR6-SMTP_ADDR,
          END OF it_final.
    DATA: BEGIN OF BUFFER OCCURS 10000,
              TEXT(255) TYPE C,
            END OF BUFFER.
    data:xtext type solix_tab." occurs 0 with header line."line.
    data:xi_pdf type soli_tab.
    DATA: OBJPACK LIKE SOPCKLSTI1 OCCURS 2  WITH HEADER LINE,
          OBJHEAD LIKE SOLISTI1   OCCURS 1  WITH HEADER LINE,
          OBJBIN  LIKE SOLISTI1   OCCURS 0  WITH HEADER LINE,
          OBJTXT  LIKE SOLISTI1   OCCURS 10 WITH HEADER LINE,
          RECLIST LIKE SOMLRECI1  OCCURS 5  WITH HEADER LINE,
          DOC_CHNG  LIKE SODOCCHGI1,
         PARAMS   LIKE PRI_PARAMS,
         ARPARAMS LIKE ARC_PARAMS,
         DAYS(1)  TYPE N VALUE 8,
         COUNT(3) TYPE N VALUE 1,
         VALID    TYPE C,
         RECEIVER(30),
         STR(256).
    data:  spoolid    type tsp01-rqident,
           pdf_table like tline occurs 0 with header line,
           v_bytecount type i,
           itab_pdf like tline occurs 10 with header line,
          xi_pdf  like tline occurs 0 with header line,
          xi_pdf  like buffer occurs 0 with header line,
           xi_pdf_1 like xi_pdf,
           v_length(2) type p,
           html  like solisti1   occurs 0  with header line,
           xi_temp      like bapiqcmime occurs 0 with header line,
           xi_mime(255) type c occurs 0 with header line.
              VARIABLES
    data: g_email type adr6-smtp_addr,
          TAB_LINES LIKE SY-TABIX,
          G_FLAG(1) TYPE C.
         g_norm(1) TYPE C,
         g_shbv(1) TYPE C,
         g_merk(1) TYPE C,
         g_park(1) TYPE C,
         g_apar(1) TYPE C.
    data: l_lines     type i,
          line1       type i,
          l_temp(500) type c,
          l_offset    type p,
          l_lineslen(2) type p,
          l_mimelen(2)  type p,
          v_spono like tsp01-rqident,
          l_tabix       like sy-tabix.
    *****VIA SELECTION-SCREEN
    ENDFORM.                    " SEND_TO_SPOOL
    *&      Form  GET_SPOOL_ID
    *&      Form  CONVERT_SPOOL_TO_PDF
    *&      Form  SEND_MAIL
    FORM SEND_MAIL .
      data:l_lin  like sy-tabix,
            l_lint like sy-tabix,
            it_list like abaplist occurs 0,
            l_newline(2) type x value '0D0A'.
    *--Data for the status output after sending
      data: user_address like sousradri1 occurs 1 with header line,
            sent_to_all like sonv-flag.
      clear: reclist, reclist[],
             objtxt , objtxt[],
             objpack, objpack[],
             objbin , objbin[],
             doc_chng.
    *--move list to office table objbin
    *--Start of Changes to support PDF attachments - UB20030116
    loop at html.
       objbin-line = html-line.
       append objbin.
       clear objbin.
    endloop.
    loop at xi_pdf.
       objbin-line = xi_pdf-text.
       append objbin.
       clear objbin.
    endloop.
    *--We may write additional text to the main document
    *--For faxing this will be the cover page. Like sending from SAPoffice
    *--the layout set Office-Telefax will be used.
      objtxt-line = 'NOTE : Please Consider the below Headers'.
      append objtxt.
      clear objtxt.
      objtxt-line = 'Assignment -->  Purchase order number '.
      append objtxt.
      clear objtxt.
      objtxt-line = 'Document  -->   Invoice No '.
      append objtxt.
      clear objtxt.
      objtxt-line = 'Amount In DC --> Amount Due '.
      append objtxt.
      clear objtxt.
      objtxt-line = '                                            '.
      append objtxt.
      clear objtxt.
      objtxt-line = '                                            '.
      append objtxt.
      clear objtxt.
      objtxt-line = 'Please find attached statement for this week'.
      append objtxt.
      clear objtxt.
      objtxt-line = '                                            '.
      append objtxt.
      clear objtxt.
      objtxt-line = 'This is an AUTO GENERATED MAIL'.
      concatenate objtxt-line 'Please Do not reply to this mail' into
      objtxt-line separated by ' '.
      append objtxt.
      clear objtxt.
      describe table objtxt lines tab_lines.
      read table objtxt index tab_lines.
    *--Create the document which is to be sent
    doc_chng-obj_name  = 'List'.
      doc_chng-obj_name = 'SAPRPT'.
    doc_chng-obj_descr = 'Customer statement for the week'.
      concatenate 'Customer statement for '
                  sy-datum into
                  doc_chng-obj_descr
                  separated by ' '.
      doc_chng-doc_size = ( tab_lines - 1 ) * 255 + strlen( objtxt ).
    *--Fill the fields of the packing_list for the main document:
    *--It is a text document
      clear objpack-transf_bin.
    *--The document needs no header (head_num = 0)
      objpack-head_start = 1.
      objpack-head_num = 0.
    *--but it has a body
      objpack-body_start = 1.
      objpack-body_num = tab_lines.
    *--of type RAW
      objpack-doc_type = 'RAW'.
      append objpack.
    *--Create the attachment (the list itself)
      describe table objbin lines tab_lines.
    *--Fill the fields of the packing_list for the attachment:
    *--It is binary document
    objpack-transf_bin = 'X'.
    *--we need no header
      objpack-head_start = 1.
      objpack-head_num = 0.
    *--but a body
      objpack-body_start = 1.
      objpack-body_num = tab_lines.
    *--of type G_DOC_TYPE
    objpack-doc_type = 'PDF'. "commented on 12/13/2007
      objpack-doc_type = 'TXT'. "commented on 12/13/2007
      objpack-obj_name = 'Attachment'.
    objpack-obj_descr = 'Customer Statement'.
      concatenate 'Customer Statement' sy-datum into objpack-obj_descr.
      objpack-doc_size = tab_lines * 255.
      append objpack.
      reclist-receiver = g_email.
      reclist-rec_type = 'U'.
    reclist-com_type = 'FAX'.
      append reclist.
      data:xi type soli.
    xi-line = 'haisdgsfsdf'.
    append xi to xi_pdf.
    xi-line = 'haisdfdsfd'.
    append xi to xi_pdf.
    xi-line = 'haisfgsdfsd'.
    append xi to xi_pdf.
    xi-line = 'haisdfsgfsdgg'.
    append xi to xi_pdf.
    *xi_pdf-text = 'hai'.
    *append xi_pdf.
    *xi_pdf-text = 'hai'.
    *append xi_pdf.
    *xi_pdf-text = 'hai'.
    *append xi_pdf.
    *xi_pdf-text = 'hai'.
    *append xi_pdf.
    CALL FUNCTION 'SO_SOLITAB_TO_SOLIXTAB'
        EXPORTING
          ip_solitab        = xi_pdf[]
       IMPORTING
         EP_SOLIXTAB       = xtext[].
    **--Send the document by calling the SAPoffice API1 module for sending
    **--documents with attachments
      call function 'SO_NEW_DOCUMENT_ATT_SEND_API1'
        EXPORTING
          document_data              = doc_chng
          PUT_IN_OUTBOX              = 'X'
         COMMIT_WORK                = 'X'
        IMPORTING
          sent_to_all                = sent_to_all
        TABLES
          packing_list               = objpack
          object_header              = objhead
         contents_bin               = objbin
          contents_txt               = objtxt
          contents_hex               = xtext
          receivers                  = reclist
        EXCEPTIONS
          too_many_receivers         = 1
          document_not_sent          = 2
          operation_no_authorization = 4
          others                     = 99.

    HI,
    There are lots of bugs.
    Please refer this sample program to fix it.
    http://www.sapdevelopment.co.uk/reporting/rep_spooltopdf.htm
    Best regards,
    Prashant

  • Powershell script - how to read a registry hive and store the value in text file and then again read the text file to write the values back in registry

    Hi All,
    powershell script Method required to read a value from registry and then taking the backup of that values in some text file.
    For example the hive is
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\Path
    and under path i need to take back up  of values in some text file and then put some value in the registry after back is taken in text file.
    Also how to read the text file values so that we can again write to registry hive  back from the back up text file.
    Your help is much appreciated.
    Umeed4u

    I think you need to read this first:
    http://social.technet.microsoft.com/Forums/scriptcenter/en-US/a0def745-4831-4de0-a040-63b63e7be7ae/posting-guidelines?forum=ITCG
    Don't retire TechNet! -
    (Don't give up yet - 12,830+ strong and growing)

  • How to make an applet to read the Text file present inside a jar

    Hi All,
    I have writen one applet named ReadFile.java which reads a text file present in the same directory and does some manipulation of text file contents.
    The applet code runs successfully when i run the applet in command prompt like
    {color:#ff0000}*java ReadFile*{color}
    And i am getting the needed results.
    Then i made a jar file with the applet code and text file as
    {color:#ff0000}*jar cvf rf.jar ReadFile.class File1.txt*{color}
    Then i have inlcuded this applet inside a html file as
    {color:#ff0000}*<applet code= "ReadFile.class" width= "500" height= "300" archive = "rf.jar" ></applet>*{color}
    after this when i load the html file, the applet code is not executed fully. Its throwing FileNotFoundException: File1.txt.
    Applet is not recognizing trhe text file present inside the jar file.
    Can any body explain me how to overcome this problem. Any setting needs to be done for making the applet indicate the presence of Text file inside the jar file.

    what code in your applet gets the text file and reads it? are you using getResource or something similar?

  • To get  a  word in the text  file

    Hi,
    I m beginner to java.
    HOw i get a word in the text file.
    I used this code, it is only display the all sentence which are available in the text file.
    But , I need to print particular word (if it is available in that text file)
    package com.beryl;
    import java.io.*;
    class FileReadTest {
    public static void main (String[] args) {
         FileReadTest f = new FileReadTest();
    f.readMyFile();
    void readMyFile() {
         BufferedReader dis =null;
    String record = null;
    int recCount = 0;
    try {
    File f = new File("E:/hello/abc.txt");
    FileInputStream fis = new FileInputStream(f);
    BufferedInputStream bis = new BufferedInputStream(fis);
    dis
    = new BufferedReader(new InputStreamReader(bis));
    while ( (record=dis.readLine()) != null ) {
    recCount++;
    System.out.println(recCount + ": " + record);
    } catch (IOException e) {
    // catch io errors from FileInputStream or readLine()
    System.out.println("Uh oh, got an IOException error!" + e.getMessage());
    } finally {
    // if the file opened okay, make sure we close it
    if (dis != null) {
         try {
    dis.close();
         } catch (IOException ioe) {
    Thanks & Regards,
    kumar

    I used this code, it is only display the all
    sentence which are available in the text file.
    But , I need to print particular word (if it
    is available in that text file)if
    String.indexOf()

  • Sending the text file in ECC 6.0

    Hi All ,
    Note: I searched the so many forums about this but didnt not get the correct solution so I am posting this.
    In 4.7 version i used the FM SO_NEW_DOCUMENT_ATT_SEND_API1 to generate the Text file, and it is working good. but now after the upgrdation to ECC 6.0 version , same program with this FM is not working same like 4.7 version.
    Is there any thing need to add or remove or Any SAP NOTE related to this?
    Thanks in advance.
    Regards,
    Bharani

    Bharani,
    I am using the same FM in ECC 6.0.   Check your data declarations. There may be a change there.
    Regards
    MPersson
    * data declarations for sending Email
    DATA:   w_text(100) TYPE c.
    DATA    w_date(10) TYPE c.
    DATA    w_url(25) TYPE c.
    DATA:   w_subject(50)   TYPE c.
    DATA:   it_packing_list LIKE sopcklsti1 OCCURS 0 WITH HEADER LINE,
            it_contents     LIKE solisti1   OCCURS 0 WITH HEADER LINE,
            it_receivers    LIKE somlreci1  OCCURS 0 WITH HEADER LINE,
            it_attachment   LIKE solisti1   OCCURS 0 WITH HEADER LINE,
            gd_cnt          TYPE i,
            gd_sent_all(1)  TYPE c,
            gd_doc_data     LIKE sodocchgi1,
            gd_error        TYPE sy-subrc.
    DATA:   it_message TYPE STANDARD TABLE OF solisti1 INITIAL SIZE 0
                                                     WITH HEADER LINE.
    * ~~~~~~~~~~~~~~ further along in your program ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      CLEAR w_url.
    * (SENDS Copy TO USER - confirms email ) 
        it_receivers-receiver   = w_url.
        it_receivers-rec_type   = 'U'.
        it_receivers-com_type   = 'INT'.
        it_receivers-notif_del  = 'X'.
        it_receivers-notif_ndel = 'X'.
        APPEND it_receivers.
      CLEAR gd_error.
    * Call the FM to post the message to SAPMAIL
      CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
        EXPORTING
          document_data              = gd_doc_data
          put_in_outbox              = 'X'
          commit_work                = 'X'
        IMPORTING
          sent_to_all                = gd_sent_all
        TABLES
          packing_list               = it_packing_list
          contents_txt               = it_message
          receivers                  = it_receivers
        EXCEPTIONS
          too_many_receivers         = 1
          document_not_sent          = 2
          document_type_not_exist    = 3
          operation_no_authorization = 4
          parameter_error            = 5
          x_error                    = 6
          enqueue_error              = 7
          OTHERS                     = 8.
    * Store function module return code
      gd_error = sy-subrc.

  • Log Error Messages in the Text File using Flex

    Hi,
    I am using try/Catch block to catch exception and am trying to write these error messages in the text file.
    I do not know how to achive such funcionality.
    looking forward for your help in this regard. Please have a look on the code as pasted below:
    private function onItemRollOver(evt : ListEvent) : void
                    try
                             var s:String= evt.target.Participation;
                               var partRange:Number = evt.rowIndex;
                            if (partRange == 2)
                                    dgCohorts.setStyle( "rollOverColor", "red" );
                            if (partRange == 7)
                                dgCohorts.setStyle( "rollOverColor", "green" );
                            dgCohorts.validateNow();
                       catch(e:Error)
                                var callLaterErrorEvent:DynamicEvent = new DynamicEvent("callLaterError");                        
                                callLaterErrorEvent.error = e;
                                systemManager.dispatchEvent(callLaterErrorEvent);
    Thanks,
    Vivek Jain

    Hi,
    I am using try/Catch block to catch exception and am trying to write these error messages in the text file.
    I do not know how to achive such funcionality.
    looking forward for your help in this regard. Please have a look on the code as pasted below:
    private function onItemRollOver(evt : ListEvent) : void
                    try
                             var s:String= evt.target.Participation;
                               var partRange:Number = evt.rowIndex;
                            if (partRange == 2)
                                    dgCohorts.setStyle( "rollOverColor", "red" );
                            if (partRange == 7)
                                dgCohorts.setStyle( "rollOverColor", "green" );
                            dgCohorts.validateNow();
                       catch(e:Error)
                                var callLaterErrorEvent:DynamicEvent = new DynamicEvent("callLaterError");                        
                                callLaterErrorEvent.error = e;
                                systemManager.dispatchEvent(callLaterErrorEvent);
    Thanks,
    Vivek Jain

Maybe you are looking for