2010 Jul 22 11:13 PM
while doing lsmw by batch input recording, i am in a fix pls solve this.
in case of bdc.... we do the recording =>go to se38 => build the itab as per the flat file to be uploaded => upload the legacy data from flat file to itab => loop at itab and move the data into bdcdata str. => this is the transactional data and hence a batch input session is created.
in case of lsmw, by batch input recording.... we do the recording => create the source str (similar to itab create) =>maintain the flds of the source str => map the source str with rec => assign the flat file/dataset path (data moves from flat file to source str like bdc gui_upload ) => now my question is :
after the file is uploaded into source strcture in the step *'READ DATA'* 1 file is created with the extension ".READ" and in the step 'CONVERT DATA' another file with the extension of " .CONV" is created.
wat is the purpose of these 2 files ? pls explain?
2010 Jul 23 7:58 AM
Hi Surajit,
This Read Data "reads the data from your PC(Front end),basically the legacy data.
What Convert Data does is that it Converts the Data in SAP format(Checks wheteher it is in correct SAP format or not).
And it is this Converted data that you process in Batch input session in SM 35.
So basicallya path is created for Coverted Data and it is users requirement whether he wants it on a periodic basis or one time basis.
2010 Jul 22 11:30 PM
That's just the "connection" between the steps of the LSMW (you run each step at any moment, you can wait for weeks between a READ and a CONVERSION, so the results must be stored somewhere), and it's useful if you want to check the intermediate results.
2010 Jul 23 5:08 AM
wat this 'connection' is all about? pls explain the flow of data just after being read from a flat file till its being stored in the batch input session.
2010 Jul 23 7:58 AM
Hi Surajit,
This Read Data "reads the data from your PC(Front end),basically the legacy data.
What Convert Data does is that it Converts the Data in SAP format(Checks wheteher it is in correct SAP format or not).
And it is this Converted data that you process in Batch input session in SM 35.
So basicallya path is created for Coverted Data and it is users requirement whether he wants it on a periodic basis or one time basis.
2010 Jul 23 8:47 AM
thnx rahul for ur reply, but i have a query.ie:
after we 'specify the file path' we do 'assign file'. in this step we are assigning the flat file to the source structure.
in the next step we do 'read data' and 'convert data' where we see the files with extension '.read' and .'conv'. so the data is moving from the source structure to these files.
.thats is why i am asking why are these steps "read data " and "convert data" being done after the data moves to the source str? after the step "convert data" is there any other final structures where the converted data is stored before using in batch input session ? bcoz .read and .conv are files not structures.
according to me the flow wud be like:
flat file > source str > read from source into .read file > converted data into .conv > ??where is the data stored > process for batch
pls comment whether i am correct or not?
2010 Jul 23 10:08 AM
The important thing to understand is that the first steps of the LSMW are used to *define* the LSMW:
- Maintain Object Attributes
- Maintain Source Structures
- Maintain Source Fields
- Maintain Structure Relations
- Maintain Field Mapping and Conversion Rules
- Maintain Fixed Values, Translations, User-Defined Routines
- Specify Files
- Assign Files
The next steps are used to *execute* the LSMW
- Read Data
- Display Read Data
- Convert Data
- Display Converted Data
- The next ones may vary according to the data input technology you have chosen in step "Maintain Object Attributes"
-- If it's BDC or batch input program:
--- Create Batch Input Session
--- Run Batch Input Session
-- If it's an IDoc or BAPI (in LSMW, only BAPIs with corresponding IDocs are possible, and are processed using the IDoc technology):
--- Start IDoc Generation
--- Start IDoc Processing
--- Create IDoc Overview
--- Start IDoc Follow-Up
-- If it's a direct input program:
--- Start Direct Input Program
> thats is why i am asking why are these steps "read data " and "convert data" being done after the data moves to the source str?
As I said above, the data does not move to the source structure. You only define the source structure, i.e. you indicate what are the fields in each line of the file. Note that you can also process source files that contain lines of different structures, by creating several source structures.
> after the step "convert data" is there any other final structures where the converted data is stored before using in batch input session ? bcoz .read and .conv are files not structures.
> according to me the flow wud be like:
> flat file > source str > read from source into .read file > converted data into .conv > ??where is the data stored > process for batch
When you execute Create Batch Input Session, the program transfers the data from the .conv file into the BI session (APQI and APQD tables)
You should better have a try, you'll understand.
2010 Jul 23 10:32 AM
Sandra is perfectly correct.
To give you a metaphor ... the 'source structure' could be seen as a sieve. It only defines which bits go through which hole. The bits do not remain in the sieve ... they go to the .READ file (which oftenly is stored on the file-system - just in case you need it again). Same process happens again in the convert phase, only now you add something to the original bits, twist something round, add some spices and the result goes to the .CONV file ...
It's friday, perhaps I should better get my coat now.
2010 Jul 23 1:11 PM
thanks a ton for ur honest and sincere effort. but please clarify me on this.....
you are telling :
As I said above, the data does not move to the source structure. You only define the source structure, i.e. you indicate what are the fields in each line of the file eg:
if i am doing lsmw for tcode 'xd02'
with 10 records in flat file.
source structure name is z_struct
then after the step "read data" we get a list where the following things are written:
-----------------------------------------------------------------------------
read file: ' path of the flat file'
written file: lsmw_xbb_dsbd_sdg.read
-----------------------------------------------------------------------------
source structure: read written not written
z_struct 10 10 0
-----------------------------------------------------------------------------
transactions read: 10
records read : 10
transactions written: 10
records written :10
-----------------------------------------------------------------------------
isnt the source structure getting populated with data? pls explain this?
2010 Jul 23 1:50 PM
be careful when you use the {code} markup, there's a risk to widen the display. Simply insert > at the first position in the line for quoting original, and use {code} for only abap code (not too wide).
> isnt the source structure getting populated with data? pls explain this?
NO. The source structure is simply like an ABAP structure variable which is used to map each line of the input file. That's all.
Then the LSMW program does the conversion and writes result to the .conv file.
Try and analyze by yourself. That's my last post as this thread looks like a basic training about LSMW (SDN forums can't be used for training as explained in forum rules of engagement)
2010 Jul 23 1:47 PM
Hi Saurajit,
The READ file and CONV file has some significant.
1. when you are reading a file from the any place that data could be have so much of record in it and all the records will written on the READ file as read from the file.
2. but suppose you want to do some manipulation or validation during run time on the records read then all those code has to be written in the mapping section.
3. The major reason to maintain the CONV file is to reduce the file size on the application server and all the read data is stored in the compressed format (non readable format) and the final processing will happen using converted file.
Regards
Dhirendra