You are on page 1of 19

IDoc Inbound Processing

Use
IDocs (intermediate documents) have been developed for the exchange of messages between different systems. Providing a standard interface with the SAP system, this technique can also be used to transfer data. For more information, choose IDoc Interface in transaction WEDI. . See also: Starting IDoc Generation

Prerequisites
To be able to use IDoc inbound processing, you have to define settings and perform preparatory tasks. These tasks are grouped on the initial screen of the LSM Workbench under Settings IDoc Inbound Processing. To use IDoc inbound processing, you must first perform the following steps: 1. Define or select a file port for transporting the file. Optionally, you can also create a tRFC port. See Creating Ports 2. The partner type has to be defined or selected. See Partner Types 3. The partner number has to be defined or selected. See Partner Numbers 4. IDoc inbound processing must be activated, and the workflow customizing must be checked. Both of these tasks are performed once in each system. See Verifying the Workflow Customizing

Creating Ports Use


A port has to be available for a transfer of data from a legacy system to the SAP System by means of IDocs. As well as the file port, you can also specify a tRFC port. For data conversion, you can decide whether a file should be created or whether the data should be passed to inbound processing by "packages" directly. See Starting IDoc Generation

Prerequisites
You have chosen Settings IDoc inbound processing on the LSMW initial screen, and the IDoc inbound processing: Preparations screen is displayed.

Procedure
We recommend to maintain the following entries:

1. ... 1. Choose Maintain ports. The WF-EDI: Port Definition screen appears. 2. Activate the change mode. 3. Position the cursor on File and choose Create. Fill in the given fields. Recommendation:

Port: Description: Version:

LSMW Legacy System Migration Workbench IDoc record types: SAP Release 4.x

If you additionally want to create the transactional RFC port:

1. Position the cursor on Transactional RFC and choose Create. Fill in the given fields. 2. Save your entries. 3. Choose F3 or Back to return to the IDoc inbound processing: Preparations screen. 2. 3. Kehren Sie ber F3 oder Zurck zu dem Bild en zurck

Result
The partner port has been created.

Partner Types Use


You must select a partner type when you transfer data from an external system or legacy system to an SAP system in IDocs. For the LSMW, we recommend that you use the partner type US.

Prerequisites
You have chosen Settings IDoc Inbound Processing on the LSMW initial screen, and you are on the screen IDoc Inbound Processing: Preparatory Measures.

Procedure
Enter US as the partner type.

To do this, proceed as follows: 1. 2. Choose Maintain Partner Types. Activate the change mode.

A table is displayed. 3. 4. Choose New Entries. Fill in the fields.

Recommended values:
Partner type: Report name: Form routine: Short text: 5. US /SAPDMC/SAP_LSMW_PARTNERTYPES READ_USER <any>

Save your data and choose F3 or Back to return to the screen IDoc Inbound Processing: Preparatory Measures.

See also: Transaction WE20 Maintain Partner Profiles

Result
The partner type has been created.

Partner Numbers Use


You must select a partner number when you transfer data from an external system or legacy system to an SAP system in IDocs.

Prerequisites
You have chosen Settings IDoc inbound processing on the LSMW initial screen, and the IDoc inbound processing: Preparations screen is displayed.

Procedure
Enter LSMW as partner number. Or: 4. ... 1. 1. Choose Maintain partner numbers. The Partner Profiles screen appears.

2. 3.

2. Choose Create. 3. Fill in the given fields. Recommendation:


Partner number: Partner type: Partner status: Type: Language: ID: LSMW US A (active) US EN or DE Your user ID

4.

4. Save your data and choose F3 or Back to return to the IDoc inbound processing: Preparations screen.

Result
The partner numbers have been maintained.

Checking the Workflow Customizing Use


Workflow Customizing defines the requirements for using IDoc inbound processing.

Prerequisites
You have chosen Settings IDoc inbound processing on the LSMW initial screen, and the IDoc inbound processing: Preparations screen is displayed.

