How to Figure Out Character Length Easy in Sap for Lsmw

In this post we will go through the steps needed to create, export / import, and finally run the LSMW. This will additionally cover how to create your own Batch Input Recording and how to reuse the created LSMW. Towards the end we will discuss some frequently asked questions.

Overview

  • What is LSMW?
  • Detailed Steps
  • Importing and Exporting LSMW in SAP Environments
  • Running and Reusing LSMW
  • Additional Information
  • Summary

What is LSMW?

LSMW stands for Legacy System Migration Workbench. It is typically used during data migration tasks when you are moving data from legacy system to the new system.

The idea is to think of it as a quick "automation" tool that you can use when you are dealing with massive data in SAP or data that needs to be imported to SAP.

LSMW for Beginner Functional SAP Consultants – Detailed Step by Step Procedure (Batch Input Session)

Another way of looking at LSMW is to think of it as a friendly robot assistant. This is my personal analogy and I even like to think of LSMW as my "R2-D2".

"R2-D2" is the droid and "pilot assistant" from Star Wars.

Apologies to some who do not get the Star Wars reference. We can just stick to "friendly robot" as a general analogy. I just had to add it in there.

The concept of this analogy is that you have LSMW as your friendly robot assistant when you need to handle massive SAP data uploads and even changes.

Some Functions

  • Massive legacy data upload / import in SAP using spreadsheets or sequential files
  • Massive data upload / import using standard SAP interfaces (IDoc inbound processing, Batch Input, Direct Input)
  • Converting Data (in legacy system data format to target SAP system format)

The above functions can be a handful for beginners which is why I will focus on a basic scenario.

Our Scenario

Let us say that the client needs to move to SAP S/4HANA in the near future. Part of the preparation tasks would be to ensure the data in SAP ECC is "clean".

Our data focus for this scenario will be WBS Elements and status changes. We need to find a way to release thousands of WBS Elements in a short amount of time.

To simplify this scenario further, you can also simply consider that multiple WBS Elements in the current SAP system needs to be updated to "released status" in a short amount of time.

Note: This process will focus on creating an LSMW with Batch Input Recording.

When I say, "Batch Input Recording", it means I want to SAP to record the actions I will do in the system. SAP will use that recording and repeat the actions multiple times.

This scenario is common, and you can even create your own "recording" (provided the change proper can be recorded) for the specific changes you need to do.

Detailed Steps

The steps below will focus on creating an LSMW with Batch Input Recording

Create your LSMW Project, Subproject, and Object

  1. First, go to transaction code LSMW and click on the Check button to proceed.

When you go to the transaction for the first time, you should see the window below.

LSMW for Beginner Functional SAP Consultants – Detailed Step by Step Procedure (Batch Input Session)
  1. Click on the Create Project icon and name your Project, Subproject, Object, etc. Once done with the naming, click on the Check button to proceed.
LSMW for Beginner Functional SAP Consultants – Detailed Step by Step Procedure (Batch Input Session)

Maintain Object Attributes

  1. You should now see the screen below. Double click on Maintain Object Attributes.
LSMW for Beginner Functional SAP Consultants – Detailed Step by Step Procedure (Batch Input Session)
  1. There are multiple process steps in the screen. We will start with the first one "Maintain Object Attributes". You will notice that there are multiple Object Type and Import Methods available. Since we are focusing on "Batch Input Recording", select that option and input a recording name.
LSMW for Beginner Functional SAP Consultants – Detailed Step by Step Procedure (Batch Input Session)
  1. Click on the Overview button (highlighted in red) to start recording.

Create Batch Input Recording

  1. You should arrive at the screen below. Enter a description for your recording. Then click on the Check button to proceed.
LSMW for Beginner Functional SAP Consultants – Detailed Step by Step Procedure (Batch Input Session)
  1. You will now be asked the transaction code of your recording. Enter "CJ02" since the goal of our scenario is to create a recording that updates the Status of WBS Elements to "Released".

NOTE: Before you start recording, please have your accurate test / dummy data ready. For example, a WBS with status Created and will allow status to be set to Released.

