Thursday 22 January 2015

Customizing Logic around Cost Center Categories

Skip to end of metadata
Go to start of metadata

Purpose

The purpose of this WIKI document is to provide a clear overview of the system logic and behaviour related to categorizing Cost Centers.

Overview

Cost Center categories provide the ability to safe guard your postings to cost centers as they will prevent non-category costs being posted to the wrong cost center, in addition it provides greater organizational ability across your cost objects. After reading the following WIKI content you will have a clearer understanding of the purpose of the cost center category and also the customizing logic around them.

Cost Center Category purpose

The Cost Center category is an indicator in the cost center master data, which specifies the category for the cost center. Examples include administration, production, or sales & distribution. You can use our own cost center categories or use those supplied by SAP.
Cost Center categories enable you to assign the same characteristics to similar cost centers. For example, you can allow particular activity types only for particular cost centers. This is useful to prevent production activities from being posted to administrative cost centers by mistake. You can also use the cost center category for cost calculation, where it controls what percentage of the overheads applies to that cost center category.

Customizing Logic around Cost Center Categories

In Customizing, you can define lock indicators for each cost center category, or specify that the meaning of quantities on cost centers is allowed. When you assign a cost center to a particular category (you do this when creating the cost center), the corresponding lock indicators and allowed values for this category are proposed as default values for this cost center.
The above image illustrates how cost center categories might look in a typical organization using SAP systems.

Monday 19 January 2015

LSMW

The LSMW (Legacy System Migration Workbench) is a tool based on SAP software that supports single or periodic data transfer from non-SAP to SAP systems (and with restriction from SAP to SAP system). Its core functions are:
  • Importing legacy data from PC spreadsheet tables or sequential files.
  • Converting data from its original (legacy system) format to the target (SAP) format
  • Importing the data using the standard interfaces of SAP (IDoc inbound processing, Batch Input, Direct Input).

(This blog only explains how to create/ change Master data in SAP by using Standard Programs or recordings. I have not covered BAPI and IDoc method to make it simple and easy)

Generally, people have questions in mind as how to create an LSMW project, which method should be used to upload the master data and how to use and what all master data can be uploaded through LSMW.

LSMW – Legacy Data Migration Workbench

I am dividing the whole process of creating a Project, Subproject & Object for uploading the Master Data and its upload procedure in different steps as explained below:

Step 1 – Creating Project, Subproject and Object:

For using LSMW tool, first step you need to do is Create Project, Sub Project and Object as shown in the screen below:
1.png
Here, Project can have multiple Subprojects and in turn Subprojects can have multiple Objects as explained below:

Create Project
Give the desired name of data migration Project (For ex: Module name as I have taken “ZPM” for Plant Maintenance Module)

Create Subproject
Give the desired name of data migration Subproject (For ex: Master’s name as I have taken “EQUIP” for Equipment Master)

Create Object
Give the desired name of data migration Object (For ex: Master’s name as I have taken “CREATE” for Creating Equipment Master)

Step 2 – Selecting Menu Items:

Once Project, Subproject and Objects are created, pressing enter would generate the screen which includes all the menu items for both Master upload as well as IDoc updation which we might not require. Let us select the menu items which are required only for Master uploads.

Selecting Menu Items

First of all, pressing the User Menu button would guide you through selecting and de-selecting the Menu items.
Please tick the required Items as shown in the screen below:
6.png
Now, the screen would display only the selected Menu Items which we require for building and executing our LSMW program as shown below:
7.png
Click the button “Double Click = Display” which would make it to “Double Click=Change” which means it will allow all the Menu Items to open in Change mode on double clicking else every item is in display mode by default.

Henceforth, we will see each Menu Item in detail as an individual step.

Step 3 – Maintain Object Attributes:

This Menu Item defines the procedure we adopt for our program which could be:
  1. Standard Batch/ Direct Input
  2. Batch Recording
  3. Business Object Method (BAPI)
  4. IDoc (Intermediate Document)

For defining the procedure, double click on the First option “Maintain Object Attributes”. The screen below shows how to select the method:
9.png
As mentioned earlier, this blog covers explanation of only first two methods to make it simple and easy.
(Believe me most of the Masters gets covered in this two methods.)

Method 1 – Standard Batch/ Direct Input

In this method, we are simply selecting the standard program defined by SAP for different Masters (most of the Masters are listed here):

Click on Object to select the program then click on Method to select the method (For ex: Create/ Change) as shown in screen below:
10.png
Once selected, save this method.
Method 2 – Batch Input Recording