Procedure
5. ... 1. Choose Workflow customizing. The Workflow Customizing screen appears. 6. 2. Choose Perform Automatic Workflow Customizing. The auto customizing log for the runtime system is displayed. 7. 3. Check the entries. The following entries of the workflow runtime system must have a green checkmark assigned to them: 5. Maintain System Administrator for Workflow. Configure RFC Destination. Classify Decision Task as General. Activate Send to Objects and HR Objects. 8.

Transporting LSMW Projects Use


The LSM Workbench gives you the option of transporting the data of a project either with the SAP Change and Transport System, or with downloads and uploads.

Constraints
These transports do not include the defaults for IDoc inbound processing. You must set these defaults manually for each project in each SAP system and client.

Prerequisites
You have created and processed the project that you want to transport.

Features
You have the following options for transporting a project: 1. 2. 3. Creating a Change Request Exporting a Project Importing a Project

Creating a Change Request Use


You can create an SAP change request that contains all information about an LSMW project. You can use the SAP Change and Transport System to export and import this change request. If you choose to transport LSMW data in this way, you can use the Change and Transport System tools to monitor who transported which data into which system, and when this happened.

Procedure
1. 1. 2. 2. 3. 3. Enter your project data in the initial screen of transaction LSMW. Choose Extras Create Change Request. Select an existing change request, or choose Create Request.

4. 4. If you create a new request, you must enter a description and possibly also a project name. 5. 5. Choose Continue or Save.

When you import a change request of this type, the entire project is deleted in the target system, and then created again.

When you export the transport request, all changes to the project are recorded that were made up until the time of the export (this could include changes made after the transport request was created).

Exporting a Project Use


It is a good idea to perform the migration from a legacy system to the SAP system in a test system first. This function is used to transfer the field assignments developed to the production system.

Prerequisites
The mapping and field assignments for a migration object already exist.

Procedure
6. ... 9. 1. On the LSMW initial screen, choose Extras Export project. A dialog box appears 10. 2. Select a project. Choose Continue. 11. 3. The structure hierarchy of the selected project is displayed. Either Select / Deselect parts of the project or export the overall project. 12. 4. Choose Export conversion rules Export. A dialog box appears 13. 5. Specify the file name and path. 14. 6. Confirm by choosing Open.

Result
The mapping and field assignments are exported. The documentation of the selected elements is also exported.

Importing a Project Use


Import the mapping and field assignments into a different SAP system.

Prerequisites
Mapping and field assignments have already been exported from an SAP system with an identical LSMW version.

Procedure
7. ... 15. 1. On the LSMW initial screen, choose Extras Import project. A dialog box appears

16. 17. 18.

2. Select the file name and path. 3. Choose Open. 4. The file is being imported and its contents are analyzed. After the analysis, you get a list of the subprojects and objects that have been found.
You can now select the objects that you want to import. Any existing data of the project is flagged with a green checkmark. This data is overwritten by the import. You can prevent a project that already exists in the target system from being overwritten by using the Import and Rename function.

Error opening file If the message Error opening file is issued during transfer, check to see whether the directory mentioned exists and whether you have write authorization for this directory.

Result
The mapping and field assignments are imported into a different SAP system.

Migration of Data with LSMW Use


You can use the LSMW if the source structures are simple, like this for example:

You can also use the LSMW if the legacy system has complex structures, like:

Prerequisites
A comparison of functions between the legacy system and the SAP system must have been carried out. The data to be migrated is determined from this comparison.

Process Flow

LSMW supports a step-by-step procedure. On the List of steps screen, the next step is automatically displayed for each step.
The following basic steps are included in the LSMW: 1. Maintaining Object Attributes Here, you define the project, subproject and the required (business) object. If a suitable SAP standard import program is not available, you can use the recording function to create a user-specific, new object. 2. Maintaining Source Structures 3. Maintaining Source Fields 4. Maintaining Structure Relationships In these steps, you define the structures and fields of the project. These describe the transfer file and must have the same format in the export program. You then relate the structures and fields of the SAP system to those of the project. 5. Maintaining Field Mapping and Conversion Rules 6. Maintaining Fixed Values, Conversions and User-Defined Routines: Here, you define the conversion rules for processing project data. The system generates the conversion program from the structure and field relationships as well as the conversion rules. You then perform Migration Customizing. That is, you assign values to the fixed values and translation values and specify the definite variants for the conversion rules. 7. Specifying Files 8. Assigning Files 9. Importing Data 10. Displaying Imported Data 11. Converting Data 12. Displaying Converted Data 13. Starting IDoc Generation

14. Starting IDoc Processing 15. Creating an IDoc Overview 16. Start IDoc-Postprocessing: The converted data is transferred to the SAP system. The import technique or method has already been assigned to the object by selecting the object type in the first step.

Result
The data from the legacy system has been imported into the SAP database. Any subsequent processes result from the type of datasets migrated.

Additional Information
For more details about migrating data with the LSMW, see: Description of the Project Definition of the Source Structures and Source Fields Editing Field Assignments Data Import Special Case: Migration of Long Texts Periodic Data Transfer

Description of the Project Purpose


Your work with LSMW starts with the definition of the project as a unit of the data to be migrated.

Process Flow
19. 8. ... 1. You create the project from which you want to migrate data in the LSMW:

If The mapping and field assignments for a project are available in an SAP system (e.g. test system). The mapping and field assignments for a project have been stored on a data carrier. You want to migrate data from your legacy system for the first time.

Then You export them from this system and import them into your SAP system. See Exporting a Project and Importing a Project You import them into your SAP System.

You define the project.

20.

2. You define the subproject for a project or make it known to the LSMW by importing the mapping and field assignments (see above).

Result
The project and subproject have been defined. Now you define the (business) object.

More Information
Editing a Project Editing a Subproject Editing Objects Maintaining Object Attributes Where-Used List

Editing a Project Integration


Editing a project includes all the associated objects, such as sub-projects, (business) objects, and field assignments.

Prerequisites
A project has been created.

Features
You can perform the following actions:Create a project (see: Starting the LSM Workbench); edit a project; display a project; delete a project; copy a project; or rename a project.

Activities
21. 22. 23. 9. ... 1. On the LSMW initial screen, choose Goto Administration. 2. Position the cursor on the appropriate project. 3. Under Administration, choose the appropriate entry.

Editing a Subproject Use


You can create and edit any number of subprojects for a project that you want.

Integration
A subproject can have any number of objects.

Prerequisites
A subproject is always subordinate to a project.

Features
You can create, rename, copy, or delete subprojects.

Activities
24. 25. 10. ... 1. On the LSMW initial screen, choose Goto Administration. 2. Position the cursor on the appropriate subproject.

26.

3. Under Administration, choose the appropriate entry.

Editing Objects Use


You can copy or delete objects.

Integration
To copy an object, you need a project for which you want to use the object being copied. You can delete objects that are no longer required. This will delete the mapping and the field assignments associated with the object. Reusable rules continue to exist.

Prerequisites
You must have created an object and maintained its attributes. See Maintaining Object Attributes

Features
You can perform the following actions:Create an object (see: Starting the LSWM Workbench); edit an object; display an object; delete an object; copy an object; rename an object.

Activities
27. 28. 29. 11. ... 1. On the LSMW initial screen, choose Goto Administration. 2. Position the cursor on the corresponding object. 3. Under Administration, choose the corresponding option.

Maintaining Object Attributes Use


Maintenance of the object attributes is the first step carried out in the LSM Workbench.

Prerequisites
You have created a project, and you have chosen Continue on the initial screen to get to the list of steps.

