SlideShare a Scribd company logo
Print to Text File at OS Level
SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com
© 2006 SAP AG 1
Print to Text File at OS Level
Applies to:
All SAP products based on ABAP stack
Summary
A tutorial on how to print to text file at OS Level from SAP. The tutorial provides detailed step-by-step
configuration details to create a printer which prints to text file at OS level in designated File System.
Example configuration is done for SAP products installed on HP-UX 11i.
Author(s): Harpreet Singh
Company: Accenture (Bangalore – India)
Created on: 29 September 2006
Author Bio
I am working as SAP-BASIS Team Lead at Accenture. I have around 6Yrs in SAP-BASIS
experience which include two implementation projects.
Certifications:
• WAS 640 certified technology consultant
• OCP (Oracle Certified professional – DBA Track)
Print to Text File at OS Level
SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com
© 2006 SAP AG 2
Table of Contents
Applies to: ........................................................................................................................................ 1
Summary.......................................................................................................................................... 1
Author Bio ........................................................................................................................................ 1
Business Requirement..................................................................................................................... 2
Procedure ........................................................................................................................................ 2
Example........................................................................................................................................... 5
Disclaimer and Liability Notice......................................................................................................... 7
Business Requirement
You want to redirect the spool output to a text file at OS Level rather than the Real Printer.
Procedure
• Execute transaction SPAD
• Click output devices and switch to change mode
• Click Create
Print to Text File at OS Level
SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com
© 2006 SAP AG 3
• On “Device Attribute tab” Provide necessary details like
o Output Device name
o Short Name
o Device type as “ASCIIPRI : Some generic ASCII printer”
o Spool Server – provide name of the app server running spool work process and whose file
system you would like to use for print files.
o Provide other details as required.
• On Access method tab provide details such as
o Host Spool Access method as “L : Print Locally Using LP/LPR”
o Host printer any name you would like to have this is just a dummy name.
o Click Edit Command Set
o You will get one more box in Access tab named “Command Set ID” as show below
Print to Text File at OS Level
SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com
© 2006 SAP AG 4
o Provide one character name and double click on that. Following screen will popup
o Provide the necessary details as described below
Description : Any description for command set ID
Command to transfer print data : Here (in below Fig)
/usr/bin/cp &F <File System Path>
This will copy the contents of output to file system you specified in place of <File
System Path>
&F is the file name with default storage path and default storage path is data
directory for instance i.e. /usr/sap/<SID>/<instance>/data and default file name is
<OUTPUT_ID>.<SID>
Second part after semicolon is the script at OS level you would like to execute after
completing the first step, this would be required to rename the file to understandable
file name. You can pass on parameter to this scripts following parameter are allowed
&P : output device
&F : transfer file
&f : name of transfer file without path name share (as of 4.0A)
&p : path name of transfer file (as of 4.0A)
&C : number of copies
&I : job name of SAP spooler
&J : job name of SAP spooler with database name
&L : layout
&M : client of owner
&O : owner
&m : printing client
Print to Text File at OS Level
SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com
© 2006 SAP AG 5
&o : printing user
&t : phone number (FAX)
&T : title
&R : recipient (cover sheet)
&D : department (cover sheet)
&S : SAP name of output device
&Y : priority
&U : UNIX cover sheet requested? ('N'=No, 'X'=Yes, 'D'=Default)
&N: number of the spool request (as of Release 4.5A)
&n: number of the output request (as of Release 4.5A)
c: number of pages (as of Release 4.0A)
&s: field 'Suffix2' of the spool request (as of Release 4.0A)
Command to query job status : This is required to know the status of the output at
OS level, if this not that much important you can provide “echo ok” but don’t leave it
blank.
Click Enter and Save the printer definition
Its done
Example
For example if you would like to create the file to /intf/rq1/outb/mm/pending and rename the file to
<CREATOR>-<TITLE>-<SPOOL ID>_<YYYYMMDDHHMMSS>.done
Create the following script (say name spool_output_to_os.sh and placed at /var/adm/scripts/BASIS/general )
Print to Text File at OS Level
SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com
© 2006 SAP AG 6
J=$1
N=$2
O=$3
T=$4
E=".done"
d=`date '+20%y%m%d%H%M%S'`
FN=`echo $J | awk -F/ '{printf("%s",$7)}'`
FN1=${O}-${T}-${N}_${d}${E}
mv /intf/rq1/outb/mm/pending/${FN} /intf/rq1/outb/mm/pending/${FN1}
and in “Command to transfer print data “ enter
/usr/bin/cp &F /intf/rq1/outb/mm/pending/ ; /var/adm/scripts/BASIS/general/spool_output_to_os.sh &F &N &O
&T
Here parameter &F &N &O &T are passed to scripts.
Print to Text File at OS Level
SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com
© 2006 SAP AG 7
Disclaimer and Liability Notice
This document may discuss sample coding or other information that does not include SAP official interfaces
and therefore is not supported by SAP. Changes made based on this information are not supported and can
be overwritten during an upgrade.
SAP will not be held liable for any damages caused by using or misusing the information, code or methods
suggested in this document, and anyone using these methods does so at his/her own risk.
SAP offers no guarantees and assumes no responsibility or liability of any type with respect to the content of
this technical article or code sample, including any liability resulting from incompatibility between the content
within this document and the materials and services offered by SAP. You agree that you will not hold, or seek
to hold, SAP responsible or liable with respect to the content of this document.