This method, involves creating a recording for a specific Master transaction Creation/ Change.

We would select this method when we require only specific fields to be created/ changed inside the Master screen.
Creating a recording is explained below:

Click on3.pngbutton and then click on4.png(Recordings: Overview) button which would guide to the Recording screen. Here press Create button which will show the screen as below:
12.png
Fill in the desired Recording Name and description as shown and press Enter and input the Transaction code as shown in the next screen:
13.png
On pressing Enter, system will start the transaction screen as shown below:
14.png
Perform the recording for the transaction (i.e., input all the fields you require to be taken into account for batch input).

Remember to save the transaction to complete the recording procedure as saving is also getting recorded.

On pressing save, you will see all the fields recorded as shown below:
15.png
Here press "Default All" button to populate the fields to be made available for batch input.

This will show the exact field names against each field as shown in the screen below:
16.png
Saving this screen would guide user to the list of recordings. Here press back and select the recording in the Recording field as shown below and save:
18.png
This ends the Step 1 for creating the method for specific Master creation/ change.

Step 4 – Object Overview and Field List:

Before moving to the second Menu Item “Maintain Source Structures”, we would go for listing the fields and viewing the structuring of the fields by pressing the6.pngbutton in the Menu List Screen and then “List” button which would show the screen as below (for easiness I have used Method-1 i.e., Standard Batch/ Direct Input but list will be similar in both the cases only the fields would differ):
19.png
Here in the “Target Fields” section you will find all the fields (captured by Method-1 or Method-2).

Please copy all the fields (except field TCODE and RECORDNAME which we don’t require to change while running our batch) and arrange the same in excel file as shown below:
20.png
By this you will be able to capture all the required fields in your excel file which ends the Step 4.

Step 5 – Maintain Source Structures:

Source Structure will have all the Source fields which are recorded or captured during Method definition.

Double click on “Maintain Source Structures” to which will guide to screen of Source Structure creation
Here press the create button which will ask for Source Structure Name and Description as shown below:22.png
After entering the desired Source Structure name and Description, press enter and press Save.

Step 6 – Maintain Source Fields:

Source fields are the same which we have listed in Step 4.

Before moving to this step, back to your excel sheet, change all field Types as below:

CHARC
DATSDDMY
UNITC
TIMSC
TIMSC
23.png
(This is to be done because the types defined in LSMW are different then field types in program or recording)

Now, double click ”Maintain Source Fields” in the Menu List screen, which will guide you to the screen as shown below:
24.png
Press the7.png(Table Maintenance) button after selecting the Structure which will generate the field definition screen. Copy paste all the excel fields to the screen as shown below:
25.png
Press Save and Back and it will display the fields attached to the Source Structure as shown below:
26.png
Again press save button to save this Structure field relation.

Step 7 – Maintain Structure Relations:

This Step is for maintaining relation between Structure and Recording/ Standard Program.

Double click “Maintain Structure Relations” in the Menu List screen, which will guide you to the screen as shown below:
27.png
Select the first Structure and press8.pngand the structure you have created will be automatically be selected as you have created only one structure. This will create the relationship between program and Structure as shown below:
28.png
Press Save and Back.

Step 8 – Maintain Field Mapping and Conversion Rules:

We have created the Structure to Program Relationship, now we need to create the mapping (Relationship) between Fields from Structure and Fields from Program/ Recording.

Double click “Maintain Field Mapping and Conversion Rules” in the Menu List screen, which will guide you to the screen as shown below:
29.png
As we have copied the fields from the Program/ Recording itself as in Step 4, it will be easy to perform the field mapping in a simple step.

Go to Extras à Auto Field mapping which will pop-up a dialog box as shown below:
30.png
Perform the selection exactly as shown in the screen above and press Enter.

If you have any Date fields in your Field List, it will ask for your confirmation for every individual Fields as shown below and make selection as per your requirement (This is how system will interpret Date further throughout the program):
31.png
Press Enter for all the Date Fields and you will find the field mapping for all your Source Fields to Program/ Recording Fields as shown below:
32.png
Confirm all the Fields are mapped correctly and press Save and Back.

Due to certain restrictions of blogs, this document covers the steps uptil "Maintain Field mapping and Conversion Rules" below steps,
1. Specify Files
2. Assign Files
3. Read Data
4. Display Read Data
5. Convert Data
6. Display Convert Data
7. Create Batch Input Session
8. Run Batch Input Session

are convered in Part-2 of this document which can be found in the link below:

