‎2006 Jun 15 3:43 PM
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.
‎2006 Jun 15 4:24 PM
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
‎2006 Jun 15 4:01 PM
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
‎2006 Jun 15 4:09 PM
Hi,
I need a program or function module that can be invoke from a Z* program, and then obtain and used the archiving data.
‎2006 Jun 15 4:11 PM
Check these programs:
S3VBAKAU is archive read program for SD_VBAK
S3VBAKRL is archive reload program.
Regards
Sridhar
‎2006 Jun 15 4:13 PM
refer....SBOOKR demo program or try these function modules
ARCHIVE_READ_OBJECT and ARCHIVE_GET_NEXT_RECORD
Thanks,
‎2006 Jun 15 4:15 PM
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
‎2006 Jun 15 4:24 PM
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
‎2006 Jun 15 4:42 PM
Hi,
Check out table
ARCH_OBJ for all program
associated with archiving object.
Regards,
Amole
‎2006 Jun 15 4:52 PM
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