Formatting a tab delimited file

Hello All,
I am populating a tab delimited text file with data from a resultset and I'm having problems lining up the columns properly. I tried using tabs, but the variable length of some of the entries are messing up the positioning of the data. Is there a way to create tab delimited fixed length fields with column headers? or is there some better way to do this in general?
Thanks,
James

I got it working using StringBuffers. Where I missed it was that the formatting of the text of the report originally didn't work under the
code. It was being automatically formatted when it was passed as a message in an email under javamail. I had forgotten that Outlook will do that on it's own. When I tried to make the report an attachment, the defect in the formatting became apparent.
I also got it working (better solution) using POI. That way the attachment is an .xls file, rather than tab-delimited file.
FYI,
James

Similar Messages

  • To import addresses, need format of tab delimited file

    I am trying to import addresses from my G3 PB Mozilla App. I exported addresses on G3 to both ldif and tab-delimited files and then attached to an email message which I sent to myself. I received email on Mac mini, but the 2 files showed up inline, not as attachments. I copied the ldif portion to a text file; ditto for tab-delimited. I tried importing into Address Book, but got message that format was not valid.
    Can't I just edit the tab-delimited file in TextEdit, save as RTF, and get Address Book to recognize the data?
    Thanks,
    Owen

    Hi, Did you get solution for this? Please let me know as I'm looking for the same solution. The Bank requirement is to generate a Tab delimited file but the RFFOGB_T with Format GB_BACS issues the output as below...
    Required by Bank:
    692532 73855963 RRS P R BACKLEY         169.91 GSLV
    294518 99855581 CETS PRITECTIIN         799.72 GSLV
    The output I get from SAP/DMEE:
    ........1........2........3........4........5........6....
    VOL1000004                           ....953312
                  1 <CR/LF>
    HDR1A953312S  195331200000400010001       10040 100420000000
                    <CR/LF>
    HDR2F0200000100                                   00
                    <CR/LF>
    UHL1 10041999999    000000001 DAILY  000
                    <CR/LF>
    6010392865540009960062063474662    00000115000ABC UK Ltd.       0
    1465                                <CR/LF>
    6006206347466201760062063474662    00000115000SAPBACS0000003306 C
    ONTRA            ABC UK LTD.        <CR/LF>
    EOF1A953312S  195331200000400010001       10040 100420000000
                    <CR/LF>
    EOF2F0200000100                                   00
                    <CR/LF>
    UTL10000000115000000000011500000000010000001
                    <CR/LF>
    END
                    <CR/LF>
    <END>
    Rgds,
    Stan

  • Inserting a tab delimited file

    Hi there,
    I am inserting data into a database from text files. I can easily do this in sql with csv files but I need to be able to do it with tab delimited files. I know you can do this from the built in Oracle tool (I am using express edition) but I was wandering if anyone know how to write a script for it in sql.
    Any help would be greatly appreciated.
    Thanks

    If you are using SQL Loader to load the data use below syntex
    FIELDS TERMINATED BY X'9'
    The X'9' is Hexadecimal Format -> X
    and Hex 9 is the ASCII code of the TAB character.
    Check out the link for more details:
    http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:533222350291
    Regards
    Arun

  • Download Tab Delimited file from spool!

    Hi Experts,
    Is there any way to download tab delimited txt file from spool?
    Spool is created for Statements and Invoices from Sap Script and Smartform which is in OTF format.
    I am able to download this in Text file but I need this file in tab delimited format.

    I don't understand what you want to do as it seems impossible : the spool contains miscellaneous data, not compatible with tab delimited files which are used to store 2-dimensional tables (columns, rows).

  • Re: Tab delimited file(interface prg)

    Hi,
    I have a problem with tab delimited file.
    i am getting one tab delimited file from the user i ahve to import it to the application sever and from the i will give tht prg as input to my prg and i will do some processing and accrodingly i will genrate some file in the format they need till now i dont have any problem
    but the records which have errors in the input file it self, for those records i need to generate the error file but while importing it to presentation server from application server that should be again genrate the tab delimited file .. so while genrating error file wht need to be done.. please help me...
    am i clear with my explanation
    i will reward for all usefull answers....

    If you are using a 4.7 or older systems then use this
    Declare a constant of HEX
    constants c_hextab(1) type x value '09'.
    and use this constant in concatenate statement to generate a tab character.
    Reward points please.

  • DMEE tab-delimited file required

    Dear Experts
    with trx DMEE you define file formats to be used as payment medium
    on screen 'format attributes' you indicate if fields have a fixed length or are delimited with a character
    what to do when you want to have a tab-delimited file?
    Regards Ben

    Hi, Did you get solution for this? Please let me know as I'm looking for the same solution. The Bank requirement is to generate a Tab delimited file but the RFFOGB_T with Format GB_BACS issues the output as below...
    Required by Bank:
    692532 73855963 RRS P R BACKLEY         169.91 GSLV
    294518 99855581 CETS PRITECTIIN         799.72 GSLV
    The output I get from SAP/DMEE:
    ........1........2........3........4........5........6....
    VOL1000004                           ....953312
                  1 <CR/LF>
    HDR1A953312S  195331200000400010001       10040 100420000000
                    <CR/LF>
    HDR2F0200000100                                   00
                    <CR/LF>
    UHL1 10041999999    000000001 DAILY  000
                    <CR/LF>
    6010392865540009960062063474662    00000115000ABC UK Ltd.       0
    1465                                <CR/LF>
    6006206347466201760062063474662    00000115000SAPBACS0000003306 C
    ONTRA            ABC UK LTD.        <CR/LF>
    EOF1A953312S  195331200000400010001       10040 100420000000
                    <CR/LF>
    EOF2F0200000100                                   00
                    <CR/LF>
    UTL10000000115000000000011500000000010000001
                    <CR/LF>
    END
                    <CR/LF>
    <END>
    Rgds,
    Stan

  • Importing data from tab delimited file

    Hi everyone,
    This is my first question on here so I hope I am doing the right thing.
    I've searched online as much as I can to find an answer or a way to fix my problem but I have not been able to find a resolution.
    My issue is I'm trying to import name and contact information from a excel file, that I have saved as a tab delimited file, into a fillable PDF file. I'm able select the text file through the import option and it shows the correct information as different rows that I can import but when I select one and click on to finish the import of the data I get an error message advising that some of the text could not be imported. The issue is nothing is being imported at all.
    I've made sure that all the relevant fields are the same name as what the form has but still cannot get anything to import.
    Does anyone have any ideas why this may not be working? Also I basically have no ability to write JavaScript to import the information otherwise I would look at travelling down that path.
    Please let me know if I need to be any more specific.
    Regards,
    Adam

    Ok I can share the form itself and will need to quickly create some data itself to go along with it
    PDF Form Shared Files - Acrobat.com 
    Here is the tab delimited file I am trying to use (well the format anyway).
    Test Data File Shared Files - Acrobat.com
    Adam
    Thanks Pat Willener

  • How to extract a tab delimiter file on appli server in openhub destination

    Hi All,
    in my scenario i want download a file on application server in tab delimiter file where iam not able to do it.while creating  OHD iam selecting seperator feild has ';'(semicolan).tab delimiter fule format is not posible with semicolan and even i tried it with "comma" also but not getting the tab delimiter formate.please help how to get that particular format..
    thanks
    vamshi..

    Hi Dashyam,
    May help you:----
    with comma delimiter file read
    I want to download comma delimiter file on to presentation server from inte
    http://wiki.sdn.sap.com/wiki/display/ABAP/UploadaCommaDelimitedCSVfilethatcontainscommasindata+fields
    Regards,
    Suman

  • Attaching a tab delimited file to mail

    Hi,
    I have to attach a tab delimited file to a mail and sent it using Function Module 'SO_DOCUMENT_SEND_API1'.
    I have filled in the following details but i am not sure about what should be given for 'lt_packing_list-doc_type'. Should it be a 'TXT 'or any other file format. Some one has suggested me a 'CSV' but i guess for that the data should be separated by a comma and i need a tab delimited file.
    Please suggest me what needs to be done.
    Thank you,
    Taher
      DATA:
            con_tab  TYPE c VALUE cl_abap_char_utilities=>horizontal_tab,
            con_cret TYPE c VALUE cl_abap_char_utilities=>cr_lf.
      LOOP AT gt_output INTO ls_output.
        CONCATENATE ls_output-email
                    ls_output-pos
                    ls_output-txt
                    ls_output-func
                    ls_output-mail
                 INTO gt_attach SEPARATED BY con_tab.
        CONCATENATE con_cret gt_attach  INTO gt_attach.
        CONDENSE gt_attach.
        APPEND  gt_attach.
    * Fill the document data.
      lv_xdocdata-doc_size = 1.
    * Populate the subject/generic message attributes
      lv_xdocdata-obj_langu = sy-langu.
      lv_xdocdata-obj_name  = 'SAPRPT'.
      lv_xdocdata-obj_descr = 'Report' .
    * Fill the document data and get size of attachment
      CLEAR lv_xdocdata.
      READ TABLE gt_attach INDEX lv_xcnt.
      lv_xdocdata-doc_size =
         ( lv_xcnt - 1 ) * 255 + STRLEN( gt_attach ).
      lv_xdocdata-obj_langu  = sy-langu.
      lv_xdocdata-obj_name   = 'SAPRPT'.
      lv_xdocdata-obj_descr  = ' Report'.
      CLEAR lt_attachment.  REFRESH lt_attachment.
      lt_attachment[] = gt_attach[].
    * Describe the body of the message
      CLEAR lt_packing_list.  REFRESH lt_packing_list.
      lt_packing_list-transf_bin = space.
      lt_packing_list-head_start = 1.
      lt_packing_list-head_num = 0.  lt_packing_list-body_start = 1.
      DESCRIBE TABLE lt_message LINES lt_packing_list-body_num.
      lt_packing_list-doc_type = 'RAW'.
      APPEND lt_packing_list.
    * Create attachment notification
      lt_packing_list-transf_bin = 'X'.
      lt_packing_list-head_start = 1.
      lt_packing_list-head_num   = 1.
      lt_packing_list-body_start = 1.
      DESCRIBE TABLE lt_attachment LINES lt_packing_list-body_num.
      lt_packing_list-doc_type   =  ?????. "TXT or any other format
      lt_packing_list-obj_descr  =  'Report'.
      lt_packing_list-obj_name   =  'Report'.
      lt_packing_list-doc_size   =  lt_packing_list-body_num * 255.
      APPEND lt_packing_list.
    * Add the recipients email address
      LOOP AT gt_receivers INTO ls_receivers.
        CLEAR lt_receivers.
        lt_receivers-receiver = ls_receivers.
        lt_receivers-rec_type = 'U'.
        lt_receivers-com_type = 'INT'.
        APPEND lt_receivers.
      ENDLOOP.

    Hi Taher,
    Which table you populate your data to (CONTENTS_BIN,CONTENTS_TXT,CONTENTS_HEX) ?.
    As both the message and attachment reside one table (contents_txt) in it_packing_list body of message should start with 1 line, but of an attachment when body of message ends. This is:
    * Describe the body of the message
      CLEAR lt_packing_list.  REFRESH lt_packing_list.
      lt_packing_list-transf_bin = space.
      lt_packing_list-head_start = 1.
      lt_packing_list-head_num = 0.  lt_packing_list-body_start = 1.
      DESCRIBE TABLE lt_message LINES lt_packing_list-body_num.
      lt_packing_list-doc_type = 'RAW'.
      APPEND lt_packing_list.
    * Create attachment notification
      lt_packing_list-transf_bin = 'X'.
      lt_packing_list-head_start = 1.
      lt_packing_list-head_num   = 1.
      lt_packing_list-body_start =  "start of attachemnt with next line after body of message
    Next thing is what I appointed before. Both should be passed as ASCII so in both  lt_packing_list-transf_bin = space.
    Please see my code.
    CONSTANTS: con_cret(2) type c VALUE cl_abap_char_utilities=>cr_lf,
               con_tab(2)  TYPE c VALUE cl_abap_char_utilities=>horizontal_tab.
    DATA: doc_attr TYPE sodocchgi1,
          it_packing_list TYPE TABLE OF sopcklsti1 WITH HEADER LINE,
          it_message TYPE TABLE OF solisti1 WITH HEADER LINE,
          it_attachment TYPE TABLE OF solisti1 WITH HEADER LINE,
          it_txt TYPE TABLE OF solisti1 WITH HEADER LINE,
          it_receivers TYPE TABLE OF somlreci1 WITH HEADER LINE.
    "Document attributes
    doc_attr-obj_name = 'EXT_MAIL'.
    doc_attr-obj_descr = 'External test mail'.   "title
    doc_attr-obj_langu = sy-langu.
    doc_attr-sensitivty = 'F'.      "functional message
    "Message in ASCII (txt) format
    APPEND 'This is body message' TO it_message.   "message is from 1 to 2
    APPEND 'and second line for message.' TO it_message.
    APPEND LINES OF it_message TO it_txt.
    "Determine how data are distrtibuted to document and attachment
    "First line in it_packing describes message body
    it_packing_list-transf_bin = space.  "ASCII format
    it_packing_list-body_start = 1.      "message body starts from 1st line
    DESCRIBE TABLE it_message LINES it_packing_list-body_num.  "lines in it_txt table for message body
    it_packing_list-doc_type = 'RAW'.
    APPEND it_packing_list.
    "Attachment in ASCII (txt) format
    CONCATENATE '1first' 'second' 'third' 'fourth' into it_attachment SEPARATED BY con_tab.   "first line
    CONCATENATE con_cret it_attachment.
    APPEND it_attachment.
    CONCATENATE '2first' 'second' 'third' 'fourth' into it_attachment SEPARATED BY con_tab. "second line
    CONCATENATE it_attachment con_cret into it_attachment.
    APPEND it_attachment.
    APPEND LINES OF it_attachment TO it_txt.
    "Further lines in it_packing describe attachment
    CLEAR it_packing_list.
    it_packing_list-transf_bin = space.  "ASCII format
    it_packing_list-body_start = 3.
    DESCRIBE TABLE it_attachment LINES it_packing_list-body_num.
    it_packing_list-doc_type = 'txt'.
    it_packing_list-obj_name = 'Test attachment'.
    it_packing_list-obj_descr = 'Title of an attachment'.
    it_packing_list-obj_langu = sy-langu.
    "size od attachment = length of last line + all remaining lines * 255
    READ TABLE it_attachment INDEX it_packing_list-body_num.
    it_packing_list-doc_size = STRLEN( it_attachment ) + 255 * ( it_packing_list-body_num - 1 ).
    APPEND it_packing_list.
    "Receivers
    it_receivers-receiver = "some mail address.
    it_receivers-rec_type = 'U'.  "internet address
    it_receivers-com_type = 'INT'. "send via internet
    APPEND it_receivers.
    CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
      EXPORTING
        document_data                    = doc_attr
        put_in_outbox                    = 'X'
        commit_work                      = 'X'
    * IMPORTING
    *   SENT_TO_ALL                      =
    *   NEW_OBJECT_ID                    =
      TABLES
        packing_list                     = it_packing_list
    *   OBJECT_HEADER                    =
    *   CONTENTS_BIN                     =
       contents_txt                     = it_txt
    *   CONTENTS_HEX                     =
    *   OBJECT_PARA                      =
    *   OBJECT_PARB                      =
        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
    IF sy-subrc = 0.
      WAIT UP TO 2 SECONDS.
      SUBMIT rsconn01 WITH mode = 'INT'
    *                    WITH ouput = 'X'
                      AND RETURN.
    ENDIF.
    I am using SO01 t-code to see the document and attachemnt.
    I am sure when you get rid of the differences with the codes you will get desired result.
    Regards
    Marcin

  • Upload tab-delimited file from the application server to an internal table

    Hello SAPients.
    I'm using OPEN DATASET..., READ DATASET..., CLOSE DATASET to upload a file from the application server (SunOS). I'm working with SAP 4.6C. I'm trying to upload a tab-delimited file to an internal table but when I try load it the fields are not correctly separated, in fact, they are all misplaced and the table shows '#' where supposedly there was a tab.
    I tried to SPLIT the line using as separator a variable with reference to CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB but for some reason that class doesn't exist in my system.
    Do you know what I'm doing wrong? or Do you know a better method to upload a tab-delimited file into an internal table?
    Thank you in advance for your help.

    Try:
    REPORT ztest MESSAGE-ID 00.
    PARAMETER: p_file LIKE rlgrap-filename   OBLIGATORY.
    DATA: BEGIN OF data_tab OCCURS 0,
          data(4096),
          END   OF data_tab.
    DATA: BEGIN OF vendor_file_x OCCURS 0.
    * LFA1 Data
    DATA: mandt  LIKE bgr00-mandt,
          lifnr  LIKE blf00-lifnr,
          anred  LIKE blfa1-anred,
          bahns  LIKE blfa1-bahns,
          bbbnr  LIKE blfa1-bbbnr,
          bbsnr  LIKE blfa1-bbsnr,
          begru  LIKE blfa1-begru,
          brsch  LIKE blfa1-brsch,
          bubkz  LIKE blfa1-bubkz,
          datlt  LIKE blfa1-datlt,
          dtams  LIKE blfa1-dtams,
          dtaws  LIKE blfa1-dtaws,
          erdat  LIKE  lfa1-erdat,
          ernam  LIKE  lfa1-ernam,
          esrnr  LIKE blfa1-esrnr,
          konzs  LIKE blfa1-konzs,
          ktokk  LIKE  lfa1-ktokk,
          kunnr  LIKE blfa1-kunnr,
          land1  LIKE blfa1-land1,
          lnrza  LIKE blfa1-lnrza,
          loevm  LIKE blfa1-loevm,
          name1  LIKE blfa1-name1,
          name2  LIKE blfa1-name2,
          name3  LIKE blfa1-name3,
          name4  LIKE blfa1-name4,
          ort01  LIKE blfa1-ort01,
          ort02  LIKE blfa1-ort02,
          pfach  LIKE blfa1-pfach,
          pstl2  LIKE blfa1-pstl2,
          pstlz  LIKE blfa1-pstlz,
          regio  LIKE blfa1-regio,
          sortl  LIKE blfa1-sortl,
          sperr  LIKE blfa1-sperr,
          sperm  LIKE blfa1-sperm,
          spras  LIKE blfa1-spras,
          stcd1  LIKE blfa1-stcd1,
          stcd2  LIKE blfa1-stcd2,
          stkza  LIKE blfa1-stkza,
          stkzu  LIKE blfa1-stkzu,
          stras  LIKE blfa1-stras,
          telbx  LIKE blfa1-telbx,
          telf1  LIKE blfa1-telf1,
          telf2  LIKE blfa1-telf2,
          telfx  LIKE blfa1-telfx,
          teltx  LIKE blfa1-teltx,
          telx1  LIKE blfa1-telx1,
          xcpdk  LIKE  lfa1-xcpdk,
          xzemp  LIKE blfa1-xzemp,
          vbund  LIKE blfa1-vbund,
          fiskn  LIKE blfa1-fiskn,
          stceg  LIKE blfa1-stceg,
          stkzn  LIKE blfa1-stkzn,
          sperq  LIKE blfa1-sperq,
          adrnr  LIKE  lfa1-adrnr,
          mcod1  LIKE  lfa1-mcod1,
          mcod2  LIKE  lfa1-mcod2,
          mcod3  LIKE  lfa1-mcod3,
          gbort  LIKE blfa1-gbort,
          gbdat  LIKE blfa1-gbdat,
          sexkz  LIKE blfa1-sexkz,
          kraus  LIKE blfa1-kraus,
          revdb  LIKE blfa1-revdb,
          qssys  LIKE blfa1-qssys,
          ktock  LIKE blfa1-ktock,
          pfort  LIKE blfa1-pfort,
          werks  LIKE blfa1-werks,
          ltsna  LIKE blfa1-ltsna,
          werkr  LIKE blfa1-werkr,
          plkal  LIKE  lfa1-plkal,
          duefl  LIKE  lfa1-duefl,
          txjcd  LIKE blfa1-txjcd,
          sperz  LIKE  lfa1-sperz,
          scacd  LIKE blfa1-scacd,
          sfrgr  LIKE blfa1-sfrgr,
          lzone  LIKE blfa1-lzone,
          xlfza  LIKE  lfa1-xlfza,
          dlgrp  LIKE blfa1-dlgrp,
          fityp  LIKE blfa1-fityp,
          stcdt  LIKE blfa1-stcdt,
          regss  LIKE blfa1-regss,
          actss  LIKE blfa1-actss,
          stcd3  LIKE blfa1-stcd3,
          stcd4  LIKE blfa1-stcd4,
          ipisp  LIKE blfa1-ipisp,
          taxbs  LIKE blfa1-taxbs,
          profs  LIKE blfa1-profs,
          stgdl  LIKE blfa1-stgdl,
          emnfr  LIKE blfa1-emnfr,
          lfurl  LIKE blfa1-lfurl,
          j_1kfrepre  LIKE blfa1-j_1kfrepre,
          j_1kftbus   LIKE blfa1-j_1kftbus,
          j_1kftind   LIKE blfa1-j_1kftind,
          confs  LIKE  lfa1-confs,
          updat  LIKE  lfa1-updat,
          uptim  LIKE  lfa1-uptim,
          nodel  LIKE blfa1-nodel.
    DATA: END   OF vendor_file_x.
    FIELD-SYMBOLS:  <field>,
                    <field_1>.
    DATA: delim          TYPE x        VALUE '09'.
    DATA: fld_chk(4096),
          last_char,
          quote_1     TYPE i,
          quote_2     TYPE i,
          fld_lth     TYPE i,
          columns     TYPE i,
          field_end   TYPE i,
          outp_rec    TYPE i,
          extras(3)   TYPE c        VALUE '.,"',
          mixed_no(14) TYPE c        VALUE '1234567890-.,"'.
    OPEN DATASET p_file FOR INPUT.
    DO.
      READ DATASET p_file INTO data_tab-data.
      IF sy-subrc = 0.
        APPEND data_tab.
      ELSE.
        EXIT.
      ENDIF.
    ENDDO.
    * count columns in output structure
    DO.
      ASSIGN COMPONENT sy-index OF STRUCTURE vendor_file_x TO <field>.
      IF sy-subrc <> 0.
        EXIT.
      ENDIF.
      columns = sy-index.
    ENDDO.
    * Assign elements of input file to internal table
    CLEAR vendor_file_x.
    IF columns > 0.
      LOOP AT data_tab.
        DO columns TIMES.
          ASSIGN space TO <field>.
          ASSIGN space TO <field_1>.
          ASSIGN COMPONENT sy-index OF STRUCTURE vendor_file_x TO <field>.
          SEARCH data_tab-data FOR delim.
          IF sy-fdpos > 0.
            field_end = sy-fdpos + 1.
            ASSIGN data_tab-data(sy-fdpos) TO <field_1>.
    * Check that numeric fields don't contain any embedded " or ,
            IF <field_1> CO mixed_no AND
               <field_1> CA extras.
              TRANSLATE <field_1> USING '" , '.
              CONDENSE <field_1> NO-GAPS.
            ENDIF.
    * If first and last characters are '"', remove both.
            fld_chk = <field_1>.
            IF NOT fld_chk IS INITIAL.
              fld_lth = strlen( fld_chk ) - 1.
              MOVE fld_chk+fld_lth(1) TO last_char.
              IF fld_chk(1) = '"' AND
                 last_char = '"'.
                MOVE space TO fld_chk+fld_lth(1).
                SHIFT fld_chk.
                MOVE fld_chk TO <field_1>.
              ENDIF.       " for if fld_chk(1)=" & last_char="
            ENDIF.         " for if not fld_chk is initial
    * Replace "" with "
            DO.
              IF fld_chk CS '""'.
                quote_1 = sy-fdpos.
                quote_2 = sy-fdpos + 1.
                MOVE fld_chk+quote_2 TO fld_chk+quote_1.
              ELSE.
                MOVE fld_chk TO <field_1>.
                EXIT.
              ENDIF.
            ENDDO.
            <field> = <field_1>.
          ELSE.
            field_end = 1.
          ENDIF.
          SHIFT data_tab-data LEFT BY field_end PLACES.
        ENDDO.
        APPEND vendor_file_x.
        CLEAR vendor_file_x.
      ENDLOOP.
    ENDIF.
    CLEAR   data_tab.
    REFRESH data_tab.
    FREE    data_tab.
    Rob

  • Read Tab delimited File from Application server

    Hi Experts,
    I am facing problem while reading file from Application server.
    File in Application server is stored as follows, The below file is a tab delimited file.
    ##K#U#N#N#R###T#I#T#L#E###N#A#M#E#1###N#A#M#E#2###N#A#M#E#3###N#A#M#E#4###S#O#R#T#1###S#O#R#T#2###N#A#M#E#_#C#O###S#T#R#_#S#U#P#P#L#1###S#T#R#_#S#U#P#P#L#2###S#T#R#E#E#T###H#O#U#S#E#_#N#U#M#1
    i have downloaded this file from Application server using Transaction CG3Y. the Downloaded file is a tab delimited file and i could not see "#' in the file,
    The code is as Below.
    c_split  TYPE abap_char1 VALUE cl_abap_char_utilities=>horizontal_tab.
    here i am using IGNORING CONVERSION ERRORS in order to avoid Conversion Error Short Dump.
    OPEN DATASET wa_filename-file FOR INPUT IN TEXT MODE ENCODING DEFAULT IGNORING CONVERSION ERRORS.
          IF sy-subrc = 0.
            WRITE : /,'...Processing file - ', wa_filename-file.   
           DO.
          Read the contents of file
              READ DATASET wa_filename-file INTO wa_file-data.
              IF sy-subrc = 0.
                SPLIT wa_file-data AT c_split INTO wa_adrc_2-kunnr
                                                   wa_adrc_2-title
                                                   wa_adrc_2-name1
                                                   wa_adrc_2-name2
                                                   wa_adrc_2-name3
                                                   wa_adrc_2-name4
                                                   wa_adrc_2-name_co
                                                   wa_adrc_2-city1
                                                   wa_adrc_2-city2
                                                   wa_adrc_2-regiogroup
                                                   wa_adrc_2-post_code1
                                                   wa_adrc_2-post_code2
                                                   wa_adrc_2-po_box
                                                   wa_adrc_2-po_box_loc
                                                   wa_adrc_2-transpzone
                                                   wa_adrc_2-street
                                                   wa_adrc_2-house_num1
                                                   wa_adrc_2-house_num2
                                                   wa_adrc_2-str_suppl1
                                                   wa_adrc_2-str_suppl2
                                                   wa_adrc_2-country
                                                   wa_adrc_2-langu
                                                   wa_adrc_2-region
                                                   wa_adrc_2-sort1
                                                   wa_adrc_2-sort2
                                                   wa_adrc_2-deflt_comm
                                                   wa_adrc_2-tel_number
                                                   wa_adrc_2-tel_extens
                                                   wa_adrc_2-fax_number
                                                   wa_adrc_2-fax_extens
                                                   wa_adrc_2-taxjurcode.
    WA_FILE-DATA is having below values
    ##K#U#N#N#R###T#I#T#L#E###N#A#M#E#1###N#A#M#E#2###N#A#M#E#3###N#A#M#E#4###S#O#R#T#1###S#O#R#T#2###N#A#M#E#_#C#O###S#T#R#_#S#U#P#P#L#1###S#T#R#_#S#U#P#P#L#2###S#T#R#E#E#T###H#O#U#S#E#_#N#U#M#1
    And this is split by tab delimited and moved to other variables as shown above.
    Please guide me how to read the contents without "#' from the file.
    I have tried all possible ways and unable to get solution.
    Thanks,
    Shrikanth

    Hi ,
    In ECC 6 if all the unicode patches are applied then UTF 16 will defintly work..
    More over i would suggest you to ist replace # with some other  * or , and then try to see in debugging if any further  # appears..
    and no # appears then try to split now.
    if even now the # appears after replace statement then try to find out what exactly is it... wheather it is a horizantal tab etc....
    and then again try to replace it and then split..
    Please follow the process untill all the # are replaced...
    This should work for you..
    Let me know if you further face any issue...
    Regards
    Satish Boguda

  • GUI_Download problem in tab delimited file

    Hi,
    I am trying to download tab delimited file using F.M GUI_DOWNLOAD.We have
    4.6C version.I have declared internal table with 5 columns.The file created using F.M is very strange.Column 1 and 2 and 3 and 4 are seaprated by tab but column 2
    and 3  and column 4 and 5 are not seaprated by tab but have fixed length.
    I am not getting where I am doing mistake.Any help is appericiated.
    Below is the structure of internal table.
    DATA:BEGIN OF IT_FINAL OCCURS 0,
           Company(3) type c,
           County(30) type c,
           FId(35) type c,
           Wellno(15) type c,
           Welldesc(35) type c,
         END OF IT_FINAL.
    Data populated in table it_final.
    it_final-Company = '300'.
    it_final-County = 'Greenwood'.
    it_final-fid = 'testts'.
    it_final-wellno = '10000000'.
    it_final-welldesc = 'tebsbvd'.
    append it_final.
    F.M GUI_DOWNLOAD
    CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
        BIN_FILESIZE                  =
          filename                      = l_path
        FILETYPE                      = 'ASC'
        APPEND                        = ' '
          write_field_separator         = 'X'
        HEADER                        = '00'
        TRUNC_TRAILING_BLANKS         = ' '
        WRITE_LF                      = 'X'
        COL_SELECT                    = ' '
        COL_SELECT_MASK               = ' '
        DAT_MODE                      = ' '
      IMPORTING
        FILELENGTH                    =
        TABLES
          data_tab                      = it_final
         EXCEPTIONS
         file_write_error              = 1
         no_batch                      = 2
         gui_refuse_filetransfer       = 3
         invalid_type                  = 4
         no_authority                  = 5
         unknown_error                 = 6
         header_not_allowed            = 7
         separator_not_allowed         = 8
         filesize_not_allowed          = 9
         header_too_long               = 10
         dp_error_create               = 11
         dp_error_send                 = 12
         dp_error_write                = 13
         unknown_dp_error              = 14
         access_denied                 = 15
         dp_out_of_memory              = 16
         disk_full                     = 17
         dp_timeout                    = 18
         file_not_found                = 19
         dataprovider_exception        = 20
         control_flush_error           = 21
         OTHERS                        = 22
    Thanks,
    Rekha.

    Hi,
    i think it is because tou need to uncomment:
         FILETYPE                      = 'ASC'
    try it.
    Best regards.

  • Tab Delimited File?

    Hi All,
             I am trying to create a tab delimited file using Sender File adapter using <b>File content Conversion in Adapter Module</b>. I want a constant space beteween the fields of length 8 spaces. When i use '        ' as field seperater , the file that is generated is <b>19'     'Stringtest14,Hiring'     '09/03/2007'     'Managing Dir, Operations</b>. I want the file without colons i.e <b>19     Stringtest14,Hiring'     09/03/2007     Managing Dir, Operations</b>.
    Please Advice...
    Regards,
    XIer

    Hi Xler
    <b>content conversion parameters  ,, just like</b>
    Recordset structure = DT_PRY,*
    DT_PRY.fieldnames = ID,empname,empno,country
    DT_PRY.fieldSeparator = '0x09' (tab delimited)
    DT_PRY.endSeparator = 'nl'
    <b>
    The FCC...</b>
    Document Name : MT_PRY
    Document Namespace : http://product.com/prvsoup
    Recordset Name : recordset
    Recordset structure = DT_PRY,*
    DT_PRY.fieldnames = ID,empname,empno,country
    DT_PRY.fieldSeparator = '0x09'
    DT_PRY.endSeparator = 'nl'
    ignoreRecordsetName = true
    http://help.sap.com/saphelp_nw04/helpdata/en/14/80243b4a66ae0ce10000000a11402f/frameset.htm
    <b>can take the help of this blog</b>
    /people/shabarish.vijayakumar/blog/2005/08/17/nab-the-tab-file-adapter
    <b>Conversion agent</b>
    /people/william.li/blog/2006/03/17/how-to-get-started-using-conversion-agent-from-itemfield
    /people/paul.medaille/blog/2005/11/18/conversion-agent-a-free-lunch
    /people/alexander.bundschuh/blog/2006/03/14/integrate-sap-conversion-agent-by-itemfield-with-sap-xi
    /people/paul.medaille/blog/2005/11/17/more-on-the-sap-conversion-agent-by-itemfield
    Thanks!
    Questions are welcome here!!
    <b>Also mark helpful answers by rewarding points</b>
    Regards
    Abhishek Agrahari

  • Import text into a form from a tab delimited file using an action

    Good evening.
    I am using Adobe Acrobat XI Pro
    I have been working all weekend so far on this, and have tried many options.
    What I am wanting is to import a line of data from an excel file into a form, save the file with a name drived from the form fields, close the new file, then go back to the original file, import a line of data, and so on and so on.
    I had all of this working in livecyle with a tool, but now that we are going to Windows 8 and Microsoft Office 2013, the driver that I need to load the excel file into the form is not available--so now I have to redo the forms in Adobe and import using a tab delimited file.
    I would like to do this with an action.
    Thus far, I have the following.
    **Credit goes to George Johnson who helped me with the script to save the file using field names a few months ago**
    To start, I have a folder level script
    mySaveAs = app.trustPropagatorFunction(function(doc,path)
    app.beginPriv();
    var myDoc = event.target;
    myDoc.saveAs(path);
    app.endPriv();
    myTrustedSpecialTaskFunc = app.trustedFunction(function(doc,path)
    //privileged and/or non-privileged code above
    app.beginPriv();
    mySaveAs(doc, path);
    app.endPriv
    //Privileged and/or non-privileged code below
    For the Action, I start with the Form file loaded
    Then I execute a javascript to import the text into the file.
    this.importTextData("/c/data/clerical.txt");
    The next step is to save the file using field names as part of the file name
    --credit goes to George Johnson who assisted me with this on a similar project a few months ago.
    //Get the Field Value
    var fn=getField("Last").valueAsString + "-" + getField("First").valueAsString;
    //Specify the folder
    var fldr = "/c/data/";
    //Determine the full path
    var fp=fldr + fn + ".pdf";
    //save the file
    myTrustedSpecialTaskFunc(this, fp);
    That is as far as I have gotten. 
    What I want to do now is load the original form file, import the next line into the form, save the file, repeat.
    If anyone could assist me, I would greatly appreciate it.
    **note  I had to type this from my I-pad because I kept getting kicked off the internet from my computer.  I hope my code is typed correctly.

    George
    Thank you so much for your response.
    Yes--there are multiple lines in the data file--it will vary from month to month.  It looks like from what you are saying is that I need to do the global variable since it will constantly change, and then increment it as it goes through the text file.  When it reaches the end, then it will stop.
    I looked at the following links--but this is from Adobe 9 API--I don't know if things have changed with XI--especially since 9 used batch processing and XI has actions.
    Count PDF Files
    http://help.adobe.com/livedocs/acrobat_sdk/9.1/Acrobat9_1_HTMLHelp/wwhelp/wwhimpl/js/html/ wwhelp.htm?href=JS_API_AcroJS.88.1.html
    Global counter
    http://help.adobe.com/livedocs/acrobat_sdk/9.1/Acrobat9_1_HTMLHelp/wwhelp/wwhimpl/js/html/ wwhelp.htm?href=JS_API_AcroJS.88.1.html
    I am not exactly sure how to include this in my code.
    If you could point me in the right direction, I would appreciate it.

  • How to convert Mail attachment file Tab Delimited file to XML.

    Hi PI Experts
        I have XI scenario: MAIL  XI SAP (ABAP Proxy), the process is
    1.     XI will receive tab delimited file as attachment in mail.
    2.     XI will convert the tab delimited file into XML, then map to the target structure.
    3.     Target will be posted into ECC through ABAP Proxy.
    Can anyone help me how can I convert the attachment file (i.e. Tab delimited file) to XML while configuring the sender side.
    Thanks in Advance

    I just grabed what I answered from another thread. It should work.
    Processing sequence as follows:
    1. localejbs/AF_Modules/PayloadSwapBean Local Enterprise Bean swap1
    2. localejbs/AF_Modules/MessageTransformBean Local Enterprise Bean tran1
    3. sap.com/com.sap.aii.adapter.mail.app/XIMailAdapterBean Local Enterprise Bean mail
    Module Configuration as follows: Fill the XXXX part with your info.
    swap1 swap.keyName payload-name
    swap1 swap.keyValue MailAttachment-1
    tran1 Transform.Class com.sap.aii.messaging.adapter.Conversion
    tran1 Transform.ContentType ext/xml;charset=utf-8
    tran1 xml.conversionType SimplePlain2XML
    tran1 xml.documentName XXXXXXX_Mail
    tran1 xml.documentNamespace http://XXXXX.com.au/XXXX
    tran1 xml.fieldSeparator \t
    tran1 xml.processFieldNames fromConfiguration
    tran1 xml.structureTitle rows
    Once you set up the above configuration, you will get one record at a time.
    Create a souce message interface like the followings:
    XXXXXXXXX_Mail
    rows
    record
    Target message interface:
    XXXXXXXXX
    rows
    field 1
    field 2
    field 3
    Write a UDF function to remove the TAB space
    public removeTABSpace(String record,Container container){
    //write your code here
    StringTokenizer st = new StringTokenizer(record,"\t",false);
    String t="";
    while (st.hasMoreElements()) t += st.nextElement();
    return t;
    Write another UDF to get the field 1 for example:
    public String getField1(String input,Container container){
    int counter=0;
    int beginIndex=0;
    int endIndex=0;
    int i;
    for (i=0;i<input.length();i++){
    if (input.charAt(i)==34){
    counter=counter+1;
    if (counter==1){
    beginIndex=i+1;
    counter=0;
    break;
    for (i=0;i<input.length();i++){
    if (input.charAt(i)==34){
    counter=counter+1;
    if (counter==2){
    endIndex=i;
    counter=0;
    break;
    input=input.substring(beginIndex,endIndex);
    return input;
    Get the mapping like the followings:
    record - removeTABSpace - getField1 - field 1
    If you need to get field 2, you will need to write another UDF similar to the above one to handle it.

Maybe you are looking for

  • Nearly new Laptop in for repair, comes back broken, no help from Lenovo.

    In February of this year I purchased a built to order Lenovo Thinkpad W510. It's a beautiful machine, and I was overwhelmingly satisfied for until about two weeks ago when the screen randomly went berserk, crazy flashing and horizontal lines all over

  • Copy CLOB to BLOB

    Hi, Oracle 9.2.0.8 How can I copy a CLOB to a BLOB ? Thanks

  • Authorizations....Sales organization level

    Hi all I want to create the authorizations for the sales organization level. I have made the Sales Organization Object authorization relevant. After that i created an authorization object based on the Sales org object. I created a roles and created a

  • How to assign BOM & Routing to Prod Version.

    Dear Frndz, Pls tell me how to assign BOM & Routing to Prod Version.This is to execute the REM flow. Regards, Srini

  • DMA2200 video playback skip pauses with Windows 7

    Had DMA2200 connected to Vista Media center and all was working fine. Have upgraded to Windows 7 and when playing back recorded TV and trying to skip forward or back it has big pauses. Playback will stop for about 10 sec and often when it starts agai