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

Excel

Former Member
0 Likes
410

If my data exceeds in Excel output to more than 65000 .

how do i change the output in such a way that the remaining

data comes on a new sheet...ie. sheet 2 of the same excel and not a new excel

1 ACCEPTED SOLUTION
Read only

venkat_o
Active Contributor
0 Likes
388

Hi Dilip, Check this link. It helps you to develop for such kind of requirment. [https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/c05db2ca-569e-2910-0784-fc06cc3be31d|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/c05db2ca-569e-2910-0784-fc06cc3be31d] Regards, Venkat.O

2 REPLIES 2
Read only

Former Member
0 Likes
388

define one internal table to hold 65000 records at once and then download the data into file using GUI_DOWNLOAD....

Have a look at this code,

DATA:

w_string TYPE string, " To hold filepath accepted

w_fnum(2) TYPE n, " File Number if > 65000

w_append TYPE c, " Append Flag for GUI_DOWNLOAD

w_lines TYPE i, " To hold Number of Records

w_rem TYPE i, " To hold the Remainder

w_index TYPE i VALUE 1, " Table index for next record

w_count TYPE i, " Counter variable

w_f_num TYPE i, " Number Of Files to be generated

i_limit LIKE i_output, " Temporary storage of main data i_output

w_string = p_pfile.

DESCRIBE TABLE i_output LINES w_lines.

w_f_num = w_lines DIV 65000.

w_rem = w_lines MOD 65000.

IF w_f_num GT 1.

IF w_rem GT 0.

  • Increment File Number Counter by one

w_f_num = w_f_num + 1.

ENDIF. " IF w_loop GT 0.

  • Temporary storage of main table i_output into i_limit

i_limit[] = i_output[].

  • Initializing i_output

REFRESH i_output[].

DO w_f_num TIMES.

LOOP AT i_limit INTO wa_output FROM w_index.

  • Increment record counter by one

w_count = w_count + 1.

  • Append 65000 Records to i_output

IF w_count LE 65000.

APPEND wa_output TO i_output.

CLEAR wa_output.

ELSE.

w_count = 0.

w_index = sy-tabix.

w_fnum = w_fnum + 1.

  • Split FilePath into w_locate(filename) and w_ext(extension = XLS)

SPLIT p_pfile AT w_del INTO w_locate w_ext.

  • Condense for Spaces

CONDENSE w_locate.

CONDENSE w_ext.

  • Generate new File Name

CONCATENATE w_locate '[' w_fnum ']' '.' w_ext INTO w_string.

  • Download the File with 65000 limit

PERFORM f232_gui_download USING w_string w_append i_output.

  • Initialize the table i_output

REFRESH i_output[].

ENDIF. " IF w_count LE 5.

ENDLOOP. " LOOP AT i_limit INTO wa_output

ENDDO. " DO w_f_num TIMES.

ELSE.

FREE i_limit[].

PERFORM f232_gui_download USING w_string w_append i_iheader.

w_append = 'X'.

PERFORM f232_gui_download USING w_string w_append i_output.

ENDIF. " IF w_f_num GT 1.

<REMOVED BY MODERATOR>

Dara.

Edited by: Alvaro Tejada Galindo on Apr 21, 2008 12:22 PM

Read only

venkat_o
Active Contributor
0 Likes
389

Hi Dilip, Check this link. It helps you to develop for such kind of requirment. [https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/c05db2ca-569e-2910-0784-fc06cc3be31d|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/c05db2ca-569e-2910-0784-fc06cc3be31d] Regards, Venkat.O