04-09-2007 10:22 AM
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
04-10-2007 9:23 AM
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.
04-10-2007 11:32 AM
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".
04-10-2007 11:43 AM
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
04-10-2007 1:15 PM
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 ?
04-11-2007 10:51 AM
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 ?