Posted: Sat Nov 17, 2007 10:15 pm Post subject: Send a data stream from ABAP to UNIX named pipe
Code:
REPORT ZPIPE .
****************************************************
* Send a data stream from abap to a UNIX named pipe
* On the UNIX side the fifo can be read with such
* commnds like this: cat /tmp/fifi
****************************************************
*
TABLES: USR02.
DATA: FIFO(30) VALUE '/tmp/fifi',
MKFIFO(30) VALUE 'mkfifo -m 777 /tmp/fifi',
RMFIFO(30) VALUE 'rm -f /tmp/fifi',
OPCODE TYPE X VALUE 2,
BEGIN OF TABL OCCURS 0,
LINE(200),
END OF TABL.
* Create the pipe
CALL 'SYSTEM' ID 'COMMAND' FIELD MKFIFO
ID 'TAB' FIELD TABL-*SYS*.
* Write the data to the pipe
OPEN DATASET FIFO FOR APPENDING IN TEXT MODE.
SELECT * FROM USR02.
TRANSFER USR02-BNAME TO FIFO.
ENDSELECT.
CLOSE DATASET FIFO.
* Remove the pipe
CALL 'SYSTEM' ID 'COMMAND' FIELD RMFIFO
ID 'TAB' FIELD TABL-*SYS*.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG. SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG. Every effort is made to ensure content integrity. Use information on this site at your own risk.