Application Development and Automation 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: 
Read only

MESSAGE_TYPE_X

Former Member
0 Likes
5,230

Hi Team,

I am getting an ABAP Runtime Error i.e. Message_Type_X. I am trying to upload the excel sheet using a custom program but it is displaying Message_Type_X dump.

I am attaching the the text file contains the dump details.

Please advise.

Regards,

Sunil Kumar.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
4,475

Hi Sunil,

Seems some patch issue. Refer this thread - http://scn.sap.com/thread/1275898.

It has exact problem as yours and solution too.

BR.

14 REPLIES 14
Read only

satyabrata_sahoo3
Contributor
0 Likes
4,475

Check your program, debug and see where exactly the program fails.

-Satya

Read only

Former Member
0 Likes
4,475

This is not sufficient for issue analysis.Check ST22 analysis .

copy paste the code..

Read only

Arun_Prabhu_K
Active Contributor
0 Likes
4,475

Hi Sunil,

     Please post your code for further analysis.

Regards.

Read only

venkateswaran_k
Active Contributor
0 Likes
4,475

Hi Sunil,

We need to see your excel file format and the code.  However, couple of check points.

1.  Is it a front end process or background process.

2.  Did you try it with couple of PCs.  that is from your desktop and other user desktop.

3. Is your excel file contains any icons?

4. Is there any negative amount field ?

Regards,

Venkat

Read only

0 Likes
4,475

Hi Venkat,

It is happening both in background and foreground process. I have tried in multiple PCS and it is the same. It does not contain any icons but it contains amount fields but not negative.

Regards,

Sunil Kumar.

Read only

gurunathkumar_dadamu
Active Contributor
0 Likes
4,475

Hi Sunil,

If possible share your code.

Regards,

Gurunath

Read only

former_member182379
Contributor
0 Likes
4,475

Hi,

  Which GUI version you are using, check on some other PC in which higher version is installed, also clear your temp. folder.

Regards,

  Zafar

Read only

0 Likes
4,475

Hi zafar,

SAP 720 is the version is installed.

Regards,

Sunil Kumar

Read only

0 Likes
4,475

Update to 7.3 Patch 4..

Read only

Former Member
0 Likes
4,476

Hi Sunil,

Seems some patch issue. Refer this thread - http://scn.sap.com/thread/1275898.

It has exact problem as yours and solution too.

BR.

Read only

Former Member
0 Likes
4,475

MESSAGE_TYPE_X is usually related to the kernel .

Upgrade your SAP GUI to latest one or to prior supported one.

Have you installed the latest Patch level of the GUI.?

Which method have you used to upload excel file?

Read only

0 Likes
4,475

HI,

I have installed 720 version and Please find the below code and created a FM to upload the Excel sheet.

FUNCTION zdoupload_all.

*"----------------------------------------------------------------------

*"*"Local Interface:

*"  IMPORTING

*"     REFERENCE(FILE_NAME) LIKE  RLGRAP-FILENAME

*"  TABLES

*"      FILE_DETAILS STRUCTURE  ZPS_FILE_DETAILS

*"      DDATA TYPE  ZPS_DO_DATA_TT

*"  EXCEPTIONS

*"      EXCEEDED_ROW_COUNT

*"----------------------------------------------------------------------

* The FM to read the data from spreadsheet which may be having multiple/single tabs

* located in presentation server,  into the internal table.

* The input for this FM is file path and the  start row, end row, start column,

* end column from which data has to be read.

************************** CORRECTION **********************************

*  Date         UserID         Transport      Text

*  ........    ............    ................    ...................

* 21-Jun-13    RNAYAK         DVLK9A4GBB     Added the code to append empty     *

*                                            internal table to the return

*                                            to avoid inconsistency

*                                             Search key : UPLOAD_BLANK.

* DATA DECLARATION

   DATA: excel_tab       TYPE ty_t_sender,

         ld_separator    TYPE c,

         application     TYPE ole2_object,

         workbook        TYPE ole2_object,

         sheet           TYPE ole2_object,

         range           TYPE ole2_object,

         gv_end_cell     TYPE ole2_object,

         gv_end          TYPE ole2_object,

         ls_file_details TYPE zps_file_details.

   DATA: h_cell          TYPE ole2_object.

   DATA: ld_rc           TYPE i.

   DATA : wa_tt          LIKE LINE OF ddata,

         it_data        TYPE TABLE OF zps_alsmex_tabline.

   DATA : it_data_tmp    LIKE TABLE OF zps_alsmex_tabline,

         wa_data         TYPE zps_alsmex_tabline.

* MESSAGE DEFINATION

   DEFINE m_message.

     case sy-subrc.

       when 0.

       when 1.

         message id sy-msgid type sy-msgty number sy-msgno

         with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

       when others. raise upload_ole.

     endcase.

   END-OF-DEFINITION.

   CLASS cl_abap_char_utilities DEFINITION LOAD.

   ld_separator = cl_abap_char_utilities=>horizontal_tab.

