01-27-2009 6:11 PM
hi
i need to read archived data when my report fails to fetch data from the database for the give selection fields.
the selection fields are: cost centre, cost element, year, period, order.
i have gone through the standard program sbookri_db_ar_multiple and i am not getting a clear understanding.
i understood that i need to call 4 FMs in a sequence to read the archived data into a report, but i am not understanding how to pass my selection fields as input to those FMs.
can some on help me with this?
regards
mano
01-27-2009 6:17 PM
01-29-2009 12:09 PM
Hi,
Please follow the below function modules and the paramters for reading archived data:
CALL FUNCTION 'ARCHIVE_OPEN_FOR_READ'
EXPORTING
OBJECT = archiving object name
IMPORTING
ARCHIVE_HANDLE = archive read handle
Then in the loop(DO-ENDDO), use this FM:
DO.
CALL FUNCTION 'ARCHIVE_GET_NEXT_OBJECT'
EXPORTING
archive_handle = archive read handle
Then records from the data objects using this FM:
CALL FUNCTION 'ARCHIVE_GET_TABLE'
EXPORTING
archive_handle = archive read handle
record_structure = 'TABLENAME'
all_records_of_object = 'X'
automatic_conversion = 'X'
TABLES
table = internal table for which you want to retrieve records.
ENDDO.
Then close the archive file using this FM:
CALL FUNCTION 'ARCHIVE_CLOSE_FILE'
EXPORTING
archive_handle = archive read handle
This will help u in reading archived data from archive file.
may give some idea also on how to code the read prgram.
Thanks,
Shamim