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: 

Get Archiving Data for Object 'SD_VBAK'

alejandro_lpez
Contributor
0 Kudos

Hi,

I need to retrieve archiving data for the object 'SD_VBAK'. is there any function module or program?

I'm using 4.6B version.

it exists a general function to obtain data for all object (FI_DOCUMNT, RV_LIKP, SD_VBRK, SD_VFKK, SD_VTTK, EC_PCA_ITM, MM_MATBEL)? if doesn't exist, which module functions or programs can be use for each object?

Thanks,

Alejandro.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

I think you could use something like:


*&---------------------------------------------------------------------*
*&      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

8 REPLIES 8

Former Member
0 Kudos

Hi

need to retrieve archiving data for the object 'SD_VBAK'. is there any function module or program?

I'm using 4.6B version.

it exists a general function to obtain data for all object (FI_DOCUMNT, RV_LIKP, SD_VBRK, SD_VFKK, SD_VTTK, EC_PCA_ITM, MM_MATBEL)? if doesn't exist, which module functions or programs can be use for each object?

1. Go to Transaction SARA.

2. Enter your arch. object SD_VBAK

3. Click management button (Ver 5.0). In 4.6c you may see buttons like 'management' or 'Read'.

4. Now READ archive button is visible.

Click it.

5. It will show the program name of read archive.

6. Click execute button.

Selection screen will ask you the required sales documents to read.

I think this will help you.

Bala

Note: Award points if helpful

alejandro_lpez
Contributor
0 Kudos

Hi,

I need a program or function module that can be invoke from a Z* program, and then obtain and used the archiving data.

0 Kudos

Check these programs:

S3VBAKAU is archive read program for SD_VBAK

S3VBAKRL is archive reload program.

Regards

Sridhar

0 Kudos

refer....SBOOKR demo program or try these function modules

ARCHIVE_READ_OBJECT and ARCHIVE_GET_NEXT_RECORD

Thanks,

Former Member
0 Kudos

Hi Alejandro,

Have a look at the ARCH function group. It should give you a list of all the generic FMs used to access archive objects.

To retrive archiving data for the SD_VBAK object, there is the standard program S3VBAKAU available. Maybe this has what you are looking for?

Hope this helps.

Sudha

Former Member
0 Kudos

I think you could use something like:


*&---------------------------------------------------------------------*
*&      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

Former Member
0 Kudos

Hi,

Check out table

ARCH_OBJ for all program

associated with archiving object.

Regards,

Amole

Former Member
0 Kudos

Hi,

Important tcodes for archiving are:

AOBJ,SARA,SARI(view archive data).

Important tables are:

arch_obj,admi_run,admi_files

You acn read archive data using tranction SARI.

Regards

Amole