Mailing the Report Output-Does not generating file name

Dear Gurus,
       The below program fulfils the "mailing the report" requirement .it sends the out put as an attachment in XLS format.But one problem exists i.e.,it does not generate  filename.It gives the filename as ".XLS"(DOT XLS).
What should be done that system generates a filename?
*& Report  ZTESTMAIL                                                   *
REPORT  ZTESTMAIL                               .
tables: ekko.
parameters: p_email type somlreci1-receiver.
types: begin of t_ekpo,
ebeln type ekpo-ebeln,
ebelp type ekpo-ebelp,
aedat type ekpo-aedat,
matnr type ekpo-matnr,
end of t_ekpo.
data: it_ekpo type standard table of t_ekpo initial size 0,
wa_ekpo type t_ekpo.
types: begin of t_charekpo,
ebeln(10) type c,
ebelp(5) type c,
aedat(8) type c,
matnr(18) type c,
end of t_charekpo.
data: wa_charekpo type t_charekpo.
data: it_message type standard table of solisti1 initial size 0
with header line.
data: it_attach type standard table of solisti1 initial size 0
with header line.
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,
gd_error type sy-subrc,
gd_reciever type sy-subrc.
t_object_header = 'Text.xls'. append t_object_header.
*START_OF_SELECTION
start-of-selection.
Retrieve sample data from table ekpo
perform data_retrieval.
Populate table with detaisl to be entered into .xls file
perform build_xls_data_table.
*END-OF-SELECTION
end-of-selection.
Populate message body text
perform populate_email_message_body.
Send file by email as .xls speadsheet
perform send_file_as_email_attachment
tables it_message
it_attach
using p_email
'Example .xls documnet attachment'
'XLS'
'PO'
changing gd_error
gd_reciever.
Instructs mail send program for SAPCONNECT to send email(rsconn01)
perform initiate_mail_execute_program.
*& Form DATA_RETRIEVAL
Retrieve data form EKPO table and populate itab it_ekko
form data_retrieval.
select ebeln ebelp aedat matnr
up to 10 rows
from ekpo
into table it_ekpo.
endform. " DATA_RETRIEVAL
*& Form BUILD_XLS_DATA_TABLE
Build data table for .xls document
form build_xls_data_table.
*CONSTANTS: con_cret TYPE x VALUE '0D', "OK for non Unicode
*con_tab TYPE x VALUE '09'. "OK for non Unicode
*If you have Unicode check active in program attributes thnen you will
*need to declare constants as follows
*class cl_abap_char_utilities definition load.
constants:
con_tab type c value cl_abap_char_utilities=>horizontal_tab,
con_cret type c value cl_abap_char_utilities=>cr_lf.
concatenate 'EBELN' 'EBELP' 'AEDAT' 'MATNR'
into it_attach separated by con_tab.
concatenate con_cret it_attach into it_attach.
append it_attach.
loop at it_ekpo into wa_charekpo.
concatenate wa_charekpo-ebeln wa_charekpo-ebelp
wa_charekpo-aedat wa_charekpo-matnr
into it_attach separated by con_tab.
concatenate con_cret it_attach into it_attach.
append it_attach.
endloop.
endform. " BUILD_XLS_DATA_TABLE
*& Form SEND_FILE_AS_EMAIL_ATTACHMENT
Send email
form send_file_as_email_attachment tables pit_message
pit_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.
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[] = pit_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
object_header = t_object_header
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.
*& Form INITIATE_MAIL_EXECUTE_PROGRAM
Instructs mail send program for SAPCONNECT to send email.
form initiate_mail_execute_program.
wait up to 2 seconds.
submit rsconn01 with mode = 'INT'
with output = 'X'
and return.
endform. " INITIATE_MAIL_EXECUTE_PROGRAM
*& Form POPULATE_EMAIL_MESSAGE_BODY
Populate message body text
form populate_email_message_body.
refresh it_message.
it_message = 'Please find attached a list test ekpo records'.
append it_message.
endform. " POPULATE_EMAIL_MESSAGE_BODY
Your suggestions will be appreciated and rewarded.
Thanks in advance
Murali

