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

ALV dowload spreadsheet

Former Member
0 Likes
1,220

When download the data in excel from ALV_GRID (path LIST EXPORT- SPREADSHEET) display POP-UP of chosen if I choose "Always Use Selected Format", as I can cancel the choice to the next one I use.

I use transaction CJI3 for example.

Thank for your help.

Giampiero

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
894

Hi ,

Use the function module SAP_CONVERT_TO_XLS_FORMAT to download the internal table to an excel file.

PARAMETERS: p_file LIKE rlgrap-filename DEFAULT 'c:\tmp\test.xls'.

DATA: t100_Lines TYPE STANDARD TABLE OF t001 WITH DEFAULT KEY.

SELECT * FROM t001 INTO TABLE t100_Lines.

CALL FUNCTION 'SAP_CONVERT_TO_XLS_FORMAT'

EXPORTING

i_filename = p_file

TABLES

i_tab_sap_data = t100_Lines.

Rewards if helpful

Regards

Shambhu

Hi ,

Use the function module SAP_CONVERT_TO_XLS_FORMAT to download the internal table to an excel file.

PARAMETERS: p_file LIKE rlgrap-filename DEFAULT 'c:\tmp\test.xls'.

DATA: t100_Lines TYPE STANDARD TABLE OF t001 WITH DEFAULT KEY.

SELECT * FROM t001 INTO TABLE t100_Lines.

CALL FUNCTION 'SAP_CONVERT_TO_XLS_FORMAT'

EXPORTING

i_filename = p_file

TABLES

i_tab_sap_data = t100_Lines.

Rewards if helpful

Regards

Shambhu

5 REPLIES 5
Read only

Former Member
0 Likes
895

Hi ,

Use the function module SAP_CONVERT_TO_XLS_FORMAT to download the internal table to an excel file.

PARAMETERS: p_file LIKE rlgrap-filename DEFAULT 'c:\tmp\test.xls'.

DATA: t100_Lines TYPE STANDARD TABLE OF t001 WITH DEFAULT KEY.

SELECT * FROM t001 INTO TABLE t100_Lines.

CALL FUNCTION 'SAP_CONVERT_TO_XLS_FORMAT'

EXPORTING

i_filename = p_file

TABLES

i_tab_sap_data = t100_Lines.

Rewards if helpful

Regards

Shambhu

Read only

Former Member
0 Likes
894

hi use this ...ths is also similar coding...

report z_vishvas_alv1.

type-pools: slis.

data: begin of i_outtab occurs 0.

include structure sflight.

data: w_chk type c. "For multiple selection

data: end of i_outtab.

  • I_OUTTAB TYPE SFLIGHT OCCURS 0,

data: i_private type slis_data_caller_exit,

i_selfield type slis_selfield,

w_exit(1) type c.

parameters: p_title type sy-title.

*

start-of-selection.

select * from sflight into table i_outtab.

call function 'REUSE_ALV_POPUP_TO_SELECT'

exporting

i_title = p_title

i_selection = 'X'

i_zebra = 'X'

  • I_SCREEN_START_COLUMN = 0

  • I_SCREEN_START_LINE = 0

  • I_SCREEN_END_COLUMN = 0

  • I_SCREEN_END_LINE = 0

i_checkbox_fieldname = 'W_CHK'

  • I_LINEMARK_FIELDNAME =

  • I_SCROLL_TO_SEL_LINE = 'X'

i_tabname = 'I_OUTTAB'

i_structure_name = 'SFLIGHT'

  • IT_FIELDCAT =

  • IT_EXCLUDING =

  • I_CALLBACK_PROGRAM =

  • I_CALLBACK_USER_COMMAND =

  • IS_PRIVATE = I_PRIVATE

importing

es_selfield = i_selfield

e_exit = w_exit

tables

t_outtab = i_outtab

exceptions

program_error = 1

others = 2.

if sy-subrc <> 0.

  • MESSAGE i000(0k) WITH sy-subrc.

endif.

*****the internal table is modified with a cross sign for marking the

***rows selected

loop at i_outtab where w_chk = 'X'.

write: / i_outtab-carrid, i_outtab-price.

endloop.

regards,

venkat.

Read only

0 Likes
894

thanks for your help, but i don't modify a standard transaction.

you know a method in order to cancel the choice of flag in transaction ?

thaks.

Giampiero

Read only

Former Member
0 Likes
894

Hi!

Just go to MB51 to get some exportable list. After that enter command &RESET_EXCEL into SAP command filed.

You should get message Excel setting ware reset

Read only

Former Member
0 Likes
894

Hi,

try report: SALV_BS_ADMIN_MAINTAIN

regards, Dieter