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: 

how to read archived data into a report program?

Former Member
0 Kudos

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

2 REPLIES 2

Former Member
0 Kudos

Hi,

U already posted this question in ABAP object

Now u r repeating it here.

Cross posting threads is considered as spamming and is against the rules.

Reported!! to the moderator for rules violation

кu03B1ятu03B9к

Former Member
0 Kudos

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