cancel
Showing results for 
Search instead for 
Did you mean: 

Help on Archiving

Former Member
0 Kudos

Hi all,

i am getting data from the archiving object SD_VBRK, with this data how do i retrieve data from other archiving objects as SD_VBAK and RV_LIKP???

Please help me out...

Points are assured!!!

Regards,

Priya.

Accepted Solutions (0)

Answers (2)

Answers (2)

ferry_lianto
Active Contributor
0 Kudos

Hi Priya,

Please check this programs.

S3VBAKAU - Archive read program for SD_VBAK

S3LIKPAU - Archive read program for RV_LIKP

Also check the following Rob's sample code.


*&---------------------------------------------------------------------*
*&      Form  get_data
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
FORM get_data.
 
  LOOP AT arch_data WHERE zf_gjahr = p_gjahr.
* open existing archive files
    CALL FUNCTION 'ARCHIVE_OPEN_FOR_READ'
         EXPORTING
              archive_document = arch_data-zf_document
              object           = 'SD_VBAK'
         IMPORTING
              archive_handle   = handle
         EXCEPTIONS
              OTHERS           = 1.
 
    IF sy-subrc <> 0.
      WRITE: / 'No file can be accessed'(010).
      EXIT.
    ENDIF.
 
* loop to get the next data object from the archive file(s)
    DO.
      CALL FUNCTION 'ARCHIVE_GET_NEXT_OBJECT'
           EXPORTING
                archive_handle = handle
           EXCEPTIONS
                end_of_file    = 1
                OTHERS         = 2.
      IF sy-subrc <> 0.
        EXIT.
      ENDIF.
 
* get data records from the data container
      DO.
        CALL FUNCTION 'ARCHIVE_GET_NEXT_RECORD'
             EXPORTING
                  archive_handle   = handle
             IMPORTING
                  record           = buffer-segment
                  record_structure = buffer-rname
             EXCEPTIONS
                  end_of_object    = 1
                  OTHERS           = 2.
        IF sy-subrc <> 0.
          EXIT.
        ENDIF.
 
* Process Data
 
      ENDDO.
    ENDDO.
 
* close the archive session
    CALL FUNCTION 'ARCHIVE_CLOSE_FILE'
         EXPORTING
              archive_handle = handle.
  ENDLOOP.
 
ENDFORM.                    " get_data

Regards,

Ferry Lianto

Former Member
0 Kudos

Which FM do you use?

Rob

Former Member
0 Kudos

i am using the FM ARCHIVE_READ_OBJECT

Former Member
0 Kudos

I think you can use the same FM with your new objects. Do you also use ARCHIVE_GET_NEXT_RECORD?

Rob