About saving alv report as excel file in presentation server…
I have struggled to accomplish this task…I did not find any solution which I could easily understand on net..So I am giving the explanation in general terms..
As you know, we use REUSE_ALV_GRID_DISPLAY / LIST_DISPLAY,
In addition to the general parameters there, use the I_CALLBACK_USER_COMMAND parameter to give the name of your form.
Then, in the form, use ‘case syucomm’ to check ‘when’ it contains the function code you have assigned for the button(for which you are assigning this functionality),then call the function GUI_DOWNLOAD(inside case).
Excerpts of a program is given below:
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = SY-REPID
I_CALLBACK_PF_STATUS_SET = 'SET_PF_STATUS'
I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
…………………………..
…………………………..
FORM SET_PF_STATUS USING rt_extab TYPE slis_t_extab.
SET PF-STATUS 'STANDARD'.
ENDFORM.
FORM USER_COMMAND using p_ucomm like sy-ucomm SELFLD TYPE SLIS_SELFIELD.
CASE p_ucomm.
WHEN 'SAVEEX'.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
FILENAME = ‘C:/test.xls’
FILETYPE = 'DAT'
CONFIRM_OVERWRITE = 'X'
………………………..
………………………..
and uncomment all the exceptions
ENDFORM
Subscribe to:
Post Comments (Atom)
3 comments:
Great post.. I have a question.. Does system call 'FORM USER_COMMAND ' subroutine always ?
Hey Karthik,
Very encouraging Comments..Thank you.
I suppose it does..
My reasonin is as follows..
since its a user command, the program has to check wat is d function code behind the button tat the user has clicked on.
wat do u say bout this.
my question is little different I think .. I am sorry if did not express though .. .
question is: is the name of form USER_COMMAND always?
manasi.bs: Yes
Thanks for clarification ;)
Post a Comment