Reading and Writing data on application server in SAP
2018-02-06 09:03
453 查看
Step1:OPEN DATASET for Application server SAP Normal
Most of the times in real-time business application we need to store data in application server for further operations and we need to read data from application server.In order to do operations on application server, we need to open dataset for a particular file,
we use the below syntax to open a data set.
OPEN DATASET <FILE NAME> FOR OUTPUT IN <MODE> MODE ENCODING DEFAULT. **Do file operations like writing file, reading file CLOSE DATASET <FILE NAME>. "Close data set for file
In the above syntax
<FILE NAME>is the name of the application server file,
<MODE>is
the out put mode like BINARY MODE or TEXT MODE or LEGACY BINARY MODE or LEGACY TEXT MODE.
In the next step, example program explains you how to read data from application server and
how to write data to application server.
Step2:Reading and Writing data from Application Server SAP Normal
The below example program explains you of writing data into application server using OPEN DATASET and reading data from application server using OPEN DATASET.REPORT ZSAPN_APPLICATION_SERVER. PARAMETERS FILE TYPE string DEFAULT 'testtemp.txt' . PARAMETERS P_MTART TYPE MARA-MTART. DATA IT_MARA TYPE TABLE OF MARA. DATA WA_MARA TYPE MARA. DATA LV_STRING TYPE STRING. SELECT * FROM MARA INTO TABLE IT_MARA UP TO 50 ROWS WHERE MTART = P_MTART . OPEN DATASET FILE FOR OUTPUT IN TEXT MODE ENCODING DEFAULT. LOOP AT IT_MARA INTO WA_MARA . CONCATENATE WA_MARA-MATNR WA_MARA-MTART WA_MARA-MEINS INTO LV_STRING. TRANSFER LV_STRING TO FILE. ENDLOOP. CLOSE DATASET FILE. DATA LV_DATA TYPE STRING. OPEN DATASET FILE FOR INPUT IN TEXT MODE ENCODING DEFAULT. DO. READ DATASET FILE INTO LV_DATA. IF SY-SUBRC <> 0. EXIT. ELSE. WRITE:/ LV_DATA. ENDIF. ENDDO. CLOSE DATASET FILE.
相关文章推荐
- Reading and Writing data on application server in SAP
- Turning Off and On Identity Column in SQL Server
- Spatial data in sql and draw boundary on bing maps
- MS bug "The connection pool" in Oracle 10g and the data sort according to specified filed on DataGrid control.
- How To Turn Up Logging on the Siebel Web Server Extension in Siebel Versions 7.x and 8.x? [ID 477185
- Reading and Writing Local Files in Flash Player 10
- Get XML tree format based on the tree data in SQL server table
- Reading and Writing CSV Files in MFC
- Advanced Server Virtualization: VMware and Microsoft Platforms in the Virtual Data Center
- About UID and How to autostart an application on boot up in 3rd- Startup List Management API
- How are the icon files in my application bundle used on iPad and iPhone?
- 笔记: SAP How-to Guide: How To... Create an Application and Security profile in SMP 3.0
- MVC architecture in ASP.Net using C# and Microsoft Data Access Application block
- The techniques of data store and presentation in SAP
- Reading and Writing BLOB Data to MS SQL or Oracle Database
- Simplest way to serve static data from outside the application server in a Java web application
- Scripting <path> data in SVG (reading and modifying)
- Reading and Writing CSV Files in C#
- File operations in SAP Application server (AL11) using UNIX Command
- Unable to start debugging on the web server. You do not have permission to debug the application. The URL for this project is in