Professional Documents
Culture Documents
com/community/erp/logistics-mm/blog/2013/05/30/lsmw-migrationwith-idoc-method-and-using-idoc-as-source
In this blog I want to show one of my most used and preferred migration
option using IDOC and LSMW
The business case: Data migration with a SAP legacy system. Many
companies use already SAP for several years. Companies buy other
companies. Both run SAP. The decision is taken to consolidate many SAP
systems into just one.
Challenge: the legacy system has data for plants that were shut down,
closed companies and abandoned purchasing and sales organisations.
The good thing: your company actually owns all systems and you can
customize and develop in all those systems.
The bad thing: all love their data and want rescue as much as possible. While
in many cases where the legacy system is not a SAP system you just get an
Excel extract with maybe 20 or 30 fields, with SAP as legacy system you
have to deal with several hundred fields for material, vendor and customer
master migration.
Writing extract programs is a huge effort, downloading data from maybe 10
or more different tables not really less work and you still have to get the data
together again.
This was the basis to search for a better option where I finally found a well
known feature that saves us a lot of work, especially for the extract: ALE
In brief: I setup an ALE distribution in the legacy system to send e.g. vendors
as IDOC to a file. And in the target system I develop my LSMW object using
this file as source file for my data migration.
I do not explain any single LSMW step in this blog in deep detail as I described it in in my
other blogs:
LSMW Material master by BAPI method - Part 1
LSMW Material master by BAPI method - Part 2
So i am just focusing here on the difference to these other blogs and the specific setup of
ALE distribution and IDOC import method
The homepage of LSMW can be found here in SCN at http://scn.sap.com/docs/DOC-26158
In that document you can find the links to the general documentation in help.sap.com
too: SAP Library - Legacy System Migration Workbench
The IDOC record types for SAP Release 4.x need to be selected if you are in a system with release 4 or
higher
The Unicode-Format field has to be activated if you are in a Unicode system
Enter physical directory /DC_EX/M/. (I have to use a certain directory - this is due to a policy)
Select a Function module: I usually use EDI_PATH_CREATE_CLIENT_DOCNUM , See F4 for
alternatives
In order to prevent unprocessed files being overwritten, you use function modules which generate file or directory
names dynamically, that is to say, at runtime.
Carry out an Access Test, this helps to identify wrongly entered directories and uncovers authorization
issues.
Company Code
Migration
8740
8740
Company Code
Company Code
Company Code
Migration
Migration
Migration
4982
8787
8788
4982
8787
8788
then continue with Add message type, enter ZFILESY as Model view, you system as sender, ZFILESY as
receiver and CREMAS as message type for vendor master distribution. Make use of F4, this helps to
avoid typing mistakes
Actually for customer and vendors you can generate the distribution model and do not need to add
each message type manually in BD64
Just go to
IMG > SAP NetWeaver > Application Server > IDoc Interface / Application Link Enabling (ALE) > Modelling and
Implementing Business Processes > Configure Predefined ALE Business Processes > Logistics > Master Data
Distribution > Proposal for distribution model: Customer and vendor masters (Transaction WYL2)
Enter the message type CREMAS and your target system, the logical system ZFILESY
Enter 1, several or none account number of vendor for distribution. No entry means you send ALL
vendors, this can take some time as SAP has to read the vendor master and create IDOCs.
After execution you get a pop-up telling you how much IDocs got created for your message type
after you click continue you get another pop-up telling you how much communication IDOCs got
created:
The IDocs are still not send at this time, continue with transaction BD87
If this second Pop-up shows error B1039 0 communication IDocs generated, then you have done
some setting wrong
Check if message type exists in a distribution model (BD64)
Check if the distribution model is avctive for the current date (BD64)
Make sure the message type is added to the partner profiles (WE20)
In the selection screen of BD87 just enter your partner system and execute to find all your IDOCs
SAP lists per status (e.g. yellow - ready for dispatch; green - successfully dispatched) each message
type with its number of IDOCs
Place the cursor on a message type below the yellow status.
If you just have a few IDocs, then you can continue and click the Process button.
If you have more than 5000 IDocs and you want them all in one file (which makes most sense,
especially if you use partner functions for vendors, then you should migrate all vendors in one shot)
then choose from menu EDIT > Restrict and process.
Don't be confused with this name "restrict" as you actually want the contrary.
SAP has now taken all your IDOCs into the multiple selection. And the best part is, that this multiple
selection can take hundred thousands while multiple selections in normal selection screen may only
take 3000 vendor numbers until the application dumps.
You only need to extend the value of maximum numbers of IDocs beyond the numbers of IDOCs
you have. This ensures that all IDOCs are going into one file. Otherwise SAP would create several files.
Execute.
you get a pop-up telling you how much IDOCs got selected, then choose from menu Program >
Execute in Background
as it may take several hours to distribute those IDOCs
After the background job has finished, you can find the file with the IDOCs via AL11 transaction in the
directory that you entered in your Port definition
Further it has the name that was automatically created via the function module entered in the port
defintion.
The detail looks unstructured compared to normal flat files created from an Excel Spreadsheet:
In the second part of this blog I will describe how to read this file as source file in LSMW.
This second part can be found here:
LSMW migration with IDOC method and using IDOC as source Part2: Import
8064 ViewsProducts: sap_erp_logistics_materials_management Topics: abap, enterprise_resource_planning Tasks: mi
gration Tags:communication, port, distribution, idoc, lsmw, ale, logical_system, cremas, bd87, bd64, we20, we21, b
1039, bd14, obb5, wyl2
19 Comments
Add a comment
Hi Jurgen,
I am testing the tool for Material Masters Upload. As a tool LSMW was chosen using BAPI
SAVEDATA. All the fields are updated in the material masters except for the one - Profit
Center. I have no clue what could be the point.
1) this field is populated into IDOC when I check the IDOC.
2) there is a tick in the MARCX structure.
The only problem I see as this field is marked as mandatory. Could it be the issue then?
Like (0) Alert Moderator Reply
o
Jrgen L Feb 12, 2014 9:58 AM (in response to Olga Ivanova)
Profit Center is as well mandatory in my materials and I have no issue with the BAPI.
What does the application log tell you? did you eventually miss leading zeros?
Like (0) Alert Moderator Reply
Thanks for the reply, Jurgen. In my case, there are no leading zeros as the
profit center field is 10 characters long and the name of the profit center is
exactly 10 characters. It is just a real miracle.
Just a quick question: in the structure E1BP_MARCX, what is the value in the
PROFIT_CTR field?
The idoc is created sucessfully with status 53 so there are no application logs
availabe.
Like (0) Alert Moderator Reply
Hi Jurgen,
I am trying to do this procedure for mass opening of materials to another company code and
during step 4) Maintain Distribution Model i have an error that "Logical system ZFILESY
unknown". I have done all the steps from the beggining.
Shall i first define ZFILESY as a logical system?
Like (0) Alert Moderator Reply
o
Jrgen L Oct 22, 2014 5:46 AM (in response to Ali Dai)
Talk to your basis team, AL11 and the file system has its own
authorization settings.
Like (0) Alert Moderator Reply
Jrgen L Oct 22, 2014 7:28 AM (in response to Ali Dai)
Hi Jurgen,
I could process IDoc and it was written to file '/int/V16/outboundO_300_0000000093721725',
but I cannot see in that directory this file.
What do you think there may be the issue?
Like (0) Alert Moderator Reply
o
Jrgen L Apr 15, 2015 7:04 AM (in response to Baurzhan Zhakeleyev)
Usually authorization issues for AL11, talk to your basis team, they have certainly
options and rights to locate that file and have usually as well the role to grand access
rights.
Like (1) Alert Moderator Reply
but that actually means you could not process the IDOC successfully,
you must have received an error directly that you can't write to that
directory. The button "Access Test" in WE21 should have shown an
error already.
Like (0) Alert Moderator Reply
No it didn't.
Well, as always
right, thank you!
Found them.
You are