07-13-2012 10:19 AM
Hello Friends,
In order to read data from archive I use fm ARCHIVE_GET_NEXT_RECORD. First I open the archive with ARCHIVE_OPEN_FOR_READ and then use ARCHIVE_GET_NEXT_OBJECT. These work without raising any exceptions. But ARCHIVE_GET_NEXT_RECORD returns end_of_object without filling record and record_structure. It is really frustrating because using tx-code SARA I can access the archived document and the standard read program uses the same fm.s. What should I check?
Thx in advance,
Ali
07-16-2012 10:37 AM
Hello Friends,
Noone ever met this kind of problem before? I would really appreciate an answer.
Thanks,
Ali
07-16-2012 2:36 PM
Whats the value you pass to parameter "archive_handle"..Post ur code
07-17-2012 10:03 AM
here is the excerpt from my coding:
call function 'ARCHIVE_OPEN_FOR_READ'
EXPORTING
object = object
IMPORTING
archive_handle = handle
EXCEPTIONS
internal_error = 01
no_files_available = 02
object_not_found = 03
open_error = 04.
if sy-subrc ne 0.
write: / 'NO ARCHIVE DATA !'.
else.
* loop to get the next object from the archive files
do.
call function 'ARCHIVE_GET_NEXT_OBJECT'
EXPORTING
archive_handle = handle
* IMPORTING
* object_id = filepath-pathintern
EXCEPTIONS
end_of_file = 01
internal_error = 02
open_error = 03
wrong_access_to_archive = 04.
if sy-subrc ne 0.
exit.
endif.
do.
call function 'ARCHIVE_GET_NEXT_RECORD'
EXPORTING
archive_handle = handle
IMPORTING
record = arc_buffer-segment
record_structure = arc_buffer-rname
EXCEPTIONS
end_of_object = 01
internal_error = 02
wrong_access_to_archive = 03.
if sy-subrc ne 0.
exit.
endif.
enddo.
enddo.