* OPENING EXCEL FILE

   IF application-header = space OR application-handle = -1.

     CREATE OBJECT application 'Excel.Application'.

     m_message.

   ENDIF.

   CALL METHOD OF

       application

       'Workbooks' = workbook.

   m_message.

   CALL METHOD OF

       application

       'Workbooks' = workbook.

   m_message.

   CALL METHOD OF

       workbook

       'Open'

     EXPORTING

       #1       = file_name.

   m_message.

   CALL METHOD OF

       application

       'Worksheets' = sheet

     EXPORTING

       #1           = 1.

   m_message.

   SORT file_details BY pageno.

   LOOP AT file_details  INTO ls_file_details.

     CALL METHOD OF

         application

         'Worksheets' = sheet

       EXPORTING

         #1           = ls_file_details-pageno.

     m_message.

     CALL METHOD OF

         sheet

         'Activate'.

     m_message.

     GET PROPERTY OF application 'ACTIVESHEET' = sheet.

     m_message.

* MARKING OF WHOLE SPREADSHEET

     CALL METHOD OF

         sheet

         'Cells' = h_cell

       EXPORTING

         #1      = ls_file_details-start_row_sheet

         #2      = ls_file_details-start_column_sheet.

     m_message.

     GET PROPERTY OF application 'ActiveCell' = gv_end_cell.

     CALL METHOD OF

         gv_end_cell

         'SpecialCells' = gv_end

       EXPORTING

         #1             = '11'.

     CALL METHOD OF

         application

         'RANGE'     = range

       EXPORTING

         #1          = h_cell

         #2          = gv_end.

     CALL METHOD OF

         range

         'SELECT'.

     m_message.

* Copy marked area (SHEET1) into Clippboard

     CALL METHOD OF

         range

         'COPY'.

     m_message.

* Read clipboard into ABAP

     CALL METHOD cl_gui_frontend_services=>clipboard_import

       IMPORTING

         data                 = excel_tab

       EXCEPTIONS

         cntl_error           = 1

         error_no_gui         = 2

         not_supported_by_gui = 3

         OTHERS               = 4.

     IF sy-subrc <> 0.

       MESSAGE a037(alsmex).

     ENDIF.

*   Converting clipboard data into right format.

     PERFORM separated_to_intern_convert TABLES excel_tab it_data

     USING ld_separator.

     it_data_tmp[] = it_data[].

     SORT it_data_tmp BY row DESCENDING.

     READ TABLE it_data_tmp INTO wa_data INDEX 1.

     IF sy-subrc EQ 0.

       IF wa_data-row > ls_file_details-end_row_sheet.

         RAISE exceeded_row_count.

       ELSE.

         CLEAR wa_tt.

         APPEND LINES OF it_data TO wa_tt-do_data.

         APPEND wa_tt TO ddata.

       ENDIF.

*   Begin of change by RNAYAK - UPLOAD_BLANK

     ELSE.

*       If the tab of the spread sheet is blank append the blank internal table.

         CLEAR wa_tt.

         APPEND LINES OF it_data TO wa_tt-do_data.

         APPEND wa_tt TO ddata.

*    End of change by RNAYAK - UPLOAD_BLANK

     ENDIF.

* Clear the clipboard

     REFRESH excel_tab.

     CALL METHOD cl_gui_frontend_services=>clipboard_export

       IMPORTING

         data                 = excel_tab

       CHANGING

         rc                   = ld_rc

       EXCEPTIONS

         cntl_error           = 1

         error_no_gui         = 2

         not_supported_by_gui = 3

         OTHERS               = 4.

   ENDLOOP.

* Leaving Application .

   CALL METHOD OF

       application

       'QUIT'.

   m_message.

   FREE OBJECT application.

   m_message.

Regards,

Sunil Kumar.

ENDFUNCTION.

Read only

0 Likes
4,475

The classes and method that you have used are probably not compatible with your version.

Try uploading through some other method.

Here is a link that shows how to upload multiple sheet excel file.

http://wiki.sdn.sap.com/wiki/display/Snippets/Read+multiple+sheets+of+an+Excel+file+into+SAP+through...

Read only

venkateswaran_k
Active Contributor
0 Likes
4,475

Hi use following function to read and upload from Excel file.

form UPLOAD_DATA .

  DATA: loc_filename TYPE rlgrap-filename. "string.
  DATA: it_raw TYPE truxs_t_text_data.
  loc_filename = p_file.

  CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
    EXPORTING
*     I_FIELD_SEPERATOR    =
      i_line_header        = 'X'

      i_tab_raw_data       = it_raw       " WORK TABLE

      i_filename           = loc_filename

    TABLES
      i_tab_converted_data = gt_upload[]    "ACTUAL DATA
    EXCEPTIONS
      conversion_failed    = 1
      OTHERS               = 2.
endform. " UPLOAD_DATA