This blog is in continuation to my previous blog "LSMW for Master Data upload Simple Explanation (Part - 1)" -LSMW for Master Data upload Simple Explanation (Part - 1)

We will continue here with Step 9 - Specify Files

Step 9 – Specify Files:

Before performing this Step, you need to create your File format with exact field sequence.

For creating the Format, simply transpose your Excel File fields from column to Row as shown below:
33.png
(Here I have mentioned only Single line for data you should have all the data which you wish to create in one time as in screen shot below)

Select only the Data from excel sheet and copy it to notepad file as shown below and Save:
34.png
Now in SAP, double click “Specify Files” in the Menu List screen which will guide you to the screen as shown below:
35.png
Double click on “Legacy Data - On the PC (Frontend)” which will pop-up the dialog box as shown below:
36.png
In File field select the Notepad File created, in the Name Field assign any desired name and make other selections exactly as shown in the screen and Press Enter, Save and Back.

Step 10 – Assign Files:

Double click “Assign Files” in the Menu List screen, which will guide you to the screen as shown below:
37.png
As we have single Structure and Single File, it is auto assigned to Structure. Just Press Save and Back

Step 11 – Read Data:

Double click “Read Data” in the Menu List screen, which will guide you to the screen as shown below:
38.png
Without making any changes to this screen, press execute button which will show the screen as below:
39.png
This will Show the exact number of total records/ Masters which you have mentioned in your notepad file. If this does not match the exact value, check your notepad and excel file for data. Once Confirmed, Press back twice

Step 12 – Display Read Data:

Double click “Display Read Data” in the Menu List screen, will pop-up a dialog box as shown below:
40.png
Without making any changes to this screen press enter, which will show the screen as below:
41.png
This screen is displaying all the Master Data Records which are read from your notepad file. Double Clicking any record will show Field-wise Data where you can check the correctness of your data (this step is not mandatory).
Once confirmed press back twice.

Step 13 – Convert Data:

Double click “Convert Data” in the Menu List screen, which will guide you to the screen as shown below:
43.png
Without making any changes to this screen, press execute button which will show the screen as below:
44.png
This will Show the exact number of total records/ Masters which are converted from your notepad file to Structure. If this does not match the exact value, check your notepad and excel file for data. Once Confirmed, Press back twice

Step 12 – Display Convert Data:

Double click “Display Convert Data” in the Menu List screen, will pop-up a dialog box as shown below:
45.png
Without making any changes to this screen press enter, which will show the screen as below:
46.png
This screen is displaying all the Master Data Records which are read from your notepad file. Double Clicking any record will show Field-wise Data where you can check the correctness of your data (this step is not mandatory).
Once confirmed press back twice.

Step 13 – Create Batch Input Session:

Double click “Create Batch Input Session” in the Menu List screen, which will guide you to the screen as shown below:
48.png
Make the selections as per shown in the screen above and press execute. This will guide you to screen as shown below:
49.png
This will display the number of transactions saved for execution. This all fields should be in green. If any record is in red, please check your entries again. If all records are green, press back twice.

Note: For some masters or for recording method Step 13 would show a simple screen where you need to tick “Keep Batch Input Session” and execute.

Step 13 – Create Batch Input Session:

Double click “Run Batch Input Session” in the Menu List screen, which will guide you to the screen as shown below:
50.png
This screen can also be executed through SM35.

Here select the record you want to process and press9.pngwhich will pop-up a dialog box as shown below:
51.png
Processing Mode:

First Option “Process/ foreground” will guide you to each field of each screen of your Master records.

Second option “Display errors only” will process your program in Background but will stop at Errors in any Field of any Screen which you can change.

Third Option “Background” will process your program completely in background and will update the errors at last.

(Recommended to use “Display errors only” option)

Additional Functions

Select the “Extended Log”, “Expert Mode” and “Dynpro Standard Size” options.

Once made the above selections, press process.

Once all the data are uploaded will pop-up a dialog box as shown below:
52.png
Pressing “Session overview” will show the session details and “Exit Batch input” will exit the transaction.

Here it completes the Legacy Data Migration Workbench (LSMW) process.


Hope I have clarified the process very clearly.


(This is the First time I have written a blog. Request you to please post your honorable comments).

In my previous blogs for LSMW, I have mentioned the steps for simple LSMW (i.e., with single Structure). But, this is not the case with all the Masters.

Some of my friends insisted me to write a blog for LSMW Steps for the Masters that are having Multiple/ Hierarchical Structures like Maintenance Task List/ Bill of Material/ Routing/ Inspection Plans etc.