More Related Content

DOC
Robert Sheppard Software
DOCX
Ajaya_resume
PPTX
Nike
PDF
Realizing the Potential of Research Data by Carole L. Palmer
PPTX
4 bit Binary to Gray converter using XOR
PDF
Binary to gray converter using xor
PPT
Rangkaian dioda dan regulator
PPT
Op-Amp Basics Part I
Robert Sheppard Software
Ajaya_resume
Nike
Realizing the Potential of Research Data by Carole L. Palmer
4 bit Binary to Gray converter using XOR
Binary to gray converter using xor
Rangkaian dioda dan regulator
Op-Amp Basics Part I

Similar to Dispositivos en SAP (20)

PPT
Leveraging Open Source to Manage SAN Performance
PPT
Power point on linux commands,appache,php,mysql,html,css,web 2.0
PPT
Linux presentation
PPT
Sandy Report
PPT
Sandy Report
PPT
R12 d49656 gc10-apps dba 01
PPT
PPTX
PPT
PPT
Chapter9and10
PPT
Chapter9 and10
PPT
Sap abap training Overview
PDF
What is DCA (Diploma of Computer Application) Detail, Syllabus,Coursess.pdf
PDF
What is DCA (Diploma of Computer Application) Detail, Syllabus,Coursess.pdf
PPT
Looking for best Sap abap training institute in Chennai
PDF
Embedded Android
PDF
Graphing Nagios services with pnp4nagios
DOC
Project eprom progr
PPT
R12 d49656 gc10-apps dba 05
PDF
Passenger 6 generic language support presentation
Leveraging Open Source to Manage SAN Performance
Power point on linux commands,appache,php,mysql,html,css,web 2.0
Linux presentation
Sandy Report
Sandy Report
R12 d49656 gc10-apps dba 01
Chapter9and10
Chapter9 and10
Sap abap training Overview
What is DCA (Diploma of Computer Application) Detail, Syllabus,Coursess.pdf
What is DCA (Diploma of Computer Application) Detail, Syllabus,Coursess.pdf
Looking for best Sap abap training institute in Chennai
Embedded Android
Graphing Nagios services with pnp4nagios
Project eprom progr
R12 d49656 gc10-apps dba 05
Passenger 6 generic language support presentation
Ad

Recently uploaded (20)

PDF
Encapsulation theory and applications.pdf
PDF
August Patch Tuesday
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Empathic Computing: Creating Shared Understanding
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PPTX
Machine Learning_overview_presentation.pptx
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Machine learning based COVID-19 study performance prediction
PDF
Approach and Philosophy of On baking technology
PDF
A comparative analysis of optical character recognition models for extracting...
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Heart disease approach using modified random forest and particle swarm optimi...
PDF
A comparative study of natural language inference in Swahili using monolingua...
PPTX
A Presentation on Artificial Intelligence
PDF
Accuracy of neural networks in brain wave diagnosis of schizophrenia
PPTX
Tartificialntelligence_presentation.pptx
Encapsulation theory and applications.pdf
August Patch Tuesday
Encapsulation_ Review paper, used for researhc scholars
Diabetes mellitus diagnosis method based random forest with bat algorithm
Building Integrated photovoltaic BIPV_UPV.pdf
Empathic Computing: Creating Shared Understanding
Reach Out and Touch Someone: Haptics and Empathic Computing
Machine Learning_overview_presentation.pptx
Unlocking AI with Model Context Protocol (MCP)
Spectral efficient network and resource selection model in 5G networks
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Machine learning based COVID-19 study performance prediction
Approach and Philosophy of On baking technology
A comparative analysis of optical character recognition models for extracting...
Network Security Unit 5.pdf for BCA BBA.
Heart disease approach using modified random forest and particle swarm optimi...
A comparative study of natural language inference in Swahili using monolingua...
A Presentation on Artificial Intelligence
Accuracy of neural networks in brain wave diagnosis of schizophrenia
Tartificialntelligence_presentation.pptx
Ad