LSMW for Beginner Functional SAP Consultants – Detailed Step by Step Procedure (Batch Input Session)
  1. We are now in the Recording Proper. Do the same actions you would do in a normal scenario.

Enter the accurate WBS Element data you have on the WBS Element Field. Click on the Enter button to proceed.

LSMW for Beginner Functional SAP Consultants – Detailed Step by Step Procedure (Batch Input Session)
  1. Click on Edit > Status > Release then click on the Save button once status has updated.

You should see the update notification below.

LSMW for Beginner Functional SAP Consultants – Detailed Step by Step Procedure (Batch Input Session)
  1. You should see a summary of the recording that was done. Click on the Save button to ensure the recording is saved.
LSMW for Beginner Functional SAP Consultants – Detailed Step by Step Procedure (Batch Input Session)
  1. Notice that the input field where we indicated the WBS element. It is populated at the moment. Double click on the field or select the field, click on "Default", and delete the Default Value. Click on the check button to proceed.

Ideally, we want to input the list of WBS Elements subject to this change update so we should keep the PRPS-POSID blank (highlighted in green).

LSMW for Beginner Functional SAP Consultants – Detailed Step by Step Procedure (Batch Input Session)
  1. You can further review the input fields that were captured by the recording and delete any fields that you do not need. Select the item and click on "Delete Screen Field". You should receive the same notification below. Click on the check button to proceed. Make sure to SAVE the recording.

For example, PROJ-PSPID is not needed. It would be better to delete the field to ensure it doesn't complicate or cause issues.

LSMW for Beginner Functional SAP Consultants – Detailed Step by Step Procedure (Batch Input Session)
  1. Click on the back button and click on the Save button up until you end up in the LSMW Overview "Object Attributes" screen.
LSMW for Beginner Functional SAP Consultants – Detailed Step by Step Procedure (Batch Input Session)

Maintain Object Attributes – Link The Batch Input Recording

  1. Here we are back at the LSMW Overview "Object Attributes" screen. Notice that the recording is still registered under Batch Input Recording. Let us click Save once more just to be sure then click on Back.
LSMW for Beginner Functional SAP Consultants – Detailed Step by Step Procedure (Batch Input Session)

Maintain Source Structure

  1. We are now back in the LSMW main screen. Notice how the items lessened according the Object Attributes we specified a while ago. We will go through each one until we complete all Process Steps. Double click on Maintain Source Structure.
LSMW for Beginner Functional SAP Consultants – Detailed Step by Step Procedure (Batch Input Session)
  1. Here you need to create your source structure. Click on the New button and enter the Source details. You can also follow the description below.

Our LSMW will involve selecting a text file with all WBS Elements listed that are subject to status changes.

We will "feed" the file and LSMW will do the update proper.

LSMW for Beginner Functional SAP Consultants – Detailed Step by Step Procedure (Batch Input Session)
  1. Click on Save once done and press the back button to proceed to the next step.
LSMW for Beginner Functional SAP Consultants – Detailed Step by Step Procedure (Batch Input Session)

Maintain Source Fields

  1. This time double click on Maintain Source Fields.
LSMW for Beginner Functional SAP Consultants – Detailed Step by Step Procedure (Batch Input Session)
  1. Here you need to Enter a source field name and description. Below I entered WBSNUM. Ensure to specify the Field Length and Field Type. Click on the check button to proceed.

The field length below is just an example for explanation purposes. You can match the character requirement to the field in concern.

If the number below is higher than the actual field length, LSMW will accept the data. Of course, if you have data that exceeds the normal WBS length, SAP will throw back an error as it is not possible.

LSMW for Beginner Functional SAP Consultants – Detailed Step by Step Procedure (Batch Input Session)
  1. Click on the Save button and click on the back button to proceed to the next step.
LSMW for Beginner Functional SAP Consultants – Detailed Step by Step Procedure (Batch Input Session)

Maintain Structure Relations

  1. Double click on Maintain Structure Relations.
LSMW for Beginner Functional SAP Consultants – Detailed Step by Step Procedure (Batch Input Session)
  1. Usually the below is populated. In our case we do not need anything further. The current setting will do for our scenario. To be sure you can edit and save.
