‎2008 Apr 04 7:38 AM
Hi,
Can anybody provide a sample code that we need to write if we want to access the data that is not in database but it is archived. I know some FM but do not know how to use .
Please help me out.
‎2008 Apr 04 7:43 AM
hi,
Use
In addition to the data in the online database, archived data can also be read or analyzed. When data is analyzed, it is read sequentially and elementary information such as item number, customer and order date is displayed in list form. It is possible to run an analysis for one or several archiving sessions. Not all archiving objects offer an analysis program.
Prerequisites
· The archive files to be read are accessible from Archive Administration.
· There is at least one read program for the archiving object used.
· You are in the Archive Administration: Initial Screen (transaction SARA). You have entered the name of the archiving object in the Object Name field.
Procedure
1. Choose Read.
You access the screen Archive Administration: Start Read Program, where you can schedule your job.
2. In the Batch/Dialog field, specify whether the analysis program is to run in the background (batch) or online (dialog).
3. In the Read Program field, select a read or analysis program and choose Execute.
Depending on the selected archiving object, you access a specific selection screen. For more information, refer to the documentation on the specific archiving object.
4. Enter your selection, and choose Execute.
You access the dialog box Archive Management: Select Files to Read. For more information on file selection, refer to Archive Selection.
5. Select the archive file that you want to read or analyze and confirm the selection by choosing Continue.
Follow this link for more
http://help.sap.com/saphelp_nw70/helpdata/en/08/5741cf4ae611d1894f0000e829fbbd/content.htm
Hope this helps, Do reward.
‎2008 Apr 04 8:09 AM
Hi,
I would like to share this information with you that every archiving objects will provide you some options to read or access the archived data since in the transaction AOBJ, for a particular archiving object, you may find the READ program.
Also, you can read the archived data using the transaction SARE or SARA or ALO1.
If you want to create a new read program for an archiving object which already has one read program, then you can copy the existing read program for that object and change the program according. However, I would warn you that creating a new program with extra functionality may also take you to some critical problems if the created program is tested properly on different scenarios or developed properly.
I do appreciate your technical knowledge but please be careful.
If you don't find the read program for your archiving object, then you may refer to the read program of other archiving objects since the read programs of all the archiving objects have the same program structure and flow of coding.
Remember, one point, using read program or your own read program may not help you to modify the archived data. Only, the reload program will help you to do the same if it exists for your archiving object.
Hope this provides u some tips and info to go the creation of a new read program.
Regards,
Shamim
‎2008 Apr 07 9:40 AM
Thanks for the information.
I have more than one tables in my customizng report that correspond to more than one archiving object.If I want to make this report be able to read the archived data what should I do.
Bcoz every archiving object has diffrent read program, how to implement that in my report? Is there any FM for the same?
Can anybody give a piece of code for this?
‎2008 Apr 07 10:51 AM
For fetching archieved data you need to use following function modules in same sequence:
1) AS_API_READ
2) ARCHIVE_READ_OBJECT
3) ARCHIVE_GET_NEXT_RECORD
4) ARCHIVE_CLOSE_FILE
You can insert data in database table once you fetch the successfully by a simple program.
Retriveing MM archived data
praise be to the 'someone' who introduced you to ME1A. you can check on that transaction in case you are reading archived data directly from a flat-file.
but you also mention SAP AIS, so let me explain the difference here:
ME1A reads archived data from a flatfile which HAS to be on the filesystem or one of your application servers or a shared (global) filesystem. this has two negative aspects:
you have to read sequentially through the file and in case you have a lot of different files (and to make things worse: a lot of big files) this will be so performant that you will like to scream after 2 minutes. so for performance-reasons: skip it.
second is: if the company you're working at is using an external system to store the files after the deletion run you won't find them in the filesystem any longer and to restore them from the external archiving system just for one run of your program ...
so what you would WANT to do is this: setup an archive info structure using transactions SARI/J - or better still, have your basis team do that. fill that structure with every archive you have run and make sure that they will be filled in future runs (again: your basis team will do that). make sure in that structure that you have vendor, material, plant and info record indicator as a key-field in that structure.
so this 'structure' is actually a table you can see in SE11 and the content of wich you can edit in SE16N thus enabling you to read in that table and if you have a hit there - bingo - the data have been archived.
FM to get archived data from table bseg
FAGL_GET_ARCH_ITEMS_BSEG.
Reward points if helpful answer.
‎2008 Apr 10 6:31 AM
Thnks for the information.
Can anybody just tell if we are using infostructures how we rae going to write the code or how to implement that in an existing report that is fetching data from database table and we want the same report to be able to fetch data from archive.
‎2008 Apr 10 6:27 PM
please go through the following link
/people/community.user/blog/2008/03/25/archiving-idoc
please reward points if useful
Edited by: krishna chaitanya nanduri on Apr 10, 2008 7:27 PM