Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Dump while executing a OLE Excel download report feature in ITS

Former Member
0 Kudos

Hi,

Because of some complex requirment, I had created a report program which will download the data to an Excel sheet using SAP OLE Automation Controller. For this report i had created a tcode too.

The report which i developed is perfectly working fine in SAPGUI. But if i access the same report throught SAP ITS serice. I am getting a dump. Please find below the dump details. I am not able to figure it out why the dump is not coming in SAPGUI.

Runtime Errors MESSAGE_TYPE_X

Date and Time 09.03.2010 05:35:41

-


Short text

The current application triggered a termination with a short dump.

-


What happened?

The current application program detected a situation which really

should not occur. Therefore, a termination with a short dump was

triggered on purpose by the key word MESSAGE (type X).

|

-


Error analysis

Short text of error message:

Control Framework : Error processing control

Long text of error message:

Diagnosis

An error occurred when the system tried to process the commands

from the Automation Queue on the presentation server.

There are several possible reasons for this:

- The installation of the SAP GUI on the presentation server is

faulty or obsolete.

- There is an error in the application program

- There is an error in the SAPGUI or an integrated control

Procedure

1. Make sure that you have imported the appropriate Support

Package, the current kernel, and GUI patch for the release of your

system

2. Check whether the error occurs locally on one or a few PCs, or

generally on all PCs. Note whether the error only occurs for some

users, for example because of a specific Customizing setting.

If it only occurs locally, this suggests an installation problem

with the PC. Check the installation; if necessary, reinstall the

software. In the dump, search for the SY-MSGLI field, since it may

point to the cause of the error.

3. Activate the Automation Trace (in accordance with SAP Note

158985).

4.Start the transaction and continue until the screen immediately

before the dump.

5. From the System -> Utilities menu, choose Autom. Queue,

Synchronous Processing.

The status bar of the GUI displays the text:

"Automation synchron flush mode on"

6. If you now proceed with the application, the short dump will

display the ABAP call that caused the error; the Automation Trace

will contain the error on the presentation server.

7. If necessary, load the short dump and trace files on to

sapservX, so that SAP can analyze them.

Technical information about the message:

Message class....... "CNDP"

Number.............. 006

Variable 1.......... " "

Variable 2.......... " "

Variable 3.......... " "

Variable 4.......... " "

-


How to correct the error

Probably the only way to eliminate the error is to correct the program.

If the error occures in a non-modified SAP program, you may be able to

find an interim solution in an SAP Note.

If you have access to SAP Notes, carry out a search with the following

keywords:

"MESSAGE_TYPE_X" " "

"SAPLOLEA" or "LOLEAU02"

"AC_SYSTEM_FLUSH"

If you cannot solve the problem yourself and want to send an error

notification to SAP, include the following information:

1. The description of the current problem (short dump)

To save the description, choose "System->List->Save->Local File

(Unconverted)".

2. Corresponding system log

Display the system log by calling transaction SM21.

Restrict the time interval to 10 minutes before and five minutes

after the short dump. Then choose "System->List->Save->Local File

(Unconverted)".

3. If the problem occurs in a problem of your own or a modified SAP

program: The source code of the program

In the editor, choose "Utilities->More

Utilities->Upload/Download->Download".

4. Details about the conditions under which the error occurred or which

actions and input led to the error.

-


User and Transaction

Client.............. 120

User................ "XXXXXX"

Language Key........ "E"

Transaction......... "ZGA_BEACON_SOX_RPT "

Transactions ID..... "4B95E2560EB62F9AE10000000A241C33"

Program............. "SAPLOLEA"

Screen.............. "ZGA_REP_BEACON_SOX_REPORT 9000"

Screen Line......... 0

Information on Caller ofr "HTTP" Connection:

Plug-in Type.......... "HTTP"

Caller IP............. "10.36.28.52"

Caller Port........... 8000

Universal Resource Id. "/sap/bc/gui/sap/its/webgui/~flNUQVRFPTIzNzIxLjAxNC4wNC4

wNA=="

-


5 REPLIES 5

Former Member
0 Kudos

Check the following example to download in excel


INCLUDE ole2incl.

*&----------------------------------------------------*
*&   TYPES                                            *
*&----------------------------------------------------*
TYPES: BEGIN OF ty_spfli,
       kunnr TYPE kna1-kunnr,
       land1 TYPE kna1-land1,
       NAME1 TYPE KNA1-NAME1,
       ORT01 TYPE KNA1-ORT01,
       REGIO TYPE KNA1-REGIO,
       ADRNR TYPE KNA1-ADRNR,

       END OF ty_spfli.

TYPES: BEGIN OF ty_titles,
       title(20) TYPE c,
       field(20) TYPE c,
       END OF ty_titles.

*&----------------------------------------------------*
*&   INTERNAL TABLES                                  *
*&----------------------------------------------------*
DATA: t_spfli TYPE STANDARD TABLE OF ty_spfli,
      t_titles TYPE STANDARD TABLE OF ty_titles.

*&----------------------------------------------------*
*&   FIELD-SYMBOLS                                    *
*&----------------------------------------------------*
FIELD-SYMBOLS: <fs_spfli> LIKE LINE OF t_spfli,
               <fs_titles> LIKE LINE OF t_titles,
               <fs> TYPE ANY.

*&----------------------------------------------------*
*&   VARIABLES                                        *
*&----------------------------------------------------*
DATA: w_tabix TYPE sy-tabix,
      w_titles TYPE sy-tabix,
      w_line TYPE sy-tabix,
      w_field TYPE string,
      filename TYPE string,
      path TYPE string,
      fullpath TYPE string.

DATA: data_titles TYPE REF TO data.