LSMW for Beginner Functional SAP Consultants – Detailed Step by Step Procedure (Batch Input Session)

Maintain Field Mapping and Conversion Rules

  1. Next, double click on Maintain Field Mapping and Conversion Rules.
LSMW for Beginner Functional SAP Consultants – Detailed Step by Step Procedure (Batch Input Session)
  1. Here you can click on POSID then click on Create Source Field. It should create the entries below. Click on save and click on the back button to proceed to the next steps.
LSMW for Beginner Functional SAP Consultants – Detailed Step by Step Procedure (Batch Input Session)

If you have other rules or mappings, feel free to add them. Otherwise, this will be okay.

Maintain Fixed Values, Translations, User-Defined Routines

  1. Double click on Maintain Fixed Values, Translations, User-Defined Routines.
LSMW for Beginner Functional SAP Consultants – Detailed Step by Step Procedure (Batch Input Session)
  1. You will see the screen below. In our case we don't necessarily need fixed values or other information, but we can go through this quickly for visualization purposes.
LSMW for Beginner Functional SAP Consultants – Detailed Step by Step Procedure (Batch Input Session)

You can click on Translations for example and click on the change button. Below is an example.

LSMW for Beginner Functional SAP Consultants – Detailed Step by Step Procedure (Batch Input Session)
  1. Once done editing, click on Save and click on the back button to proceed to other steps.
LSMW for Beginner Functional SAP Consultants – Detailed Step by Step Procedure (Batch Input Session)

Specify Files

  1. Double click on Specify Files. This is when we are going to upload a file to execute / test our LSMW. We have our recording and prerequisite steps. Now we need to "feed" the input file and ask LSMW to perform the changes.

Make sure you have a text file ready with valid test data. Simply open up Notepad and copy paste the WBS Element test data you have.

LSMW for Beginner Functional SAP Consultants – Detailed Step by Step Procedure (Batch Input Session)
  1. You will see multiple options available for you to specify files. In our example, we will select the "On the PC" option. Click on New to proceed with the file input details. This will allow us to specify a file from our PC/Desktop and load it to SAP.
LSMW for Beginner Functional SAP Consultants – Detailed Step by Step Procedure (Batch Input Session)
  1. You can follow the settings / procedures below. Here we specified a file from the desktop and gave it a name. For file contents we have "Data for One Source Structure (Table)". This is a simpler approach for our scenario.
LSMW for Beginner Functional SAP Consultants – Detailed Step by Step Procedure (Batch Input Session)
  1. You can scroll down to see further settings. Below we selected a Delimiter, File Structure, File Type, and Code Page. Click on save to proceed to the next steps.
LSMW for Beginner Functional SAP Consultants – Detailed Step by Step Procedure (Batch Input Session)
LSMW for Beginner Functional SAP Consultants – Detailed Step by Step Procedure (Batch Input Session)

Assign Files

  1. Double click on Assign Files.
LSMW for Beginner Functional SAP Consultants – Detailed Step by Step Procedure (Batch Input Session)
  1. Here you can specify the assignment as seen below. Click on Save and click on back button to proceed to the next steps.
LSMW for Beginner Functional SAP Consultants – Detailed Step by Step Procedure (Batch Input Session)

Read Data

  1. Double click on Read Data. This time SAP will try to read the content of your file.
LSMW for Beginner Functional SAP Consultants – Detailed Step by Step Procedure (Batch Input Session)
  1. You should see the screen below. You don't need to enter anything. Just click on Execute. After executing, click on back to proceed to the next steps.
LSMW for Beginner Functional SAP Consultants – Detailed Step by Step Procedure (Batch Input Session)
LSMW for Beginner Functional SAP Consultants – Detailed Step by Step Procedure (Batch Input Session)

Display Read Data

  1. Double click on Display Read Data.
LSMW for Beginner Functional SAP Consultants – Detailed Step by Step Procedure (Batch Input Session)
  1. Leave the To Line blank or you can limit the number of entries you want to process. Click on the check button to proceed.
LSMW for Beginner Functional SAP Consultants – Detailed Step by Step Procedure (Batch Input Session)
  1. You should see the screen below. If the rows correspond to the number of items you have on the file input, then it worked well. Click on the back button to proceed to the next steps.