Dispositivos en SAP

  • 1. Print to Text File at OS Level SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com © 2006 SAP AG 1 Print to Text File at OS Level Applies to: All SAP products based on ABAP stack Summary A tutorial on how to print to text file at OS Level from SAP. The tutorial provides detailed step-by-step configuration details to create a printer which prints to text file at OS level in designated File System. Example configuration is done for SAP products installed on HP-UX 11i. Author(s): Harpreet Singh Company: Accenture (Bangalore – India) Created on: 29 September 2006 Author Bio I am working as SAP-BASIS Team Lead at Accenture. I have around 6Yrs in SAP-BASIS experience which include two implementation projects. Certifications: • WAS 640 certified technology consultant • OCP (Oracle Certified professional – DBA Track)
  • 2. Print to Text File at OS Level SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com © 2006 SAP AG 2 Table of Contents Applies to: ........................................................................................................................................ 1 Summary.......................................................................................................................................... 1 Author Bio ........................................................................................................................................ 1 Business Requirement..................................................................................................................... 2 Procedure ........................................................................................................................................ 2 Example........................................................................................................................................... 5 Disclaimer and Liability Notice......................................................................................................... 7 Business Requirement You want to redirect the spool output to a text file at OS Level rather than the Real Printer. Procedure • Execute transaction SPAD • Click output devices and switch to change mode • Click Create
  • 3. Print to Text File at OS Level SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com © 2006 SAP AG 3 • On “Device Attribute tab” Provide necessary details like o Output Device name o Short Name o Device type as “ASCIIPRI : Some generic ASCII printer” o Spool Server – provide name of the app server running spool work process and whose file system you would like to use for print files. o Provide other details as required. • On Access method tab provide details such as o Host Spool Access method as “L : Print Locally Using LP/LPR” o Host printer any name you would like to have this is just a dummy name. o Click Edit Command Set o You will get one more box in Access tab named “Command Set ID” as show below
  • 4. Print to Text File at OS Level SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com © 2006 SAP AG 4 o Provide one character name and double click on that. Following screen will popup o Provide the necessary details as described below Description : Any description for command set ID Command to transfer print data : Here (in below Fig) /usr/bin/cp &F <File System Path> This will copy the contents of output to file system you specified in place of <File System Path> &F is the file name with default storage path and default storage path is data directory for instance i.e. /usr/sap/<SID>/<instance>/data and default file name is <OUTPUT_ID>.<SID> Second part after semicolon is the script at OS level you would like to execute after completing the first step, this would be required to rename the file to understandable file name. You can pass on parameter to this scripts following parameter are allowed &P : output device &F : transfer file &f : name of transfer file without path name share (as of 4.0A) &p : path name of transfer file (as of 4.0A) &C : number of copies &I : job name of SAP spooler &J : job name of SAP spooler with database name &L : layout &M : client of owner &O : owner &m : printing client
  • 5. Print to Text File at OS Level SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com © 2006 SAP AG 5 &o : printing user &t : phone number (FAX) &T : title &R : recipient (cover sheet) &D : department (cover sheet) &S : SAP name of output device &Y : priority &U : UNIX cover sheet requested? ('N'=No, 'X'=Yes, 'D'=Default) &N: number of the spool request (as of Release 4.5A) &n: number of the output request (as of Release 4.5A) c: number of pages (as of Release 4.0A) &s: field 'Suffix2' of the spool request (as of Release 4.0A) Command to query job status : This is required to know the status of the output at OS level, if this not that much important you can provide “echo ok” but don’t leave it blank. Click Enter and Save the printer definition Its done Example For example if you would like to create the file to /intf/rq1/outb/mm/pending and rename the file to <CREATOR>-<TITLE>-<SPOOL ID>_<YYYYMMDDHHMMSS>.done Create the following script (say name spool_output_to_os.sh and placed at /var/adm/scripts/BASIS/general )
  • 6. Print to Text File at OS Level SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com © 2006 SAP AG 6 J=$1 N=$2 O=$3 T=$4 E=".done" d=`date '+20%y%m%d%H%M%S'` FN=`echo $J | awk -F/ '{printf("%s",$7)}'` FN1=${O}-${T}-${N}_${d}${E} mv /intf/rq1/outb/mm/pending/${FN} /intf/rq1/outb/mm/pending/${FN1} and in “Command to transfer print data “ enter /usr/bin/cp &F /intf/rq1/outb/mm/pending/ ; /var/adm/scripts/BASIS/general/spool_output_to_os.sh &F &N &O &T Here parameter &F &N &O &T are passed to scripts.
  • 7. Print to Text File at OS Level SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com © 2006 SAP AG 7 Disclaimer and Liability Notice This document may discuss sample coding or other information that does not include SAP official interfaces and therefore is not supported by SAP. Changes made based on this information are not supported and can be overwritten during an upgrade. SAP will not be held liable for any damages caused by using or misusing the information, code or methods suggested in this document, and anyone using these methods does so at his/her own risk. SAP offers no guarantees and assumes no responsibility or liability of any type with respect to the content of this technical article or code sample, including any liability resulting from incompatibility between the content within this document and the materials and services offered by SAP. You agree that you will not hold, or seek to hold, SAP responsible or liable with respect to the content of this document.