Application Development 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: 

LSMW

Former Member
0 Kudos

Hi experts,

i wanna know where exactly we have to write the code for lsmw.

the logic which i have to write is

The data will be downloaded from the AMPL table of R3. Only those AMPLs which are valid will be extracted. The extraction will be done only for those plants whose warehouses are handled in EWM.

Data to be extracted are

• Internal material number (AMPL-BMATN)

• MPN number (AMPL-EMATN)

• Plant (AMPL-WERKS)

Selection criteria would be

• Plant (AMPL-WERKS)

• MPN number (AMPL-EMATN) > 0

• Valid To date (AMPL-DATUB) > current date

The transaction and the fields are

/SAPAPO/MAT1----Transaction

fields are

Source Table (R3) fields Target fields in EWM (properties 2 view

AMPL MATNR MATNR

ampl werks LOCNO

ampl ematn ALTPN

APNTYPE(constant,char2)

regards,

sandeep.

2 REPLIES 2

Former Member
0 Kudos

Hi

you can do coding in LSMW at the EVENT level

in Step 'Maintain Field Mapping and Conversion Rules' change mode,

click the layout button, which at Check button right.

tick Processing Times, and click OK button.

The LSMW evernt will appear, and just double-click them to add your own logic.

Check out these:

Processing time Meaning Default setting

<b>__BEGIN_OF_PROCESSING__ Before the beginning of</b>

data processing

(blank)

<b>__BEGIN_OF_TRANSACTION__ Before the beginning of</b>

transaction data

processing

(blank)

<b>__BEGIN_OF_RECORD__ Before applying the</b>

conversion rules for a

source structure

Initialize the structure <segment>

(Name of target structure)

Batch Input, Direct Input:

<segment> = init_<segment>.

BAPI, IDoc:

g_edidd_segnam = '...'.

g_edidd_segnum = '....'.

g_edidd_psgnum = '......'.

g_edidd_hlevel = '..'.

Clear <segment>.

<b>__END_OF_RECORD After applying the</b>

conversion rules for a

source structure

Transfer_record.

<b>__END_OF_TRANSACTION__ After finishing transaction</b>

processing

Transfer_transaction.

<b>__END_OF_PROCESSING__ After finishing data</b>

processing

(blank)

transfer_record. Transfers the current record (i.e. for the current target

structure) to the output buffer.

transfer_this_record '...'. Transfers a record of another target structure to the output

buffer. The name of the target structure has to be specified as

argument in single quotes.

at_first_transfer_record. Transfers the current record to the output buffer, if it is the first

transaction.

on_change_transfer_record. Transfers the current record to the output buffer, if it has

changed compared to the last record.

transfer_transaction. Writes the current transaction to an output file. All records of

Legacy System Migration Workbench

38

the output buffer are transferred to the output file.

skip_record. The current record is not transferred to the output buffer.

skip_transaction. The current transaction is not written to the output file.

0 Kudos

Hi,

U can write the code inside the 5th step.As per your requirement just give the conditions as you have written.

Just click the change mode, then press the event button,then check the processing time periods box.

U will find the editor to write your code eventwise.

Give the conditions as per your requirement for the corresponding fields.

Thanks,

Reward if helpful.