Hi
Your pgm is not passing anything in obj_descr in packing list for excel file. If you pass a name your excel file will have that.
Regards
Sathar
perform send_file_as_email_attachment
tables it_message
it_attach
using p_email
'Example .xls documnet attachment'
'XLS'
'PO'
' '  *------> no value*
changing gd_error
gd_reciever.
form send_file_as_email_attachment tables pit_message
pit_attach
using p_email
p_mtitle
p_format
p_filename
p_attdescription *----> no value*
p_sender_address
p_sender_addres_type
changing p_error
p_reciever.
t_packing_list-obj_descr = ld_attdescription.

Similar Messages

  • The RFUMSV50 program does not generate transfer lines of deferred VAT

    Hello;
    The RFUMSV50 program does not generate transfer lines of deferred VAT ,
    The context is the following one:
    Code VAT Created with code target VAT, general account of VAT also created,
    Rule of deferred VAT created and activated for the company code in question, with marks to compensate for check.
    The data of tests are the following ones:
    Creation of an invoice via the FB60,
    Integral payment of the invoice via F-53,
    Creation of the confirmation of the operation in bank via the manual statement FF67,
    Clearing of the intermediate banking account  with the bank account  via F-03.
    After all these elements, by executing the RFUMSV50 program, I have nothing in result.
    There somebody who had the same problem, could help us?
    Thank you.

    Hi
    Service Tax credit cannot be utilized unless the Vendor Invoice is Paid. This is the reason till the payment is done the service tax Amount will be accumulated in deferred tax account and once the invoice is paid the balance in deferred tax is need to be transferred  to respective Service Tax , Educational Cess and higher Education Cess account. There can be various business scenarios for full and Partial Payment to facilitates the transfer of such deferred balance to respective account SAP has come up with some new standard program RFUMSV50 instead of RFUMSV25. To overcome the limitation of this program i.e. not able to take care of more than one tax line item, below the solution is provided with scenarios “Full Payment is made to Vendor Invoice”. 
    hope this is help ful
    thanks
    Trinath

  • In Apple mail, the attachment symbol does not appear in the list of sent items

    In Apple mail, the attachment symbol does not appear in the list of sent items. So you cannot sort sent emails based on whether or not they have an attachment. Is there a way to fix this?

    I think my question wasn't clear. I know how to display the attachment header (I use classic layout) but the problem is that the paperclip icon does not appear against the messages that contain attachments. See screenshot below. The attachment column is displayed but is blank. These are my sent items and I know for a fact that most of them have attachments. Can you help?

  • The Report Designer does not support this query drill down colum

    Iam working On BI7 When iam doing report desingner when iam opening query through data provider
    Iam getting thsi error The Report Designer does not support this query drill down colum colum axis may contain one structure only remove additional dimensions
    I modify the cube and i remove some dimensions also My problem is when iam putting characterstics in Colums Iam getting this error When iam removing that charcterstics from colums it was not throuing any error
    Chaitanya

    hi,
    report designer is for front end view design and the designcan be done with restriction to navigation.
    you have dynamic and static report designs with restricted navigations.
    chk the links for document
    http://help.sap.com/saphelp_nw04s/helpdata/en/dd/cea14119eb9f09e10000000a155106/frameset.htm
    http://help.sap.com/saphelp_nw04s/helpdata/en/17/16d941de405f24e10000000a1550b0/frameset.htm
    Ramesh

  • Adobe Reader does not recognize file name (filename10.5.11.pdf) but does in Adobe Standard 9.  Why?

    I post documents to our Intranet site and found out recently that Adobe Reader does not recognize certain file names in PDF files.  For instance,  when trying to open a PDF file with the name
    filename10.5.11.pdf  in Adobe Reader, the web browser will not open the PDF and the display is blank.   When I'm using another computer with Adobe Standard 9, I do not have a problem opening the file.
    I would like to know if anyone else has had a similar issue and why Reader will not recognize the file name and Standard does.

    The version is Adobe Reader 10.1.0    I will request the latest version
    and let you know if that fixes the problem
    Actually I had changed the name of the file so our associates could access
    the file (changed the  .  to a hyphen)  It still made me wonder why Reader
    wouldn't open it at that time.
    Thanks again for you assistance and I will let you know if this resolves
    the  issue.
    Regards,
    Susan
    From:   Ankit_Jain <[email protected]>
    To:     SusanPleso <[email protected]>
    Date:   10/19/2011 12:56 AM
    Subject:        Adobe Reader does not recognize file name
    (filename10.5.11.pdf) but does in Adobe Standard 9.  Why?
    Re: Adobe Reader does not recognize file name (filename10.5.11.pdf) but
    does in Adobe Standard 9. Why?
    created by Ankit_Jain in Adobe Reader - View the full discussion
    Hi Susan,
    Thanks for providing the information.
    Could you also let me know what is the exact version of Adobe Reader on
    your system. You can check the same y clicking on Help > About Adobe
    Reader X.
    In case its not 10.1.1, please try updating to the latest version and see
    if the problem persists.
    Also, does any other PDF with a different filename open in Internet
    Explorer correctly?
    Thanks
    Ankit
    Replies to this message go to everyone subscribed to this thread, not
    directly to the person who posted the message. To post a reply, either
    reply to this email or visit the message page: [
    http://forums.adobe.com/message/3979020#3979020]
    To unsubscribe from this thread, please visit the message page at [
    http://forums.adobe.com/message/3979020#3979020]. In the Actions box on
    the right, click the Stop Email Notifications link.
    Start a new discussion in Adobe Reader by email or at Adobe Forums
    For more information about maintaining your forum email notifications
    please go to http://forums.adobe.com/message/2936746#2936746.

  • Headphone audio does not work.  The external output does NOT appear in system preferences at all

    It does NOT have a red light.  I have had that issue before ad was able to fix it.  My external output does NOT show up in my system preferences at all.

    Pram reset
    http://support.apple.com/kb/ht1379
    (Try a few times as you may not get the correct sequence 1st time)
    also plug headphones in a few times in case switch sticking

  • Unix version of Reports 6i does not generate html

    Hi: It generates xml but not html. Keeps asking for a file which is there. Any pointers?
    Thanks
    Prasad

    Hello,
    We need more information in order to help. How are you requesting the report (command line, URL, ?). What file is it asking for?
    Regards,
    The Oracle Reports Team --skw
    null

  • Windows mail on external drive does not show senders name, only an odd alpha/num. file name. How to view by sender to sent to name ?

    Hello,
    I have downloaded from a PC to an external drive my windows mail files (sent, inbox, etc). I can view the files on the PC by changing headers to add senders name, etc.
    However, when viewing on my MacBook Pro, I can see all the files but the they are labled with a mixed alpha/numberic file name and not the sender, etc. Can the sender and/or sent to names can be added as searchable fields ?
    Thank you,
    Mike B.

    Enterprise manager still requires a static service definition in listener.ora and does not rely on dynamic registration.
    From documentation:
    The SID_LIST is required for backward compatibility with Oracle8 or Oracle7 databases, as well as external procedures and heterogeneous services, and some management tools, including Oracle Enterprise Manager.
    Werner

  • FSG report output does not show column headers (XML Publisher)

    Hi everyone
    Iam required to create a template for an FSG report with 20 columns. Used copy of FSG:Fixed number of columns Template(FSGTEMP) to create the template because i need to do some conditional formatting(need to show negative values in red color).
    here is the problem:
    when i use the template and run the program the output i can see the row data but not the column headers..column headings are blank!
    regarding the conditional formatting, can anybody tell me how to give the condition
    iam able to give the condition for oracle reports but not for FSG reports as i dont see the column name in the 'data field' in conditional format
    Regards
    sam

    Open the report in Edit Mode Click on the reports and in the properties section Uncheck the
    Enable Document Cache Property and your issue should be resolved.

  • In Photoshop Element 9, when opening the Organise section, the top bar does not show File, etc.?

    Just reinstalled Photoshop Ele,ents 9 onto Windows 7.
    In the Editt part,on opening, all is well.  This clearly show the top bar where youcan call and enter from the file to work with items on your computer.
    However, on the Organise section, this to bar does not show at all, therefoere you are unable to do any work as you cannot import items from anywhere.
    How do I get this to work now.

    You should ensure your font/text size is 100% or 96 dpi in the Windows control panel or you may need to adjust the native screen resolution of your monitor. Alternatively try keyboard shortcuts to access the menus.
    File – Alt+f
    Edit – Alt+e
    Find - Alt+i
    View – Alt+v
    Window – Alt+w
    Help – Alt+h

  • The only thing that comes up is alot a place to google, when I click on my e-mail the whole page does not open

    My mail page will not open all the way, it gives me a very tiny window.
    There is no web page...only says alot with a place for a question.

    OK well that doesn't actually work.  Restarting does not work. It has not affected Firefox, so I can get online, but every time I try to start Safari it comes up to that page with the f-ing popup and won't go any further.  It has made itself the homepage for Safari.
    Any suggestions.

  • The sound output does not work on my ipod

    Hi There,
    I have an Ipod 4 th generation and the sound output no longer works on any device.  I've reset and reinstalled the software but nothing appears to work?
    Any ideas please?
    Serial number: 9C6463XJV9R
    Thanks Chris

    If none of the 5 R's helped address the issue, it's likely hardware related.
    http://www.apple.com/support/ipod/five_rs/
    As to what exactly is damaged/faulty, no there is no certain way to tell.  It could be the iPod's audio chip or something else on the logic board.
    Either way you'll need to have your iPod serviced/replaced either by Apple or a third party company.
    B-rock

  • Strange issue with rights of account, used by SSIS (Foreach Loop Container does not return file names without Admin rights on server)

    Hello everyone.
    Faced very strange issue with account, which is used to run SSIS package.
    The specific package uses Foreach Loop Container to retrieve file names within the specified folder, and put them into Import file task.
    The package is set up to run under specific service account. This service account is given all permissions (Full control) to the folder where source files reside.
    So the issue is: SSIS package fails to execute this task (Foreach Loop Container and then Import), and shows that no files are found in the directory (although files ARE there).
    Once we're adding the service account into local Administrators group on the SQL Server, it works! Removing - does not work again. We cannot leave the service account as SQL server's admin as it's prohibited by our IT policies, and is just a bad practice.
    Any ideas, please? 
    MCP

    Here's the real log output:
    Date 16.04.2014 12:47:09
    Log Job History (RU-BW: Update)
    Step ID 1
    Server Server
    Job Name RU-BW: Update
    Step Name bw_import_cust_master_data
    Duration 00:00:02
    Sql Severity 0
    Sql Message ID 0
    Operator Emailed
    Operator Net sent
    Operator Paged
    Retries Attempted 0
    Message
    Executed as user: service_account Microsoft (R) SQL Server Execute Package Utility  Version 10.50.4286.0 for 64-bit  Copyright (C) Microsoft Corporation 2010. All rights reserved.    Started:  12:47:09  Error: 2014-04-16 12:47:11.45
        Code: 0xC0202070     Source: bw_import_cust_master_data Connection manager "Input"     Description: The file name property is not valid. The file name is a device or contains invalid characters.  End Error  Error:
    2014-04-16 12:47:11.47     Code: 0xC0202070     Source: bw_import_cust_master_data Connection manager "Input"     Description: The file name property is not valid. The file name is a device or contains invalid characters.  End
    Error  Error: 2014-04-16 12:47:11.48     Code: 0xC0202070     Source: bw_import_cust_master_data Connection manager "Input"     Description: The file name property is not valid. The file name is a device or contains invalid
    characters.  End Error  Error: 2014-04-16 12:47:11.48     Code: 0xC020207E     Source: Import file Flat File Source [1]     Description: The file name is not valid. The file name is a device or contains invalid characters.
     End Error  Error: 2014-04-16 12:47:11.48     Code: 0xC004701A     Source: Import file SSIS.Pipeline     Description: component "Flat File Source" (1) failed the pre-execute phase and returned error code 0xC020207E.
     End Error  DTExec: The package execution returned DTSER_FAILURE (1).  Started:  12:47:09  Finished: 12:47:11  Elapsed:  2.324 seconds.  The package execution failed.  The step failed.
    MCP

  • HT4977 The reported solution does not work (add two carriage returns).

    When setting up my gmail account as an exchange accounts message which are only signed, are not validly signed. There is an smile.p7s attachment which isn't recognised as a valid signature.
    Some users report this is caused by a bad implementation of the Active Sync protocol in iOS, which isn't using the approptiate commands.
    Does anybody have a workaround?

    Hi,
    Did you find any solution to your issue?
    I am also having similar kind of issue. If you can guide me on this. I am describing my issue below:
    I need to add verification for field dock door of tcode LM05 using user exit MWMRF302.
    I have created 9302 screen in program SAPLXLRF and deleted ok_code from it, changed it to sub-screen.
    Then i have created a new entry in the spro (screen management) with screen variant 1.
    But i am unable to understand what code i need to write in EXIT_SAPLLMOB_520 so that verification of that particular field will take place.
    Also, do i need to code both EXIT_SAPLLMOB_210 and EXIT_SAPLLMOB_520?
    Can you please help me with this.
    Thanks,
    Archana

  • When I delete an E-mail the next one does not automatically pop up any more

    When deleted,next E-mail always opened.Now it just goes back to E-mail page.Went into yahoo mail site and it still has "open next E-mail" checked as the option of choice.Firefox 25 just downloaded automatically a few days ago and that is when I started having the problem.

    Try some basic steps if you have issues with web pages:
    Reload web page(s) and bypass the cache to refresh possibly outdated or corrupted files.
    *Hold down the Shift key and left-click the Reload button
    *Press "Ctrl + F5" or press "Ctrl + Shift + R" (Windows,Linux)
    *Press "Command + Shift + R" (Mac)
    Clear the cache and cookies only from websites that cause problems.
    "Clear the Cache":
    *Firefox/Tools > Options > Advanced > Network > Cached Web Content: "Clear Now"
    "Remove Cookies" from sites causing problems:
    *Firefox/Tools > Options > Privacy > Cookies: "Show Cookies"
    Start Firefox in <u>[[Safe Mode|Safe Mode]]</u> to check if one of the extensions (Firefox/Firefox/Tools > Add-ons > Extensions) or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox/Firefox/Tools > Add-ons > Appearance).
    *Do NOT click the Reset button on the Safe Mode start window.
    *https://support.mozilla.org/kb/Safe+Mode
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes

Maybe you are looking for

  • How to compare value in input field to value in database?

    Hi all. I need to clear up if the value in the input field (e.g. input_field) is equal to at least one record in the field (e.g. name) in database table (e.g. customers), or not. The code should be like this: IF...   message001.  "(there's such a rec

  • IP SLA UDP-ECHO socket error

    have this configuration on ASR1002F router. Trying to setup IP Sla so that we can monitor the delay on WAN interfaces. Would like to send UDP-ECHO from one router to another across the WAN.   I need to send and receive on fixed port numbers. Keep get

  • How to keep videos from pixelating in browser

    Hi, How do I keep my flash videos from pixelating badly when viewed in a browser using the zoom feature (as in Opera, Explorer, and Firefox)? So far, I've been embedding my videos using the Dreamweaver CS3 "insert: media: flash video" routine. The vi

  • Help needed with oracle 11g installation

    Hi All, I need some help setting up oracle database with users, schemas and the like. I am new to oracle - using it due to a project requirement. Any advice, links etc would be great. Thanks in Advance

  • MIGO Posting Issue

    Hi Guru: When I use MIGO,I encountered below issue,Posting only possible in periods 1998/03 and 1998/02 in company code 0001,and the system gave me the hint as below: For the system, the first of the entered periods is the current period. At the begi