DATA: e_sheet TYPE ole2_object,
      e_activesheet TYPE ole2_object,
      e_newsheet TYPE ole2_object,
      e_appl TYPE ole2_object,
      e_work TYPE ole2_object,
      e_cell TYPE ole2_object,
      e_color TYPE ole2_object,
      e_bold TYPE ole2_object.

*&----------------------------------------------------*
*&   SELECTION-SCREEN                                 *
*&----------------------------------------------------*
SELECTION-SCREEN BEGIN OF BLOCK b1.
PARAMETERS: p_file TYPE rlgrap-filename.
SELECTION-SCREEN END OF BLOCK b1.

*&----------------------------------------------------*
*&  START-OF-SELECTION                                *
*&----------------------------------------------------*
START-OF-SELECTION.
  PERFORM get_titles.
  PERFORM get_data.

  PERFORM create_excel.


Former Member
0 Kudos

Continue.......


AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
  CALL METHOD cl_gui_frontend_services=>file_save_dialog
    EXPORTING
      window_title      = 'Select archivo'
      default_extension = 'xls'
      file_filter       = '*.xls'
    CHANGING
      filename          = filename
      path              = path
      fullpath          = fullpath.

  IF sy-subrc EQ 0.
    p_file = fullpath.
  ENDIF.
FORM get_titles.

  CREATE DATA data_titles TYPE ty_titles.
  ASSIGN data_titles->* TO <fs_titles>.
  <fs_titles>-title = 'Customer Number 1'.
  <fs_titles>-field = 'KUNNR'.
  APPEND <fs_titles> TO t_titles.
  <fs_titles>-title = 'Country Key'.
  <fs_titles>-field = 'LAND1'.
  APPEND <fs_titles> TO t_titles.
  <fs_titles>-title = 'Name 1'.
  <fs_titles>-field = 'NAME1'.
  APPEND <fs_titles> TO t_titles.
  <fs_titles>-title = 'City'.
  <fs_titles>-field = 'ORT01'.
  APPEND <fs_titles> TO t_titles.
  <fs_titles>-title = 'Region'.
  <fs_titles>-field = 'REGIO'.
  APPEND <fs_titles> TO t_titles.
  <fs_titles>-title = 'Address'.
  <fs_titles>-field = 'ADRNR'.
  APPEND <fs_titles> TO t_titles.
ENDFORM.                    "get_titles
FORM get_data.
  SELECT KUNNR LAND1 NAME1 ORT01 REGIO ADRNR
  INTO TABLE t_spfli
  FROM KNA1
  WHERE LAND1 EQ 'IN'
  and KUNNR EQ '0000700008'.
ENDFORM.                    " get_data

Edited by: kk.adhvaryu on Mar 10, 2010 7:38 AM

Former Member
0 Kudos

Continue.....


FORM create_excel.
  w_line = 1.
  CREATE OBJECT e_appl 'EXCEL.APPLICATION'.
  SET PROPERTY OF e_appl 'VISIBLE' = 1.
  CALL METHOD OF e_appl 'WORKBOOKS' = e_work.
  CALL METHOD OF e_work 'Add' = e_work.
  GET PROPERTY OF e_appl 'ActiveSheet' = e_activesheet.
  SET PROPERTY OF e_activesheet 'Name' = 'Customer Details'.
  LOOP AT t_spfli ASSIGNING <fs_spfli>.
    w_tabix = sy-tabix.
    w_line = w_line + 1.

    LOOP AT t_titles ASSIGNING <fs_titles>.
      w_titles = sy-tabix.
      CALL METHOD OF e_appl 'Cells' = e_cell
        EXPORTING
          #1 = 1
          #2 = w_titles.
      SET PROPERTY OF e_cell 'Value' =  <fs_titles>-title.
      GET PROPERTY OF e_cell 'Interior' = e_color.
      SET PROPERTY OF e_color 'ColorIndex' = 0.
      GET PROPERTY OF e_cell 'Font' = e_bold.
      SET PROPERTY OF e_bold 'Bold' = 1.

      CALL METHOD OF e_appl 'Cells' = e_cell
        EXPORTING
          #1 = w_line
          #2 = w_titles.
      CONCATENATE '<fs_spfli>-' <fs_titles>-field
      INTO w_field.
      ASSIGN (w_field) TO <fs>.
      SET PROPERTY OF e_cell 'Value' = <fs>.
      GET PROPERTY OF e_cell 'Interior' = e_color.
      SET PROPERTY OF e_cell 'ColumnWidth' = 20.
      SET PROPERTY OF e_color 'ColorIndex' = 15.
      GET PROPERTY OF e_cell 'Font' = e_bold.
      SET PROPERTY OF e_bold 'Bold' = 0.
    ENDLOOP.
  ENDLOOP.
 CALL METHOD OF e_work 'SAVEAS'
    EXPORTING
      #1 = p_file.
  CALL METHOD OF e_work 'close'.
  CALL METHOD OF e_appl 'QUIT'.
  FREE OBJECT e_appl.
ENDFORM.                    " create_excel

former_member206439
Contributor
0 Kudos

Hi Maneesh,

If your getting dump at the time of accessing report program through ITS then check SE93 for that TCODE.

Under GUI support.

Check all the check box and try once.

Let me know if there are any concerns.

Thanks

Naresh

cris_hansen
Advisor
Advisor
0 Kudos

Hi Maneesh,

The WEBGUI cannot use OLE integration (check SAP note 314568). If you want to upload/download files through the WEBGUI then you need to use the methods of class cl_gui_frontend_services.

If you want to test the applet in general, please use function module ws_query with query parameter "cd"; it should return the home directory. If you want to test the download, you can use FM gui_download with transaction se37 or program itsq_upload_download.

I hope this helps.

All the best,

Cristiano