You are on page 1of 60

https://blogs.sap.

com/2013/08/13/lsmw-for-uploading-bom/

Purpose
This document will briefly discuss LSMW for uploading Bill of Material using Direct Input Method.

Prepare LSMW
Project      : As name describes, I mention the name of the project.
Subproject : I usually maintain the module for which we are preparing.

Object       : It is the business object, in this case I mention as BOM

Here I mention LSMW as

One advantage of this kind of naming is, we can see all objects created under one project – under
one subproject.

Procedure
Step 1 : Maintain Object Attributes
Step 2 : Maintain Source Structures

Create two structures, second structure as lower level.


Step 3 : Maintain Source Fields
Here we maintain two structures – one for header level data and second one for item data. Header
Material number (MATNR) is the common field connecting these two structures.

Step 4 : Maintain Structure Relations

Step 5 : Maintain Field Mapping and Conversion Rules

Maintain fields for both the two structures.


Step 6 : Prepare Excel File.

Prepare both header and item file separately.

Step 7 : Specify Files


Item file should be created under the Header file.

Logical File path must be created in transaction FILE.

Step 8: Assign Files

Step 9 : Read Data


Step 10 : Display Read Data

Step 11 : Convert Data

Step 12 : Display Converted Data

Step 13 : Create Batch Input Session

Click Display Errors Only

Following screen appears .

Now the BOM is created for material.


*&

LSMW : BOM Upload using


Direct Input Method

28 MONDAYAPR 2014

POSTED BY AROKIANATHANROBERT IN LSMW
≈ LEAVE A COMMENT
Tags
BOM
Uploading BOM for Materials , EQ …. are general requirements for any type of project.
Creating a LSMW by recording will be difficult and will not work for complicated data upload
requirements. This is due to the fact that the structure of BOM is broken down to Header ,
Item and Item details.

LSMW by direct input method is the easiest way to upload mass data
with ease.BDC processing might work but I personally prefer LSMW.
Note :

1. The Header and item structure should be defined in hierarchy.

2. A common reference field should be defined in both the structures for linking header with
items.

1. Create a new project , sub project using TCode : LSMW


2.Select object and method for direct input
3. Maintain source structure
Create structure in the following hierarchy

4. Maintain Source fields


Maintain fields as required for the upload.

Note: The first column in both the structures should be the same.
 

5. Maintain Structure Relations


6. Maintain field Mapping

Note : Maintain Tcode as required. T Code defines the BOM as a Material , Functional
location or a equipment BOM.Assign other fields as required for the upload
7. Prepare 2 upload files , 1 for header with header field structure and 2 for item with the field
structure defined.
8. Assign files

9 Other steps are the same as any LSMW process.


 

Attachments:
BOM Upload Instructions.pdf

BOM Upload Instructions.pdf

Sample Upload Files


PM_MASTER_IB01_11.lsmw.conv
There are certain LSMW Direct Input programs that require you to specify a logical path & file when constructing

your LSMW.  You’ll find this is required in the “Specify Files” step of the LSMW.

The program for creating purchasing info records (object 0060 / method 0000 / program RM06IBI0) is a good

example.

The details of the rest of the LSMW are not pertinent to this discussion, so let’s skip directly to the step “Specify

Files”.

This is the status in display mode.  Switch to change mode and you’ll see that the system proposes values

for Imported Data and Converted Data.  The values in these fields are limited to 45 characters for technical reasons,

so check that the proposed values do not exceed this length.  The system will prevent you from saving if either of the

fields do not meet the criteria.


Drill into the Converted Data proposal and you can see that two additional fields are necessary for this LSMW: logical

path and logical file.  Unfortunately, these cannot be created on the fly.  You must exit LSMW and create them before

assigning.  Before leaving, however, make a note of the file name on the screenshot above.  We will assign this specific

file to the logical file we create below.

Use transaction FILE to start the process of creating the logical path and logical file.  You should be aware that this is

a cross-client table – the system will warn of this fact.  In this transaction, we’ll execute two steps to define the path

and file.  Once complete, that data will be saved in a Workbench transport.  With that in mind, you will need to be

working in a client where you have authority to create such a transport and are able to modify cross-client settings.

To start, use the  folder labeled “Logical File Path Definition”.  Although you can copy from existing, I’ll show the

process to create from scratch to help understand all aspects.  Click on the button “New entries”.

Enter an appropriate path name, up to 60 characters.  The appropriate namespace for this entry includes names

starting with Y or Z.  Additionally, type a description for this new entry.  Press enter or click the green checkmark to

