LSMW – tips and tricks 1

You need to update thousands of objects (material, vendor, equipment, BOM, … ), but you are not sure if some field should be updated or not. So, my tip is: leave the decision to your source file.

(if you don´t know how to use LSMW, please check the post LSMW – tutorial)

There is a checkbox in SAP LSMW program that can be useful in this situation: it allows the LSMW to choose to update the field if the source field is not empty (or “initial”, according to ABAP syntax).

Please check it at: LSMW > Maintain Field Mapping and Conversion Rules.

Select a field and click on “Rule” button:

2015-04-16 10_41_58-LSM Workbench_ Change Field Mapping and Conversion Rules

Choose “Transfer (MOVE)” and flag “Only if Source Field Not Initial”:

2015-04-16 10_49_04-LSM Workbench_ Change Field Mapping and Conversion Rules

LSMW will create an ABAP code for you:

2015-04-16 10_51_52-LSM Workbench_ Change Field Mapping and Conversion Rules

Now, when you run the LSWM to update your objects, this field will be updated only if the field in your Excel file (or text file) is not blank.

Again: now who “controls” the LSWM is the Excel (source) file:

2015-04-16 11_02_44-Microsoft Excel - PRS.xlsx

Tip #2:

You can change the ABAP code suggested by the LSMW:

2015-04-16 11_02_45-Microsoft Excel - PRS.xlsx

In the given example, the LSMW program would:

  • If the source field has some content, it will update the SAP field
  • If the source field is empty, it will update the SAP field with “blank”
  • If the source field has “DONTUPDATE”, then LSMW will not update the SAP field.

 

Posted in LSMW, SAP - General use | Tagged , , , , , , , | 3 Comments

How to migrate Favorites

Are you migrating to a new SAP system and you want to keep your Favorites? Here is how to migrate them:

 

Go to your legacy system.

In the initial screen, click “Favorites > Download to PC”

2015-04-14 10_42_53-

 

Save it in a folder. Memorize the folder. (Desktop is a easy-to-remember place).

2015-04-14 10_47_34-

Go to your new system. Click on “Favorites > Upload from PC”:

2015-04-14 10_50_09-

Choose the file you saved with your favorites:

2015-04-14 10_52_20-

 

Done! If you have already some favorites, the system will ask you to update or just add the new favorites:

2015-04-14 10_54_34-

INSERT ==> it will update your Favorites

APPEND ==> it will add the Favorites from the file to the Favorites you already have.

Posted in SAP - General use | Tagged , , , , | Leave a comment

How to migrate Queries – problem solved!

SAP provides a nice program to migrate queries: you can download the query elements (Usergroup, Infoset and the Query) in a text file, and upload in another SAP system.

However, not all SAP systems are 100% compatible with others SAP versions. Tables can be different, table fields also and specially ABAP versions. The migration program compares this objects and gives you warning or error messages.

Regardless all the benefits SAP provides us in this migration program, I found a bug when I was trying to migrate queries from SAP 4.6C to 6.0. And the solution! Which I present to you now:

 

===> all migration work will be done in transaction SQ02 + Transports (Ctrl-F3 or 2015-04-07 10_48_08-InfoSet_ Initial Screen):

2015-04-07 10_49_10-InfoSet_ Initial Screen

2015-04-07 10_50_05-RSAQR3TR

(Download and Upload options)

 

1) Migrate the USERGROUPS:

  • this must be the first step.
  • download the Usergroups from the old system to a text file
  • upload this file into the new system.

2015-04-07 11_14_45-RSAQR3TR

 

2015-04-07 12_50_58-Export Log

(in the destination system, you don´t need to write the Usergroup names):

2015-04-07 12_59_11-SAP Query_ Transport tool

2015-04-07 12_54_31-Import log

 

2) Migrate the INFOSETS:

Download the Infoset normally:

2015-04-07 13_18_41-RSAQR3TR

(save as .txt):

2015-04-07 13_19_48-

2015-04-07 13_21_08-Export Log

Now, the solution. SAP uses a markup language, but there is something missing in the Version 4.6C when you compare to newer versions:

2015-04-07 13_38_57-Infoset.txt - Editor

2015-04-07 13_41_41-Infoset

In order to change in mass, open the file in MS-Word:

2015-04-07 13_44_04-temp

Press <Ctrl-H> to “Find and Replace”, fill in with the following text and replace all the occurrences:

Search: *SGTEXT

Replace with: *SGTEXT^pTDBDP^p*DBDP

2015-04-07 13_47_13-Infoset.txt - Microsoft Word

 

repeat this step with:

Search: CL_TEXT_IDENTIFIER

Replace with: CL_TEXT_IDENTIFIER^pVTABLE_ACCESS_AUTHORITY        CL_QUERY_TAB_ACCESS_AUTHORITY

 

Save the file without changing the file format (save as text). This file is ready to be uploaded in the new system:

2015-04-07 14_01_45-SAP Query_ Transport tool

 

2015-04-07 14_24_28-Import log

 

3) Migrate the QUERIES:

The same method used to migrate Infosets can be used to migrate the Queries. The difference is in the markup language.

Download the queries:

2015-04-07 14_48_03-RSAQR3TR

 

Please remember to put the Query names and also the Usergroup (it´s possible to have queries with the same name in different Usergroups).

2015-04-07 15_11_48-Export Log

 

and the solution: that´s the missing part!

2015-04-07 15_13_34-Query.txt - Editor

So, again open the text file with MS Word:

2015-04-07 15_36_23-temp

Press <Ctrl-H> to “Find and Replace”, fill in with the following text and replace all the occurrences:

Search: *DBLC

Replace with: *DBLC^pTDBLD^p*DBLD

2015-04-07 15_47_07-Add New Post ‹ super SAP user — WordPress

Save the file. It´s ready to upload it into the new system:

2015-04-07 12_59_11-SAP Query_ Transport tool

2015-04-07 16_11_07-Import log

And there it is:

2015-04-07 16_14_10-Query from User Group MY_USERGROUP_ Initial Screen


 

PS. You may find interesting to adjust que Infoset after the migration:

2015-04-07 16_15_24-Program Manager

2015-04-07 16_15_51-

and the queries:

2015-04-07 16_16_25-Query from User Group MY_USERGROUP_ Initial Screen

 

Important!

  • This method solves a bug, but it will not ensure that all the Infosets/Queries are migrated. There may happen big differences in tables/tables fields that forbid the migration. Pay attention on warning/error messages.
  • You can migrate Queries and Infosets at the same time.

 

 

Posted in Query | Tagged , , , , , , | Leave a comment

LSMW – tutorial (using Recording)

LSMW (Legacy System Migration Workbench) is a powerful tool to execute mass transactions, specially Data Migration.

In this tutorial, I will give you an example, the simplest I could find. This will allow you to create your first LSMW mass change, and then you’re going to be able to run any SAP transaction in mass, since you have the right to use that transaction.

So, let’s start it:

Continue reading

Posted in LSMW, SAP - General use | Tagged , , , , , , , | 1 Comment

Mass change Conversion Factor

When you create a Vendor Contract (and a Purchasing Scheduling Agreement), the system makes a copy of Material Master data.

If you change the Material Master, the Contract/PSA will not be changed. This is a problem, because all the Goods Receipts will be made based on the PSA information.

Traditional approach should be to delete PSA (after being sure that ther is no invoice, GR or Schedule Lines created), then delete the Contract, and create all new documents.

Here is a method to change in mass the conversion factor, direct in the contract/PSA.

 

Continue reading

Posted in MM, SAP - General use

How to create a quick report using transaction SQVI

Sometimes you need to extract information from one or more SAP tables, and you don’t have a standard report. So, if you don’t have time or resources to develop an ABAP report, transaction SQVI can be a solution.

 

In the example, we’re going to create a report which shows you the Vendor for each Material given, if there’s a Contract between the our company and the Vendor.

For this report, you will need access to the following Tables:

  • EKKO – Purchasing Document Header
  • EKPO – Purchasing Document Item
  • LFA1 – Vendor Master (General Section)

 

One important remark about the order. It should be:

EKPO -> EKKO -> LFA1

Because you have the Material Code (MATNR), you enter them in EKPO to obtain the Doc. Number.

Then you select the Doc. Number (EBELN), and enter them in the EKKO, and obtain the Vendor (LIFNR)

Then you enter the Vendor code in the LFA1, to obtain Vendor data.

 

As you can see, it’s important to know a little bit about Tables in SAP. I assume that you are already searching for information in the tables, and you want to make your life easier by using this transaction.

 

Continue reading

Posted in SAP - General use | Tagged , , , ,

MN05 – Default Printer for PO (Purchase Orders)

How to set up default printer for POs

When you create a new PO (Purchase Order), there is a printer associated to it. In SAP, each PO can have a different printer. This post shows you how to set up a default printer, in case of: automatic PO creation, or if in the moment you create it, you don’t change the printer.

Continue reading

Posted in MM, PUR, SAP - General use | Tagged , , , , ,