Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

LSMW

Former Member
0 Likes
776

alrady i have 3 files on application server.i have to upload data to sap thru LSMW.

I want to add some logic to extract the data from legacy.where to add logic in lsmw

exactly where to code in lsmw?

alrady i have 3 files on application server.i have to upload data to sap thru LSMW.

I want to add some logic to extract the data from legacy.where to add logic in lsmw

exactly where to code in lsmw?

5 REPLIES 5
Read only

Former Member
0 Likes
643

follow the links

ttp://www.sap-img.com/sap-data-migration.htm

http://www.sapgenie.com/saptech/lsmw.htm

http://sapabap.iespana.es/sapabap/manuales/pdf/lsmw.pdf

http://www.sap.info/public/INT/int/glossary/int/glossaryletter/Word-17643ed1d6d658821_glossary/L#Wor...

steps

Steps -

1. Import data (legacy data in spreadsheet tables and/or sequential files)

2. Convert data (from source format to target format)

3. Import data (into the database of the SAP application)

a. Maintain Structure relations, field mapping and conversion rules.

b. Data from legacy system is read

c. Based on step a, the data gets converted

d. The converted data is imported to R/3 system based onBatch input processing or Direct Input or through IDOC Inbound processing

Do reward if helpful

Read only

Former Member
0 Likes
643

Hi,

go through this link

http://help.sap.com/saphelp_nw04/helpdata/en/ad/2d54a41d7011d2b42e006094b944c8/frameset.htm

this is regarding 6th step in LSMW

Maintain Fixed Values, Translations, User-Defined Routines

Editing Reusable Rules

Use

Edit fixed values, translation rules, and user-defined routines.

Prerequisites

To be able to edit reusable rules, you have to create them in step Maintain field mapping and conversion rules first.

Features

You can:

· Edit fixed values

· Define the type of translation

· Define 1:1 translation values

· Define interval translation values

Activities

You can edit the corresponding rule after positioning the cursor on that rule in the change mode in step Maintain fixed values, translations, and user-defined routines.

More Information

Copying Reusable Rules

Deleting Reusable Rules

Control of Translation

I have Not tried that but probably this is the only way u can add some code in LSMW

Reward if helpful & do let me know if you find something , I am watching this thread

Hi ,

Here id some solution for ur problem

Storing ABAP Code

Use

You can write your own ABAP code and assign it to the SAP target fields.

Prerequisites

To change ABAP code, you require the relevant developer authorization. For authorization object S_DEVELOP, at least activity 02 and any values for the other authorization fields must be selected.

Procedure

...

1. From the list of steps, choose Maintain field mapping and conversion rules.

A screen appears.

2. Position the cursor on the corresponding SAP field.

3. Choose Insert rule.

A dialog box appears.

4. Set a flag under ABAP Code.

Confirm with Continue.

You enter the editor mode where you can store your own code.

Note that a maximum of 24 lines can be displayed. To display the other lines, double-click.

5. Afterwards, choose Check.

An error message is issued if your code contains any errors.

Result

Your ABAP code has been stored.

Conversion rules already assigned will be deleted as soon as you enter your own code in the editor.

Link :

http://help.sap.com/saphelp_nw04/helpdata/en/ad/2d54a41d7011d2b42e006094b944c8/frameset.htm

Do reward if helpful

Edited by: Ashish Paliwal on Apr 4, 2008 11:37 AM

Read only

Former Member
0 Likes
643

Hi, FYI...

The LSMW will read the data from the file which got assigned to the source structure. we have to specify the files which are available at different locations(Local or Application) in the Specify files step. Here u can specify how many files u want.

But in assign files step u can assign only one file to the source structure, when u execute the step Import/read data the LSMW will read the data from the assigned file.

Regarding the coding in LSMW, u can write the code in step Maintain Field Mapping and Conversion Rules. Place the cursor wherever required and double click on it. U will get the window to write the code.

To look the different blocks available in LSMW, select the Layout button in application toolbar and select all the check boxes.

Thanks,

Rajinikanth

Read only

Former Member
0 Likes
643

To add to the above suggestion.

For 4.6 In "Maintain Field Mapping and Conversion Rules" you will have display variant instead of layout.

Read only

Former Member
0 Likes
643

In Maintain Field Mapping and Conversion Step.

Once in the field that you want to add or create the ABAP Logic, press then the Icon_:(RULE),_

a Pop-up screen with a list of options will appear, just select the ABAP Code, then you will be able to Create your own ABAP Source.

Please Reward if it help you.

See the example Below, so you can skip the record if you want or print a Log of the process.

Data: wa_kunnr type knvp-kunnr.

Data: wa_kunnr1(10) type n,

wa_kunn21(10) type n.

Move: KNVP_ST-KUNNR to WA_KUNNR1,

KNVP_ST-KUNN2 to WA_KUNN21.

PERform ur_PF_CONVERTION using KNVP_ST-PARVW

CHANGING KNVP_ST-PARVW.

Select single kunnr into wa_KUNNR

From KNVP

Where KUNNR = WA_KUNNR1

and VKORG = KNVP_ST-VKORG

and VTWEG = KNVP_ST-VTWEG

and SPART = KNVP_ST-SPART

and PARVW = KNVP_ST-PARVW

and KUNN2 = WA_KUNN21.

If sy-subrc ne 0.

Write: / 'N', Sy-subrc, WA_KUNNR1,

KNVP_ST-VKORG,

KNVP_ST-VTWEG,

KNVP_ST-SPART,

KNVP_ST-PARVW,

WA_KUNN21.

WA_ERRORTAB-ID = '/SAPDMC/LSMW'.

WA_ERRORTAB-MSGTY = 'W'.

WA_ERRORTAB-MSGNO = 004.

WA_ERRORTAB-PAR1 = WA_KUNN21.

WA_ERRORTAB-PAR2 = 'KNVP'.

INSERT WA_ERRORTAB INTO TABLE G_ERROR_TAB.

skip_record.

endif.