Application Development 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: 

ARCHIVE_GET_NEXT_RECORD does not fill structure

Former Member
0 Kudos

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

3 REPLIES 3

Former Member
0 Kudos

Hello Friends,

Noone ever met this kind of problem before? I would really appreciate an answer.

Thanks,

Ali

Former Member
0 Kudos

Whats the value you pass to parameter "archive_handle"..Post ur code

0 Kudos

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.