SAP R/3 форум ABAP консультантов
Russian ABAP Developer's Club

Home - FAQ - Search - Memberlist - Usergroups - Profile - Log in to check your private messages - Register - Log in - English
Blogs - Weblogs News

Send a data stream from ABAP to UNIX named pipe



 
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> Connect to External system, Unix и Perl
View previous topic :: View next topic  
Author Message
admin
Администратор
Администратор



Joined: 01 Sep 2007
Posts: 1640

PostPosted: Sat Nov 17, 2007 10:15 pm    Post subject: Send a data stream from ABAP to UNIX named pipe Reply with quote

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*.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> Connect to External system, Unix и Perl All times are GMT + 4 Hours
Page 1 of 1

 
Jump to:  
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.