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

Download to Excel functionality

Former Member
0 Likes
382

HI Gurus,

I am using a FM LIST_DOWNLOAD.

It shows a pop up message once dowlnload is successful.

But everytime I am choosing cancel button its also showing me the same pop up message saying Successful download,

CALL FUNCTION 'LIST_DOWNLOAD'

EXPORTING

list_index = 0

method = 'DAT'

EXCEPTIONS

list_download_error = 1

OTHERS = 2.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ELSE.

  • Information message to inform the user that the file has been

  • successfully been created.

MESSAGE i910.

ENDIF.

as control is going to else part always.

Plz suggest me something that can be done in case something failure happens or I press X button for cancelling and it wont show me some other message for the action I have taken. I may have to overwrite an existing file and in case of error it should show proper message.

Even when the file could not be downloaded properly proper message should be shown, etc etc.

I mean any to find something which catches the action which I have performed.

Plz reply.

Regards,

Binay.

1 ACCEPTED SOLUTION
Read only

VikasB
Active Participant
0 Likes
328

Hi,

use FM : GUI_DOWNLOAD and check the value of SY_SUBRC.

you can give then appropriate message depending upon the value of SY_SUBRC.

Regards,

Vikas,

plz reward if helpful...

2 REPLIES 2
Read only

Simha_
Product and Topic Expert
Product and Topic Expert
0 Likes
328

Hi,

In the exceptions u have to handle it for evry single exception.

In your coding u are checking only for sy-subrc = 0.

Not for other exceptons.

Handle all the other exceptions as well within ur IF and ENDIF.

Then u can give whatever the message you want to give.

Cheers,

SImha.

Read only

VikasB
Active Participant
0 Likes
329

Hi,

use FM : GUI_DOWNLOAD and check the value of SY_SUBRC.

you can give then appropriate message depending upon the value of SY_SUBRC.

Regards,

Vikas,

plz reward if helpful...