This blog dedicates to those Masters which are having Multiple/ Hierarchical Structures as mentioned above.


As only the certain Steps for hierarchical Structure LSMW differ from Single Structure LSMW, following points are not covered in this blog:

  1. Creating Project, Sub-Project and Object (Part - 1)
  2. Selecting Menu Items (Part - 1)
  3. Maintain Object Attributes (Part - 1)
11. Read Data (Part - 2)
12. Display Read Data (Part - 2)
13. Convert Data (Part - 2)
14. Display Convert Data (Part - 2)
15. Create Batch Input Session (Part - 2)
16. Run Batch Input Session (Part - 2)
The Points that will be covered in this blog will be:
  4. Object Overview and Field List
  5. Maintain Source Structures
  6. Maintain Source Fields
  7. Maintain Structure Relations
  8. Maintain Field Mapping and Conversion Rules
  9. Specify Files
10. Assign Files

Here I have taken the example of LSMW for General Maintenance Task List using Standard Program (i.e., Object – 0490 – Gen. task list, Method – 0000 – Create)

Below I am starting with the explanation of Step 4 assuming that Step 1 – Step 3 are understood from Blog mentioned above:

Step 4 – Object Overview and Field List:

  By pressing the 1.png button in the Menu List Screen and then “List” button will show the screens as below:
2.png
Here in the “Target Fields” section you will find all the fields segregated in different structures as seen on the screen above (i.e., IBIPTLST – IBIP: Task List Header, IBIPTEXT – IBIP: Long Text, IBIPILOP – IBIP: Task List Operation and so on).

Here for simplicity, we can understand that each structure contributes to each screen (i.e., Here the structure IBIPTLST is for Task List Header, structure IBIPTEXT is for Long Text of Description in Header, IBIPTLOP is for Task List Operation and so on).

Please copy all the fields from different Structures and paste it based on separate in excel as shown in screenshot below. Here copy field RECORDNAME (RECORDNAME is in case of General Task List, If you are creating LSMW for any other master, please select any standard field like RECORDNAME which is present in all Structures) also, as we would require this field to co-relate between different Structures (How will be explained later):
3.png
Here I have selected 3 Basic Structures for General Maintenance Task List (i.e., IBIPTLST – Header, IBIPTLOP – Operations and IBIPMPAC – Maintenance Packages) you may select any Structures and their fields you wish to.

Step 5 – Maintain Source Structures:

Before moving to this step, we will just move to Step 7 “Maintain Structure Relations”. We will see the screen as shown below:
4.png
This screen shows the hierarchical arrangement of the Target Structures. We have to maintain the same hierarchical arrangement for Source Structure as well.

Now back to Step 5, Click on “Maintain Source Structure” and define the hierarchical Structures as shown below:
5.png
After defining the desired hierarchical Source Structures, press enter and press Save.

Step 6 – Maintain Source Fields:

Source fields will be the same which we have listed in Step 4 based on the hierarchical structures.

In SAP, click on “Maintain Source Fields” in the Menu List screen, which will guide you to the screen as shown below:
6.png
Select each Structure and press the 7.png(Table Maintenance) button which will generate the field definition screen. Copy paste all the excel fields to the screen Structure by Structure.
8.png
The fields will look like as shown above. Now, press Save and Back to save this Structure field relation.

Step 7 – Maintain Structure Relations:

This Step is for maintaining relation between Hierarchical Source Structures to Hierarchical target Structures.

Double click “Maintain Structure Relations” in the Menu List screen, which will guide you to the screen as shown below:
9.png
Select the first Structure and press 10.pngand it will pop-up a dialog box with List of Source Structures you have defined as shown below:
11.png
Here select the appropriate Structure which will create a relationship between Source Structure to its respective Target Structure.

Repeat this process for all the Structures you require. Once all the relationship for all Source Structures is created to their respective Target Structures, your screen would look like as shown below:
12.png
Please note that not all Structures are required to be defined from the hierarchy, you may create any number of Structures but, you have to make sure that no upper hierarchy is missed. (For ex: I have not created Source Structure for IBIPTEXT i.e., Long Text Line as I don’t require it and it is not an UPPER HIERARCHY to any structure but on contrary, for using Structure IBIPMPAC, I need to create IBIPTLOP even if I don’t need any fields from IBIPTLOP as it is UPPER HIERARCHY to IBIPMPAC)

Once done, press Save and Back.

Step 8 – Maintain Field Mapping and Conversion Rules:

