Application Development and Automation 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: 
Read only

How to read data from archived data ?

Former Member
0 Likes
4,529

I have a question on archiving.

How can our customized program can read or select archived records??

Is there is any sample how customized program to read back old achived data ?

Regards,

Rayblur

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,331

Rayblur... i have some PPT slides for archiving ...

if you want i can send you...give me you mail id...

Send it to [email protected].

Thanx,

Mandeep.

I have a question on archiving.

How can our customized program can read or select archived records??

Is there is any sample how customized program to read back old achived data ?

Regards,

Rayblur

6 REPLIES 6
Read only

Former Member
Read only

Former Member
0 Likes
2,331

Hi Rayblur,,,

I dnt have much idea about reading archived data ..but i hav a sample code..

it may help you....

[IMG]http://www.designoo.com/files/6678/incorrectInfo.jpg[/IMG]

My code:

  • for Read Archive

DATA: handle LIKE sy-tabix,

buffer TYPE arc_buffer,

wa_arc_bsak LIKE bsak,

number_of_records_read TYPE i.

data: LE_DATA(8192) TYPE C,

LE_STRUCTURE LIKE ARC_BUFFER-RNAME.

...

perform read_archive_bsak.

........

FORM read_archive_bsak.

  • open existing archive files for BSAK

CALL FUNCTION 'ARCHIVE_OPEN_FOR_READ'

EXPORTING

object = 'FI_DOCUMNT'

IMPORTING

archive_handle = handle

EXCEPTIONS

OTHERS = 1.

  • IF sy-subrc <> 0.

  • WRITE: / 'No file can be accessed'(001).

  • EXIT.

  • ENDIF.

CLEAR number_of_records_read.

  • 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 = LE_DATA

record_structure = LE_STRUCTURE

EXCEPTIONS

end_of_object = 1

OTHERS = 2.

IF sy-subrc <> 0.

EXIT.

ENDIF.

CASE buffer-rname.

WHEN 'BSAK'.

wa_arc_bsak = LE_DATA.

move-corresponding wa_arc_bsak to Tab_ARC_bsak.

APPEND Tab_ARC_bsak.

CLEAR: wa_arc_bsak, LE_DATA, Tab_ARC_bsak.

ENDCASE.

ADD 1 TO number_of_records_read.

ENDDO.

ENDDO.

  • close the archive session

CALL FUNCTION 'ARCHIVE_CLOSE_FILE'

EXPORTING

archive_handle = handle.

Move-corresponding tab_arc_bsak to tab_bsak.

append tab_bsak.

clear tab_bsak.

ENDFORM. " read_archive_bsak

Plz reward points if answer is helpful.......

Regards,

Mandeep.

Read only

Former Member
0 Likes
2,331

Does anyone have sample program how can we retrieve archive data from archive table?

In our normal customized program, we use SELECT * tablename.

If we want to select from archive data ? what are the procedure, RFC or command that we used??

Pls advice

Read only

Former Member
0 Likes
2,332

Rayblur... i have some PPT slides for archiving ...

if you want i can send you...give me you mail id...

Send it to [email protected].

Thanx,

Mandeep.

Read only

0 Likes
2,331

Hi Mandeep,

my email is [email protected]

Can you send to me?

Thanks a lot

Rayblur

Read only

Former Member
0 Likes
2,331

Hi there,

Is there anyone have any archiving document as well?

Rayblur