‎2006 Jan 19 4:31 AM
hi ,if i want to take data from a single file to two
different struture then how should i go for it.
‎2006 Jan 19 4:37 AM
Hi,
you can do it normal way as you are doing previously with one structure.
regards
vijay
‎2006 Jan 19 4:37 AM
Hi,
you can do it normal way as you are doing previously with one structure.
regards
vijay
‎2006 Jan 19 4:37 AM
Read the contents of the file into an internal table using WS_UPLOAD or GUI_UPLOAD and loop through the first internal table and move the rows to the other.
Ps: Reward points if helpful.
‎2006 Jan 19 4:48 AM
data: begin of itab occurs 0,
fld1 like ztab-fld1,
fld2 like ztab-fld2,
fld3 like ztab-fld3,
fld4 like ztab-fld4,
end of itab.
data: begin of itab1 occurs 0,
fld1 like ztab-fld1,
fld2 like ztab-fld2,
end of itab1.
data: begin of itab2 occurs 0,
fld3 like ztab-fld3,
fld4 like ztab-fld4,
end of itab2.
CALL FUNTION 'GUI_UPLOAD'
...
TABLES
itab = itab.
loop at itab.
itab1-fld1 = itab-fld1.
itab1-fld2 = itab-fld2.
append itab1.
clear itab1.
itab2-fld3 = itab-fld3.
itab2-fld4 = itab-fld4.
append itab2.
clear itab2.
endloop.
if ur problem is solved pls reward for helpful answers, if not pls ask more
Message was edited by: chandrasekhar jagarlamudi
‎2006 Jan 19 5:17 AM
hi chandrasekar , sir i think this type of work can be done in BDC but in LSMW i havent use concpet like internal table , where all this coding shoudl be done,
plese tell me in detais.
thanks
deepak
‎2006 Jan 19 5:21 AM
Hi Deepak,
you cannot use gui_upload in lsmw, and you can create the two structures and map them in field mapping, while uploading the data you may need to write coding in event
<b>__BEGIN_OF_RECORD__</b>. but upload you cannot do.
regards
vijay
‎2006 Feb 08 12:39 PM
Hi Deepak,
In Maintain field mapping and conversion rules step we get a detailed view of the field mapping. Here at the end of each structure you could see the statement transfer_record. This statement is something similar to ur append itab. Each of the structure denotes a loop. The hierarchy in the structure will be reflected in ur loop as well. Inside this loop ur data from file is retrieved record by record and transfer record denote the end of one record fetch. You can double click on the node and enter ur own code there.
If u want to know how ur code becomes the part of the entire read and conversion program which actually get created in background, u need to include them in the lsmw steps. This can be done by checking the appropriate box in personal menu popup window. The personal menu button is located in the application tool bar. Ofcourse u cannot edit the conversion prog but still u will be able to understand where ur coding comes into picture.
If data for several structures is stored in one file the field Identifying field value has to be
maintained. This is done where u maintain ur source field.Maintain only one identifying field value per structure.
For fields of top hierarchy level structures, ID "selection parameter" can be set during Read/Convert
data. If you set this indicator, the corresponding field is made available as selection parameter when
reading or converting data. As a rule, this is used for testing.
‎2006 Feb 08 12:44 PM
Just define one source structure that matches your input file. In the mapping of the source structure assignment to target structure, assign the same source structure to both the target target structures.
After that you will manipulate in your mapping of the fields as to which one goes to the first structure or which value goes to the other one.