Application Development Blog Posts
Learn and share on deeper, cross technology development topics such as integration and connectivity, automation, cloud extensibility, developing at scale, and security.
cancel
Showing results for 
Search instead for 
Did you mean: 
Former Member

DATA MIGRATION OF Production ORDERS

1.          Requirements

1.1             OVERVIEW

This artifact enables us to reuse attached program for successful data migration of Transactional data – production orders from SAP to SAP

1.2                 FUNCTIONALITY – PRODUCTION orders

         A production order defines which material is to be processed, at which location, at what time and how much work is required. It also defines which resources/components are to be used and how the order costs are to be settled. As soon as a planned order or other request is generated from material requirements planning, the information is passed on to shop floor control; the order-relevant data is also added to ensure complete order processing. Production orders are used to control production within a company and also to control cost accounting.

1.3                 BUSINESS scenario

There would be a need of migration of production orders as a part of Transactional data migration @ cut off period. We may argue that if we run MRP in new system for the created sales order or planned independent requirements, we will generate planned orders which can be converted to production orders  or manual creation of orders

However, there might be interface or third party system which is used for Business planning need old order details which is unavoidable.  Under this Business scenario, Data migration of production order becomes critical object

  1. Scenario 1 – No change in Master data – BOM OR ROUTING :
    

          Under this scenario , we need to Migrate first Master data required for creation of production order first such as work center,cost center,BOM,ROUTING ,PRODCUTION VERSION and of course Material master .

Once Master data has been done without any error, we may list out open production orders which needs to be migrated which will be in creation, release or under WIP. This is based on client Business requirement.

           Now, we can use standard BAPI program to extract open orders based of filter criteria followed by Transformation (Mapping) and final upload. LSMW recording using SAP standard BAPI program developed in this artefact can be reused.

  1. Scenario 2 : Changes done inside  production order BOM OR routing

            Practically, in real time condition, Business users may change BOM or routing inside production orders which are used due to manufacturing requirement. This cannot be avoided as SAP PP system itself will allow this.

Ie)  Changes done in BOM or Routing inside released order to accommodate real time conditions . Changes are specific to order and not Master data.

Example:

Let us say we have below material x having PV as 0001 , Alt Bom – 01, routing group counter – 01 and  PV – 0002 ,alt bom 02,routing group counter - 02

1.    Order no 1  : ( PV – 0001)

        Once order is released, Business person changes below data inside order such as

·         Added a component in BOM and assigned to operation x

·         Changed UOM

·         No changes in routing

2.    Order No 2  : ( PV – 0002)

         Once order is released, Business person changes below data inside order such as

·         Changing in process time , move time

·         Changing a alternative work centre

·         Adding a new operation for say rework

·         Deleting a operation which is not needed

·         No changes in BOM

I have provided both examples of BOM OR ROUTING change each. It may happen both change in order no 3.

Challenges of Business scenario:

  1. Scenario 1 – No change in Master data – BOM OR ROUTING :
    

Since this scenario calls for no changes in order level Master data, it is simple and easy. We can use reuse Program

  1. Scenario 2 : Changes done inside  production order BOM OR routing

Since this scenario need changes made in order to be reflected in migrated orders, we need a separate migration strategy as below

·         Extract changes done @ order level in BOM & routing

·         Create Master data in new system with changed BOM, routing, PV

·         Migrate orders using above master data as scenario 1

      Limitation:

Scenario 2 is applicable only if Production order uses PV only once. Multiple orders using same PV need a strategy to create new PV with Mapping

1.4                 IMPLEMENTATIONS

          In General, Production order data migration from SAP to SAP system involves 4 main steps such as

                     

  • Extraction
  • Transformation
  • Loading
  • Reconciliation

Our Reusable artifact will cover only first step which means Extraction of Transaction data from source system. Last 3 steps involves only activity and not any logic while doing Data Migration

As these steps are client specific, customized ones , we are  limiting to Extraction logic alone which is  the most crux part in data  migration . Rest of the steps can be achieved as below based on client requirement

Transformation of data  ie) Mapping can be done on Extracted data if needed

Loading is just a simple LSMW recording which can be developed by Technical Team

Reconciliation is a Functional validation of created orders .This will be achieved by downloading production order  Tables of source and Target system and  do validation by Business 

SELECTION SCREEN

The following Selection Screen is applicable for both the scenarios (1 & 2).

Flow of the Program

        The Program extracts data required for creating the BOM, Routing and Production Versions to create the Production Order from the source server in 6 files and puts them on the application server of the destination server.

There are two set of tables:

1.    Master tables which contain the master data.

2.    Transaction tables which contain Transaction level data.

If there are any changes done at the transaction level, these tables will contain the changed data else they will contain the master data as such.

Note: In this program, we hit the transaction tables only in both the scenarios. This is because the transaction tables contain the master data as such if no changes are done at transaction level else the latest updated data in case of changes done at transaction level.

Algorithm:

1.    Select data from table AFPO for all the production orders and materials given in the selection screen.

2.    For each record extracted from AFPO, use the BAPI “CO2H_PROD_ORDER_READ” and get all the Operations.

3.    Select data from table RESB for all production orders given in the selection screen.

4.    For each record extracted from RESB, select data from tables AFKO, CAUFV and STKO.

5.    For each record extracted from STKO, select data from tables MAST and STAS.

6.    For each record extracted from STAS, select data from table STPO.

7.    Select data from table AFKO for each operation extracted using the BAPI “CO2H_PROD_ORDER_READ”.

8.    For each record extracted in Step7, select data from table AFVC.

9.    For each record extracted from AFVC, select data from tables CRHD, PLMK, PLKO, AFVV and AFVU.

10. For each record extracted from PLKO, select data from tables MAPL, PLFL and PLAS.

11. Extract the long text using function module “READ_TEXT”.

12. Concatenate all the above extracted data and put them in a format that is ready to be directly uploaded in the form of files to the application server of the destination server.

13. Upload all the extracted and formatted data into the application server of the destination server using the function module “Z_RFC_TRANSFER_APPL_SERV_LSMW”.

1 Comment