validate your new entry.

Highlight the new entry and double-click on the subfolder labeled “Assignment of Physical Paths to Logical Path”.  In

this section, you’ll assign a placeholder.


Click on “New Entries”.

I’ve always used the Syntax group “Unix”.  Recognizing that I’ve always been in SAP environments where Unix was

used, I cannot say if this is the only value that should ever be used.  Looking at the dropdown, it is obvious that there

are other possibilities.  Use what is appropriate for your environment.  For the Physical path,  use <FILENAME>.

Looking at the help for this field, you’ll find there are several other identifiers that could be added here.  From my

experience, this suffices.

After validation, your new entry should look something like the screenshot above.  The next step is to create the

logical file which has a link to the logical path.  In order to do that the path has to be recorded in the database – that

is, you need to save first.

Once the logical path is saved, you can continue.  Double-click on the folder labeled “Logical File Name Definition”

and click on “New Entries”.


In the field Logical file, I use an identifier similar to the logical path above, replacing “PATH” with “FILE”.  In Name,

I use the same description as used in the logical path.  In Physical file, you’ll need to use the file name that was

mentioned above in the LSMW.  In Data format and Applicat.area, I use the values ASC (ASCII data type) and BC

(Basis Components/SAP NetWeaver), respectively.  Finally, in Logical path, use the logical path identifier created

above.  You can see that there are dropdowns for the last three fields, but Physical file is free-form text.  Be aware that

there is no system validation on this field.  Be certain that you use the same value in the LSMW.

Above is the completed new entry after validation.  Save again.  If you did not leave the transaction between creation

of the logical path and logical file, the system should store this new entry in the same transport request.

Go back to the LSMW and the “Specify Files” step.  Switch to change mode and drill into the Converted

Data proposal.  You can now assign your recently created logical path and logical file.

Other examples of load programs that require a logical path and file:
 creating material BOMs
(object 0030 / method 0001 / program RCSBI010)
 posting goods movements
(object 0110 / method 0000 / program RM07MMBL)
 updating classification
(object 0130 / method 0000 / program RM07MMBL RCCLBI03)
 creating planned independent requirements
(object 0180 / method 0000 / program RM60IN00)

Your input is welcome for other examples you come across.

Edit 2014/02/04: the program name identified for updating classification was incorrect.  It should have

been RCCLBI03.  The requirement for a logical path and file is still valid.
Loading Material Masters with LSMW Direct Input
method

https://saptribalknowledge.wordpress.com/2011/07/1
3/create-logical-path-file-for-lsmw/

By Willem Hoek
INTRODUCTION 

It is a lot easier and quicker to load material masters using the Standard Direct Input object in LSMW
rather than with a recording of transaction mm01 or mm02. (To learn more about loading data using
recording, see this post) 

One input file can be used to create all the views of the material master. For all the material types.
Even if different views and fields are used for the different materials. 

Steps to take 

 Create text file with data to be loaded 


 Set up and run LSMW

All steps are discussed in this post. A sample data file and LSMW Project can also be found in
attachment. (see end of this post). 

Please take note that my project and input file will need slight modification to work fully on your SAP
system. You will have different material types, number ranges, field selections, etc. To get going,
use my LSMW Project and data file and make changes as required to get a simple dataset loaded. 

The most difficult bit in loading materials is getting the input file correct. I suggest you create the file
from a database (SQL) or programmatically. Excel does work but it sometimes convert numbers /
strings (example 0100 becomes 100). More notes about this at the end of this post. 

Let's first go through LSMW steps -; then look at the input file. 

LSMW 

You can either create the LSMW project manually or load my project (in attachment at end of post). 

Import Project 
Download project as attachment from end of this post to your PC. 

Go to LSMW -; transaction LSMW 


Menu: Extras > Import Projects 

select file LSMW_Z2_MM01.txt 

Press 'Import' (or 'Import Under Another Name'). 

Select Project / Subproject / Object and press 'Execute' 

Step 1: Maintain Object Attributes 


With first option selected -; press 'Execute' 
Press 'Display <> Change' to select Object 

Step 2: Maintain Source Structures 

Step 3: Maintain Source Fields 

Define here all the fields that will be in your input file (text file with data). As a rule, keep the field
names the same as in SAP. This way mapping can be done automatically. 

The order of the fields is not important. For simplicity, make field size bigger than required, in this
case mostly 40. 

What fields can be included? See next step for that 


 

Step 4: Maintain Structure Relations 

Here you map the one input file to structures that was selected in step one (direct input objects). 
To get an idea what material master field can be loaded -; click on the structure. Example for
BMMH1 
 

You will see BMM00 is to select the Views and BMMH1 contains bulk of the material fields. 

The fields can also be viewed via ABAP Dictionary (se11 /se12) and display the database table
BGR00, BMM00, BMMH1, BMMH2 (or other). 

Step 5: Maintain Field Mapping and Conversion Rules 

Map field in input file to fields in SAP Material master. If your fieldnames in file is same as in SAP,
then you can map them automatically by selecting Menu: Extras > Auto-Field Mapping 
Not all fields need to be mapped, only those that you are loading (as defined in input file). Don't
worry to much about the warning that 'Source field is longer than target file' just make sure your input
data is correct. Example material type must be 4 characters. 

Step 6: Maintain Fixed Values, Translations, User-Defined Routines 

Not used for this project 


Step 7: Specify Files 

Specify source file (on your PC) and what the files will be called on the SAP server. 

Also indicate how your input file will look. Example, TAB delimited and Field names in first row. 
 

Step 8: Assign Files 

Step 9: Read Data 


At this point your input file must be ready. More about the input file later. You may want to use
sample file attached to this post as a start. 

Note you don't need to specify path / filename. This was done is step above. 

For big files -; many thousand of records this might take a while. 

Step 10: Display Read Data 

The input file is now on the SAP server and can be displayed. 

Click on line to see the details 

Step 11: Convert Data 

We now need to convert the data to format so that SAP can process. 

Step 12: Display Converted Data 

You can display converted data to ensure that all is ok so far before creating the materials. 

And select the structure to see details 

Step 13: Start Direct Input Program 

If all is OK -; let's run them in. 


 

First run it in test mode (not creating material) by selecting the 'Check data, do not update' option 

You might get a view messages -; just press OK. In my case I got NO errors. 

I now run it without the test option. same as above but 'untick' the 'Check data, do not update' option 

 
Materials were successfully created. 

At this point you may still have errors. Either your input data is incorrect, you may have fields as
mandatory that was not in your input fields, different material types, etc. etc. 

INPUT FILE 

In step 7 above we have indicated that we are using TAB delimited files. 

TIP: if you will be working with LSMW files a lot, get a decent text editor. Some suggestions are:
UltraEdit or Crimson Editor (if you want a good free one). 

This is how my input file looks (via Crimson Editor). The funny '>>' fields are TAB's. My editor is set
up to show TAB characters. 

Or in Excel (importing the tab delimited file) 

Note that the material number field (MATNR) is blank for first line and 0 (zero) for subsequent lines.
This is the way to specify that internal numbering will be used. And 0 (zero) indicates that material
being created will be extended. Fields to be ignored are marked with "/". For more about format of
file, see notes in SAP Help file. 

In my file, every line is unique material / plant / sloc. The input file can be prepared using database,
spreadsheet or other program. In my case I generated the tab delimited file directly from database
program. 
LAST NOTE ON PREPARING THE DATA (OPTIONAL) 

I find the easiest way is to prepare the material master data is using a SQL database. I
used MySQL [mysql.com]. That way a sql script can be created that implement all the conversion
rules. 

This sample file used in this post was created directly from the database program. Below is the SQL
statement (used in MySQL) that created the final data file. The header (field names) was added in
another step. 

SELECT 'MATLD','500','SAP123','Y','/','MM01', '0','B',mat_type, plant, sloc,

'/','/','/','X','/','/','X','/','X','X','/','/','/',base_uom,'MAT DESCRIP','0100',

'/','/','/','/',1,'/',1,'/','F','ND','001',1,1,'HB',1,100,'A','02','BIN','/',

price_control, price, val_class,'/',14,'/','/','/','/','/','/','/',

old_matnr,'01','00010',profit_centre

INTO OUTFILE 'c:/data/sap123.com/lsmw_direct/lsmw_directinput.txt'

FIELDS TERMINATED BY ' '

LINES TERMINATED BY '

'

FROM main_table

GROUP BY mat_number, plant, sloc

ORDER BY mat_type, old_matnr, plant, sloc;

If above code is meaningless to you. Don't stress, you don't need to use any of this in LSMW. (But I
do suggest you buddy up with someone who knows SQL :) ). 

GETTING HELP FROM SAP 

Very detail help is available in SAP Help Files. For SAP Help files,
goto http://help.sap.com/ [help.sap.com] 
Cross Application Components > CA Data Transfer > Data Transfer Objects > LO logistics General
> Material Master 

This post was prepared using SAP R/3 Enterprise (and LSMW version 4.0.0) 
With this sample and reading the SAP Help files, I hope you are in a position to load your own
materials. 

DCDK935152 ALL_PM_Logical Path File


BASIC UNDERSTANDING OF ROLES AND AUTHORIZATION

https://blogs.sap.com/2014/10/09/basic-understanding-of-roles-and-authorization/

Many of the Functional Consultants face issues in understanding what are the Roles and what are
Authorizations in SAP. This is a document which would help people who are curious to know what is
exactly the concept behind this and how does it work.
Functional Consultants have a lot of questions in mind regarding this concept and one of the main
questions here is why should Functional Consultants worry about Roles and Authorization when it is a job
of BASIS team.
Well, to answer this, it is not solely a job of BASIS team rather it is also like other activities, it an
integrated activity which should be performed by both BASIS team and Functional team.
BASIS team have a know how about the User Management, Roles Creation, Profile Creation, Roles and
Profile assignment, Authorization assignments etc. but main concern in most of the cases arises when the
below questions are unanswered by BASIS team:

1. Whom to Assign the Roles or transactions


2. What to Restrict in a transaction and for whom
3. How to authorize Custom transactions

and many more such questions cannot be answered by BASIS team. Hence, it becomes the role of a
Functional Consultant to guide them with the exact process flow and exact organizational chart.
Explaining with a small example here, suppose we have a maintenance team as below:

1. Supervisor – He is responsible for notifying the breakdown or Corrective Maintenance


requirements
2. Maintenance In-charge – He is responsible for assigning the above tasks to Engineers
3. Head of the department – He is responsible for approving the Maintenance tasks.

Now, Functional Consultant is very well aware that for Supervisor would require only the transactions
related to Notifications (say IW21, IW22, IW28, IW29 etc), Maintenance In-charge would require some of
the notification related transactions (say IW22, IW28, IW29) and also order related transactions (IW31,
IW32, IW38, IW39 etc) and the Head of the department would require notifications and order transactions
(say IW28, IW29, IW38, IW39) and also along with this he require special permissions like releasing
orders, approving permits, technical completions etc.
Looking from BASIS team’s perspective they are not clear with these requirements and they thus cannot
take the decision for this and should be provided by Functional Consultants.
But, the main issue in most of the cases arises when Functional Consultants are not aware about the
concept of Roles and Authorizations.
Hereby, this document will explain the basic concept of Roles and Authorizations:
WHAT IS ROLES AND AUTHORIZATION CONCEPT:
Roles and Authorizations allow the users to access SAP Standard as well as custom
Transactions in a secure way.
SAP provides certain set of generic Standard roles for different modules and different
scenarios.
We can also define user defined roles based on the Project scenario keeping below
concept in mind:
There are basically two types of Roles:
1. Master Roles – With Transactions, Authorization Objects and with all
organizational level management.
2. Derived Roles –With organizational level management and Transactions and
Authorization Object copied from Master Role.

The reason behind this concept is to simplify the management of Roles.


WHAT ARE THE COMPONENTS OF A ROLE:
A Master Role or a Derived Role is having below components inside it:

1. Transaction Codes
2. Profile
3. Authorization Objects
4. Organization level

Transaction Codes: SAP Transaction codes (Standard or custom)


Profile: Profiles are the objects that actually store the authorization data and Roles are the Container that
contains the profile authorization data.
Authorization Objects: Objects that define the relation between different fields and also helps in
restricting/ allowing the values of that particular field (For ex: Authorization object I_VORG_ORD: PM:
Business Operation for Orders, contains relation between fields: AUFART = Order Type and BETRVORG
Business Transaction).
Authorization objects are actually defined in programs that are executed for any particular transactions.
We can also create custom authorization objects for any particular transaction (generally custom
transaction).
Organization level: This defines actually the organizational elements in SAP for ex: Company Code,
Plant, Planning Plant, Purchase organization, Sales organization, Work Centers, etc.
Suppose we take an example of creating a role for Maintenance In-charges in a particular industry who
are responsible for different maintenance plants. Consider the Scenario as under:
Company = C1, Maintenance Plants = M1, M2, M3 and M4 (Hence assuming 4 Shift In-charges).
As mentioned before, Maintenance In-charge will have rights to following transactions – IW22, IW23,
IW28, IW29, IW31, IW32, IW38 and IW39 but he will not have rights to release the Maintenance order.
EXPLAINING WITH AN EXAMPLE:
Hence, considering the above situation, we will create a common Master role for all 4 Maintenance In-
charges say ZMPM_MAIN_IN_CHARGE_ROLE (Here the role name starts with ZMPM to make us
understand that it is a Z Master Role for Plant Maintenance ) with transaction mentioned above with all
rights (with value “*”) inside the transactions but only restricting release of Maintenance order with the
help of authorization object I_VORG_ORD and removing value: BFRE and field: BETRVORG but with all
any organizational level (say plant) assignment.
Now based on this Master Role we have to create derived Roles for all 4 Maintenance In-charges
individually say for first Maintenance In-Charge we create a derived
role ZDPM_MAIN_IN_CHARGE_ROLE_MI1referring the above Master
Role ZMPM_MAIN_IN_CHARGE_ROLE. This will copy all the transactions and authorization objects
from Master Role but will not copy the organizational level assignments which we have assigned in
Master Role. Hence, we need to maintain the organizational level for the derived role (say PlantP1).
Here once we save (& Generate) the Master as well as Derived Role we can assign this role to the User
ID for the particular Maintenance In-charge.
Step1. Create IP30 Variant.
– Run IP30,

– Give your Plan (here it is ABC123 ) in the Maintenance Plan field   (Do not forget this step)
– Click Save Button and in the resulting screen give the Variant name,
– Optional:- Tick  Only for Background Processing and Save again.

So we have just created a Variant named TEST for IP30 .


Note:
This variant will not be available for changes in IP30 Tcode, because  ‘Only for Background
Processing‘ has been ticked.
For changes of this Variant, you need to Run SE38, give RISTRA20 in Program field,
select Variants radio button, and then click on Display,
Click F4 help in Variant field  and click Change.
Step2.  Create Background Job – Run Tcode SM36
Give Job Name and click Start Condition (See Picture)

A pop-up is displayed.

Follow the steps 1 to 7 given in Picture .


(Here it is assumed that you want the RISTRA20 program to run at midnights of everyday)
Click SAVE again

You will be given a pop-up.


Enter ABAP Program Name (Here it is RISTRA20) and the Variant (we know it is TEST),
and SAVE.
(Steps 1,2,3 in the above picture)

You will be here:

Do not do anything, Click Back arrow and

SAVE
All Done

Now to see the schedule –

Run SM37 and Execute. (Give Current Date as FROM date and Date after 2 days as TO Date)
Execute to see a screen like this, where your Job is seen scheduled to be run at Midnight of Every
Day. (According to the settings in picture 3 above)
During Scheduling, the Status changes from Released to Active and after Scheduling it turns
to Finished.
Hope members will be benefited by this post.

Thank you

Jogeswara Rao K
Transaction Code : SQVI (Quick Viewer)
enter name in place of quick view and click on create.

enter Title like description and select data source table join

You can select basis mode or layout mode  and enter


Click on insert Table (shift+F1)

enter table name , example EKKO and enter

Again click on table and enter table which should be link to previous table. Example in EKKO  Po number
it is linked to EKPO PO number.
We can take n number of tables which should linked to previous entered table.

Once completed all table linking then click on back button


Now extract the table which is showing left side
Here two rows showing 1)  list fields 2) selection fields 
selection fields means in selection screen what fields required , these fields  are display in input
selection screen

list fields means out put format.

Example i am selecting purchase document number, document date and material number as input
fields.

and out put filed as material number, vendor number,PO number, item number, Po amount, Po qty,
delivery date and scheduling qty, quantity of goods received, issued qty, PR number, PR item
number   .

If you want one filed as input and out put select both. If you want in only input screen then select
only selection fields, if you want as out put select only list fields. For example see below screen
Once selection is completed, please save it.

Click on enter
Now execute (F8)

Execute (F8)
After lot of comments and suggestions, i am adding little more use full to other users.

First thanks to our greatest Lion Jurgen   for sharing the below documents. Lot of users they
asking queries how we can see SQVI maintained report in other user. I am only R&D on SQVI, may
be this is reason i am not found proper result. But Jurgen provided beautiful link, We can see now
other user sqvi reports in our system.

http://scn.sap.com/community/erp/logistics-mm/blog/2012/03/22/how-to-find-and-execute-or-work-
with-other-users-quick-views-or-quick-views-created-with-old-user-id
Hope it is very helpfull to all.

https://blogs.sap.com/2013/07/04/how-to-create-report-by-using-sqvi/

You might also like