LSMW for Beginner Functional SAP Consultants – Detailed Step by Step Procedure (Batch Input Session)

Convert Data

  1. Double click on Convert Data.
LSMW for Beginner Functional SAP Consultants – Detailed Step by Step Procedure (Batch Input Session)
  1. You don't have to enter anything. Click on execute. Once done with the execution, click on back to proceed to the next steps.
LSMW for Beginner Functional SAP Consultants – Detailed Step by Step Procedure (Batch Input Session)
LSMW for Beginner Functional SAP Consultants – Detailed Step by Step Procedure (Batch Input Session)

Display Converted Data

  1. Double click on Display Converted Data.
LSMW for Beginner Functional SAP Consultants – Detailed Step by Step Procedure (Batch Input Session)
  1. You can leave the To field blank or add a number to limit the rows processed. Click on the Check button to proceed.
LSMW for Beginner Functional SAP Consultants – Detailed Step by Step Procedure (Batch Input Session)
  1. You should see the screen below. If the rows correspond to the number of items from your input file then it is working okay. Click on back to proceed to the next steps.
LSMW for Beginner Functional SAP Consultants – Detailed Step by Step Procedure (Batch Input Session)

Create Batch Input Session

  1. Double click on Create Batch Input Session.
LSMW for Beginner Functional SAP Consultants – Detailed Step by Step Procedure (Batch Input Session)
  1. SAP will populate default values as seen below. I like to leave it as is. You can select the Keep Batch Input Folder if you would like to retain the Batch Input. If not, just leave it unticked. Click on Execute to proceed.
LSMW for Beginner Functional SAP Consultants – Detailed Step by Step Procedure (Batch Input Session)
  1. You should see this notification once the Batch Input Session has created. Click on the check button to proceed.
LSMW for Beginner Functional SAP Consultants – Detailed Step by Step Procedure (Batch Input Session)

Run Batch Input Session or SM35

  1. The last step is to Run Batch Input Session. No changes have taken place unless the Batch Input Session is executed. For me, I like to skip this step in LSMW and go to Transaction code SM35. If you would like to proceed with this in LSMW, feel free to do so.
LSMW for Beginner Functional SAP Consultants – Detailed Step by Step Procedure (Batch Input Session)
  1. Go to transaction code SM35. You should see the created Batch Input Session from our LSMW. Highlight / Select the Batch Input Session concerned and click on Process.
LSMW for Beginner Functional SAP Consultants – Detailed Step by Step Procedure (Batch Input Session)
  1. A good step is to process the Batch Input Session in Foreground first to ensure it is doing exactly what it needs to do. Executing this in foreground allows you to visualize what SAP is doing. Click Process to proceed and run through the recording.
LSMW for Beginner Functional SAP Consultants – Detailed Step by Step Procedure (Batch Input Session)
  1. When processing is complete, you should see the notification below. You can view the session overview or exit the batch input. You can also verify the status of the WBS by checking the master data. If the status has indeed updated, then it is working.
LSMW for Beginner Functional SAP Consultants – Detailed Step by Step Procedure (Batch Input Session)

Validate by Testing and Checking Relevant Master Data

Checking the master data:

WBS Change Log. LSMW for Beginner Functional SAP Consultants – Detailed Step by Step Procedure (Batch Input Session)

Importing and Exporting LSMW in SAP Environments

Export LSMW

To export your LSMW, click on Extras > Export Project.

Export LSMW. LSMW for Beginner Functional SAP Consultants – Detailed Step by Step Procedure (Batch Input Session)

You can select / deselect the content of the project. There can be multiple rules, recordings, subprojects in a project. In our example, it is just 1 of each. Be careful if you are exporting an already existing Project with multiple items.

Export LSMW. LSMW for Beginner Functional SAP Consultants – Detailed Step by Step Procedure (Batch Input Session)

Select where the file should be saved on your Desktop / PC. You should receive the following notification once it is complete:

Export LSMW. LSMW for Beginner Functional SAP Consultants – Detailed Step by Step Procedure (Batch Input Session)

Import LSMW

