SAP GUI – Excel Upload Problem SOLVED

Some of our users had a problem with Excel uploads through SAP GUI. I have solved the problem by repairing ALSM_EXCEL_TO_INTERNAL_TABLE.

  DEFINE m_message.
    COMMIT WORK.
    COMMIT WORK AND WAIT.
    CASE sy-subrc.
      WHEN 0.
        WAIT UP TO 1 SECONDS. " <- REPAIR
      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.

But why?

Apparently, on some machines, Windows can’t respond fast enough to Excel OLE commands. If I make them wait 1 second after every command, their OS catches up and can continue working.

Additional info: The following command sometimes returns SY-SUBRC = 2, despite the file being opened correctly:

CALL METHOD OF workbook 'Open' 

Therefore, you may want to repair even further and accept SY-SUBRC = 2 as a valid response.

  DEFINE m_message.
    COMMIT WORK.
    COMMIT WORK AND WAIT.
    CASE sy-subrc.
      WHEN 0 OR 2. " <- REPAIR
        WAIT UP TO 1 SECONDS. " <- REPAIR
      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.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s