For Mapping Source fields to Target Fields, double click “Maintain Field Mapping and Conversion Rules” in the Menu List screen, which will guide you to the screen as shown below:
13.png
As we have copied the fields from the Program/ Recording itself as in Step 4, it will be easy to perform the field mapping in a simple step.

Go to Extras --> "Auto Field Mapping" which will pop-up a dialog box as shown below:
14.png
Perform the selection exactly as shown in the screen above and press Enter.

If you have any Date fields in your Field List, it will ask for your confirmation for every individual Fields as shown below and make selection as per your requirement (This is how system will interpret Date further throughout the program):
15.png
Press Enter for all the Date Fields and you will find the field mapping for all your Source Fields to Program/ Recording Fields as shown below:
16.png
Now, here we have a critical part to take care of in case of hierarchical Structure case.

In Step 4, we had selected field RECORDNAME also. But, here the question would come to your mind that, field RECORDNAME is not present in the Target Field list as it is a Technical Field.

To Show this Field please click on17.png button and select “Technical Field” check box as shown in screen below:
18.png
Once selected, you may find all the Technical Fields also displayed such as TCODE, RECORDNAME, etc.

You have to manually assign your Source field RECORDNAME to target field RECORDNAME without making any changes to technical codes already assigned to this field by selecting the field RECORDNAME and clicking on 19.pngbutton.

Clicking on 19.pngbutton, will pop-up a dialog box as shown below:
20.png
Select the field RECORDNAME and repeat the same for all your defined Structures (Please make sure that you select field RECORDNAME from respective Structure only. for ex: RECORDNAME field for IBIPTLST should be mapped with RECORDNAME field for ZIBIPTLST only, for IBIPTLOP with ZIBIPTLOP only and for IBIPMPAC with ZIBIPMPAC only)

In case of LSMW for General Task List, one small change is to be made in TCODE field. Here, standard LSMW program for General Task List has by mistake used TCODE IA01. Please replace IA01 to IA05 bydouble clicking on TCODE field (Double clicking will raise a warning message to not to change the standard setting. Please select “Yes” and make the necessary changes as guided). Again, please take care that no other changes are made.

Once above changes have been done, your screen would be like as shown below:
21.png
Confirm all the Fields are mapped correctly and press Save and Back.

Step 9 – Specify Files:

Here, this Step is having the most changes from what I have explained in my previous blog for single Structure.

Before performing this Step, you need to create your File format with exact field sequence and Structure sequence.

For creating the Format, simply transpose your Excel File fields from column to Row as shown below:
22.png
As you can see above, I have created three separate sheets for different Structures, please create separate sheets for all the Structures you are having.

These sheets explain why we have used field RECORDNAME in all the Structures.

Here, I am creating two task lists with five Operations each with Maintenance Package for each operation. That means RECORNAME in first (Header) Structure will have two records (i.e., 1 and 2 for two task lists) in Second (Operation) Structure RECORNAME will have ten records (i.e., five records with value 1 and five records with value 2 for five operations in each task list) and in third (Maintenance Package) Structure RECORDNAME will have ten records for each operation. (Hope I have made it clear!!!)

Now, we have to select only the Data from each excel sheet (please select all the columns even if they are blank) and copy it to separate notepad files as shown below:
23.png
Now in SAP, Double click ”Specify Files” in the Menu List screen, which will guide you to the screen as shown below:
24.png
Select “Legacy Data - On the PC (Frontend)” and clicking on 25.pngbutton will pop-up the dialog box as shown below:
26.png
In File field select the Notepad File for First Structure, in the Name Field assign any desired name and make other selections exactly as shown in the screen and click Enter.

Repeat the above process for all your Structure Notepad files. Once done uploading all the files, your screen will be like as shown below:
27.png
Press Back and Save.

Step 10 – Assign Files:

Double click “Assign Files” in the Menu List screen, which will guide you to the screen as shown below:
28.png
Here,double click on each Structure and select the respective Files for respective Structures.

Once done, your screen would look like as shown below:
29.png
Press Save and Back.

For Further process steps mentioned below, please refer to my previous blog post (Part-2) which I have mentioned at the starting of this post:

11. Read Data (Part - 2)
12. Display Read Data (Part - 2)
13. Convert Data (Part - 2)
14. Display Convert Data (Part - 2)
15. Create Batch Input Session (Part - 2)
16. Run Batch Input Session (Part - 2)


Hope I have cleared all your possible doubts by this post.


Would love to solve all the questions that comes to your mind…wish you would comment with the same.