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: 

Copying the data from table given a reference record.

Former Member
0 Kudos

Can anyone help me if we can copy the data from a table for some particular records using an LSMW.

Message was edited by:

Rajesh Nanda

5 REPLIES 5

Former Member
0 Kudos

Hi,

we can retieve the data in lsmw step 5 (maintain field mapping).

here we are having dofferent blocks like

Global data (just like the Global declarations in report program)

Begin of processing (Initialization)

begin of Transaction(it is executed fopr every transaction.If there are any header and item data, it will be executed for only header records).

begin of record (will be executed for every record)

........

u can write the abap code in any of the block by double clicking it.

in any block u can retrieve the data from data base table using the select statement same as in ABAP reports.

i think it will helps U.

0 Kudos

Hi

I will explain you further .

Suppose in table of material master there is entry "D10897".

Now when i give this entry, is there any method in LSMW that it will go to the material master table and fetch the value in each field of the table corresponding to material "D10897".

0 Kudos

Yes, as suggested in the above post, you will have to code in the ABAP block for

select from mara where matnr = 'xxx'.

Hope this helps.

Sudha

0 Kudos

Hi sudha ,

So it means i need to write the code for each field individually and get the data accumulated into internal table forst and then transfer it to excel sheet . Is this what you mean ?

0 Kudos

Hi

I have a query that when we write the code how will the value related to the particular field gets copied and where it needs to be stored ...do i need to define the internal table also ..... if yes then how ?