EXTRACTing to TEXT file in Data Warehouse - Simple doubts!

Hi Experts,
Pls. clarify my simple doubts, in data EXTRACTing prog.,(data extract from SAP to text file in Application server, prog. runs in back ground)
For the Dataware house mapping, I hv been asked to make the following changes,
1) Presently, there is NO column headings in Text file, so I need to add the column Headings - How to get it done?
2) presently, its NOT tab deliminated, so, I need to make it to TAB deliminated- How to achieve it?
I am here paste some piece of code, so that U will get understand well.
PERFORM open_dataset_zdata_whouse_04.
    DESCRIBE FIELD i_tab LENGTH tfr_length IN BYTE MODE.
    LOOP AT i_itab.
      TRANSFER i_itab TO transfer_file1 LENGTH tfr_length.
    ENDLOOP.
    CLOSE DATASET transfer_file1.
ThaNQ.

See the below code :
parameters: d1 type localfile default
'/usr/sap/TST/SYS/Test.txt'.
data: begin of itab occurs 0,
      field1(20) type c,
      field2(20) type c,
      field3(20) type c,
      end of itab.
data: str type string.
constants: con_tab type x value '09'.
if you have a newer version, then you can use this
instead.
*constants:
   con_tab  type c value
cl_abap_char_utilities=>HORIZONTAL_TAB.
start-of-selection.
itab-field1 = 'ABC'.
itab-field2 = 'DEF'.
itab-field3 = 'GHI'.
append itab.
itab-field1 = '123'.
itab-field2 = '456'.
itab-field3 = '789'.
append itab.
  open dataset d1 for output in text mode.
  loop at itab.
    translate itab using ' # '.
    concatenate itab-field1 itab-field2 itab-field2
into str
                  separated by con_tab.
    translate str using ' # '.
    transfer str to d1.
  endloop.
  close dataset d1.
above code for tab delimited.
for heading then you can write simple logic in the loop of internal table
loop at itab.
if sy-tabix = 1'
move heading data to file.
endif.
endloop.
Thanks
Seshu

