Report Output Saving Problem
I am using Oracle Developer6.0 . I am facing problem with reports. I am invoking reports from form using run_product.
1. I could not able to save the report in text file . Whenever i try to save the report output in a text file.It gives dump and application get closed.
2. In RTF format , it execute the query which i have given at the design time while creating a report . But while running i am passing query either through lexical parameter or passing value of where criteria user parameters. It display the output for the specified value. But when i save this report output in rtf file . It execute design time query and save that in a rtf file.
If any body is having any idea about it . Please let me ASAP . It is very urgent for me.
Thanks in advance
null
Hi ,
Why don't you try the output in PDF. Its been working for us. We don't have any problems
Good Luck
Rao
Similar Messages
-
Report output refresh problem.
Hi experts,
I am using editable ALV via pop up window...after modifying the vaules are coming to final table which we have used in Report output....but report output is showing old values can any body tell me what code i have to write for this...
regards,
Praveena.stable-row = 'X'.
stable-col = 'X'.
CALL METHOD c_alvgd->refresh_table_display
EXPORTING
is_stable = stable
EXCEPTIONS
finished = 1
OTHERS = 2.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF. -
I developed purchase register for vendor wise when i am displaying out put it is taking 4 lines gap for each vendor.
my output is coming as below.
Afton chemicals 100020 01.2.2008
sector 6 10021 02.2.2008
Mumbai.
here it is taking 4 line space
indian additives 123456 09.02.2008
sector 20 124567 10.02.3008
newdelhi
here it is taking 4 lines space
abatap chemicals 456789 12.03.2008
deonar 123456 13.03.2008
mumbai
again 4 lines space it is taking.
i have given line-count 10.
in my pogram i have used with in loops
reserved 8 lines and back statement.
how to reduce space between each vendor.
i written code as ..
report puchase order line-count 10.
loop at output.
onchange of output-name1.
reserved 8 lines.
write: output-date , output-amount.
back.
endon.
write: output-billno.Hi,
the reason for your program behaviour is the combination of reserve 8 lines. and the back. statement You could either reduce the number of 8 lines, try to do without back or use a simple skip.
Rgds.
Roman Weise -
Password protect report output
We are generating the payslips of all employees as individual report outputs, saved as pdf files. Now we are planning to send the payslips as email attachments to all employees. Is there a way to password protect all these 1500 files togther,, but each with an unique password which is a combination of their employee number and dob?
Thanks for your advice
GeorgeHi,
I don't think there is any easy solution to this, but what we do at this site is schedule the Discoverer reports to run using the eBusiness Suite Concurrent Manager. We use dedicated Discoverer workstations to run the Discoverer exports and these could also be used to email the report if this was a requirement.
There is an article on my website (www.cabotconsulting.co.uk) about scheduling Discoverer reports using the Applications 11i concurrent manager and you can also search this forum for scheduling and email for information on how to email reports.
Hope that helps,
Rod West -
Saving reports output in PDF or Excel
Hello, I am in the process of developing some oracle reports to run over the web. My question is. When the reports are run over the web how can I save the output in either PDF or Excel. The reports will be called from
a form with parameters passed. I am also having a problem whem the output is shown in htlm it is wrapped. Is there away to stop this data wrapping process from happening?
Thanks,
MorrisHi Ratheesh,
In a previuos posted message I've suggested to Carla close exactly the same you did after. And also did'nt worked.Anyway, just for your info.
Dear Carlangas (as we say in Mexico, with no offense)
Here is a workaround for you...
As I'm not a JSP expert developer in my case I will do next
It seems we are facing a problem with the DESFORMAT=PDF and report out parameter for your jsp report and requiere a jsp/reports experienced developer help or further investigation. I'm not saying it's not possible to generate a PDF output from a jsp report, but for the moment nobody has said how to.
I believe you saved your report in jsp format because you need your users review the report previuosly they may print it.
I also suppose you have a form with a magic button from where you launch your report.
Well I will call your existing button PREVIUOS or will add a nice gif icon and will create another one called PRINT or with a pretty printer .gif icon. This new button will call a RDF version of your report. As you have read is very easy to create PDF format/output report in RDF format.
Also your will need negotiate presentation with your customer. As you must know reports output in a Paper report, PDF, jsp formats are not always exactly the same because they are not simply the same.
Hope this help you. In the meantime you will save time for your investigation for a future release of your report. -
Saving report output in default path
Hi,
We are using the 6i reports server. We want to save the report output as a file in a default path. We are making the report requests through URL call from within a PL/SQL block. When we give just the filename(this will dynamically be generated for each request) in the DESNAME parameter, it is saving directly into the path where we started the reports server. We don't want to hardcode the required path in the PL/SQL block.
Can't we set the default path for saving the report output during the configuration of the reports server?
Is there any alternative to achieve this, like storing the path(without filename) in any configuration file similar to <servername>.conf in 9i reports server?
Regards,
Milton.Hi Milton
Try these suggestion and see if they work...
Add ORACLE_HOME/bin in your system PATH and run Reports Server from the folder where you want your output file to be generated.
You could also be storing the "default" path in a config file and use IO packages to read it.
Create a user parameter of character type and do the following in any of the Reports trigger:
:desname := :p_1 || :desname;
You may pass the "default" path on the URL.
Regards
Sripathy -
Problem In report output display when i run in the background
Hi,
In a classical report i am printing around 17 fields the width of the report out put is around 800 characters.
If i run the report in the fore ground it running perfectly. But the thing is when i give large selection is it GETTING ' TIMED OUT ' as it is running more than an Hour.
so i wanted to run it in the back ground to avoid TIME OUT problems.
But when i run in the backgroud i am not getting full out put in the SPOOL request(SIZE of the report output may causing the problem) .
Pls come up with some solutions
Thanks in advanceTry increasing the spool length..
Refer this link for doing so.
Spool List output display > 255 char when the rpt is run in Background
Thanks
mahesh -
Problem in Report Output ( Batch )
Hi ,
We have a batch job ( a report ) that runs everyday , till friday the output in the spool was as expected , we were getting the output of everyline item in the same line ( single line ) but from monday onwards the same report output in the spool is spreading across two lines instead of one single line . It is working fine if we execute the report in foreground but the problem occurs if we do it in background . What could be the problem here ? Can some one pls help some inputs .
Thanks in Advancehi...
do one thing goto TCODE SM37 and give the name of the job and in command window give value 'JDBG' and execute it ...
it will be in debug mode and may help to solve ur issue..
regards -
Hello,
I remember Portal(first version and WebDB prior to that)
perfectly saving a Report as File even if the Report output
spans multiple pages.
Now I am using the latest version of Portal and I am unable
to save the Report to file when the Report output paginates to
several pages.
It always saves the First Page of Report.
Please throw light through any form of Solution.
Thanks a million
Madhavput the lines per page higher
-
Problem with Report Output in Apps R12
Hi,
I am having some problems with my report output when run under Apps R12. It looks fine when I run in Reports Developer 10g.
The problem is that pages get split into two (i think because there are too many rows). So page 1 of the report will be split into two pages in the Apps report output, and the page number (which is normally at the bottom) displays on the second page as "Page 1 of xx".
I think there is some problem but I don't know what.
I am running the report as Text Output in apps, and using the default Landwide style (which is 180 col x 66 rows). In my report design, I made the dimensions of the body section to be 180 col x 66 rows as well. I also have it set to 8.5 tall x 14 inches wide.
Any suggestions?
Thanks,
KevinSQL> set long 1000000
SQL> set heading off
SQL> column cola format a40000
SQL> select cola from clob_dummy;
gfhjtuioep mnhjkie rt-hlospd. ngktio pokdnebtt, gkhohphpdjdbs wmqksxnd - kfnfdkdldkdkdkdkdkdkdkdkdbdsjgdvj h geg.jv ehh shgghsga wshkwlsgsdklghlahgkh lahgkas lhks kglaks gksh a
ssjfsjgskjhghsgskgkksl hgeldhldlkskhdlk dklhkdlkhlkdlhdkfhldkhkhdkhkdhkdhkdkhklhkddkhdkhdkl djhlkdkhdhkshlkd dkhdkhldsjhkslhjd eutywe 398863694 i230e ehgd ehglegighsihdlk eltiweytilhdhgehgisehbkd
SQL>Edited by: Tubby on Oct 3, 2008 11:44 AM -
Problem while downloading report output
Hi friends,
I want to download the report output to local disk in excel file format. The report is developed using ALV grid display (using type poolSLIS). When I run the report all the values are displaying correctly.
When I download the same in excel file using spreadsheet/unconverted option, some fields are getting cut. For example Vendor code in report showing as 4060070, but in downloaded file it is showing as 406007 (last character missing.).
I tried GUI_DOWNLOAD function module(for practice), and it is downloading correct values in excel format.
The problem occurs for only one column. What will be the problem.
Is this something system problem or we what else.
Thank you,
madanHi,
Did you set the outlen property for your ALV Grid display?
Please check this.
Also, check whether you are exceeding the size for uploading a row in Excel or not.
Thanks and Best Regards,
Suresh -
Problem in converting report output to pdf
Hi,
I'm managing to get the spool id and other requirements but could'nt get the output of the program converted to pdf format.When i'm trying to do this i'm getting the pdf format of the functional module which retrievs the header and item records and displays the numbers records in the header and item like for eg. header records 8 and item records 10 this its displaying in the format in which we get our funtional module output when we give some data into it.....
Can any one please tell me how to solve this for ur information i'm using hierarchail squential report with multiple reports in the same report.............
for instance i'm using the following coding please find the bug......
PARAMETER: p_email1 LIKE somlreci1-receiver
DEFAULT '[email protected]',
p_sender LIKE somlreci1-receiver
DEFAULT '[email protected]',
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.
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.
Spool to PDF conversions
DATA: gd_spool_nr LIKE tsp01-rqident,
gd_destination LIKE rlgrap-filename,
gd_bytecount LIKE tst01-dsize,
gd_buffer TYPE string.
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, will be stored in sy-spono.
*submit ZSPOOLTOPDF2
to sap-spool
spool parameters %_print
archive parameters %_print
without spool dynpro
and return.
Get spool id from program called above
IMPORT w_spool_nr FROM MEMORY ID 'SPOOLTOPDF'.
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.
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.
FORM convert_spool_to_pdf *
FORM convert_spool_to_pdf.
CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
EXPORTING
src_spoolid = gd_spool_nr
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.
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.
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 = 'Subject'.
gd_attachment_desc = 'Attachname'.
CONCATENATE 'attach_name' ' ' INTO gd_attachment_name.
it_mess_bod = 'Message Body text, line 1'.
APPEND it_mess_bod.
it_mess_bod = 'Message Body text, line 2...'.
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
'Example .xls documnet attachment'
'PDF'
gd_attachment_name
gd_attachment_desc
p_sender
gd_sender_type
changing gd_error
gd_reciever.
ENDFORM.
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.
*& 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.Please go throught the code ... this is my salary sending program to all the employees as pdf attach file of his salary breakup ...... it was so clear how the data is converted in th pdf format .... and more understanding way the internal tables are declared ....
DATA W_OPTIONS LIKE ITCPO OCCURS 0 WITH HEADER LINE.
DATA : z_itcpp LIKE itcpp OCCURS 0 WITH HEADER LINE.
DATA : otfdt like ITCOO OCCURS 0 WITH HEADER LINE.
DATA : pdfdt like TLINE OCCURS 0 with header line.
DATA: NUMBYTES TYPE I.
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.
DATA: DOC_CHNG LIKE SODOCCHGI1.
DATA: TAB_LINES LIKE SY-TABIX.
DATA: Begin of i_errors occurs 0,
type(1) type c,
descr(100) type c,
End of i_errors.
w_options-tdprinter = 'POSTSCPT'.
W_options-TDRDIDEV = 'XP45'.
W_options-TDGETOTF = 'X'.
APPEND W_options.
call function 'OPEN_FORM'
exporting
device = 'PRINTER'
dialog = ' '
form = 'ZHRPAYSLIP'
language = sy-langu
options = w_options
* IMPORTING
* LANGUAGE =
* NEW_ARCHIVE_PARAMS =
* RESULT =
exceptions
canceled = 1
device = 2
form = 3
options = 4
unclosed = 5
mail_options = 6
archive_error = 7
invalid_fax_number = 8
more_params_needed_in_batch = 9
others = 10 .
CALL FUNCTION 'CLOSE_FORM'
* IMPORTING
* RDI_RESULT =
TABLES
OTFDATA = otfdt
EXCEPTIONS
UNOPENED = 1
BAD_PAGEFORMAT_FOR_PRINT = 2
SEND_ERROR = 3
OTHERS = 4.
EXPORT otfdt TO MEMORY ID 'PDFT'.
CALL FUNCTION 'CONVERT_OTF'
EXPORTING
FORMAT = 'PDF'
* MAX_LINEWIDTH = 132
* ARCHIVE_INDEX = ' '
* COPYNUMBER = 0
* ASCII_BIDI_VIS2LOG = ' '
* PDF_DELETE_OTFTAB = ' '
IMPORTING
BIN_FILESIZE = NUMBYTES
* BIN_FILE =
TABLES
otf = otfdt
lines = pdfdt
* EXCEPTIONS
* ERR_MAX_LINEWIDTH = 1
* ERR_FORMAT = 2
* ERR_CONV_NOT_POSSIBLE = 3
* ERR_BAD_OTF = 4
* OTHERS = 5
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF .
Refresh OBJTXT. clear OBJTXT.
Refresh OBJPACK. clear OBJPACK.
Refresh objbin. clear objbin.
Refresh OBJHEAD. clear OBJHEAD.
Refresh RECLIST. Clear RECLIST.
* Creation of the document to be sent
* File Name
DOC_CHNG-OBJ_NAME = 'PAYSLIP'.
* Mail Subject
DOC_CHNG-OBJ_DESCR = 'Payslip'.
* Mail Contents
OBJTXT = 'This e-mail was sent from an automated system...'.
APPEND OBJTXT.
OBJTXT = 'Do not reply to this message.'.
APPEND OBJTXT.
OBJTXT = 'Please open the attachment to view the Payslip'.
APPEND OBJTXT.
OBJTXT = ''.
APPEND OBJTXT.
if not msgtxt1 is initial.
OBJTXT = msgtxt1.
APPEND OBJTXT.
endif.
if not msgtxt2 is initial.
OBJTXT = msgtxt2.
APPEND OBJTXT.
endif.
if not msgtxt3 is initial.
OBJTXT = msgtxt3.
APPEND OBJTXT.
endif.
DESCRIBE TABLE OBJTXT LINES TAB_LINES.
READ TABLE OBJTXT INDEX TAB_LINES.
DOC_CHNG-DOC_SIZE = ( TAB_LINES - 1 ) * 255 + STRLEN( OBJTXT ).
* Creation of the entry for the compressed document
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.
* Creation of the document attachment
CALL FUNCTION 'QCE1_CONVERT'
TABLES
t_source_tab = pdfdt
t_target_tab = objbin
EXCEPTIONS
convert_not_possible = 1
OTHERS = 2.
describe table objbin lines tab_lines.
OBJHEAD = 'Payslip.PDF'.
APPEND OBJHEAD.
** Creation of the entry for the compressed attachment
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'.
OBJPACK-OBJ_NAME = 'Payslip'.
OBJPACK-OBJ_DESCR = 'Payslip'.
OBJPACK-DOC_SIZE = TAB_LINES * 255.
APPEND OBJPACK.
* Completing the recipient list
* Read table i_pa0105 with key pernr = pernr-pernr binary search.
loop at i_pa0105 where pernr = pernr-pernr and USRTY = '0010'.
endloop.
if sy-subrc = 0.
RECLIST-RECEIVER = i_pa0105-USRID_LONG.
RECLIST-REC_TYPE = 'U'.
APPEND RECLIST.
endif.
if RECLIST[] is initial.
loop at i_pa0105 where pernr = pernr-pernr and USRTY = 'MAIL'.
endloop.
if sy-subrc = 0.
RECLIST-RECEIVER = i_pa0105-USRID.
RECLIST-REC_TYPE = 'U'.
APPEND RECLIST.
endif.
endif.
if not RECLIST[] is initial.
* Sending the document
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
DOCUMENT_DATA = DOC_CHNG
PUT_IN_OUTBOX = ''
COMMIT_WORK = 'X'
TABLES
PACKING_LIST = OBJPACK
OBJECT_HEADER = OBJHEAD
CONTENTS_BIN = OBJBIN
CONTENTS_TXT = OBJTXT
RECEIVERS = RECLIST
EXCEPTIONS
TOO_MANY_RECEIVERS = 1
DOCUMENT_NOT_SENT = 2
OPERATION_NO_AUTHORIZATION = 4
OTHERS = 99.
CASE SY-SUBRC.
WHEN 0.
LOOP AT RECLIST.
* Concatenate pernr-pernr '-' RECLIST-RECEIVER(48)
into error1.
IF RECLIST-RETRN_CODE = 0.
* Concatenate error1 ': The document was sent' into
error1.
i_errors-descr = pernr-pernr.
i_errors-type = 'S'.
append i_errors.
ELSE.
Concatenate error1 ': The document could not be
sent' into error1.
i_errors-descr = error1.
i_errors-type = 'E'.
append i_errors.
ENDIF.
ENDLOOP.
WHEN 1.
Concatenate pernr-pernr '-' RECLIST-RECEIVER(48) into
error1.
Concatenate error1 ': No authorization for sending to the
recipients' into error1.
i_errors-descr = error1.
i_errors-type = 'E'.
append i_errors.
WHEN 2.
Concatenate pernr-pernr '-' RECLIST-RECEIVER(48) into
error1.
Concatenate error1 ': Document could not be sent to the
recipient' into error1.
i_errors-descr = error1.
i_errors-type = 'E'.
append i_errors.
WHEN 4.
Concatenate pernr-pernr '-' RECLIST-RECEIVER(48) into
error1.
Concatenate error1 ': No send authorization' into error1.
i_errors-descr = error1.
i_errors-type = 'E'.
append i_errors.
WHEN OTHERS.
Concatenate pernr-pernr '-' RECLIST-RECEIVER(48) into
error1.
Concatenate error1 ': Error occurred while sending' into
error1.
i_errors-descr = error1.
i_errors-type = 'E'.
append i_errors.
ENDCASE.
else.
error1 = pernr-pernr.
* Concatenate error1 ': Maintain Infotype 0105.' into error1.
i_errors-descr = error1.
i_errors-type = 'M'.
append i_errors.
endif.
girish -
Formatting problem when downloading classical report output to excel sheet.
Dear Experts,
My classical report o/p looks like:
SI Name ID
1 xyz 11
2 abc 22
3 eet 33
4 jnc 44
When I download the same to a excel sheet from List->Save->file->Spreadsheet and save it.
The formatting looks like this:
SI Name ID
1 xyz 11
2 abc 22
3 eet 33
4 inc 44
That is the heading and column entries are in different columns.
There is no GUI_Download used.
Kindly help what may be the issue.Hi,
In the report output the formatting looks fine. It is exactly below the heading. But only when I save it to excel, this alignment issue is coming. Even the columns after this column are are properly aligned and there is no issue at all. Only this column in the middle has issue. -
Problem when dowloading the ALV report output to Excel Sheet.
Hi ,
I am dowloading the ALV report output to Excel Sheet.
There is field Condition Unit(KOMP-KMEIN) in the output of the ALV, this has values PC and CSE , but when I download to Excel Sheet, CSE is appearing as CSE ,but PC is appearing as ******.
Can you please help me in knowing the reson for this.
Regards,
Madhu.hi
refer to following link
http://www.****************/Tutorials/ALV/ColorSALV/Demo.htm
http://www.sap-img.com/abap/download-to-excel-with-format-border-color-cell-etc.htm
Cheers
Snehi
Edited by: snehi chouhan on Jul 11, 2008 12:42 PM -
Regarding SavIng of reports output into appl. or presentation server
Hello Everyone I am working on ALE IDoc I am getting my output in forms of XML. I want to save my reports output directly to presentation server or application server (i have neither any flat file on desktop nor any file on application server).
I have following codes which convert my Idoc into XML:
*& Report ZIDOC_XML_CONVERSION
report ZIDOC_XML_CONVERSION.
types: TRESLIN(4096) type X,
TRESTAB type standard table of TRESLIN.
data: RESSTR type ref to IF_IXML_OSTREAM.
data: RESTAB type TRESTAB.
data: XSLTP type ref to CL_XSLT_PROCESSOR.
data: G_IXML type ref to IF_IXML,
G_STREAM_FACTORY type ref to IF_IXML_STREAM_FACTORY,
DIR type STRING.
data: IDOC type ref to CL_IDOC_XML1.
data: PROGNAME type CXSLTDESC.
data: STR type STRING.
data: XSTR type XSTRING.
data: RESSIZE type I.
data: ID type EDI_STYLE.
data GLOBAL_DOCNUM type EDI_DOCNUM.
data GLOBAL_STYLEID type EDI_STYLE.
data: GLOBAL_OK_CODE(30).
data: HTML_CONTROL type ref to CL_GUI_HTML_VIEWER.
data: FCODE_WA(30).
data: FCODE_TAB type standard table of CHAR30.
data: MS_DEFAULT_STYLE type EDI_STYLE.
data: SAP_DEFAULT_STYLE type EDI_STYLE.
data: SAP_TEXT_STYLE type EDI_STYLE.
data: SAP_CONTEXT_STYLE type EDI_STYLE.
data: TEXT_MS_DEFAULT_STYLE(30).
data: TEXT_SAP_DEFAULT_STYLE(30).
data: TEXT_SAP_TEXT_STYLE(30).
data: TEXT_SAP_CONTEXT_STYLE(30).
data ACTION like SY-UCOMM.
parameters: IDOCNUM like EDIDC-DOCNUM,
IDSTYLE type EDI_STYLE,
ACTIONS type EDI_STFLAG.
class CL_IXML definition load.
class CL_ABAP_CHAR_UTILITIES definition load.
class CL_GUI_FRONTEND_SERVICES definition load.
class CL_GUI_HTML_VIEWER definition load.
data: CONTAINER type ref to CL_GUI_CUSTOM_CONTAINER.
data: REPID like SY-REPID, DYNNR like SY-DYNNR.
data: WA_OBJ_LOCATION type IDOCSTYLE.
data: LOCAL_XSLID type EDI_STYLE.
data: BASE_URL(30).
data: DATA_TABLE type TAB_RAW512.
data: LEN type I.
data: UI_FLAG type I.
data: MYEVENT_TAB type CNTL_SIMPLE_EVENTS,
MYEVENT type CNTL_SIMPLE_EVENT.
data: LOCAL_STYLEID type EDI_STYLE.
data: PARENT type ref to CL_GUI_CONTAINER.
data: LINE type I.
data: WA_SRC type STRUCT_SRC.
data: LOCAL_EDIDC type EDIDC.
data: TAB_OBJ_LOCATION type standard table of IDOCSTYLE .
data: GEN_EX type ref to CX_XSLT_EXCEPTION.
data: SRCSTR type ref to IF_IXML_ISTREAM.
*load-of-program.
try.
create object XSLTP.
catch CX_XSLT_EXCEPTION.
write / TEXT-E01. exit. " XSLT not supported
endtry.
G_IXML = CL_IXML=>CREATE( ).
G_STREAM_FACTORY = G_IXML->CREATE_STREAM_FACTORY( ).
DIR = ''.
call method CL_GUI_FRONTEND_SERVICES=>GET_TEMP_DIRECTORY
changing
TEMP_DIR = DIR.
*start-of-selection.
GLOBAL_DOCNUM = IDOCNUM.
GLOBAL_STYLEID = IDSTYLE.
get parameter id 'IDOC_STYLEID' field GLOBAL_STYLEID.
if GLOBAL_STYLEID is initial.
GLOBAL_STYLEID = 'IE5'.
endif.
clear FCODE_TAB.
clear GLOBAL_OK_CODE.
clear ACTION.
we only support action "deletemark" + "closeproce"
if ACTIONS ' X X '.
FCODE_WA = 'DELM'.
append FCODE_WA to FCODE_TAB.
FCODE_WA = 'CLPR'.
append FCODE_WA to FCODE_TAB.
endif.
Create Object and create IDOC_XML
create object IDOC
exporting
DOCNUM = IDOCNUM
exceptions
ERROR_LOADING_IDOC = 1
ERROR_BUILDING_XML = 2
others = 3.
if SY-SUBRC 0.
message id SY-MSGID type 'E' number SY-MSGNO
with SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4
raising NO_IDOC_XML_LOADED.
endif.
Determine transformation program.
clear TAB_OBJ_LOCATION.
select * from IDOCSTYLE into table TAB_OBJ_LOCATION
where ( STYLEID = GLOBAL_STYLEID or STYLEID = '' )
and ( MESTYP = LOCAL_EDIDC-MESTYP or MESTYP = '')
and ( DIRECT = LOCAL_EDIDC-DIRECT or DIRECT = '')
and OBJNR = 0.
describe table TAB_OBJ_LOCATION lines LINE.
if LINE > 0.
loop at TAB_OBJ_LOCATION into WA_OBJ_LOCATION.
move WA_OBJ_LOCATION-URL to PROGNAME.
clear WA_OBJ_LOCATION.
exit.
endloop.
else.
message E110(IDOC_XML1) with LOCAL_XSLID WA_OBJ_LOCATION-URL
raising ERROR_LOADING_OBJECT.
endif.
Transformation
call method IDOC->GET_XMLDATA_AS_STRING
importing
DATA_STRING = STR.
RESSTR = G_STREAM_FACTORY->CREATE_OSTREAM_ITABLE( TABLE = RESTAB )
RUN
try.
call transformation (PROGNAME)
source xml STR
result xml RESSTR.
catch CX_XSLT_EXCEPTION into GEN_EX.
message E110(IDOC_XML1) with LOCAL_XSLID WA_OBJ_LOCATION-URL
raising ERROR_LOADING_OBJECT.
exit.
endtry.
write : / STR.
I am getting following output:
<?xml version="1.0"?><RSREQUST><IDOC BEGIN = "1"><EDI_DC40 SEGMENT="1"><TABNAM><![CDATAEDI_DC40]></TABNAM><M
i want to save this output on my application server or presentation server, my data is not on presentation server or in application server, its on form of output and i want to save my output directly to application server or presentation server.hope that you people will help me out please reply me for this query.
Thanks & Regards
Vimarsh B.Hello Subhash,
Try this
data: sheet TYPE ole2_object.
data: lv_file(512) default 'C:tst.xls'.
* Save excel speadsheet to particular filename
GET PROPERTY OF h_excel 'ActiveSheet' = sheet.
CALL METHOD OF sheet 'SaveAs'
EXPORTING
#1 = lv_file "filename
#2 = 1. "fileFormat
Maybe you are looking for
-
How can I restore an old backup from Time Machine to my iPhone 5?
I have the iPhone 5 that I had previously transferred my apps and other data to from my iPhone 4. Due to poor battery life, I had to restore the iPhone 5 as a new phone. This helped battery life but now I habve lost my text messages, App data and pho
-
How do I convert a Variant of type=String to G data? (LV 5.1.1)
I've tried to return a string in the Variant return of a VB function in a DLL. (I want to do this so that I can retain the interface and thus binary compatibility in the DLL.) When I use the DLL function in LabVIEW 5.1.1 I get an error in the call li
-
Activate problem CS6 master collection with original product key
Hello, I have an original version of the Adobe CS6 master collection with a original product key. I use this version now or more than one year on my Imac with version Yosemite 10.10.2. The last days i have the problem that my product key is not valid
-
From line on emails shows incorrectly
i belong to a group where i must send an email to the entire group at once, because it is a group mail it will also come to my inbox. the problem is the "from" line shows someone else's email, when i send the same email from my other email client the
-
FDM - Scripting for exporting application
Hi Can you please advise if it is possible to write a script to automate the FDM export (Application export, this would be for the locations, users, maps etc...) Regards Edited by: user12990175 on 2010/07/05 11:59 PM