Procedure
1. From the list of steps, choose Maintain object attributes. A screen appears. 2. Choose Change. 3. Specify the object. 4. Specify whether the data is to be transferred once or periodically. With a periodic data transfer, you cannot import any data from the PC. Additional step Frame program is displayed. See Periodic Data Transfer

5. Select the object type and import technique and fill in the corresponding fields. You can use the F4 help on the input fields. In this help, lists are displayed from which you can select the relevant objects. 6. Choose Back or F3 to return to the list of steps.

Result
The object attributes and, as a consequence, the import method for the data to be migrated have been defined.

When you select the batch input or direct input method, documentation is displayed for the program (see icon). When you select the batch input recording, you can make additional recordings after activating the icon.

If you select the BAPI or IDoc method, the system checks whether a so-called partner profile for the defaulted partner and the selected message type already exists when you save the data. Otherwise, the system tries to create them. See also: Converting BAPIs/IDocs

Where-Used List Use


Shows you for which objects of a project specific reusable rules have been used.

Prerequisites
Rules that can be reused have been created.

Procedure
In the Administration menu option: 12. ... 30. 1. On the LSMW initial screen, choose Goto Administration. 31. 2. Position the cursor on the corresponding reusable rule. 32. 3. Choose Where-used list. A dialog box appears.
For recordings:

13. ... 33. 1. On the LSMW initial screen, choose Goto Recordings. 34. 2. Position the cursor on the corresponding reusable recording entry. 35. 3. Choose Where-used list. A dialog box appears.

Result
A table of the objects in the project to which the reusable rule has been applied is displayed. If no reusable rule has been used, the notification message List does not contain any data is issued.

Definition of Source Structures and Fields Purpose


The source structures and fields have to be defined before they can be adjusted to the SAP target structures and fields.

Process Flow
1. The object overview shows you the structures and fields that are expected in the SAP system. To display the list, click on Object overview or choose Extras Object overview in the list of steps. See Object Overview 2. You define the source structures. 3. You define the source fields associated with the structures. From the list of steps, choose Maintain source fields.

Result
The source structures and fields have been defined.

More Information
Maintaining Source Structures Changing Source Structures Reassigning Source Structures Deleting Source Structures Maintaining Source Fields Copying Source Fields Changing Source Fields Reassigning Source Fields Deleting Source Fields

Maintaining Source Structures Use


The source structures (LS structures) are defined with the ID, name, and hierarchical relationships. Start with the highest hierarchy level since only hierarchies with the same level or a lower level can be created.

Procedure
36. 14. ... 1. From the list of steps, choose Maintain source structures.

2. Choose Change. 3. Position the cursor on Source structures. 4. Choose Create structure. A dialog box appears. 40. 5. Enter the name and description of the source structure. 41. 6. Choose Continue. The LSM Workbench: Source structures screen appears again. The structure you created is displayed. You can create additional structures now. When you create additional structures, a dialog box with query "Same level/subordinated" appears. By setting the corresponding indicator, you define the hierarchy level of the structure. 37. 38. 39.

For user-defined objects (created by recording a transaction) you may define only one structure, since there is a flat target structure available only. See Recordings

Changing Source Structures Procedure


15. ... 1. From the list of steps, choose Maintain source structures. A screen appears. 43. 2. Position the cursor on the corresponding line. 44. 3. Choose Source structures Change structure. 45. 4. Enter changes as required. 46. 5. Choose Continue. 42.

Reassigning Source Structures


Use
You have to transfer source structures to a new position within the hierarchy.

Procedure
1. From the list of steps, choose Maintain source structures.
A screen appears.

2. Choose Change.
3. Position the cursor on the structure to be reassigned. 4. Select this source structure. 5. Position the cursor on the source structure that you want to assign the selected structure to.

6. Choose Source structures Move structure. 7. 8.


A dialog box appears. Specify whether the structure to be reassigned is to be assigned at a lower level or at the same level. Choose Continue. The structure has been transferred to the new position.