Similar Messages

  • How to create a text file with data.

    Hi,
    I am writing java code for testing an application, some times test can failed in some cases, I want to display an error message in text file. To that I written the code as like,
    BufferedWriter bout;
    bout =new BufferedWriter(new FileWriter("test.txt"));
    String str=”Your input data is not match with pattern”
    bout.write(str);but here it is creating a text file “ test” without any data in it.
    Can any body help that to execute the program properly
    Regards
    Buntty

    sabre150 wrote:
    JoachimSauer wrote:
    You didn't close your BufferedWriter. Since it's buffered it probably didn't write anything to the underlying file.
    Generally you must close every Writer/OutputStream that you no longer use or it won't be written reliably.It's not quite as simple as that. If you have a chain of Writers / OutputStreams then you only have to close() the outer most one since each is responsible for closing any Writer/OutputStream that it wraps. If you do decide to close them individually (a bad idea but people do do it) then you MUST close them starting from the outer most one and working to the most inner one or you will not guarantee to flush any buffered content.Of course. I might have used a misleading phrasing here. What I meant is "Every time you are done with a Writer, you must close it" and not "You must close *every* Writer that you used". Thanks for the clarification.

  • Text file contains data separated by pipe symbol read the data and saved in

    Hi ,
    This is Sreedhar, i am new to java. my query is Report its in text file format it contains data like GLNO,name ,amount. All fields are separated by pipe(|) symbol. I would like to read that
    data and saved into the database. Please anyone can help me.

    thx Ottobonn.
    Scanner is very usefull with string operation like in my problem..but i want try to find java.util.Scanner in j2me, i can't found this class...:(
    so, may be i can't use this class in j2me...
    i new in java, so i try myself to code the simple method for my problem,
    may be anyone can make this class more simple than my coding....:)
    public StringPipe(String _msg){
            String message = _msg;
            int pipe = 0;
            int lengthmessage = message.length();
            int lengthMsgresult = 0;
            while(lengthMsgresult<=lengthmessage){
                String msg = null;
                int pipeX = message.indexOf("|");
                if(pipeX==-1){
                    msg = message;
                else{
                    msg = message.substring(pipe, pipeX);
                    message = message.substring(pipeX+1, message.length());
                    lengthMsgresult += msg.length();  
                // the string seperated by pipe
                System.out.println("msg = " + msg);
                if(pipeX==-1){
                   break;
    }thx...

  • Text file numerical data in columns (spaces between colums) to graph after averaging each 500 columns values.ple​ase help.

    i have a text file with numerical data in three columns,(first i need to skip the few lines of text within the file above the three column of data values)then i need to convert the numerical values above "-999" to zero,then take the average of each 500 values in the first column (second and third colum needs the same operation separately),thus found average values are to be stored into a text file and finally plotted in a graph separately. Please help.Its apart of my project work.
    Solved!
    Go to Solution.
    Attachments:
    data file.txt ‏715 KB

    i have a text file with numerical data in three columns,(first i need to skip the few lines of text within the file above the three column of data values)then i need to convert the numerical values above "-999" to zero,then take the average of each 500 values in the first column (second and third colum needs the same operation separately),thus found average values are to be stored into a text file and finally plotted in a graph separately.
    " i am attaching the code tht i hv done so far, its for reading and plotting the numerical data from text, but its not working :-( "
    Attachments:
    read from text and plot.vi ‏26 KB
    sample input.txt ‏1 KB
    final input to be read and plot.txt ‏345 KB

  • Data warehouse configuration doubt

    Hi guys,
    I´m studing data warehouse and I would like to know if there´s any documentation showing the correct way to configure a DW database, like parameters, block size and partitioned tables.
    or if you have experience please post here your suggestions.
    Thank you,
    Felipe

    Starting with Oracle's data Warehousing Guide, documentation is a great start.
    http://download-uk.oracle.com/docs/cd/B10501_01/server.920/a96520/toc.htm
    You can also search fro datawarehouse books from goole or any search enginee.
    Jaffar

  • Best Way To Extract Large Text Files From Query

    Using CF7/SQL Server 2000.  I need to extract about 50,000 records from another server, and save it to a .CSV file.  Not sure what the best method is for this.  I've got the query written, and it will pull all the records.  But don't want to display them on the screen, just store in a .CSV file somewhere on the server.
    I've looked at CFFILE and CFDIRECTORY, and those don't seem to be the best tools for this.  What about using CFCONTENT with CFHEADER?  I use that to output to Excel files
    <CFCONTENT type="application/vnd.ms-excel">
    <CFHEADER NAME="Content-Disposition" VALUE="attachment; filename=c:\mydir\myfile.xls">
    But when trying to use it, it doesn't save the file on my drive.  Would appreciate advice on the best tools/tags for extracting large volumes of data from other servers, and saving to a local file.
    Once working, ultimately, I'd like to set it up, so the .CFM job runs daily, automatically, extracts the data and FTP's it to another server.  I've seen the CFFTP tag, but until I can get a file saved on my drive, or another server's drive, there's nothing to FTP.  Thanks for any help/advice.
    Gary

    Thanks, but I can't find any good examples of using CFFILE (just syntax of the tag, which doesn't make a lot of sense).  I've been writing CF code for 8 years, and feel I can make it sing and dance.  But I didn't understand how CFFILE worked, from reading the online documentation and my Ben Forta books.  There are no good examples.  Do you still write the query with CFQUERY, then "substitutute" CFFILE for CFOUTPUT?  Or enclose CFFILE inside CFOUTPUT?  I can't find any examples that explain this.
    I just need to see a basic example of CFFILE "in action."  Starting with a simple query, and a simple output that writes the query results to a file.
    Lastly, once you have the data written to a file, using CFFILE, is that when you can use CFFTP, to FTP that file, (or any file on the hard drive for that matter) to another server?
    Thanks for help, and any simple examples, just to get me started.  Thanks.
    Gary

  • Weird data reached in text files

    Hi all,
    I am seeking for some opinions about a problem I encouter in an
    experiment. I would very much appreciate your thoughts. There are the
    well-known programs in the Example Finder:
    1. Write binary file - which takes inputs from a sinus wave generator.
    2. Cont Acq& Graph Voltage - which in my case takes the input from a channel of a DAQ NI 6255
    So with these two I get two binary files from which I want to extract the information by means of a conversion to a text file.
    When I convert the bin files to text, I use the same VI program (which
    I attached) to do that. The conversion for the 1st VI looks as
    expected, but for the 2nd is really weird!.
    For the data in the 1st text file see textFile.txt file attached.(One would get the same result if it runs the VI):
    For the data in the second text file, see textmydaq2.txt file
    attached.(The data should normally record values ranging from 4.XX to
    8.XX):
    Should I constraint the data with some data format to avoid such strange values? Or is it something else I should do?
    Thank you very much for any kind of support.
    Dana
    Attachments:
    myRead Binary File8.vi ‏28 KB

    I can see there is a problem for the server to upload maybe other files(like txt files) different than VIs.
    As I cannot attach the txt files, I will provide you with samples:
    Here is a sample for the 1st text file(One would get the same result if it runs the VI):
    0.00    376.74    752.00    1124.29    1492.14    1854.10    2208.75    2554.68    2890.52    3214.96    3526.71    3824.54    4107.28    4373.81    4623.08    4854.10    5065.97    5257.84    5428.96    5578.66    5706.34    5811.50    5893.72    5952.69    5988.16    6000.00    5988.16  
    Here is the result in the second text file(The data should normally record values ranging from 4.XX to 8.XX):
    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    73333305348950320900000000000000000000000000000000000000000000000000000000000000000000000000.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    633318785695744.00    0.00    0.00    0.00    9663677760.25    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  
    Best!
    Dana

  • Text File is not picking with data

    Hi Experts,
    I am doing file to file scenario without IR as file will be generated by the ECC system and places in SAP FTP App Server.
    My job is to pick up the file and send it to the Third Party Application Server.
    But when i am picking up the Text file the data in the file is converting into special characters like below format.
    ÅÁÄÅÙ@ððððððâÖÕÄÅçöôðð@@@@@@òððùð÷ñ÷ðñ%@@@@@@@@@@@@@@òððùð÷ñ÷%ÄÅãÁÉÓ@ðððð
    I have tested with other Application server with same file its working fine, but when i send the file from SAP FTP Appl server the data is converting in the above format.
    Right now when i open file zilla it is opening with 3 FTP Appl Server in that suppose lets say the FTP are APP1, APP2, APP3.
    1.When i send the file from APP1 through Transport Protocol NFS System the file is picking up and  placing successfully in the Third Party APP3 App Server fiolder but the data in the file is converting into special charaters.
    2.when i send the same file from APP2 through Transport Protocal FTP the file is picking up and placing successfully in the third party APP3 App server and here the same data is coming in the text file, there is no data conversion.
    I am not getting here, when i send the file from APP1 the data is converting but when i send the same file from APP2 App srever the data is posting correctly.
    And also i can give you one more info.. if i try with puting the Transport Protocal as FTP in APP1 then i am getting error in sender comm channel as 'log on attempt by User JOHN rejected' : contact your FTP server vendor.
    But i think for sending the file from SAP Appl Server we can use TP as NFS rather than FTP.
    And also i can give one more info: The Version is the ECC system is using the 4.6c for which there is no compatability for unicodes.
    Can anyone please advise what would be the wrong.
    Appreciate your inputs
    Thanks,
    Bhaskar

    Hi,
    Reason because file is not picked up.
    >'log on attempt by User JOHN rejected' : contact your FTP server vendor.
    clearly user/password for this FTP server or system is not correct. Get correct userid/password for your Application server where you are trying to poll.
    >The Version is the ECC system is using the 4.6c for which there is no compatability for unicodes
    File transfer is nothing to unicode here.
    Regards,
    Gourav

  • Problem with Date - Text File Source and Oracle Target

    Hi All,
    I have a source data (text file) with date column in the format of 'MM/DD/YYYY'. My target is oracle. I am using the LKM FILE TO SQL and IKM SQL Control Append. When i execute this interface, i am getting an error as
    7000 : null : com.sunopsis.jdbc.driver.file.b.i
    com.sunopsis.jdbc.driver.file.b.i
    at com.sunopsis.jdbc.driver.file.b.f.getColumnClassName(f.java)
    at the Load Data step.
    How to load date columns from text file to oracle tables? Please help me in resolving this...
    Thanks in Advance,
    Ram Mohan T

    The worst solution is to define for your text file the date as a string and then to rebuild your date type in Oracle.
    something like
    convert(Substr(myfield,4,2)||Substr(myfield,1,2)||Substr(myfield,7,4) ,'MMDDYYYY')
    this is maybe the worst solution but it should work.
    Regards
    Brice

  • How do i create an ssis package that transforms data from a text file?

    I have a text file with data that in the following  format; i want this data in columns with the appropriate heading. Any ideas??
    Name – Tony
    Married – 2 children (Girl:3, Boy:1)
    AddressLine1: 10 Sunnhill Ave
    AddressLine2: Streatham
    AddressLine3: London
    PostCode:  SW18 7NN
    Name – Sarah
    Married – 2 children (Girl:3, Boy:1)
    AddressLine1: 10 High St
    AddressLine2: Streatham
    AddressLine3: London
    PostCode:  TW18 7NN
    Name – Tom
    Married – 2 children (Girl:3, Boy:1)
    AddressLine1: 10 Bridge Ave
    AddressLine2: Hammersmith
    AddressLine3: London
    PostCode:  TF20 8HN
    sukai

    I don't see how you're going to pivot that using SSIS.  I happen to know VBA pretty well, and I'll give you this Macro, which should do what you want.
    Sub CombineRows()
    lastRow = Range("A" & Rows.Count).End(xlUp).Row
    'set rowcount to row where you want 1st entry
    RowCount = 1
    NewRow = RowCount
    Start = False
    Do While RowCount <= lastRow
    If Start = False Then
    If Range("A" & RowCount) <> "" Then
    Start = True
    StartRow = RowCount
    End If
    Else
    If Range("A" & (RowCount + 1)) = "" Then
    ColCount = 1
    For MoveRow = StartRow To RowCount
    Cells(NewRow, ColCount) = Cells(MoveRow, "A")
    ColCount = ColCount + 1
    Next MoveRow
    NewRow = NewRow + 1
    Start = False
    End If
    End If
    RowCount = RowCount + 1
    Loop
    Rows(NewRow & ":" & lastRow).Delete
    End Sub
    Knowledge is the only thing that I can give you, and still retain, and we are both better off for it.

  • Is it possible to output a report as a text file (.txt) in a Data Driven Subscription?

    Is it possible to create a Data Driven Subscription report as a text file output to a shared folder? Thanks.
    Kahlua

    Hi Vicky:
    Thank you for your reply. I changed the config file in SSRS and it works. I managed to generate a text file with Data Driven Subscription as the report output in a shared folder. However is it possible not to have the "double quote" wrapping around
    the text. Do I need to modify the config file to remove the "double quote" and how. Thanks. 
    Kahlua
    <Render>
    <Extension Name="XML" Type="Microsoft.ReportingServices.Rendering.DataRenderer.XmlDataReport,Microsoft.ReportingServices.DataRendering"/>
    <Extension Name="NULL" Type="Microsoft.ReportingServices.Rendering.NullRenderer.NullReport,Microsoft.ReportingServices.NullRendering" Visible="False"/>
    <Extension Name="CSV" Type="Microsoft.ReportingServices.Rendering.DataRenderer.CsvReport,Microsoft.ReportingServices.DataRendering"/>
    <Extension Name="PDF" Type="Microsoft.ReportingServices.Rendering.ImageRenderer.PDFRenderer,Microsoft.ReportingServices.ImageRendering"/>
    <Extension Name="TAB" Type="Microsoft.ReportingServices.Rendering.DataRenderer.CsvReport,Microsoft.ReportingServices.DataRendering">
    <OverrideNames>
    <Name Language="en-US">TAB (Tab Delimited Text File)</Name>
    </OverrideNames>
    <Configuration>
    <DeviceInfo>
    <FieldDelimiter xml:space="preserve">[TAB]</FieldDelimiter>
    <UseFormattedValues>True</UseFormattedValues>
    <NoHeader>True</NoHeader>
    <FileExtension>txt</FileExtension>
    <Qualifier xml:space="preserve"></Qualifier>
    <ExcelMode>False</ExcelMode>
    </DeviceInfo>
    </Configuration>
    </Extension>
    <Extension Name="RGDI" Type="Microsoft.ReportingServices.Rendering.ImageRenderer.RGDIRenderer,Microsoft.ReportingServices.ImageRendering" Visible="False" LogAllExecutionRequests="False"/>
    <Extension Name="HTML4.0" Type="Microsoft.ReportingServices.Rendering.HtmlRenderer.Html40RenderingExtension,Microsoft.ReportingServices.HtmlRendering" Visible="False" LogAllExecutionRequests="False"/>
    <Extension Name="MHTML" Type="Microsoft.ReportingServices.Rendering.HtmlRenderer.MHtmlRenderingExtension,Microsoft.ReportingServices.HtmlRendering"/>
    <Extension Name="EXCEL" Type="Microsoft.ReportingServices.Rendering.ExcelRenderer.ExcelRenderer,Microsoft.ReportingServices.ExcelRendering"/>
    <Extension Name="RPL" Type="Microsoft.ReportingServices.Rendering.RPLRendering.RPLRenderer,Microsoft.ReportingServices.RPLRendering" Visible="false" LogAllExecutionRequests="false"/>
    <Extension Name="IMAGE" Type="Microsoft.ReportingServices.Rendering.ImageRenderer.ImageRenderer,Microsoft.ReportingServices.ImageRendering"/>
    <Extension Name="WORD" Type="Microsoft.ReportingServices.Rendering.WordRenderer.WordDocumentRenderer,Microsoft.ReportingServices.WordRendering"/>
    </Render>

  • Problem with alv output export to text file

    hi experts,
    when iam exporting alv output to text file,
    some data is missing in text file.say for example sold-to-party value is 1155027 in alv out put,but in text file it is showeing only 115502 ,
    the last digit is missing,
    can anyone help urgent!!!!!

    and when you export it to excel?
    from here you could save it as text file too...
    A.

  • How do I create multiple text files from a list in another file?

    I have a text file with data in it:
    1. Bristol
    2. Bath
    3. Exeter
    etc
    I want to run an action which outputs the following files:
    1.txt (contents: 1 Bristol)
    2.txt (contents: 2.Bath)
    3.txt (contents: 3.Exeter)
    I can't work ou how to do this, any help appreciated. Thanks
    Dave

    Hi mate, thanks for the suggestion.  I saw that section in the user guide - but it is only for copying from one library to another - I want to copy from an FCP library to a file structure OUTSIDE FCP.  I have had problems with FCP losing media when copying to another library so I just want the files in the Finder where I can see them...
    Stephen

  • Deleting a column in a text file using LabVIEW

    Hello all,
    I'm trying to delete the first column of my tab delimited text file using LabVIEW and then save it under the same file name.  Can someone show me a quick way to perform this operation.  Is this even possible with LabVIEW?  Any help would be much appreciated.
    My purpose is to automate this operation for hundreds of daily text files containing data that needs processing.  I'm currently using LabVIEW 8.2.
    Thanks!
    -noviceLabVIEWuser

    If the file is relatively small:
    Read the file using the Read from Spreadsheet File VI to get 2D array.
    Remove the column from the 2D array.
    Write out new 2D array to new file using Write to Spreadsheet File VI.
    If the file is relatively large then you will likely run into memory issues. In this case you will need to read the file in chunks. You can decide how many lines to read at a time. Use a for-loop that's set to run for the number of chunks to read (based on the total number of lines and the number of lines you want to read at a time). Hint: Quotient & Remainder function. In the loop use the Read Text File VI to read your set number of lines. Convert the lines to a 2D array delete your column, and write out that chunk of data to the new file. Rinse and repeat.

  • How to import a text file created in Pages (iWork '08) to Photoshop Elements

    I am totally a novice at working with Photoshop Elements.  I need help.  I want to create my business card in Photoshop Elements with a background image and then a text layer over the background layer.  The logo and text was created in Pages (iWork '08).  Can I import this text file to Photoshop Elements and if so how do I do that?  I cannot create the same logo in Elements unless someone can tell me how to draw a circle with a transparent background so that just the outline of the circle shows and the background comes through.  Thanks for any help you can offer.  I have OS X Snow Leopard 10.6.4 and Photoshop Elements 6.

    In PSE, to draw an empty circle use the elliptical marquee tool and hold down shift while you drag to constrain it to a circle. That will give you an empty selection, then go to Edit>Stroke (outline) selection. A window appears where you can choose the width and color of the stroke.
    However, I'm not understanding why you would want to create your business card in PSE rather than in Pages or equivalent. Is there a special reason for this?
    EDIT As for the text file, it would be simpler just to retype it in PSE, since it can't be very much text. Remember that PSE doesn't do all the fancy things with text that Pages can, although it can do some things (like warping) that Pages can't.
    You could activate the text tool and use copy/paste, but you'll lose most of the formatting.

Maybe you are looking for

  • Any way to store if a user visited a slide?

    Hi! NewB here. I was wondering if there is a way to know whether a user has visited a certain slide or not. I was thinking along the lines of a variable, although I don't see a direct shot to coding. I do see that JavaScript (JS) is available. I have

  • Photoshop CS and Acrobat 6.0 stopped working in Snow Leopard

    Hello.  "Photoshop CS" and "Acrobat 6.0 Standard" suddenly stopped working in my iMac, apparently after I upgraded it to MacOS 10.6.8 (the latest version of Snow Leopard).  Both programs had worked normally until that OS upgrade.  I deleted Photoshop

  • Receiver Proxy

    Do we need to create receiver communication channel and receiver agreement if target is SAP ECC(proxy)?

  • Unable to upload photo to Mac from Camera

    Camera is Canon SX160 IS; cannot upload photos to Mac from camera. "Connection of software for another Canon camera, etc.".  Yale

  • Need Help:I meet trouble after I installed Oracle10g in my Linux OS.

    After i installed Oracle10g Database in Linux OS in my PC,I can manage it from em . But when i reboot my PC,i found i can't connect the Database again,whether i use sqlplus or em. Why?Somethings i miss?But i install it depend on the documents downloa