2010 Apr 29 10:37 AM
Hi,
I want to archive around 10 tables for the past 30 days. i have used the following code to archive for one table.
* Internal table to store the records that was retrieved
DATA : BEGIN OF GET_TAB OCCURS 1000.
INCLUDE STRUCTURE ZFIT0056.
DATA : END OF GET_TAB.
MOVE SY-DATUM TO TEMP_DATE.
SUBTRACT 30 FROM TEMP_DATE.
IF WA_CNT <> 0.
PERFORM MOVE_RECORDS.
ENDIF.
FORM MOVE_RECORDS.
CLEAR GET_TAB.
TEMP_DATE = TEMP_DATE + 1.
MOVE TEMP_DATE+0(4) TO DATE_YY.
MOVE TEMP_DATE+4(2) TO DATE_MM.
MOVE TEMP_DATE+6(2) TO DATE_DD.
CONCATENATE 'DR' DATE_DD DATE_MM DATE_YY '.AAA' INTO FILENAME.
SELECT * FROM ZFI00001 INTO GET_TAB WHERE FILENAME1 = FILENAME.
IF SY-SUBRC = 0.
APPEND GET_TAB.
ENDIF.
ENDSELECT.
PERFORM ADD_RECORDS.
ENDFORM.
FORM ADD_RECORDS.
INSERT ZFI00006 FROM TABLE GET_TAB.
IF SY-SUBRC = 0.
PERFORM DELETE_RECORDS.
ENDIF.
ENDFORM. "add_Records
FORM DELETE_RECORDS.
DELETE FROM ZF000001WHERE FILENAME1 = FILENAME.
IF SY-SUBRC = 0.
WA_CNT = WA_CNT - 1.
ENDIF.
ENDFORM. "delete_records
can anybody suggest me a simpler way to archive all the 10 tables in a single program.
can anybody help me on this
2010 Apr 29 10:45 AM
Have you considered using the SAP standard ADK (Archive Developement Kit) and Workbench to get a more modularised and easier to (re-)use tool for this project?
You would have to do [a bit of reading first|http://help.sap.com/saphelp_nw2004s/helpdata/en/2a/fa0391493111d182b70000e829fbfe/content.htm], though.
2010 Apr 29 10:50 AM
no we are not using it. we want to archive the customized tables
2010 Apr 30 2:51 AM
2010 May 03 3:25 AM
2010 May 03 5:00 AM
Hi,
Hope this link will helpful to you
http://www.pbs-software.com/medien/praesentationen/PBS_CUSTOM_EN.pdf
Regards,
Pravin
| User | Count |
|---|---|
| 6 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |