04-14-2009 7:52 PM
Hi all
while downloadng spool data into excel...
in my spool table i have 60500 records.here i am skipping first 3 records (some junk text)which i don't need in output excel,by adding sy-tabix >3 condition.with this am gettngs 59999 records in one page correctly.
when its turn to 60000 reocord which should be displayed in second page.here problem is in second page am getting those 3 records which i skipped initially as 60000th n so onrecords.i don't want to display those 3 records again here.can any one explain me how to do?
04-15-2009 4:12 PM
You must be having something in your TOP-OF-PAGE which can distinguish between your TOP-OF-PAGE and your actual data. You can read the spool as suggested by aRs and then deletes the header generated from TOP-OF-PAGE.
Program to generate the Spool
REPORT ztest_np_1 LINE-COUNT 10 NO STANDARD PAGE HEADING.
start-of-selection.
do 55 times.
write: / sy-abcde.
enddo.
top-of-page.
write: / 'Top'.
write: / 'Something'.
Read the spool and deletes header
DATA: lf_spool TYPE tsp01-rqident.
DATA: lt_buffer TYPE STANDARD TABLE OF txmisporow.
lf_spool = <spool>
CALL FUNCTION 'RSPO_RETURN_ABAP_SPOOLJOB'
EXPORTING
rqident = lf_spool
first_line = 2
TABLES
buffer = lt_buffer
EXCEPTIONS
no_such_job = 1
not_abap_list = 2
job_contains_no_data = 3
selection_empty = 4
no_permission = 5
can_not_access = 6
read_error = 7
OTHERS = 8.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
DATA: la_buffer LIKE LINE OF lt_buffer.
LOOP AT lt_buffer INTO la_buffer WHERE ( line+0(3) = 'Top' or line = 'Something' ).
DELETE lt_buffer.
ENDLOOP.
Regards,
Naimesh Patel
04-14-2009 8:57 PM
I think you are using fm to read the spool , then
call function 'RSPO_RETURN_ABAP_SPOOLJOB'
exporting
rqident = wa_spool
first_line = 4 " Give the value here to skip top lines on each page
tables
buffer = i_spldata
exceptions
no_such_job = 1
not_abap_list = 2
job_contains_no_data = 3
selection_empty = 4
no_permission = 5
can_not_access = 6
read_error = 7
others = 8.
a®
04-15-2009 10:32 AM
yes, let me try with this FM..am already using but not passing the parameter ' FIRST LINE'.
thank you..
Edited by: sunny on Apr 15, 2009 11:33 AM
04-15-2009 10:41 AM
04-15-2009 12:26 PM
Hi a@s,
call function 'RSPO_RETURN_ABAP_SPOOLJOB'
exporting
rqident = wa_spool
first_line = 4 " Give the value here to skip top lines on each page
tables
buffer = i_spldata
exceptions
no_such_job = 1
not_abap_list = 2
job_contains_no_data = 3
selection_empty = 4
no_permission = 5
can_not_access = 6
read_error = 7
others = 8.
This one working for only first page...in the same way i want to skip lines for 2nd page n 3rd page..how to do..can u suggest me..
thank u..
04-15-2009 12:42 PM
Hi Sunny,
How you solved your problem. I am also having the same type of requirement
04-15-2009 1:13 PM
04-15-2009 3:43 PM
This may be a roundway solution.
While creating the spool keep the line to the maximum by
call function 'GET_PRINT_PARAMETERS'
exporting
destination = 'LOCL'
immediately = space
new_list_id = 'X'
no_dialog = 'X'
user = sy-uname
importing
out_parameters = wa_params
valid = v_valid
exceptions
archive_info_not_found = 1
invalid_print_params = 2
invalid_archive_params = 3
others = 4.
wa_params-linct = 1000000. "<<<< Keep this to maximum number of lines in
wa_params-paart = ' '.
then use
call function 'RSPO_RETURN_ABAP_SPOOLJOB'
exporting
rqident = wa_spool
first_line = 4 " Give the value here to skip top lines on each page
tables
buffer = i_spldata
exceptions
no_such_job = 1
not_abap_list = 2
job_contains_no_data = 3
selection_empty = 4
no_permission = 5
can_not_access = 6
read_error = 7
others = 8.
So in the Spool Heading part will come ONLY in the first page.
a®
04-15-2009 4:12 PM
You must be having something in your TOP-OF-PAGE which can distinguish between your TOP-OF-PAGE and your actual data. You can read the spool as suggested by aRs and then deletes the header generated from TOP-OF-PAGE.
Program to generate the Spool
REPORT ztest_np_1 LINE-COUNT 10 NO STANDARD PAGE HEADING.
start-of-selection.
do 55 times.
write: / sy-abcde.
enddo.
top-of-page.
write: / 'Top'.
write: / 'Something'.
Read the spool and deletes header
DATA: lf_spool TYPE tsp01-rqident.
DATA: lt_buffer TYPE STANDARD TABLE OF txmisporow.
lf_spool = <spool>
CALL FUNCTION 'RSPO_RETURN_ABAP_SPOOLJOB'
EXPORTING
rqident = lf_spool
first_line = 2
TABLES
buffer = lt_buffer
EXCEPTIONS
no_such_job = 1
not_abap_list = 2
job_contains_no_data = 3
selection_empty = 4
no_permission = 5
can_not_access = 6
read_error = 7
OTHERS = 8.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
DATA: la_buffer LIKE LINE OF lt_buffer.
LOOP AT lt_buffer INTO la_buffer WHERE ( line+0(3) = 'Top' or line = 'Something' ).
DELETE lt_buffer.
ENDLOOP.
Regards,
Naimesh Patel
07-31-2009 3:36 PM