I would like to share the subject related to the Archiving setup in SAP MES. We are all familiar with the Standard Archiving setup in the SAP ME system. But sometimes based on the business requirement, we have to archive the custom tables.

From this blog, you will get the business logic to archive the custom tables in SAP ME.

 

Standard Archiving in ME

The number of records in the WIP (Work In Progress) database becomes quite large after a certain period of time. When the system searches through a large number of records, it slows down the retrieval process. So, the performance of the system will be poor. To achieve good performance, we must archive closed SFC or shop orders. Once we archive the shop orders or SFC, the DB performance will improve.

 

Why do we need Custom Archiving?

The Standard Archiving setup in SAP ME allows you to archive the standard tables in ME. The Shop Order and SFC tables can be archived with this configuration.

In some cases, based on the project need, we have mapped and stored the shop order and SFC details in custom tables in SAP ME. Here, the standard archiving setup ignores the custom table archiving, and the archived Shop Orders and SFCs were not archived from the custom tables.

In this case, the custom table details must be archived. So, we have to follow the steps to archive the Custom tables in SAP ME.

 

High-level Steps

Step 1. Create an archive table for “Z_ID” (Custom Table).

Step 2. Develop a transaction for archiving.

Step 3. Create a scheduler to execute the transaction every night (say, at 1:30 am).

Detailed Steps:

Step 1. Create an archive table for “Z _ID”.

  1. In the WIP database, create the archive table “Z_AR_ID” for “Z_ ID”.
  2. The new table should contain all columns belonging to the “Z _ID”
  3. Make sure the column names for the new table have the same naming convention as the “Z _ID”

Step 2. Develop a Transaction for archiving.

  1. Write an SQL query to get the newly archived shop order list from the last scheduler run and validate that the records are not in “Z_AR_ID” but present in the “Z_ID” table.
  2. For each shop order from the list, insert into the custom archive table “Z_AR_ID”.
  3. Write the query to delete the archived shop order (Z_AR_ID) from the custom table “Z_ID”.

Step 3. Create a scheduler to execute the transaction Every day at 1:30 AM.

  1. Create a scheduler “Archive_Z_ID_Table” in MII Menu -> System Management -> Scheduler.
  2. Set Scheduler time as “0 30 1 * * *” for 1:30:00am every Day.

Conclusion:

I hope you have got how to set up the MII schedulers and use the MII transactions to improve the application development in SAP MII. Please, let me know your comments. If you have any questions, I encourage you to post in the comment section and I will try to answer them as soon as possible. Please follow me for more useful content.

Sara Sampaio

Sara Sampaio

Author Since: March 10, 2022

0 0 votes
Article Rating
Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x