How to send ALV Report in excel format from SAP

Advertisement

Hi Gurus,
We are using SAP 4.7 and using different SAP reports.Now I want to send SAP ALV report in excel format directly from SAP in background.Now we send these reports in background weekly by using autimetic scheduling but this is PDF format.Now I want to change this pdf format to excel format.In SCOT T.Code I am able to find any excel format.Please help me out.
I am waiting for your reply.
Advance Thanks
Nirmal

Advertisement

Hi Nirmal,
I have done the same in my previous organisation.For this particular solution you need to ask your basis guys to upgrade the support package so that BCS classes could be available in the system.
API interafces five some problem with attachemnts and SAP has recommended to use BCS classes.
Currently BCS classes won't be availbale in 4.7.
Once the BCS classes are available
use below code
   CONSTANTS:
    lc_tab          TYPE c VALUE cl_bcs_convert=>gc_tab,
    lc_crlf         TYPE c VALUE cl_bcs_convert=>gc_crlf,
   lc_codepage     TYPE abap_encod VALUE '4103',
data :
   lv_string      TYPE string,
   binary_content TYPE solix_tab,
   size           TYPE so_obj_len,
   *" Set Heading of Excel File
  CONCATENATE 'Employee DATA'
               lc_crlf lc_crlf
               INTO lv_string.
   *" Set Header for Excel Fields
  CONCATENATE lv_string
              lc_header1 lc_tab
              lc_header2 lc_tab
              lc_header3 lc_tab
              lc_header4 lc_tab
              lc_header5 lc_tab
              lc_header6 lc_tab
              lc_header7 lc_tab
              lc_header8 lc_tab
              lc_header9 lc_tab
              lc_header10 lc_crlf
              INTO lv_string.
"lc_header1 to 10 could be your field headers
   "Move Internal table data
  LOOP AT gt_final1 INTO gwa_final1.
    CONCATENATE lv_string
                gwa_final1-field1     lc_tab
                gwa_final1-field2      lc_tab
                gwa_final1-field3    lc_crlf
                INTO lv_string.
  ENDLOOP.
   *" convert the text string into UTF-16LE binary data including
*" byte-order-mark. Mircosoft Excel prefers these settings
*" all this is done by new class cl_bcs_convert (see note 1151257)
  TRY.
      cl_bcs_convert=>string_to_solix(
        EXPORTING
          iv_string   = lv_string
          iv_codepage = lc_codepage  "suitable for MS Excel, leave empty
          iv_add_bom  = abap_true     "for other doc types
        IMPORTING
          et_solix  = binary_content
          ev_size   = size ).
    CATCH cx_bcs.
      MESSAGE e445(so).
  ENDTRY.
  TRY.
*" create persistent send request
      send_request = cl_bcs=>create_persistent( ).
      document = cl_document_bcs=>create_document(
        i_type    = lc_doc
        i_text    = main_text
        i_subject = lc_sub  ).     
      document->add_attachment(
        i_attachment_type    = lc_attach                    "#EC NOTEXT
        i_attachment_subject = lc_sub                       "#EC NOTEXT
        i_attachment_size    = size
        i_att_content_hex    = binary_content ).
   send_request->set_document( document ).
   recipient = cl_cam_address_bcs=>create_internet_address( email ).
   CALL METHOD send_request->add_recipient
          EXPORTING
            i_recipient = recipient.
   IF recipient IS NOT INITIAL.
        sent_to_all = send_request->send( i_with_error_screen = abap_true ).
        COMMIT WORK.
*        MESSAGE text-014 TYPE gc_succ  .
      ENDIF.
    CATCH cx_bcs INTO bcs_exception.
      MESSAGE i865(so) WITH bcs_exception->error_type.
  ENDTRY.
For BCS decalartion u can go to se 38 and see program BCS_EXAMPLE_1 to BCS_EXAMPLE_7.
Rewrads if helpful.
Cheers
Ramesh Bhatt

October 11, 2015

How to send ALV Report in excel format from SAP

Hi Gurus, We are using SAP 4.7 and using different SAP reports.Now I want to send SAP ALV report in excel format directly from SAP in background.Now we send these reports in background weekly by using autimetic scheduling but this is PDF format.Now I

How to send Oracle report automatically in format pdf by email with subject and body?

Hello, How to send e-mail attachment and mail other details like from ,subject,cc,to,mail body. In Oracle Developer Suite 10g? Regards.did you try to run report parameter form = yes , put to the parameter form following system parameters  and set et.

