‎2009 Jul 02 5:46 PM
hi friends i learning abap. i need to create 2 files on application server one containing data and another empty file to signify the sucessful creation of the first file.
the data in the file should have pipe delimiter and the contents will have header in a specific format and line items in different format.
any sample program or examples will be of great hep.
<REMOVED BY MODERATOR - REQUEST OR OFFER POINTS ARE FORBIDDEN>
Edited by: Alvaro Tejada Galindo on Jul 2, 2009 12:55 PM
‎2009 Jul 02 5:48 PM
Hi,
Do little bit of search in the forum..you can find the lot treads with sample code.
‎2009 Jul 02 9:04 PM
Hi,
Try the following way out:
*transferring data from it_temp_header to it-pipe_hdr in pipe delimited format
loop at it_temp_header.
concatenate it_temp_header-progid it_temp_header-reqnr it_temp_header-verid it_temp_header-mode1 it_temp_header-custty
it_temp_header-custid it_temp_header-vkorg it_temp_header-vtweg it_temp_header-spart it_temp_header-rcode it_temp_header-sdate
it_temp_header-edate it_temp_header-fixamt it_temp_header-amtaccr it_temp_header-expamt it_temp_header-weeks it_temp_header-status
into it_pipe_hdr separated by '|'.
append it_pipe_hdr.
endloop.
clear it_pipe_hdr.
*transferring data from it_temp_item to it-pipe_item in pipe delimited format
loop at it_temp_item.
concatenate it_temp_item-progid it_temp_item-mode1 it_temp_item-linenr it_temp_item-prodty it_temp_item-prodid
it_temp_item-meins it_temp_item-fixamt it_temp_item-amtaccr it_temp_item-volum it_temp_item-status
into it_pipe_item separated by '|'.
append it_pipe_item.
endloop.
clear it_pipe_item.
transferring header data from the internal table to the file at the application server
open dataset file1 in text mode for output encoding default.
if syst-subrc eq 0.
loop at it_pipe_hdr.
transfer it_pipe_hdr to file1.
endloop.
close dataset file1.
endif.
transferring Item data from the internal table to the file at the application server
open dataset file3 in text mode for output encoding default.
if syst-subrc eq 0.
loop at it_pipe_item.
transfer it_pipe_item to file3.
endloop.
close dataset file3.
endif.
Hope this will help.
Thanks,
Rajeev
‎2009 Jul 03 3:39 AM
Simple search in SCN .U can find a lot of examples relating to files at the application server ....(creating , reading , deleting ) a lot of them .