When you reassign a structure, the subordinate structures are reassigned as well. The header structure cannot be reassigned.

Deleting Source Structures Procedure


16. ... 47. 1. From the list of steps, choose Maintain source structures. A screen appears. 48. 2. Position the cursor on the corresponding line. 49. 3. Choose Delete structure. The structure is deleted.

Deleting a structure deletes the fields as well as the data relationships and conversion rules already created for the structure. The structure of the highest hierarchy level cannot be deleted.

Maintaining Source Fields Prerequisites


The source structures must have been defined before you maintain the source fields.

Procedure
Two options are available. You can create the source fields: 17. ... 50. 1. From the list of steps, choose Maintain source fields. The LSM Workbench: Source fields screen appears. 51. 2. Choose Change. 52. 3. Position the cursor on the associated source structure if you want to define a field for the first time. For any additional field definitions, make sure to enter the new field below the original cursor position. 53. 4. Choose Create field. A dialog box appears. 54. 5. Fill in the following fields: Field name Field text

Field length Field type: Character field, numeric field, packed field, or date field. 55. 6. Choose Continue.
You can also maintain source fields in table format:

56. 57. 58.

18. ... 1. Position the cursor on a source structure or on a source field already created. 2. Choose Table maintenance. 3. Enter the field name, type, length, and field description. If you enter the field name only and then choose Enter, the system will assign the following values: Field type: C Field length: 10 Field description in accordance with the field name.
By choosing Extras Unassigned Source Fields, you can display the source fields that have not been assigned yet, which means that you can see whether there is data that has been neglected. If you want to run a migration test with a limited number of data, set an indicator for Selection parameters under Read/convert data. If data for several source structures is included in one file, the value of the respective source structure has to be specified under Identifying field content.

Copying Source Fields Use


You can also create a source field by copying a different one.

Prerequisites
You are in step Maintain source fields, and the change mode is activated.

Procedure
Choose Copy fields. A dialog box with the following options is displayed: Upload (Tab delimited text): The system expects the description of the source fields to be stored in a text file the columns of which are separated by tab stops. Choose Continue. A dialog box appears that specifies what the structure of the file must be like. Check to see if your file meets these requirements. Specify the name and path of the file. Confirm by choosing Transfer.

Copy from other object: You can copy source fields from the source structure of a different object. Specify the project, subproject, object, and source structure from which you want copy the source fields. Choose Continue. Copy from Data Repository: You can copy the source fields from a structure of the ABAP Dictionary. Enter the table name. Choose Continue. From data file (field names in 1st line): The data file from which you copy the source fields must be available on a PC in the format "Tab delimited text". The field names must be on the first line. Enter the number of fields as well as their maximum record length. Choose Continue. A dialog box appears Specify the name and path of the local file. Confirm by choosing Transfer.

Result
The source fields have been created.

Changing Source Fields Procedure


19. ... 1. From the list of steps, choose Maintain source fields. A screen appears. 60. 2. Position the cursor on the corresponding line. 61. 3. Choose Source fields Change field. 62. 4. Enter changes as required. 59.

5. Choose Continue. Reassigning Source Fields Use


You want to move source fields to a new position.

Procedure
20. ... 1. From the list of steps, choose Maintain source fields. A screen appears. 64. 2. Choose Change. 65. 3. Position the cursor on the source field to be reassigned. 66. 4. Select this source field. 63.

67.

5. Position the cursor on the source field under which you want to position the previously selected source field. 68. 6. Choose Source fields Move field. The field is reassigned. Fields can only be moved within the corresponding structure.

Deleting Source Fields Procedure


21. ... 1. From the list of steps, choose Maintain source fields. A screen appears. 70. 2. Position the cursor on the line of the field to be deleted. 71. 3. Choose Delete field. The field is being deleted. 69.

By deleting a field, any data relationships and conversion rules associated with the field are deleted as well 72.