Back spool report
Hi,
How to see the report in the spool while executing a program in background which has fields more than 255 characters? I want to see all the columns in the spool. But it is showing upto only 255 characters.
Plz urgent
I know that this is probably not what you want, but if you view the spool in SM37, click the "Raw" button, then you will see all of the columns, it wraps the columns greate than 255 to the next line. I think that this has something to do with the print format. When you submitted the job to the background, you told it a certain format to use, the biggest one in my system is 255. If you want to see all of the data in the graphical view of SM37, I believe you would have to have a format which is greater than 255. I don't know how to set this stuff up. Check with your basis people.
Regards,
Rich Heilman
Similar Messages
-
Hi All,
I have executed one report(Z report) in Production by Background, that has generated Spool report.
My problem is some fields are cut-off(missing) from that spool report.
Please provide the solution ASP.
Regards,
DSK.Hi DS
Do one thing: Configure your text editor as follws:
Go to Utilities->Settings->Downwards-Compatible Line Length(72) .
Hope you can away from the spool request now.
Have a look on the OSS note:
<b>
https://websmp230.sap-ag.de/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/sapnotes/index2.htm?numm=534487&nlang=EN&smpsrv=https%3a%2f%2fwebsmp201%2esap-ag%2ede</b>
Summary
Symptom
A list that includes more than 255 columns in the background is supposed to be issued. Instead of broad list lines being distributed on several printed lines for every 255 columns, only a single truncated printed line appears.
Other terms
Lists, print, 255 columns
Reason and Prerequisites
A Support Package which allows the printing of broad lists was imported. This creates a broad line of print with more than 255 columns in the spool. Generally, this is desired.However, the problem occurs if no corresponding format is defined because the default format X_65_255 truncates the line correspondingly at the print output.
Solution
1.) Define a format which can output the required number of printing columns.
2.) Using the attached correction, the number of columns in the print dialog can be changed in this special case.If a column figure of 255 is now entered, the old behavior is active again.The correction is only effective if you imported note 501826 beforehand.
Header Data
Release Status: Released for Customer
Released on: 13.06.2003 07:44:06
Priority: Correction with medium priority
Category: Program error
Primary Component: BC-ABA-LI List Processing
Releases
Software
Component Release From
Release To
Release And
subsequent
SAP_BASIS 46 46B 46B
SAP_BASIS 46C 46C 46D
Highest Implemented Support Package
Support
Packages Release Package
Name
SAP_BASIS 46B SAPKB46B44
SAP_BASIS 46B SAPKB46B48
SAP_BASIS 46C SAPKB46C36
SAP_BASIS 46C SAPKB46C40
Related Notes
586914 - Workaround for printing signature data via CJ00 or DSAL
Print Selected Notes (PDF)
Regards,
Sree
Message was edited by:
sree ram -
IN bapi- how to provide spool report with messages
in BAPI, how to provide spool report with messages?
>
sujan T wrote:
> Thanks for your reply.
>
> What is the logic to call the standard report from zprogram?Inside the zpogram how to call standard report?
>
> Regards,
> Sujan
no special logic is required
If u want to use
RPUAUDOO IN THE ZREPORT.
Put the submit button where ever required
ex: In zreport after certain process reacedu want to call then use
submit rpuaudoo and return.
Regards
Sas -
Alright, I have been through the entire board and found bit and pieces here and there on how to do this, but I am not satisfied with the results. Answers to these questions will dictate whether we use this product or not.
1) The QBE solution is great for the above EXCEPT I am unable (it seems) to make updates to the form portion of the Report/Form combination. I need to be able to lock off certain fields and disallow certain functions. Other's have asked whether this can be done. No answers issued forth.
Is there some way short of hacking into the PL/SQL code of updating the form on a wizard created QBE?
2) I was able to create my own report, link (via link object) to a custom form (update the form as I needed). Now I would like my users not to have to hit the query button (which is absurd in this case because they already have the proper record displayed). So I need to open the form in "update" mode. I have seen some different approaches to this on the board, and all kinds of code, but is there a simple way to do this (preferably from the tool, not hacking code)?
I see the code in the various posting (including the FAQ), the question is where I put in in the context of my link from report to form (if it is in the native pl/sql, this is not an answer because we will not go that route; having code blown away by the tool and have to be reentered. It goes in in the context of the tool or we don't use the tool).
Also, is there a way to utilize the "close" button from the QBE that so nicely takes you back to the report and does a refresh?
This is the simplest app I could dream up to test this product and it looks like it falls short.
In summation:
1) Generate a report. (yes)
2) Link to form (yes)
2a) Link direct to record (no query click) (no, without hacking)
3) update the form (yes, if after query click)
4) Jump back to report at spot where you left, do automatic refresh (just like QBE) (No, without hacking)
Again, this is the simplest and most common of apps, I cannot understand why it would be so hard to accomplish. What am I missing? Anybody on the board, please advise.
nullIf your report is created using ‘Reports From SQL Query’ then you can modify it using the following to achieve this:
1. Remove the link from ‘Column Formatting’ section of the report object.
2. In the SQL of the report , use custom link to the column where you want to provide link using the syntax
select a.empno,’‘||a.ename||’‘ ename_link,a.deptno
from scott.emp a
Order by a.empno
and the form will always open in ‘INSERT’ mode with passed values filled in.
Thanks
Krishnamurthy -
Hi All,
We have a requirement for back order report in BW . we are using the extractors V_SSL and VASCL to get this information.
The calculation for backorder and backlog qty are done from V_SSL. But there are few scenarios that we have to manage
1) hard deletion of deliveries
2) one schedule line with multiple deliveries
3) merging data from V_SSL & VASCL ... we tried merging at DSO level but due to difference in keys of DSO the change log update sequence messes the reocrd status
4) GBSTA appended in VASCL gives wrong value for status
Could anyone help by explaining staging for such a report if done in their system ?
Thanks ..would appreciate your help greatly !
Regards,
VNHi vidya
For hard deletion of entries are you planning to drop and reload daily ?
Since you have multiple delivery at one scheudle line , V_SSL and VASCL cant be combined.
Put load date ( which will be sydatum ) in both the DSO. Create customer extractor in BI to combine these two data sources and generate delta on load date.
Thanks,
Monika -
Hi Experts,
I have a client who do not want the Open Sales Orders that is past it's due date to show up on the Sales Back Order report.
I run into some difficulties with the querie:
When I use the Open Quantity and Deloivered Quantity fields in the query it will also bring back the Open SO with no Deliveries linked.
SELECT T1.[DocNum], T1.[CardCode], T1.[CardName], T1.[DocDate], T1.[DocDueDate], T0.[ItemCode], T0.[Dscription] FROM [dbo].[RDR1] T0 INNER JOIN ORDR T1 ON T0.DocEntry = T1.DocEntry WHERE T0.[LineStatus] = 'O' AND T0.[Quantity] <> '0'
When I use the RDR1 and DLN1 base entry link, it will also show the lines that are already delivered in full.
SELECT T1.[DocNum], T1.[CardCode], T1.[CardName], T1.[DocDate], T1.[DocDueDate], T0.[ItemCode] FROM RDR1 T0 INNER JOIN ORDR T1 ON T0.DocEntry = T1.DocEntry INNER JOIN DLN1 T2 ON T2.BaseEntry = T0.DocEntry and T2.BaseLine = T0.Visorder
How do I get a query that displays only the Sales Orders that have Backorders, without also showing the Sales Orders that have nothing delivered but is past due date?
Your help will be greatly appreciated.
Thanks,
MarliPlease check this thread:
Customized Back Order Report
Thanks,
Gordon -
Hello,
I have a customer who would like a customized back order report. They would like a query that would show them the following:
- The Items on any orders that have been partially shipped on the row level. (I was able to create a query that would do this by making it a requirement that the Delivered Quantity be greater than 0).
- The Items on any orders that may be partially shipped overall. I cannot figure out how to write this part of the query. I don't know how to tell the query only to pull the lines from orders that have other lines that have been shipped. The one query I wrote only looked at the Delivered Quantity and I made it so it had to be greater than 0. However, this left out a number of orders that did not have whole lines shipped. I would still like to see those rows.
The conventional Back Order report is not very helpful to our customer because they are a seasonal distributor. They receive most of their product all at once. For this reason, they may have whole orders that are overdue a few days (due to a delay in overseas shipping or other reasons). They know about these orders. They would like a list of the orders in which they have already shipped something (either partially shipped the line or partially shipped the order). They would then use this list to call the affected customers and ask if they would like to remainder of their order to ship when they receive the product or if they would like to cancel the remainder.
The conventional backorder report has over two thousand lines on it and it would be very time-consuming for them to go through the individual documents to determine which ones had shipments created and which ones were listed simply because they were overdue.
Can anybody help with this? I'm not sure how to tell if the sales order has had a delivery created or not. Like I said, I can figure out how to tell when a line is partially shipped but not when the order overall is only partially shipped.
I appreciate everybody's help!
Thanks,
AmandaHi Gordon,
Thank you for your query. However, your query brings the same results I was able to query as well. It shows all of the lines that have had something shipped on them. But my customer would also like to to see those orders that have had some lines shipped and other lines not.
For example, they have a sales order 10962. This sales order has 3 lines on it. 1 line on this sales was order was shipped complete. The other two lines have not been shipped at all. I would the query to pull the two lines that have not been shipped at all.
The other part of the query is what you and I have both written. This part of the query pulls the lines that have had something shipped on the line but it is not the complete line.
I was hoping there may be some sort of flag in the table or something that would indicate if a delivery has been created from the sales order. Do you know of any such flag or any way of writing a query that would check this?
Again, thank you for taking the time to write your query. I appreciate the help and time you've spent.
Thank you,
Amanda -
In back order report , I want Posting date , delivery date to display in Print layout
regards
kavitha SI itself find the solution
variable - 104 for Delivery date / 119 for posting date / 115 for customer ref / 112 for customer name.
regards
kavitha S -
Hi,
I have a simple question.
What is back order reporting? and howz it done!
This is not a technical term i know. What is the market significance of backorder reporting? i need to know this.
And howz a proposal is created?
Please help me with this!!
Thanks and Regards
ObilyObily,
We have a service level report that measures the volume delivered V's ordered and also compare the dates delivered V's expected delivery date.
Weput the Expected Delivery Date from the Order into a Char called Service Level Date, then when our delivered is made it copies that Actual Delivery Date to the same characteristic.
Therefore we can compare orders based on the service level date to delivers.
Regards
Gill -
Send back the report for revision in BPF
Hi all,
I have a scenario to create BPF
1.I have one report and user 1 make changes to that report and submit to BPC
2.i have a manager who have two options either to send back the report for revision or to approve it.
How can i proceed wit the second step?
Thanks in advance
Regards,
Anila
Edited by: Anila Mohan on Apr 6, 2009 1:02 PM
Edited by: Anila Mohan on Apr 6, 2009 1:05 PMHi Anila,
You define work status according to scenario and use BPC-Excel: E-submit- Cahnge work status Settings to modify your data work status.
Try this option it will work.
Regards
Naveen.KV -
Back ordrer report with checking on available stock
Hi ALL,
I need a back order report that will check on open sales order item (not confirm due to insufficient stock) and then lookup whether the open item had arrived and then recommend to User which Sales order to confirm the line item.
Current back order report, v.15 is not good enough.
ThanksHi
Try Tcode CO09 to view the ATP quantities. The ATP quantities are the Available To Promise - which are not assigned to any sales orders or customers and are free for sale.
Thanks,
Ravi -
I need to send sm37 Spool Report Automatically to one or more user ids.
Hai Gurus,
I need to send sm37 Spool Report Automatically to one or more user ids.
Kindly guide meThanks.. .
is it possible to create Many distribution list for each & every Spool Report ?
I mean, Can i create separate distribution list for each Reports ?. EX: ME2N Report.
Edited by: Swetha SAP Girl on Jul 6, 2009 10:11 AM -
Hi,
How do I send a spool report as an e-mail?
NOT as PDF file.
If we can send it as a text file that would also be fine, but preferably as a Spool report as it is (non-editable).Hi,
Have a look at this code...
z_send_email_fax_global
FUNCTION-POOL z_gfaian_mail_fax. "MESSAGE-ID ..
WORK TABLE AREAS
TABLES: tsp01.
INTERNAL TABLES
DATA: lt_rec_tab LIKE STANDARD TABLE OF soos1 WITH HEADER LINE,
lt_note_text LIKE STANDARD TABLE OF soli WITH HEADER LINE,
lt_attachments LIKE STANDARD TABLE OF sood5 WITH HEADER LINE.
DATA: lt_objcont LIKE STANDARD TABLE OF soli WITH HEADER LINE,
lt_objhead LIKE STANDARD TABLE OF soli WITH HEADER LINE.
DATA: pdf_format LIKE STANDARD TABLE OF tline WITH HEADER LINE.
TYPES: BEGIN OF y_files,
file(60) TYPE c,
END OF y_files.
DATA: lt_files TYPE STANDARD TABLE OF y_files WITH HEADER LINE.
DATA: l_objcont LIKE soli OCCURS 0 WITH HEADER LINE.
DATA: l_objhead LIKE soli OCCURS 0 WITH HEADER LINE.
STRUCTURES
DATA: folder_id LIKE soodk,
object_id LIKE soodk,
link_folder_id LIKE soodk,
g_document LIKE sood4,
g_header_data LIKE sood2,
g_folmem_data LIKE sofm2,
g_header_data LIKE sood2,
g_receive_data LIKE soos6,
g_ref_document LIKE sood4,
g_new_parent LIKE soodk,
l_folder_id LIKE sofdk,
v_email(50).
DATA: hd_dat like sood1.
VARIABLES
DATA: client LIKE tst01-dclient,
name LIKE tst01-dname,
objtype LIKE rststype-type,
type LIKE rststype-type.
DATA: numbytes TYPE i,
arc_idx LIKE toa_dara,
pdfspoolid LIKE tsp01-rqident,
jobname LIKE tbtcjob-jobname,
jobcount LIKE tbtcjob-jobcount,
is_otf.
DATA: outbox_flag LIKE sonv-flag VALUE 'X',
store_flag LIKE sonv-flag,
delete_flag LIKE sonv-flag,
owner LIKE soud-usrnam,
on LIKE sonv-flag VALUE 'X',
sent_to_all LIKE sonv-flag,
g_authority LIKE sofa-usracc,
w_objdes LIKE sood4-objdes.
DATA: c_file LIKE rlgrap-filename,
n_spool(6) TYPE n.
DATA: cancel.
DATA: desired_type LIKE sood-objtp,
real_type LIKE sood-objtp,
attach_type LIKE sood-objtp,
otf LIKE sood-objtp VALUE 'OTF', " SAPscript Ausgabeformat
ali LIKE sood-objtp VALUE 'ALI'. " ABAP lists
CONSTANTS
CONSTANTS: ou_fol LIKE sofh-folrg VALUE 'O',
c_objtp LIKE g_document-objtp VALUE 'RAW',
c_file_ext LIKE g_document-file_ext VALUE 'TXT'.
=================================================================================
z_send_email_fax2
FUNCTION z_faian_mail_fax2.
""Interface local:
*" IMPORTING
*" REFERENCE(SRC_SPOOLID) LIKE TSP01-RQIDENT
*" REFERENCE(FAX_MAIL_NUMBER) TYPE SO_NAME
*" REFERENCE(HEADER_MAIL) TYPE SO_OBJ_DES
*" REFERENCE(OBJECT_TYPE) TYPE SO_ESCAPE
*" TABLES
*" LT_BODY_EMAIL STRUCTURE SOLI
*" EXCEPTIONS
*" ERR_NO_ABAP_SPOOLJOB
Fist part: Verify if the spool really exists
SELECT SINGLE * FROM tsp01 WHERE rqident = src_spoolid.
IF sy-subrc NE 0.
RAISE err_no_abap_spooljob. "doesn't exist
ELSE.
client = tsp01-rqclient.
name = tsp01-rqo1name.
CALL FUNCTION 'RSTS_GET_ATTRIBUTES'
EXPORTING
authority = 'SP01'
client = client
name = name
part = 1
IMPORTING
type = type
objtype = objtype
EXCEPTIONS
fb_error = 1
fb_rsts_other = 2
no_object = 3
no_permission = 4
OTHERS = 5.
IF objtype(3) = 'OTF'.
desired_type = otf.
ELSE.
desired_type = ali.
ENDIF.
CALL FUNCTION 'RSPO_RETURN_SPOOLJOB'
EXPORTING
rqident = src_spoolid
desired_type = desired_type
IMPORTING
real_type = real_type
TABLES
buffer = l_objcont
EXCEPTIONS
no_such_job = 14
type_no_match = 94
job_contains_no_data = 54
no_permission = 21
can_not_access = 21
read_error = 54.
IF sy-subrc EQ 0.
attach_type = real_type.
ENDIF.
CALL FUNCTION 'SO_FOLDER_ROOT_ID_GET'
EXPORTING
owner = sy-uname
region = ou_fol
IMPORTING
folder_id = l_folder_id
EXCEPTIONS
OTHERS = 5.
fill out informations about the header of the email
CLEAR: g_document.
g_document-foltp = l_folder_id-foltp.
g_document-folyr = l_folder_id-folyr.
g_document-folno = l_folder_id-folno.
g_document-objtp = c_objtp.
g_document-objdes = header_mail.
g_document-file_ext = c_file_ext.
g_header_data-objdes = header_mail.
CALL FUNCTION 'SO_DOCUMENT_REPOSITORY_MANAGER'
EXPORTING
method = 'SAVE'
office_user = sy-uname
IMPORTING
authority = g_authority
TABLES
objcont = lt_body_email
attachments = lt_attachments
CHANGING
document = g_document
header_data = g_header_data
EXCEPTIONS
OTHERS = 1.
folder_id-objtp = l_folder_id-foltp.
folder_id-objyr = l_folder_id-folyr.
folder_id-objno = l_folder_id-folno.
object_id-objtp = c_objtp.
object_id-objyr = g_document-objyr.
object_id-objno = g_document-objno.
link_folder_id-objtp = l_folder_id-foltp.
link_folder_id-objyr = l_folder_id-folyr.
link_folder_id-objno = l_folder_id-folno.
REFRESH lt_rec_tab.
CLEAR lt_rec_tab.
lt_rec_tab-sel = 'X'.
lt_rec_tab-recesc = object_type. "This field for FAX/MAIL
lt_rec_tab-recnam = 'U-'.
lt_rec_tab-deliver = 'X'.
lt_rec_tab-not_deli = 'X'.
lt_rec_tab-read = 'X'.
lt_rec_tab-mailstatus = 'E'.
lt_rec_tab-adr_name = fax_mail_number.
lt_rec_tab-sortfield = fax_mail_number.
lt_rec_tab-recextnam = fax_mail_number.
lt_rec_tab-sortclass = '5'.
APPEND lt_rec_tab.
lt_rec_tab-recextnam = fax_mail_number.
lt_rec_tab-recesc = object_type.
lt_rec_tab-sndart = 'INT'.
lt_rec_tab-sndpri = 1.
APPEND lt_rec_tab.
lt_files-file = c_file.
APPEND lt_files.
begin of insertion by faianf01
hd_dat-objdes = header_mail.
CALL FUNCTION 'SO_ATTACHMENT_INSERT'
EXPORTING
object_id = object_id
attach_type = attach_type
object_hd_change = hd_dat
owner = sy-uname
TABLES
objcont = l_objcont
objhead = l_objhead
EXCEPTIONS
active_user_not_exist = 35
communication_failure = 71
object_type_not_exist = 17
operation_no_authorization = 21
owner_not_exist = 22
parameter_error = 23
substitute_not_active = 31
substitute_not_defined = 32
system_failure = 72
x_error = 1000.
IF sy-subrc > 0.
ENDIF.
end of insertion by faianf01
send email from SAPOFFICE
CALL FUNCTION 'SO_OBJECT_SEND'
EXPORTING
folder_id = folder_id
object_id = object_id
outbox_flag = outbox_flag
link_folder_id = link_folder_id
owner = sy-uname
check_send_authority = 'X'
TABLES
receivers = lt_rec_tab
note_text = lt_note_text
EXCEPTIONS
active_user_not_exist = 35
communication_failure = 71
component_not_available = 1
folder_no_authorization = 5
folder_not_exist = 6
forwarder_not_exist = 8
object_no_authorization = 13
object_not_exist = 14
object_not_sent = 15
operation_no_authorization = 21
owner_not_exist = 22
parameter_error = 23
substitute_not_active = 31
substitute_not_defined = 32
system_failure = 72
too_much_receivers = 73
user_not_exist = 35.
ENDIF.
ENDFUNCTION.
=================================================================================
z_send_email_fax
FUNCTION ZCBFS_SEND_MAIL.
""Interface local:
*" IMPORTING
*" REFERENCE(SRC_SPOOLID) LIKE TSP01-RQIDENT
*" REFERENCE(HEADER_MAIL) TYPE SO_OBJ_DES
*" TABLES
*" LIST_FAX_MAIL_NUMBER STRUCTURE SOLI
*" EXCEPTIONS
*" ERR_NO_ABAP_SPOOLJOB
DATA: vg_achou(1) TYPE n.
Fist part: Verify if the spool really exists
vg_achou = 1.
DO 60 TIMES.
SELECT SINGLE * FROM tsp01 WHERE rqident = src_spoolid.
IF sy-subrc IS INITIAL.
CLEAR vg_achou.
EXIT.
ELSE.
WAIT UP TO 1 SECONDS.
ENDIF.
ENDDO.
IF vg_achou = 1.
RAISE err_no_abap_spooljob. "doesn't exist
ENDIF.
client = tsp01-rqclient.
name = tsp01-rqo1name.
CALL FUNCTION 'RSTS_GET_ATTRIBUTES'
EXPORTING
authority = 'SP01'
client = client
name = name
part = 1
IMPORTING
type = type
objtype = objtype
EXCEPTIONS
fb_error = 1
fb_rsts_other = 2
no_object = 3
no_permission = 4
OTHERS = 5.
IF objtype(3) = 'OTF'.
desired_type = otf.
ELSE.
desired_type = ali.
ENDIF.
CALL FUNCTION 'RSPO_RETURN_SPOOLJOB'
EXPORTING
rqident = src_spoolid
desired_type = desired_type
IMPORTING
real_type = real_type
TABLES
buffer = l_objcont
EXCEPTIONS
no_such_job = 14
type_no_match = 94
job_contains_no_data = 54
no_permission = 21
can_not_access = 21
read_error = 54.
IF sy-subrc EQ 0.
attach_type = real_type.
ENDIF.
CALL FUNCTION 'SO_FOLDER_ROOT_ID_GET'
EXPORTING
owner = sy-uname
region = ou_fol
IMPORTING
folder_id = l_folder_id
EXCEPTIONS
OTHERS = 5.
fill out informations about the header of the email
CLEAR: g_document.
g_document-foltp = l_folder_id-foltp.
g_document-folyr = l_folder_id-folyr.
g_document-folno = l_folder_id-folno.
g_document-objtp = c_objtp.
g_document-objdes = header_mail.
g_document-file_ext = c_file_ext.
g_header_data-objdes = header_mail.
CALL FUNCTION 'SO_DOCUMENT_REPOSITORY_MANAGER'
EXPORTING
method = 'SAVE'
office_user = sy-uname
IMPORTING
authority = g_authority
TABLES
attachments = lt_attachments
CHANGING
document = g_document
header_data = g_header_data
EXCEPTIONS
OTHERS = 1.
folder_id-objtp = l_folder_id-foltp.
folder_id-objyr = l_folder_id-folyr.
folder_id-objno = l_folder_id-folno.
object_id-objtp = c_objtp.
object_id-objyr = g_document-objyr.
object_id-objno = g_document-objno.
link_folder_id-objtp = l_folder_id-foltp.
link_folder_id-objyr = l_folder_id-folyr.
link_folder_id-objno = l_folder_id-folno.
REFRESH lt_rec_tab.
LOOP AT LIST_FAX_MAIL_NUMBER.
lt_rec_tab-recextnam = LIST_FAX_MAIL_NUMBER-LINE.
lt_rec_tab-recesc = 'U'.
lt_rec_tab-sndart = 'INT'.
lt_rec_tab-sndpri = 1.
APPEND lt_rec_tab.
ENDLOOP.
lt_files-file = c_file.
APPEND lt_files.
hd_dat-objdes = header_mail.
CALL FUNCTION 'SO_ATTACHMENT_INSERT'
EXPORTING
object_id = object_id
attach_type = attach_type
object_hd_change = hd_dat
owner = sy-uname
TABLES
objcont = l_objcont
objhead = l_objhead
EXCEPTIONS
active_user_not_exist = 35
communication_failure = 71
object_type_not_exist = 17
operation_no_authorization = 21
owner_not_exist = 22
parameter_error = 23
substitute_not_active = 31
substitute_not_defined = 32
system_failure = 72
x_error = 1000.
IF sy-subrc > 0.
ENDIF.
send email from SAPOFFICE
CALL FUNCTION 'SO_OBJECT_SEND'
EXPORTING
folder_id = folder_id
object_id = object_id
outbox_flag = outbox_flag
link_folder_id = link_folder_id
owner = sy-uname
TABLES
receivers = lt_rec_tab
note_text = lt_note_text
EXCEPTIONS
active_user_not_exist = 35
communication_failure = 71
component_not_available = 1
folder_no_authorization = 5
folder_not_exist = 6
forwarder_not_exist = 8
object_no_authorization = 13
object_not_exist = 14
object_not_sent = 15
operation_no_authorization = 21
owner_not_exist = 22
parameter_error = 23
substitute_not_active = 31
substitute_not_defined = 32
system_failure = 72
too_much_receivers = 73
user_not_exist = 35.
ENDFUNCTION.
Please check this links for sample code.
http://www.sap-basis-abap.com/sapac018.htm
http://www.sapdevelopment.co.uk/reporting/rep_spooltopdf.htm
http://www.sapdevelopment.co.uk/reporting/email/emailhome.htm
http://www.sap-img.com/abap/sending-mail-with-attachment-report-in-background.htm
Regards -
Hi Experts,
Please tell me how to access the Spool reports in XI. And what roles are needed to access.
Thanks in advance.
MKHi,
I think you can have the access for Spool Request reports from SP01 in XI also.
These spool requests are for handling the print outputs for generated archiving or deleting log for the messages in XI.
Refer
http://help.sap.com/saphelp_nw04/helpdata/en/0e/80553b4d53273de10000000a114084/frameset.htm
For Authorizations of Spool system see below
You need
1. Authorizations for Output Devices
http://help.sap.com/saphelp_nw04/helpdata/en/c7/58c902e5bf11d18e2b0000e83dd9fc/content.htm
2. Authorizations for the System (for administrators)
http://help.sap.com/saphelp_nw04/helpdata/en/5a/4df93bad37f87ae10000000a114084/content.htm
3. Authorizations for the output controller
http://help.sap.com/saphelp_nw04/helpdata/en/c7/58c905e5bf11d18e2b0000e83dd9fc/content.htm
Thanks
Swarup -
Sendin Spool reports to an e-mail address.
Just wondering how one would go about developing a process to look for a specific spool report and send it to a specific e-mail address. I would place the reports and associated e-mail address in a Z table to be maintained by a user group. I have no clue on how to read the spool and collect a specific report to be sent via e-mail. Any help or suggestions would be greatly appreciated.
Thanks,
ScottHere is some sample code. This program takes the spool from a previous job step. It converts this spool to PDF and then inserts this PDF as an attachment in an E-mail.
* Program Name: KEG Job Sched Run with PDF Output Creation: 03/22/2001
* SAP Name : ZESU_JOB_RUN_WITH_PDF_OUTPUT Application: U *
* Author : Thomas Jung Type: 1 *
* Description : This Program will read the spool produced
* by the specified previous job step and converts it to
* PDF. This PDF-Formatted report is then output to a file. *
* Inputs: File name, job step *
* Outputs: File formatted in PDF with the report output. *
* External Routines
* FILE_GET_NAME
* CONVERT_ABAPSPOOLJOB_2_PDF
* CONVERT_OTFSPOOLJOB_2_PDF
* Z_E_OPEN_FILE_FOR_OUTPUT_BIN
* Z_E_WRITE_TO_FILE_WITH_LENGTH
* SO_NEW_DOCUMENT_ATT_SEND_API1
* BAPI_USER_GET_DETAIL
* Return Codes:
* The program uses the standard function modules for File manipulation
* therefore it has all the standard error routines for Files. *
* Ammendments: *
* Programmer Date Req. # Action *
* ================ ========== ====== ===============================*
* Thomas Jung 03/27/2001 ------ Initial Program. *
report zesu_job_run_with_pdf_output message-id zes_job.
* DATA DICTIONARY TABLES *
tables: raldb. "Transfer Structure for Logical Databases
tables: tbtcp.
tables: icon, "Icons table
bapiadsmtp, "BAPI structure for e-mail addresses (central
bapiadpag.
* TYPE POOLS *
type-pools: sbdst.
* CONSTANTS *
constants: logical_file_name like filename-fileintern
value 'ZEX_STANDARD_FILENAME',
pdf_ext(4) type c
value '.pdf',
pdf_type(3) type c
value 'PDF',
internet(1) type c
value 'U',
dist_list(1) type c
value 'C',
kimball_domain(12) type c value '@kimball.com'.
constants: kim_ftp(80) type c
value
'ftp://kww.kog.kimball.com/webtools/acrobat_reader/acroread40w95.exe'.
constants: ext_ftp(80) type c
value
'http://www.adobe.com/products/acrobat/readermain.html'.
* VARIABLES *
data: length type i.
data: f4_field like trdir-name.
data: pathleng type i,
nameleng type i,
physleng type i.
data jselect like btcselect.
data: report like sy-repid.
data: doc_chng like sodocchgi1.
data: tab_lines like sy-tabix.
* INTERNAL TABLES *
data: begin of html_tab occurs 0.
include structure w3html.
data: end of html_tab.
data: icontab(32) occurs 10 with header line.
data: itab like abaplist occurs 0 with header line.
data: ipdf like tline occurs 0 with header line.
data: objpack like sopcklsti1 occurs 2 with header line.
data: objhead like solisti1 occurs 1 with header line.
data: objbin like solisti1 occurs 10 with header line.
data: objtxt like solisti1 occurs 10 with header line.
data: reclist like somlreci1 occurs 5 with header line.
* SELECTION SCREEN LAYOUT *
selection-screen begin of block one with frame title text-001.
parameters: fileintn like filename-fileintern obligatory
default logical_file_name,
filepath like rlgrap-filename lower case.
parameters: file1 like rlgrap-filename obligatory lower case,
physname like rlgrap-filename lower case.
parameters: date1 as checkbox.
parameters: time1 as checkbox.
selection-screen end of block one.
selection-screen begin of block two with frame title text-002.
parameter: step like tbtcp-stepcount.
parameter: abap radiobutton group one.
parameter: oft radiobutton group one.
selection-screen end of block two.
selection-screen begin of block three with frame title text-003.
parameter: file radiobutton group two.
parameter: email radiobutton group two.
selection-screen skip 1.
parameter: int radiobutton group thre.
parameter: dis radiobutton group thre.
selection-screen skip 1.
parameter: ext_user like somlreci1-receiver.
selection-screen end of block three.
* SELECTION SCREEN PROCESSING - OUTPUT *
at selection-screen output.
perform filename_processing.
loop at screen.
if screen-name eq 'FILEPATH' or
screen-name eq 'PHYSNAME'.
screen-input = 0.
modify screen.
endif.
endloop.
* START OF SELECTION *
start-of-selection.
move sy-repid to report.
perform auth_check.
perform filename_processing.
perform get_spool.
perform convert_list_to_pdf.
if file = 'X'.
perform write_to_file.
else.
perform send_pdf_in_email.
endif.
*& Form filename_processing
* Prepair to conver to the logical file name to a physical name
* --> p1 text
* <-- p2 text
form filename_processing.
perform get_filename using fileintn file1 physname.
nameleng = strlen( file1 ).
physleng = strlen( physname ).
pathleng = physleng - nameleng.
if pathleng > 0.
filepath = physname(pathleng).
endif.
endform. " filename_processing
*& Form get_filename
* Convert the logical file name into a physical file name
* -->P_FILEINTN Input Logical File Name
* -->P_FILE1 Filename selected by input
* -->P_PHYSNAME Output Physical File Name
form get_filename using p_fileintn
p_file1
p_physname.
data: p_file2 like rlgrap-filename.
clear p_file2.
move p_file1 to p_file2.
if date1 = 'X'.
concatenate p_file2
sy-datum
into p_file2.
endif.
if time1 = 'X'.
concatenate p_file2
sy-uzeit
into p_file2.
endif.
concatenate p_file2
pdf_ext
into p_file2.
call function 'FILE_GET_NAME'
exporting
client = sy-mandt
logical_filename = p_fileintn
operating_system = sy-opsys
parameter_1 = p_file2
* PARAMETER_2 = ' '
* PARAMETER_3 = ' '
* USE_PRESENTATION_SERVER = ' '
* WITH_FILE_EXTENSION = ' '
* USE_BUFFER = ' '
importing
* EMERGENCY_FLAG =
* FILE_FORMAT =
file_name = p_physname
exceptions
file_not_found = 1
others = 2
if sy-subrc <> 0.
message e001(zes_general) with sy-subrc.
endif.
endform. " get_filename
*& Form write_to_file
* TRANSFER PDF DATA TO OUTPUT FILE
* --> p1 text
* <-- p2 text
form write_to_file.
data: string_out type string.
describe field objbin length length.
call function 'Z_E_OPEN_FILE_FOR_OUTPUT_BIN'
exporting
filename1 = physname.
loop at objbin.
clear string_out.
move objbin to string_out.
call function 'Z_E_WRITE_TO_FILE_WITH_LENGTH'
exporting
filename1 = physname
length = length
please_open_file = 'NO'
string = string_out.
endloop.
endform. " write_to_file
*& Form convert_list_to_pdf
* Convert to Spool to PDF
* --> p1 text
* <-- p2 text
form convert_list_to_pdf.
data: spool_id like tsp01-rqident.
move tbtcp-listident to spool_id.
****Is this ABAP List Processing?
if abap = 'X'.
call function 'CONVERT_ABAPSPOOLJOB_2_PDF'
exporting
src_spoolid = spool_id
* NO_DIALOG =
* DST_DEVICE =
* PDF_DESTINATION =
* IMPORTING
* PDF_BYTECOUNT =
* PDF_SPOOLID =
* LIST_PAGECOUNT =
* BTC_JOBNAME =
* BTC_JOBCOUNT =
tables
pdf = ipdf
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.
if sy-subrc <> 0.
message i016 with sy-subrc.
endif.
else.
****Or is this SAPscript?
call function 'CONVERT_OTFSPOOLJOB_2_PDF'
exporting
src_spoolid = spool_id
* NO_DIALOG =
* DST_DEVICE =
* PDF_DESTINATION =
* IMPORTING
* PDF_BYTECOUNT =
* PDF_SPOOLID =
* OTF_PAGECOUNT =
* BTC_JOBNAME =
* BTC_JOBCOUNT =
tables
pdf = ipdf
exceptions
err_no_otf_spooljob = 1
err_no_spooljob = 2
err_no_permission = 3
err_conv_not_possible = 4
err_bad_dstdevice = 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.
if sy-subrc <> 0.
message i016 with sy-subrc.
endif.
endif.
perform convert_pdf tables ipdf
objbin.
endform. " convert_list_to_pdf
*& Form get_spool
* Read the job log to get the spool number for the specified step
* --> p1 text
* <-- p2 text
form get_spool.
clear jselect.
*jselect-jobname = '*'.
jselect-username = '*'.
****Have this program get its own Job Name
call function 'GET_JOB_RUNTIME_INFO'
importing
* EVENTID =
* EVENTPARM =
* EXTERNAL_PROGRAM_ACTIVE =
jobcount = jselect-jobcount
jobname = jselect-jobname
* STEPCOUNT =
exceptions
no_runtime_info = 1
others = 2.
****Read the spool number for this job step.
clear tbtcp.
select single listident from tbtcp
into tbtcp-listident
where jobname = jselect-jobname
and jobcount = jselect-jobcount
and stepcount = step.
if tbtcp-listident = 0.
message i009 with step.
endif.
endform. " get_spool
*& Form convert_pdf
* Take the PDF information returned by the function module
* and convert it to a file readable format. It currently is
* in a printable-only format.
* -->P_IPDF PDF Source
* -->P_OBJBIN PDF Destination
form convert_pdf tables t_source_tab structure ipdf
t_target_tab structure objbin.
data: l_hfeld(1600) type c,
l_offset type p,
l_tabix like sy-tabix,
l_max type i,
l_linecount_source type i,
l_length_source type i,
l_length_target type i.
* Zeilenlänge des Quell-PDF-Files
describe field t_source_tab length l_length_source.
* Zeilenlänge der Ziel-Mime-Tabelle
describe field t_target_tab length l_length_target.
* Zeilenanzahl des Quell-PDF-Files
describe table t_source_tab lines l_linecount_source.
* Die maximale Zielgröße wird durch das Feld l_hfeld begrenzt.
l_max = l_length_target + l_length_source.
* IF L_MAX > 1600.
* RAISE CONVERT_NOT_POSSIBLE.
* ENDIF.
refresh t_target_tab.
loop at t_source_tab.
l_tabix = sy-tabix.
move t_source_tab to l_hfeld+l_offset.
* falls letzte zeile der quelltabelle erreicht
if l_tabix = l_linecount_source.
l_length_source = strlen( t_source_tab ).
endif.
l_offset = l_offset + l_length_source.
while l_offset ge l_length_target.
clear t_target_tab.
t_target_tab = l_hfeld(l_length_target).
append t_target_tab.
shift l_hfeld by l_length_target places.
l_offset = l_offset - l_length_target.
endwhile. " l_offset ge p_length_target
* falls letzte zeile der quelltabelle erreicht
if l_tabix = l_linecount_source.
if l_offset gt 0.
clear t_target_tab.
t_target_tab = l_hfeld(l_offset).
append t_target_tab.
endif. " l_offset gt 0
endif. " l_tabix = l_linecount_lines
endloop. " p_source_tab
endform. " convert_pdf
*& Form auth_check
* Perform Authorization Check
* --> p1 text
* <-- p2 text
form auth_check.
authority-check object 'Z_ABAP_CHK'
id 'BUKRS' dummy
id 'ACTVT' dummy
id 'WERKS' dummy
id 'REPID' field report.
if sy-subrc ne 0.
message e024.
endif.
endform. " auth_check
*& Form send_pdf_in_email
* Transfer the PDF file in an E-Mail
* --> p1 text
* <-- p2 text
form send_pdf_in_email.
data: iaddsmtp type bapiadsmtp occurs 0 with header line.
data: ireturn type bapiret2 occurs 0 with header line.
concatenate text-010 jselect-jobname text-011
into doc_chng-obj_descr
separated by space.
clear objtxt.
objtxt = text-012.
append objtxt.
clear objtxt.
objtxt = text-013.
append objtxt.
clear objtxt.
concatenate text-014 jselect-jobname
into objtxt
separated by space.
append objtxt.
clear objtxt.
objtxt = text-015.
append objtxt.
clear objtxt.
objtxt = text-016.
append objtxt.
clear objtxt.
append objtxt.
clear objtxt.
concatenate text-017 kim_ftp
into objtxt
separated by space.
append objtxt.
clear objtxt.
concatenate text-018 ext_ftp
into objtxt
separated by space.
append objtxt.
describe table objtxt lines tab_lines.
read table objtxt index tab_lines.
doc_chng-doc_size = ( tab_lines - 1 ) * 255 + strlen( objtxt ).
clear objpack-transf_bin.
objpack-head_start = 1.
objpack-head_num = 0.
objpack-body_start = 1.
objpack-body_num = tab_lines.
objpack-doc_type = 'RAW'.
append objpack.
describe table objbin lines tab_lines.
concatenate jselect-jobname pdf_ext
into objhead.
append objhead.
objpack-transf_bin = 'X'.
objpack-head_start = 1.
objpack-head_num = 1.
objpack-body_start = 1.
objpack-body_num = tab_lines.
objpack-doc_type = pdf_type.
objpack-obj_name = jselect-jobname.
concatenate text-019 jselect-jobname
into objpack-obj_descr
separated by space.
objpack-doc_size = tab_lines * 255.
append objpack.
if int = 'X'.
clear iaddsmtp.
refresh iaddsmtp.
clear bapiadsmtp.
call function 'BAPI_USER_GET_DETAIL'
exporting
username = ext_user+0(12)
tables
return = ireturn
addsmtp = iaddsmtp.
loop at iaddsmtp where std_no = 'X'.
clear bapiadsmtp.
move iaddsmtp to bapiadsmtp.
endloop.
if bapiadsmtp-e_mail = ''.
concatenate ext_user kimball_domain
into reclist-receiver.
else.
move bapiadsmtp-e_mail to reclist-receiver.
endif.
move internet to reclist-rec_type.
else.
reclist-receiver = ext_user.
move dist_list to reclist-rec_type.
endif.
append reclist.
call function 'SO_NEW_DOCUMENT_ATT_SEND_API1'
exporting
document_data = doc_chng
put_in_outbox = 'X'
* IMPORTING
* SENT_TO_ALL =
* NEW_OBJECT_ID =
tables
packing_list = objpack
object_header = objhead
contents_bin = objbin
contents_txt = objtxt
* CONTENTS_HEX =
* OBJECT_PARA =
* OBJECT_PARB =
receivers = reclist
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
case sy-subrc.
when 0.
message i014 with reclist-receiver.
when 1.
message i015 with text-027.
when 2.
message i015 with text-028.
when 3.
message i015 with text-029.
when 4.
message i015 with text-030.
when 5.
message i015 with text-031.
when 6.
message i015 with text-032.
when 7.
message i015 with text-033.
when 8.
message i015 with text-036.
when others.
message i015 with text-036.
endcase.
endform. " send_pdf_in_email
Maybe you are looking for
-
Bought my ipod touch 4g from apple's official reseller on 21st November 2012. Purchase slip says warranty ends on 20th November 2013. But apple website says its 19th November 2013 when I put in my ipod's serial number. Why is that? When I bought the
-
Configuring 2 css11503s for multiple service load-balancing
first here's my present config on one of my CSS11503: !************************** CIRCUIT ************************** circuit VLAN33 ip address 19.10.28.211 255.255.255.0 ip virtual-router 2 priority 110 preempt ip redundant-vip 2 19.10.28.210 ip crit
-
Create object on user's default tablespace only
Hi all, Is there anyway I can limit a user to create tables NOT on system tablespace , besides alter user quota 0M on system ? Can I limit a user to create objects only on his own default tablespace ? alter user quota 0M on < all other tablespaces ex
-
Hi, Am looking for some help and advice please. All i want to do is to turn off the SMS & Email popup, not the icon notification, i've already disabled that, but the popup that says 'You have 1 new message' with 'Show' on the bottom left and 'Exit' o
-
Photoshop Script - save as PDF, how to programmatically use "Use proof setup" option
Hello, I'm trying to create a jsx script for Photoshop CC that will automaitically convert the given file to PDF format. The requirement is that the PDF must be saved using two options available on "Save as" dialog: - Use proof Setup: Working CMYK -