To import your LSMW in the target SAP System, click on Extras > Import Projects then select the file from your Desktop / PC:

Import LSMW. LSMW for Beginner Functional SAP Consultants – Detailed Step by Step Procedure (Batch Input Session)

Select what gets imported:

Import LSMW. LSMW for Beginner Functional SAP Consultants – Detailed Step by Step Procedure (Batch Input Session)

In our case, all will be applicable so you can proceed. Once it is imported, you should see the notification below. You are now free to use the LSMW in the target SAP System.

Import LSMW. LSMW for Beginner Functional SAP Consultants – Detailed Step by Step Procedure (Batch Input Session)

Running and Reusing LSMW

To run and reuse LSMW, you can go to transaction code LSMW and look for the project, subproject, and object in concern.

Instead of starting the process steps from the very beginning, you can start with Specify Files (Except assign files as it is not needed) up until Create Batch Input Session.

From there you can proceed to transaction code SM35 and process the session accordingly. The same steps are repeated as needed for all files you need to upload using the same LSMW / recording.

Reuse LSMW. LSMW for Beginner Functional SAP Consultants – Detailed Step by Step Procedure (Batch Input Session)
  • Specify Files,
  • Read Data
  • Display Read Data
  • Convert Data
  • Display Converted Data
  • Create Batch Input Session
  • SM35 Process > Display Errors Only.

Additional Information

What is the difference between BDC and LSMW?

This seems similar to BDC or Batch Data Recording. In ways, it is similar because you are recording and making use of that recording to perform the same action multiple times.

LSMW is of course an "enhanced" version because it contains more settings / options. It is also easier to "control" because you have process steps available for you to follow.

Can I copy an LSMW recording and modify the recording myself?

Yes, you can. Simply select the existing recording and click on the Copy button. You can modify the content as needed. Please ensure you know the exact lines to be deleted or modified.

Copy Recording. LSMW for Beginner Functional SAP Consultants – Detailed Step by Step Procedure (Batch Input Session)

Can I use Transaction Code MASS instead of LSMW?

Yes, provided that the action you need is available in MASS. However, MASS transaction code doesn't contain all "actions" so LSMW would be a good alternative.

More Resources on LSMW

  • Legacy System Migration Workbench – SAP Help
  • Using LSMW – SAP Help

Summary

  1. What is LSMW? Your friendly robot assistant when you need to handle massive SAP data uploads and even changes.
  2. Detailed Steps (Batch Input Session Approach in LSMW)
    • Maintain Source Fields
    • Maintain Structure Relations
    • Maintain Field Mapping and Conversion Rules
    • Maintain Fixed Values, Translations, User-Defined Routines
    • Specify Files
    • Assign Files
    • Read Data
    • Display Read Data
    • Convert Data
    • Display Converted Data
    • Create Batch Input Session
    • Run Batch Input Session or SM35
    • Validate by Testing and Checking Relevant Master Data
  3. Importing and Exporting LSMW in SAP Environments
  4. Extras > Import Projects > Select applicable items
  5. Extras > Export Projects > Select applicable items
  6. Running and Reusing LSMW
    • Note: Make sure you have the file upload ready with the data.
    • LSMW > Choose the concerned Project, Subproject, and Object.
    • Execute the following:
      • Specify Files
      • Read Data
      • Display Read Data
      • Convert Data
      • Display Converted Data
      • Create Batch Input Session
      • SM35 Process > Display Errors Only
  7. Additional Information
    • What is the difference between BDC and LSMW? – LSMW is an enhanced version and easier to "control" and "reuse".
    • Can I copy an LSMW recording and modify the recording myself? Yes. There is a Copy Recording button you can utilize. Make sure you 100% know the recording lines that you plan to add or delete.
    • Can I use Transaction Code MASS instead of LSMW? Yes, provided that the action you need is available in MASS.

I hope this helps 😊 Good luck!

fletcherconsento.blogspot.com

Source: https://techlorean.com/2021/01/28/lsmw-beginner-sap-consultant-detailed-step-by-step-procedure-batch-input-session/

0 Response to "How to Figure Out Character Length Easy in Sap for Lsmw"

Enregistrer un commentaire

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel