‎2005 Jun 23 12:55 PM
Hello all,
I am facing a problem in OPEN DATASET.
I need to download a .TXT file on the application server.
Desired format is to download each record in new line. for example:
0110432191852710 20021213
0110432191854710 20021213
I have used:
OPEN DATASET p_daf FOR OUTPUT in text mode.
LOOP AT g_t_itab.
TRANSFER g_t_itab TO p_daf.
CLEAR:g_t_itab. ENDLOOP.
CLOSE DATASET p_daf.
But I get a single stream of data in my text file. The records are separated by a special character ( a Black box ) - I open the .TXT file in <b>NOTEPAD</b>
Is this behaviour normal? Else how do I download the records in different lines as a text file on Application server?
Thanks in advance.
Regards, Murugesh AS
Message was edited by: Murugesh Arcot
Message was edited by: Murugesh Arcot
‎2005 Jun 23 1:02 PM
Hi,
You can use the syntax
OPEN DATASET <dsn> [FOR ....] [IN ... MODE] AT POSITION <pos>.
This statement opens the file <dsn>, and prepares it for reading or writing from position <pos>. <pos> is the number of bytes from the beginning of the file. It is not possible to specify a position before the beginning of the file.
Hope this may help you.
Thanks&Regards
Ruthra.R
‎2005 Jun 23 1:30 PM
‎2005 Jun 23 2:37 PM
You haven't included your endloop statement. It has to be before the close statement.
Rob
‎2005 Jun 23 2:50 PM
Hi Murugesh,
your coding is ok.
perhaps try to omit ending .txt in your file name
what is when you reload your saved file with sap ?
-> try another text editor e.g. ultra edit
regards Andreas
‎2005 Jun 23 2:55 PM
What are you using to look at the file? Sounds like you have something that doesn't understand unix-style newlines. There is absolutely no reason why that code of yours shouldn't work.
‎2005 Jun 23 3:14 PM
Hello Andreas, Nathan and others,
Thanks for your response.
As Andreas suggested, I uploaded the same in SAP and it works fine.
Well I have not explained the requirement. We have different SAP systems and the data is downloaded in .txt from each system and a java utility uploads this data into the BW system.
This system/interface is in place now and SAP system on which I am working will be giving data to BW system.
Regards, Murugesh AS
‎2005 Jun 23 3:18 PM
If you transfer data from unix to windows computer you have to modify the return code. You do this with ftp when you select ascii transfer.
Maybe look your java utility for text transfer instead of binary transfer
Frédéric
‎2005 Jun 28 1:12 PM
Hello Andreas and Nathan,
The Interface works fine with the downloaded file from Unix bases SAP system too without any changes.
Thanks for the help.
Best Regards, Murugesh AS
‎2005 Jun 23 4:40 PM
Hi Murugesh,
WHy dont you try using split command when moving the file.
Let me know if you have any questions still. Put split and go for F1, you will know the syntax.
Thanks,
Bhavana