Cannot export crystal report in excel format from crystal report viewer

This problem occurs on only one workstation. Open Advanced Reports > Enter workorder # > Click on 'workorder work(uninvoiced)' > Work order opens. Click on icon "Export report" Save as type: change to .xls Error: Crystal Report Windows

Problem in downloading ALV report to Excel

hi All, i am facing the problem when i am trying to download the ALV report to Excel format i should have the option to  save as  the Excel file from the dropdown where as instead of it i am getting the option to save as XML file. is it something rel

Export the Report in Excel format

Hi, How to export the Report in Excel format directly from the SAP to my Desktop. Plz. give me the process??? Thanksuse this, INCLUDE OLE2INCL. INCLUDE EXCEL__C. AND          H_EXCEL TYPE OLE2_OBJECT,        " Excel object           H_MAPL  TYPE OLE2

How to  send ALV output data into Excel sheet format via Mail to the user?

Hi friends, I have a doubt ie, How to  send ALV output data into Excel sheet format via Mail to the user? regards MoosaHi, Provide the output internal table to the objbin in the below FM Send Message   CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'   

How to send the report output to the application server in a excel file

Hello, how to send the report output to the application server in a excel file. and the report runs in background. Thanks in advance. SundeepDear Sundeep. I'm providing you with the following piece of code ... Its working fine for me ... hopefully it

How to download ALV report having more than 200 columns to Excel

Dear Experts, I am facing the issue of line break during downloading ALV report into excel. I referred the lot of forums but i didn't get the proper solution to solve this issue..Please guide me to solve this issue.... My output in ALV header1 header

Help me to download my report in excel format.

Here is my code below. On selection screen I am giving three inputs. And There are two radio buttons present on my selection screen. first one is for display the report. second button name is generate(to export the report). Clicking on the generate r

How to send a report output as a FAX ?

Hallo Experts, How to send a report output as a FAX ? Suppose if I have all the data in an internal table, I will show it as a normal list OR ALV list output. In the application tool bar I should have a button, and by clicking it the output should go

Saving the report in Excel format form BO

Hi Team, Would like to know how to provide/grant an access to User to save his/her BO reports in Excel format. Save as option is not being highlited for the user for saving the data into EXcel format. Thanks.Hi, Just check the preferences in the WEBI

Urgent- o/p of report in excel format

Hi All, I want to generate o/p of my report in excel format. Please send me the sample code for it at [email protected] Thanks in advance bhushanRajesh, yes, with BI Publisher (formerly known as XML Publisher) it's easy. But with Reports you don't ne

Formatting report in excel format

Hi, I have to generate report in excel format but I don't know how to format it for example to add a dynamic title, and to add a logo in the top of the excel sheet... any help.. thanks in advance.Hi, Oracle Portal Reports generated do not pick up the

Exporting large report to Excel format (90K lines)

Hi, I am trying to export a 90K line report to excel format and I get that error messsage: Description : Une erreur d'application s'est produite sur le serveur. Les paramètres d'erreur personnalisés actuels pour cette application empêchent l'affichag

Saving report in excel format

I need to save a report directly to excel format. The user does not want to open a delimited file in excel. After a lot of trials I got excel.prt file which supposedly saves the report in excel format directly from the PRINT TO FILE option. But I am

About how to send ALV through email

Hi  everyone ,       I have a problem about how to send ALV through email  in background . if someone knows , pls tell me . thanks in advance Best Regard NickI write a test program , but it doesn't work , use any exists ALV program in the system , an

Failed to schedule report in Excel format

We have successfully scheduled report in PDF format, however, we go the error message "Error in File D:\Business Objects\BusinessObjects Enterprise 11.5\Data\procSched\eagnmnsx2c5.reportjobserver\~tmp2ee063064fe000e.rpt: The request could not be subm

How to send puchase report in email ?

how to send puchase report in email ?Search SCN, you will get lot of post for this. Here is an example. http://scn.sap.com/thread/321890Read other 3 answers

Simple code to send ALV display as XLS attachment  to SAP inbox

Hi All, Simple code to send ALV display as XLS attachment  to SAP inbox. Also i need to send only 200 records per attachement. So in this case i need send multiple attachment per mail Thanks, LokeshThe following code is used to send the internal tabl

How to send print through your phone away from your neighbour hood

how to send print through your phone away from your neighbour hoodHi there, I'm not exactly sure what your specific question is but it sounds like your inquiring about remote printing i.e. being able to print to a printer that's not on your local net