0% found this document useful (0 votes)
33 views2 pages

ABAP Certification, Smartform, Sapscripts, BAPI, JAVA, Visual Basic Programming Books

Reading and Writing a text file from and to the application server. Sy-subrc = 0 Record read from file end of file reached data: w_dataset1(27) value'/ var / textfile.txt'

Uploaded by

amitsmilesforu
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
33 views2 pages

ABAP Certification, Smartform, Sapscripts, BAPI, JAVA, Visual Basic Programming Books

Reading and Writing a text file from and to the application server. Sy-subrc = 0 Record read from file end of file reached data: w_dataset1(27) value'/ var / textfile.txt'

Uploaded by

amitsmilesforu
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Reading and Writing a text file from and to the application server Page 1 of 2

ERP Access Remote Systems $60-3 weeks. $99/month. $699/year All systems. 24/7 Help. No fees. www.Be
.NET PDF Components Efficient .NET PDF Assemblies Download FREE Evaluation Edition! www.cete.com/Prod
SAP Jobs for Freshers. Apply to all SAP Vacancies. Submit Your Resume Free. Now! MonsterIndia.com

ABAP Certification, Smartform, Sapscripts, BAPI, JAVA, Visual Basic


Programming Books
Reading and Writing a text file from and to the application server

* sy-subrc = 0 Record read from file


* sy-subrc = 4 End of file reached

data: w_dataset1(27) value '/var/textfile.txt',


w_dataset2(27) value '/var/outfile.txt'.

data:begin of itab1 occurs 0, "Text file format


matnr(18), "MATERIAL NUMBER
bwkrs(4), "PLANT
end of itab1.

*Uploading of text file from Application server.


open dataset w_dataset1 for input in text mode.
do.
if sy-subrc <> 0.
exit.
endif.
read dataset w_dataset1 into itab1.
append itab1.
clear itab1.
enddo.
close dataset w_dataset1.

*Downloading of text file to Application server.


open dataset w_dataset2 for output in text mode.
loop at itable.
transfer itable to w_dataset2.
endloop.
close dataset w_dataset2.

Return to :-
SAP ABAP/4 Programming, Basis Administration, Configuration Hints and Tips

(c) www.sap-basis-abap.com All material on this site is Copyright.


Every effort is made to ensure the content integrity. Information used on this site is at your own risk.
All product names are trademarks of their respective companies. The site www.sap-basis-abap.com is in

http://www.sap-basis-abap.com/sapac012.htm 11/30/2010
Reading and Writing a text file from and to the application server Page 2 of 2

no way affiliated with SAP AG.


Any unauthorised copying or mirroring is prohibited.

http://www.sap-basis-abap.com/sapac012.htm 11/30/2010

You might also like