on 04-06-2006 9:04 AM
Hi All,
In lsmw I need to test some data.That program will take only application server files.I need to upload one(Tab delimmitted file ) and test.Here I am trying to upload tab delimitted text file to application server.How can I upload tab delimitted file in to application server.
I have taken one itab and uploaded data from presentation server.Now i am trying to put that itab data in to a file at application server along with tab.
Next I am trying to put that data in to application server file.What can I do to store data as it is like tab delemitted text file in presentation server.
I need to store fields to be stored along with tab.
How can I do it?
Regards
Vijaya P
Hi,
U can store the file as a tabdelimited file in application server by separating fields of itab by '#' symbol.
U can upload the file by the open dataset and transfer dataset statements in the application server.
U can declare a variable like this
data:c_tab type c
value CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB.
use this field as a separator of fields like
open dataset p_file for <i/p> in text mode.
if sy-subrc = 0.
loop at itab.
concatenate itab-fld1 itab-fld1 .... into v_text
separated by c_tab.
transfer v_text to p_file.
endloop.
close dataset p_file.
Thanks,
Vamsi.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi,
Use Open dataset and close dataset statements for loading the file into application server / from application server
<b>OPEN DATASET <file name> FOR {OUTPUT/INPUT/APPENDING}
IN {TEXT/BINARY} MODE</b>
OPEN DATASET P_UNAME FOR INPUT IN TEXT MODE.
IF SY-SUBRC = 0.
CLOSE DATASET P_UNAME.
DELETE DATASET P_UNAME.
ENDIF.
OPEN DATASET P_UNAME FOR OUTPUT IN TEXT MODE.
IF SY-SUBRC <> 0.
MESSAGE E039 WITH
'Message'.
ENDIF.
LOOP AT ITAB_OUT.
PERFORM ZYIR008_TRANSFER_DATASET USING 'C'
P_UNAME
ITAB_OUT SY-INDEX.
ENDLOOP.
CLOSE DATASET P_UNAME.
Regards,
Santosh
Hi Vijaya,
There is option for specifying delimeter in LSMW ; 7th Step specify file ;
hope it may help you.
Regards
Manoj B gupta
Message was edited by: Manoj Gupta
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Vijaya,
For testing purpose you can always move the file from Presentation server to app server using CG3Z transaction.
Regards,
Ravi
Note : Please mark the helpful answers
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi ,
While using Cg3z system is asking for source and target file.So I am givi spurce file name c:\sampledata.txt and source as \temp\source1.txt
when i click on upload button system is showing an information that source1.txt can't open.
How can I overcome this problem
please answer.
Regards
Vijaya
Hi p vijaya,
1. I think u have given in the reverse way.
2. in the FIRST INPUT field,
(source file on front end)
give
c:\sampledata.txt
3. and in the second field
( Target file on application server)
give as \temp\source1.txt
(file name along with path is case sensitive
in case of application server)
<b>4. to check the full path,
u can use AL11 tcode.
the path can be for eg.
/usr/sap/DEV/SYS/gen/dbg/abc.txt</b>
regards,
amit m.
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.