ARE 1 output
Dear Friends,
I am working on ARE form in SD .. but iam unabul to see output of standard form . My consultant was telling that its ABAP problem so u are un abut to take output of standard forms .
so friends plz help me whar is problem & plz guide me how to take print out of standard one ,
Regards .
Reddy
Hi
Check whether the excise values are flowing in Excise INVOICE.
IF not you have to maintain a user exit in J_1I7_USEREXIT_DUTY_IN_EXPORT
where you have to make SUPPRESS CALCULATION = X
ALso
Remarks needs to be maintained in ARE1
regards
PRASHANTH
Similar Messages
-
Are Output of reports generated stored in tables & fields in SAP?
Hi,
If a report is generated or if a scheduled job is executed, is the output stored in SAP tables & fields or just displayed on the screen.
Thank You...
Nag.Hi Rajesh,
You are right that, If posting happens, obviously the data is going to be stored in tables.
I am not talking about posting. I want to know if the job is scheduled for report generation (where there is no posting involved) whether the result is stored in tables or not. After executing SM37, we will select the job and click Spool right. I am talking about the report result stored there.
waiting for your reply...
Thank you,
Nag -
How to check what fields are output from ABAP to smartform
Hi All,
I am working on a Zcopy of RLB_INVOICE smart form and need to check what fields are being output to the vendor_address window in the smartform.
I have examined the NACE setup and found "Medium -> printoutput", "Program -> ZRLB_INVOICE", "Form Routine -> "ENTRY_INS", "Form -> ZRLB_INVOICE", "PDF/SmartForm -> ZRLB_INVOICE".
Where would I find the code that shows the direct correlation between the driver program and a specific element of the smart form.
All I need to check is that all elements of the venfore address are being sent to the form as I am hearing reports that we are missing house number on the printed output.
Many thanksHi Meenakshi,
First you find out your driver program. Here in your case it is ZRLB_INVOICE. Then within that check where address of the vendor is found and is assigned to which import parameter of the smartform.
Check your smartform also. Find which all fields are being printed in that. If vendor_address window is an address window, then there will be uniques identifier passed to that window from the driver program.
Regards,
Abijith -
Where are output module presets physically stored?
I have a broken XP installation that is not fixable but the drive is accesible from my other Windows installation.
Before I broke XP I deactivated my CS3 and now I have it installed and activated in Windows 7.
Now I am really missing all my output module presets. I can import them, but then I should have exported them first, which is not an option.
The AppData folder is really full of stuff
Here are some other important folders when migrating. In this case D: is the old installation drive:
D:\Program Files (x86)\Adobe\Adobe After Effects CS3\Support Files\Scripts\
D:\Program Files (x86)\Adobe\Adobe After Effects CS3\Support Files\Templates\
D:\Users\[Username]\AppData\Adobe\After Effects\8.0\
Media Encoder presets:
D:\Users\[Username]\AppData\Adobe\After Effects\8.0\MediaIO\Presets
But hey no Output Modules in there..Hi,
Thanks for the reply.
I think you misunderstood me though. There was nothing wrong with the Adobe installation. It was my operating system that I broke. Sort of on purpose. I just assumed I could get my settings back the good old manual way instead of using the program. And I was right for the most part. Don't worry, I know what I am doing. I just didn't know the output module presets weren't stored in either the application folder or the AppData folder.
So what I need to know is where those presets are physically stored so I can get them back too.
Oh I hope it's not the registry. That's the one thing I cannot touch. But then again why would it be in the registry when everything else is stored in files and AE is portable to OSX anyway and they don't have a registry. -
Is there a way to modify the bass levels that are output from the built in iMac speakers?
For example, in the settings of the iPhone, you can change the EQ to Bass Boost. Is there such an option on the iMac?
It's here in iTunes 11:
-
What are output condition records?
Hi all,
Please refer to documents/files or threads if needed...
Thanks,
Charles.This is related to IDocs..
-
What are the output type and Tcodes?+
What are the output type and Tcodes?
hi,
ex-how to config output type.
You will assign output types using Transaction NACE.
Do the follow steps to assign output type
1)Select Application Type V2 which will have description Shipping.
2)Click on Output types button.
3)Go to change mode by pressing Ctrl+F4.
4)Select one output type which already exists
5)Do Copy As(F6)
6)Give your output type against Output Type field.
7)Under General data Tab, Give Program and Form routine and Save the data.
i think it a work of functional guy but at senior level i think it is not a big deal for abaper.
Check the following documentation
In NACE t-codewe have the application for each one. based on the application output type can be defined, based on output type script and print progrma can be defined.
If suppose data can be read from EDI then we should go for condition records.
So whenever we execute the script first composer checks the output type and then execute the program. in program whenever opn form FM will be populate then script will open first. After that again program till another FM will populate if it then script will populate........like it is cycle proces. Composer does all these things and at last it will submit that output to spool.
Go to the Transaction NACE.
choose the related sub module.. like billing or shipping
doubel click on Output Types
Choose the Output Type for which whcih you wanted your script to trigger
Then select the Output Type and double click on Processing Routine
Then go to create new entries--> Select the Medium (1- print output), then enter your Script and Print Program detls --> Save and come out
Now go to the Transaction (for which you have created the output type)... Issue output--> Select the output type --> Print....
Device Types for SAP Output Devices (Detail Information)
Definition
The device type indicates the type of printer to be addressed. When you define an output device, choose the name of the device type that was defined in the SAP System for your printer model, such as Post2 for a PostScript printer. In the case of frontend printing under Microsoft Windows, you can also use the generic (device-independent) device type SWIN.
The system uses the information in the device type to convert a document from the internal SAP character representation (spool request in OTF or in text format) to a device-specific, print-ready data stream (output request). Since a device type specifies attributes that apply to all devices of a certain model, it can be shared among device definitions. For example, all devices in the SAP spool system that are compatible with Hewlett-Packard LaserJet IIID printers would use the HPLJIIID device type.
You should not confuse the device type with the printer driver. The device type is the total of all attributes of an output device that the SAP System must know to control the output device correctly, such as control commands for font selection, page size, character set selection, and so on. These attributes also include the printer driver that SAPscript/Smart Forms (the SAP form processor) should use for this printer. The SAPscript printer driver that is to be used for devices of this type for output formatting is therefore only an attribute that the device type specifies.
How do I choose the correct device type?
In most cases, the SAP System already provides the appropriate device type for the printer type for the printer model that you want to use.
These standard device types are completely defined and need no modification or extension before you use them in device definitions.
You can also download missing device types from the sapserv server. For a current list of the supported device types, see SAP Note 8928 in the SAP Service Marketplace.
Most printers can be controlled using a generic format, such as PostScript. They can be switched to a mode that is compatible with one of the standard printers for which an SAP device type is available. In this case, a supported model is emulated.
Almost all printers are delivered with Microsoft Windows printer drivers. The system can control these printers with the generic (device-independent) device type SWIN. The Microsoft Windows spool system then performs the processing of the print data.
If the specified device types are not available, and generic device types cannot be used, you must create your own device type or edit a copy of an existing device type. We recommend that only those with specialist knowledge of the SAP Spool System and printer driver code do this. For more information, see Defining a New Device Type .
Attributes of a Device Type
A device type is distinguished by the attributes listed below. If you change an existing device type or create a new device type, you must change at least some of these attributes.
Character set: A character set specifies the codes with which characters must be represented in the print-ready output stream (output request). This code replaces the generic SAP characters set that is used internally by the SAP spool system (spool request).
Printer driver: You can specify different printer drivers for printing SAPscript documents and ABAP lists.
Print controls: Print controls represent printer operations, such as boldface or changing the font size. These print control are replaced by printer-specific commands during the creation of the output request from a spool request.
Formats: Formats specify the format supported by the SAP system. The system differentiates between SAPScript formats (DINA4 and LETTER) and ABAP list formats (X_65_132 = 65 rows/132 columns).
Page format: A page format is the interface between a format and SAPscript. It specifies the paper dimensions with which SAPScript can calculate the row and column lengths.
Actions: Actions are output device-specific commands that are required for the implementation of a format. The action printer initialization, for example, can contain a printer command with which the number of rows on a page is defined. There is a set of actions for every format supported by a device type.
regards
siva -
Does the video adapter output both S-Video and Composite simultaneously?
I have a multi-zone receiver which converts S-Video to component for the main zone and passes S-Video signals through to zone 2 but does not convert them to composite which is how that zone is set up. I solved a similar problem with my DVD player by connecting both the component output and composite output of the DVD player to the receiver allowing high quality viewing in the lounge room and passable viewing in the bedroom.
I realise the quality from the adapter is questionable particularly for composite but I'm still interested if both S-Video and composite signals are output from the MBP 17" via the adapter simultanesouly.
Thanks,
Max.I have a follow-up question which may help answer the original question. Does the MBP have to detect the external display when connected via S-Video/Composite in the same way that it has to when connected via DVI? My Dell notebook had so much trouble detecting composite and S-Video connections that eventually I gave up so I'm a little "once bitten twice shy" on this. If the MBP doesn't attempt to detect the external display via S-Video or composite then it must output both S-Video and Composite signals continuously (which would be great).
Thanks,
Max. -
Sapscript output(Spool) to PDF problem when viewed
We have a number of documents which are output in Russian using the Cyrillic courier font within our Uincode SAP system. They look fine on the spool when viewed, print okay, and all look fine when converted to a PDF file (using RSTXPDFT4) and viewed via Adobe PDF viewer (vers 9.1.20), except one form, the invoice, which will not display properly in Adobe, showing square blocks with crosses through them when viewed. The strange thing is that when this same PDF is viewed via Sumatra (Open source PDF viewer) it looks perfect, but will not display via the Adobe PDF viewer, even though all the other delivery/dispatch docuemnts (all Sapscript) print and view fine via the Adobe PDF viewer.
I guess I could suggest that we just use Sumatra from now on, but that is not really the answer when you have a multinational company which has Adobe already installed on all hardware as default.
Has anyone come across this problem before. I was wondering if there could be anything in Sapscript that might have caused this as this is a copy of SAP standard Russian Invoice Sapscript (J_3RVINVOICE)?
I'm going to check OSS to see if there's a fault with the PDF convertion program (RSTXPDFT4) but I would like to hear from anyone that may have encountered the same problem.
Regards
GaryHi Gary
How the issue is resolved, please let me know. Since i am also facing same issue.
Thanks
M G Shankar -
hi friends,
i have a report that i submit to run as background job...in this report there are outputs, e.g. "WRITE" statements...how can i make those visible on screen ?
regards,
clemensHi,
When you run the job in the Background, the Output will be generated in the Spool, so you can look at this from SE37 or From Spool SP01, from there you can see that value,
You can use the below function modules to read the Spool
BAPI_XBP_JOB_SPOOLLIST_READ Read the Spool List of an ABAP Job Step
BAPI_XBP_JOB_SPOOLLIST_READ_20 Read the spool list for an ABAP job step (XBP Version 2.0)
BAPI_XBP_JOB_SPOOLLST_READ_RW Read ABAP Job Step Spool List (Raw Format)
Regards
Sudheer -
How do I synchroniz​e my instrument​s output at the same time?
Hello:
I am using Labview to control a New Era Pump Systems automatic syringe pump and to record diameter measurements from a LaserMike optical comparator. My program is fully functional, the code is attached with all auxilliary files in the NE-50X folder. I mostly understand my program, I used drivers for the NE-50X pump found on the NI website to build my code and added to it as needed. My program currently does the following:
After I push the white Run button, I am prompted for a file name. After I enter one, Labview begins collecting data from the LaserMike, syringe pump and pressure transducer and outputs them to their respective numerical indicators and waveform charts. Then I can change the syringe pump flow rate and syringe diameter on the front panel. Once I push the green RUN button on the front panel, the syringe pump runs, and the balloon diameter vs. syringe volume XY graph begins to record. I can then reverse the direction of the pump and/or pause the pump however many times I like, while Labview still records diameter from the LaserMike. Pushing the red STOP button on the front panel terminates the program and stops the pump.
Here are three things I would like to change about my program that I don't know how/what to do:
1) I would like to synchronize my machines so that they are outputing at the same rate.
2) I would like to convert my strain output into PSI.
If anyone has ideas about how to do any of these three things, your help is greatly appreciated.
Attachments:
NE-50X.llb 994 KB
Balloon DiameterStrain.vi 227 KBHello N,
What is considered a special board? I am using a SC-2345 DAQ board. This is where my transducer is hooked into. For my syringe pump and LaserMike I have them being inputed as instruments. When you say millisec resolution does that mean that the data points will be lined up better with one another?
I would like my strain gauge to measure pressure.
Thanks! -
I'm using the MHDDK for analog out/in with the PXIe 6341 DAQ card.
The examples, e.g. aoex5, show a single Timer (outTimerHelper::loadUI method), but the example shows DMA data loaded with the same vector size.
There is a comment in the outTimerHelper:rogramUpdateCount call which implies that different buffer sizes per channel can be used.
(the comment is: Switching between different buffer sizes will not be used)
Does anyone know what the format of the DMA buffer should be for data for multiple channels with different frequencies ?
For example, say we want a0 with a 1Khz Sine wave and a1 with a 1.5Khz sine wave. What does the DMA buffer look like ?
With the same frequency for each channel, the data is interleaved, e.g. (ao0#0, ao1#0; ao0#1, ao1#1, ...), but when the frequencies for each channel is different, what does the buffer look like ?Hello Kenstern,
The data is always interleaved because each card only has a single timing engine for each subsystem.
For AO you must specify the number of samples that AO will output. You also specify the number of channels. Because there is only one timing engine for AO, each AO will channel will get updated at the same time tick of the update clock. The data will be arranged interleaved exactly as the example shows because each AO channel needs data to output at each tick of the update clock. The data itself can change based on the frequency you want to output.
kenstern wrote:
For example, say we want a0 with a 1Khz Sine wave and a1 with a 1.5Khz sine wave. What does the DMA buffer look like ?
With the same frequency for each channel, the data is interleaved, e.g. (ao0#0, ao1#0; ao0#1, ao1#1, ...), but when the frequencies for each channel is different, what does the buffer look like ?
In your example, you need to come up with an update rate that works for both waveforms (1 KHz and 1.5 KHz sine waves). To get a good representation of a sine wave, you need to update more than 10x as fast as your fastest frequency...I would recommend 100x if possible.
Update Frequency: 150 KHz
Channels: 2
Then you create buffers that include full cycles of each waveform you want to output based on the update frequency. These buffers must also be the same size.
Buffer 1: Contains data for the 1 KHz sine wave, 300 points, 2 sine wave cycles
Buffer 2: Contains data for the 1.5 KHz sine wave, 300 points, 3 sine wave cycles
You then interleave them as before. When the data is run through the ADC, they are outputting different sine waves even though the AO channels are updating at the same rate. -
Error in Output message for PO
Hello,
While saving Purchase Orders I get a warning in message type NEU for the Fax transmission for two particular vendors.When I select the line and check on 'Processing log' button, I see a message in popup as "Error in OPEN_FORM for (purchase order number)".
Please help.
Thanks,
Amit GHi Amit,
I have found some information that may assist us in determining the cause of your issue.
The error ME142 can have different causes like missing authorizations or a terminated connection. Please check SAP NOTE 397691. This note states that is errors occur when purchasing documents are output, the system generates an error message in the log of the message overview.
However, error message ME142 'Error in OPEN_FORM for document &' contain only the information that an error occurred and not the error cause. With the attached source code, the error cause is also displayed in the error message (for example, missing authorizations, terminated connection and so on).
If you apply the note then this will provide more detailed
information behind the problem you are having. Please apply this SAP note and then you can go further.
Sanjeev -
VF03 smartform: Output could not be issued
Hi All,
Ive created a custom invoice print program and associated smartform.
These two run perfectly together when standing alone.
However Ive created a custom output type to call this program from VF03.
This output type appears in the "Issue Output To "options in VF03.
But it returns the message "Output could not be issued" when trying to print.
In debug mode the Print Program and smartform execute perfectly when calling from VF03 in the same way, but the output fails to appear.
In the Header -Output section inside the status of the output type is "Not Processed".
Any ideas guys??Hi
It seems that the Output determination is not taking place correctly
the link between the Output type and Program and smartform is not established peoperly
You have to assign this in SPRO for the billing documents
And most of the times it won't work we assign our custom program to the custom output type
it is better to use the std output type and the Std program(you copy the std and can change it but the same copied ZPeogram to be attached) and Copied/modified smartform.
check this.
Output is a link between the Driver Program and the Sapscript,
An output type summarizes messages of the same meaning. It contains parameters that are valid for all its assigned messages, for example appropriate partner functions.
Transmission medium is a medium which the layout will be come out, this may be printout, Fax or Mail
Check this link.
http://help.sap.com/saphelp_nw2004s/helpdata/en/c8/19884743b111d1896f0000e8322d00/content.htm
ex-how to config output type.
You will assign output types using Transaction NACE.
Do the follow steps to assign output type
1)Select Application Type V2 which will have description Shipping.
2)Click on Output types button.
3)Go to change mode by pressing Ctrl+F4.
4)Select one output type which already exists
5)Do Copy As(F6)
6)Give your output type against Output Type field.
7)Under General data Tab, Give Program and Form routine and Save the data.
i think it a work of functional guy but at senior level i think it is not a big deal for abaper.
Check the following documentation
In NACE t-codewe have the application for each one. based on the application output type can be defined, based on output type script and print progrma can be defined.
If suppose data can be read from EDI then we should go for condition records.
So whenever we execute the script first composer checks the output type and then execute the program. in program whenever opn form FM will be populate then script will open first. After that again program till another FM will populate if it then script will populate........like it is cycle proces. Composer does all these things and at last it will submit that output to spool.
Go to the Transaction NACE.
choose the related sub module.. like billing or shipping
doubel click on Output Types
Choose the Output Type for which whcih you wanted your script to trigger
Then select the Output Type and double click on Processing Routine
Then go to create new entries--> Select the Medium (1- print output), then enter your Script and Print Program detls --> Save and come out
Now go to the Transaction (for which you have created the output type)... Issue output--> Select the output type --> Print....
Device Types for SAP Output Devices (Detail Information)
Definition
The device type indicates the type of printer to be addressed. When you define an output device, choose the name of the device type that was defined in the SAP System for your printer model, such as Post2 for a PostScript printer. In the case of frontend printing under Microsoft Windows, you can also use the generic (device-independent) device type SWIN.
The system uses the information in the device type to convert a document from the internal SAP character representation (spool request in OTF or in text format) to a device-specific, print-ready data stream (output request). Since a device type specifies attributes that apply to all devices of a certain model, it can be shared among device definitions. For example, all devices in the SAP spool system that are compatible with Hewlett-Packard LaserJet IIID printers would use the HPLJIIID device type.
You should not confuse the device type with the printer driver. The device type is the total of all attributes of an output device that the SAP System must know to control the output device correctly, such as control commands for font selection, page size, character set selection, and so on. These attributes also include the printer driver that SAPscript/Smart Forms (the SAP form processor) should use for this printer. The SAPscript printer driver that is to be used for devices of this type for output formatting is therefore only an attribute that the device type specifies.
How do I choose the correct device type?
In most cases, the SAP System already provides the appropriate device type for the printer type for the printer model that you want to use.
These standard device types are completely defined and need no modification or extension before you use them in device definitions.
You can also download missing device types from the sapserv server. For a current list of the supported device types, see SAP Note 8928 in the SAP Service Marketplace.
Most printers can be controlled using a generic format, such as PostScript. They can be switched to a mode that is compatible with one of the standard printers for which an SAP device type is available. In this case, a supported model is emulated.
Almost all printers are delivered with Microsoft Windows printer drivers. The system can control these printers with the generic (device-independent) device type SWIN. The Microsoft Windows spool system then performs the processing of the print data.
If the specified device types are not available, and generic device types cannot be used, you must create your own device type or edit a copy of an existing device type. We recommend that only those with specialist knowledge of the SAP Spool System and printer driver code do this. For more information, see Defining a New Device Type .
Attributes of a Device Type
A device type is distinguished by the attributes listed below. If you change an existing device type or create a new device type, you must change at least some of these attributes.
Character set: A character set specifies the codes with which characters must be represented in the print-ready output stream (output request). This code replaces the generic SAP characters set that is used internally by the SAP spool system (spool request).
Printer driver: You can specify different printer drivers for printing SAPscript documents and ABAP lists.
Print controls: Print controls represent printer operations, such as boldface or changing the font size. These print control are replaced by printer-specific commands during the creation of the output request from a spool request.
Formats: Formats specify the format supported by the SAP system. The system differentiates between SAPScript formats (DINA4 and LETTER) and ABAP list formats (X_65_132 = 65 rows/132 columns).
Page format: A page format is the interface between a format and SAPscript. It specifies the paper dimensions with which SAPScript can calculate the row and column lengths.
Actions: Actions are output device-specific commands that are required for the implementation of a format. The action printer initialization, for example, can contain a printer command with which the number of rows on a page is defined. There is a set of actions for every format supported by a device type.
Output Determiantion :
You can use output control to automate either messages or subsequent processing of partner-specific messages"
This means, it provides a method for you to perform subsequent processing once a document is saved in the system. This subsequent processing is normally to print the document, but can also include activities such as:
- Faxing the document
- Emailing the document
- Sending an idoc of the document
- Sending an EDI message for the document (via an Idoc)
- and so on.
In general, it uses the condition technique to determine what, if any, output is to be produced. The condition technique works by selecting key fields from the document (document type, plant, etc.) and matching them to master data records you have previously set up. If there is a match, then output is produced.
You can use transaction NACE for the output determination settings for all applications.
1. When you start transaction NACE, a list of all represented applications appears.
2. From this initial screen, you can access all the individual processing screens for output determination from the EDIT menu.
3. Select the relevant application. This transaction does not have a menu path in customizing.
Refer the following links.
http://help.sap.com/saphelp_crm40/helpdata/en/b3/58bf39f7568648e10000000a11402f/content.htm
http://help.sap.com/saphelp_erp2004/helpdata/en/c8/19878343b111d1896f0000e8322d00/frameset.htm
http://help.sap.com/saphelp_erp2004/helpdata/en/c0/4e4746497d11d385ee0000e81ddea0/content.htm
<b>Reward points for useful Answers</b>
Regards
Anji -
Need a VB-Script that read a txt-file and only the lines that are new since last time
Hi,
I need help to write a VB script that read all new lines since the last time.
For example: The script reads the textfile at specific time, then 10 minutes later the script read the file again, and it should now only read the lines that are new since last time. Anyone that has such a script in your scriptingbox?
cheers!
DocHo
DocBased on the excellent idea by Pegasus, where is a VBScript solution. I use a separate file to save the last line count read from the file, then each time the file is read I update the line count. Only lines after the last count are output by the program:
Option Explicit
Dim strFile, objFSO, objFile, strCountFile, objCountFile, strLine, lngCount, lngLine
Const ForReading = 1
Const ForWriting = 2
Const OpenAsASCII = 0
Const CreateIfNotExist = True
' Specify input file to be read.
strFile = "c:\Scripts\Example.log"
' Specify file with most recent line count.
strCountFile = "c:\Scripts\Count.txt"
' Open the input file for reading.
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile(strFile, ForReading)
' Check if the line count file exists.
If (objFSO.FileExists(strCountFile) = False) Then
' Initial count is 0, so all lines are read.
lngCount = 0
Else
' Open the line count file.
Set objCountFile = objFSO.OpenTextFile(strCountFile, ForReading)
' Read the most recent line count.
Do Until objCountFile.AtEndOfStream
lngCount = CLng(objCountFile.ReadLine)
Loop
End If
' Read the input file.
lngLine = 0
Do Until objFile.AtEndOfStream
' Count lines.
lngLine = lngLine + 1
strLine = objFile.ReadLine
If (lngLine >= lngCount) Then
' Output the line.
Wscript.Echo strLine
End If
Loop
' Close all files.
objFile.Close
If (lngCount > 0) Then
objCountFile.Close
End If
' Ignore last line of the file if it is blank.
If (strLine = "") Then
lngLine = lngLine - 1
End If
' Save the new line count.
Set objCountFile = objFSO.OpenTextFile(strCountFile, _
ForWriting, CreateIfNotExist, OpenAsASCII)
objCountFile.WriteLine CStr(lngLine + 1)
objCountFile.Close
Richard Mueller - MVP Directory Services -
Send Smartforms Output as pdf Attachment in E-Mail
Hi!
I've searched quite a long time and tried to use different examples I've found in the forum but it doesn't work for me.
I tried to do the following:
Send output of smartforms by mail to a specified e-mail adress. Sometimes there have to be sent 2 pdf's (both are output of smartforms) in one e-mail.
The function to download the output of smartform with FM CONVERT_OTF_2_PDF and GUI_DOWNLOAD works fine for me but I couldn't get the FM SO_NEW_DOCUMENT_SEND_API1 to work.
Can someone give me an example or a description to get from the output of the smartform to the e-mail with attachment?
I'm pretty new to this so it maybe is a very simple question.
Regards,
JackoTry the following code
report zpp430_report_in_pdf no standard page heading line-size 255.
*& Converts spool request into PDF document and emails it to *
*& recipicant. *
*& Execution *
*& This program must be run as a background job in-order for the write *
*& commands to create a Spool request rather than be displayed on *
*& screen *
tables: tsp01.
parameter: p_email1 like somlreci1-receiver.
p_sender like somlreci1-receiver.
p_repid like sy-repid, " Report to execute
p_linsz like sy-linsz default 132, " Line size
p_paart like sy-paart default 'X_65_132', " Paper Format
p_slset like sy-slset, "Variant name
p_odescr like sodocchgi1-obj_descr,
p_adescr type so_obj_nam,
p_delspl as checkbox.
*DATA DECLARATION
data: gd_recsize type i.
* Spool IDs
types: begin of t_tbtcp.
include structure tbtcp.
types: end of t_tbtcp.
data: it_tbtcp type standard table of t_tbtcp initial size 0,
wa_tbtcp type t_tbtcp.
* Job Runtime Parameters
data: gd_eventid like tbtcm-eventid,
gd_eventparm like tbtcm-eventparm,
gd_external_program_active like tbtcm-xpgactive,
gd_jobcount like tbtcm-jobcount,
gd_jobname like tbtcm-jobname,
gd_stepcount like tbtcm-stepcount,
gd_error type sy-subrc,
gd_reciever type sy-subrc.
data: w_recsize type i,
mc_valid(1) type c.
data: gd_subject like sodocchgi1-obj_descr,
it_mess_bod like solisti1 occurs 0 with header line,
it_mess_att like solisti1 occurs 0 with header line,
gd_sender_type like soextreci1-adr_typ,
gd_attachment_desc type so_obj_nam,
gd_attachment_name type so_obj_des,
mi_rqident like tsp01-rqident.
* Spool to PDF conversions
data: gd_spool_nr like tsp01-rqident,
w_spool_nr like tsp01-rqident,
gd_destination like rlgrap-filename,
gd_bytecount like tst01-dsize,
gd_buffer type string.
data:
mstr_print_parms like pri_params.
* Binary store for PDF
data: begin of it_pdf_output occurs 0.
include structure tline.
data: end of it_pdf_output.
constants: c_dev like sy-sysid value 'DEV',
c_no(1) type c value ' ',
c_device(4) type c value 'LOCL'.
*START-OF-SELECTION.
start-of-selection.
* Write statement to represent report output. Spool request is created
* if write statement is executed in background. This could also be an
* ALV grid which would be converted to PDF without any extra effort
* WRITE 'Hello World'.
* NEW-PAGE.
* COMMIT WORK.
* NEW-PAGE PRINT OFF.
* IF SY-BATCH EQ 'X'.
* PERFORM GET_JOB_DETAILS.
* PERFORM OBTAIN_SPOOL_ID.
*** Alternative way could be to submit another program and store spool
*** id into memory.
*submit ZSPOOLTOPDF2
* to sap-spool
* spool parameters %_print
* archive parameters %_print
* without spool dynpro
* and return.
call function 'GET_PRINT_PARAMETERS'
exporting
authority = space
copies = '1'
cover_page = space
data_set = space
department = space
destination = space
expiration = '1'
immediately = space
* in_archive_parameters = space
* in_parameters = space
layout = space
mode = space
new_list_id = 'X'
no_dialog = 'X'
user = sy-uname
importing
out_parameters = mstr_print_parms
valid = mc_valid
exceptions
archive_info_not_found = 1
invalid_print_params = 2
invalid_archive_params = 3
others = 4.
if mstr_print_parms-pdest = space.
mstr_print_parms-pdest = 'LOCL'.
endif.
mstr_print_parms-linsz = p_linsz.
mstr_print_parms-paart = p_paart.
submit (p_repid) to sap-spool without spool dynpro
spool parameters mstr_print_parms
using selection-set p_slset
and return.
* Get spool id from program called above
perform get_spool_number using sy-repid sy-uname changing mi_rqident.
* IMPORT w_spool_nr FROM MEMORY ID SY-REPID.
perform convert_spool_to_pdf.
perform process_email.
if p_delspl eq 'X'.
perform delete_spool.
endif.
if sy-sysid = c_dev.
wait up to 5 seconds.
submit rsconn01 with mode = 'INT'
with output = 'X'
and return.
endif.
* ELSE.
* SKIP.
* WRITE:/ 'Program must be executed in background in-order for spool'
* 'request to be created.'.
* ENDIF.
* FORM obtain_spool_id *
form obtain_spool_id.
check not ( gd_jobname is initial ).
check not ( gd_jobcount is initial ).
select * from tbtcp
into table it_tbtcp
where jobname = gd_jobname
and jobcount = gd_jobcount
and stepcount = gd_stepcount
and listident <> '0000000000'
order by jobname
jobcount
stepcount.
read table it_tbtcp into wa_tbtcp index 1.
if sy-subrc = 0.
message s004(zdd) with gd_spool_nr.
gd_spool_nr = wa_tbtcp-listident.
message s004(zdd) with gd_spool_nr.
else.
message s005(zdd).
endif.
endform. "OBTAIN_SPOOL_ID
* FORM get_job_details *
form get_job_details.
* Get current job details
call function 'GET_JOB_RUNTIME_INFO'
importing
eventid = gd_eventid
eventparm = gd_eventparm
external_program_active = gd_external_program_active
jobcount = gd_jobcount
jobname = gd_jobname
stepcount = gd_stepcount
exceptions
no_runtime_info = 1
others = 2.
endform. "GET_JOB_DETAILS
* FORM convert_spool_to_pdf *
form convert_spool_to_pdf.
call function 'CONVERT_ABAPSPOOLJOB_2_PDF'
exporting
src_spoolid = mi_rqident
no_dialog = c_no
dst_device = c_device
importing
pdf_bytecount = gd_bytecount
tables
pdf = it_pdf_output
exceptions
err_no_abap_spooljob = 1
err_no_spooljob = 2
err_no_permission = 3
err_conv_not_possible = 4
err_bad_destdevice = 5
user_cancelled = 6
err_spoolerror = 7
err_temseerror = 8
err_btcjob_open_failed = 9
err_btcjob_submit_failed = 10
err_btcjob_close_failed = 11
others = 12.
check sy-subrc = 0.
* Transfer the 132-long strings to 255-long strings
loop at it_pdf_output.
translate it_pdf_output using ' ~'.
concatenate gd_buffer it_pdf_output into gd_buffer.
endloop.
translate gd_buffer using '~ '.
do.
it_mess_att = gd_buffer.
append it_mess_att.
shift gd_buffer left by 255 places.
if gd_buffer is initial.
exit.
endif.
enddo.
endform. "CONVERT_SPOOL_TO_PDF
* FORM process_email *
form process_email.
describe table it_mess_att lines gd_recsize.
check gd_recsize > 0.
perform send_email using p_email1.
* perform send_email using p_email2.
endform. "PROCESS_EMAIL
* FORM send_email *
* --> p_email *
form send_email using p_email.
check not ( p_email is initial ).
refresh it_mess_bod.
* Default subject matter
gd_subject = p_odescr.
gd_attachment_desc = p_adescr.
* CONCATENATE 'attach_name' ' ' INTO gd_attachment_name.
it_mess_bod = 'This is an automated report from SAP.'.
append it_mess_bod.
it_mess_bod = 'Please do not reply to this mail id.'.
append it_mess_bod.
*IT_MESS_BOD = 'For any clarification on the details of this report'
* APPEND IT_MESS_BOD.
* IT_MESS_BOD = 'please contact Business Planning. Thank you'.
* APPEND IT_MESS_BOD.
* If no sender specified - default blank
if p_sender eq space.
gd_sender_type = space.
else.
gd_sender_type = 'INT'.
endif.
* Send file by email as .xls speadsheet
perform send_file_as_email_attachment
tables it_mess_bod
it_mess_att
using p_email
p_odescr
'PDF'
gd_attachment_name
gd_attachment_desc
p_sender
gd_sender_type
changing gd_error
gd_reciever.
endform. "SEND_EMAIL
* FORM delete_spool *
form delete_spool.
data: ld_spool_nr type tsp01_sp0r-rqid_char.
ld_spool_nr = gd_spool_nr.
check p_delspl <> c_no.
call function 'RSPO_R_RDELETE_SPOOLREQ'
exporting
spoolid = ld_spool_nr.
endform. "DELETE_SPOOL
*& Form SEND_FILE_AS_EMAIL_ATTACHMENT
* Send email
form send_file_as_email_attachment tables it_message
it_attach
using p_email
p_mtitle
p_format
p_filename
p_attdescription
p_sender_address
p_sender_addres_type
changing p_error
p_reciever.
data: ld_error type sy-subrc,
ld_reciever type sy-subrc,
ld_mtitle like sodocchgi1-obj_descr,
ld_email like somlreci1-receiver,
ld_format type so_obj_tp ,
ld_attdescription type so_obj_nam ,
ld_attfilename type so_obj_des ,
ld_sender_address like soextreci1-receiver,
ld_sender_address_type like soextreci1-adr_typ,
ld_receiver like sy-subrc.
data: t_packing_list like sopcklsti1 occurs 0 with header line,
t_contents like solisti1 occurs 0 with header line,
t_receivers like somlreci1 occurs 0 with header line,
t_attachment like solisti1 occurs 0 with header line,
t_object_header like solisti1 occurs 0 with header line,
w_cnt type i,
w_sent_all(1) type c,
w_doc_data like sodocchgi1.
ld_email = p_email.
ld_mtitle = p_mtitle.
ld_format = p_format.
ld_attdescription = p_attdescription.
ld_attfilename = p_filename.
ld_sender_address = p_sender_address.
ld_sender_address_type = p_sender_addres_type.
* Fill the document data.
w_doc_data-doc_size = 1.
* Populate the subject/generic message attributes
w_doc_data-obj_langu = sy-langu.
w_doc_data-obj_name = 'SAPRPT'.
w_doc_data-obj_descr = ld_mtitle .
w_doc_data-sensitivty = 'F'.
* Fill the document data and get size of attachment
clear w_doc_data.
read table it_attach index w_cnt.
w_doc_data-doc_size =
( w_cnt - 1 ) * 255 + strlen( it_attach ).
w_doc_data-obj_langu = sy-langu.
w_doc_data-obj_name = 'SAPRPT'.
w_doc_data-obj_descr = ld_mtitle.
w_doc_data-sensitivty = 'F'.
clear t_attachment.
refresh t_attachment.
t_attachment[] = it_attach[].
* Describe the body of the message
clear t_packing_list.
refresh t_packing_list.
t_packing_list-transf_bin = space.
t_packing_list-head_start = 1.
t_packing_list-head_num = 0.
t_packing_list-body_start = 1.
describe table it_message lines t_packing_list-body_num.
t_packing_list-doc_type = 'RAW'.
append t_packing_list.
* Create attachment notification
t_packing_list-transf_bin = 'X'.
t_packing_list-head_start = 1.
t_packing_list-head_num = 1.
t_packing_list-body_start = 1.
describe table t_attachment lines t_packing_list-body_num.
t_packing_list-doc_type = ld_format.
t_packing_list-obj_descr = ld_attdescription.
t_packing_list-obj_name = ld_attfilename.
t_packing_list-doc_size = t_packing_list-body_num * 255.
append t_packing_list.
* Add the recipients email address
clear t_receivers.
refresh t_receivers.
t_receivers-receiver = ld_email.
t_receivers-rec_type = 'U'.
t_receivers-com_type = 'INT'.
t_receivers-notif_del = 'X'.
t_receivers-notif_ndel = 'X'.
append t_receivers.
call function 'SO_DOCUMENT_SEND_API1'
exporting
document_data = w_doc_data
put_in_outbox = 'X'
sender_address = ld_sender_address
sender_address_type = ld_sender_address_type
commit_work = 'X'
importing
sent_to_all = w_sent_all
tables
packing_list = t_packing_list
contents_bin = t_attachment
contents_txt = it_message
receivers = t_receivers
exceptions
too_many_receivers = 1
document_not_sent = 2
document_type_not_exist = 3
operation_no_authorization = 4
parameter_error = 5
x_error = 6
enqueue_error = 7
others = 8.
* Populate zerror return code
ld_error = sy-subrc.
* Populate zreceiver return code
loop at t_receivers.
ld_receiver = t_receivers-retrn_code.
endloop.
endform. "SEND_FILE_AS_EMAIL_ATTACHMENT
*& Form GET_SPOOL_NUMBER
* text
* -->P_SY_REPID text
* -->P_SY_UNAME text
* <--P_MI_RQIDENT text
form get_spool_number using f_repid
f_uname
changing f_rqident.
data:
lc_rq2name like tsp01-rq2name.
concatenate f_repid+0(9)
f_uname+0(3)
into lc_rq2name.
select * from tsp01 where rq2name = lc_rq2name
order by rqcretime descending.
f_rqident = tsp01-rqident.
exit.
endselect.
if sy-subrc ne 0.
clear f_rqident.
endif.
endform. " GET_SPOOL_NUMBER
there are lot's of posts available on sdn which u can refer to.
tx
ashwa
Maybe you are looking for
-
Deleting Reservation from RESB Table
Hi Experts, I have reservations of child component in RESB table which are resulted from the parent component in Subcontracting Scheduling Agreement. All Delivery Schedules lines are completed (GR Made.) Still reservations exist for child component.
-
IChat Sever audio and video sessions
Hi, How can I register when start and when stop sessions of audio and video?. Appreciate any help. ibook G4 Mac OS X (10.4.5)
-
What's the best iTunes import setting for highest quality and universality?
What's the best iTunes import setting for highest quality and universality?
-
I would like to instantiate collections only when they are needed. It works fine for non transactional instances but fails when my instance is transactional with following error: To perform writes on persistent data outside of a transaction, the "non
-
Why do I just get my reflection and that of my background when I try to take a picture either into or behind the sun? I have a Galaxy 4 with a Ballistic cover with a rather thick protection sheet. I have been to two Verizon stores & neither place h