11-13-2015 6:37 AM
Hi All
I am trying to read archived data (archiving object = pa_calc) from content server to show this data in my customized report becuase of the client requirement, I am using this Fm to get this data,
CALL FUNCTION 'ARCHIVE_READ_OBJECT'
CALL FUNCTION 'ARCHIVE_GET_NEXT_RECORD'
CALL FUNCTION 'ARCHIVE_CLOSE_FILE'
But in CALL FUNCTION 'ARCHIVE_GET_NEXT_RECORD' fm its giving me error of
Please guide me as i am new in archiving,and correct me if my approach is not correct,
Regards,
11-13-2015 7:10 AM
Hi David,
In generally, at first we call FM 'ARCHIVE_OPEN_FOR_READ' using archiving object(yours is PA_CALC),
DO.
call FM 'ARCHIVE_GET_NEXT_OBJECT'.
IF sy-subrc <> 0.
EXIT.
ENDIF.
call FM 'ARCHIVE_GET_TABLE' to get data, and process it.
ENDDO.
At the end, call FM 'RCHIVE_CLOSE_FILE''.
Regards,
Archer
11-13-2015 7:10 AM
Hi David,
In generally, at first we call FM 'ARCHIVE_OPEN_FOR_READ' using archiving object(yours is PA_CALC),
DO.
call FM 'ARCHIVE_GET_NEXT_OBJECT'.
IF sy-subrc <> 0.
EXIT.
ENDIF.
call FM 'ARCHIVE_GET_TABLE' to get data, and process it.
ENDDO.
At the end, call FM 'RCHIVE_CLOSE_FILE''.
Regards,
Archer
11-13-2015 7:18 AM
Hi Archer
Thnaks for replying
I am using CALL FUNCTION 'ARCHIVE_READ_OBJECT' instead of ARCHIVE_OPEN_FOR_READ is it correct?.
Here is my Initial development please guide and if you have some example program do share with me if possible.
CALL FUNCTION 'ARCHIVE_READ_OBJECT'
EXPORTING
OBJECT = 'PA_CALC'
OBJECT_ID = '0001 '
* USER_EXIT_PROGRAM = ' '
* USER_EXIT_FORM = ' '
ARCHIVKEY = '000012-001PA_CALC '
OFFSET = '1379'
* MOVEFLAG = ' '
IMPORTING
ARCHIVE_HANDLE = r_handle
* COMPR_OBJECT_LENGTH =
EXCEPTIONS
NO_RECORD_FOUND = 1
FILE_IO_ERROR = 2
INTERNAL_ERROR = 3
OPEN_ERROR = 4
CANCELLED_BY_USER = 5
ARCHIVELINK_ERROR = 6
OBJECT_NOT_FOUND = 7
FILENAME_CREATION_FAILURE = 8
FILE_ALREADY_OPEN = 9
NOT_AUTHORIZED = 10
FILE_NOT_FOUND = 11
OTHERS = 12
.
IF SY-SUBRC <> 0.
MESSAGE ID sy-msgid TYPE 'I' NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
CALL FUNCTION 'ARCHIVE_GET_NEXT_RECORD'
EXPORTING
ARCHIVE_HANDLE = r_handle
* GET_REAL_STRUCTURE_NAME = 'X'
* AUTOMATIC_CONVERSION = 'X'
IMPORTING
RECORD = lit_data
* RECORD_CURSOR =
* RECORD_FLAGS =
RECORD_STRUCTURE = l_structure
* RECORD_LENGTH =
* RECORD_REF =
EXCEPTIONS
END_OF_OBJECT = 1
INTERNAL_ERROR = 2
WRONG_ACCESS_TO_ARCHIVE = 3
OTHERS = 4
.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
EXIT.
ENDIF.
CALL FUNCTION 'ARCHIVE_CLOSE_FILE'
EXPORTING
archive_handle = r_handle
EXCEPTIONS
internal_error = 1
wrong_access_to_archive = 2
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE 'NOT FOUND1' TYPE 'I'." 'Unable to close archive session'.
EXIT.
ENDIF.
11-13-2015 7:26 AM
There are many example programs in AOBJ, each archiving object have one, in 'Read programs' node.
Including 'PA_CALC'.
11-13-2015 7:41 AM
IF you want use 'ARCHIVE_READ_OBJECT', I suspect that the parameter 'OFFSET = 1397' is not correct, try a smaller number?
And you`d better set a break point for message class BA(260) in your program, once it reached there, you could exactly check why it raise this error message.
11-13-2015 10:29 AM
Dear Archer
I have Check Aobj read node in this i found RPAR1R00 program but when i check the program it actually reload the archive data, my requirement is to just read the Archive Payroll results and show their payslips of archived employees just like in Remuneration statement.
Please help me.