‎2007 Oct 29 5:32 AM
HI,
i have 2 structures.X_data and y_data both are of type structure TAB512 which is 512 characters
1.x_data-->contains data for ebeln and ihrez from ekko table.
2.Y_data--->conatins data for ebeln.ebelp and werks from ekpo table
3.now i want to move data of ebeln,ihrez and werks into z_data.
Since all are structures it is not accepting offset length in read table statement.
because here y_data and x_data conatins only one field WA of 512 characters.
So i have use offset lenth to divede into different fieldfs.
Ex: loop at y_data into e_data.
read table x_data inot f_data with ....here ..i am not able to give offset..
if sy-subrc eq 0.
move y_data-ebeln to z_data-ebeln.
move x_data-ihrez to z_data-ihrez.
move y_data-werks to z_data-werks.
append z_data
endif.
So can any body tell me how to resolve this?
‎2007 Oct 29 5:39 AM
Hi,
Use loop endloop with offset instead of using Read statement.
‎2007 Oct 29 5:44 AM
Hi,
You'll have to create two new tables
X_NEW_DATA with fields EBELN and IHREZ
Y_NEW_DATA with fields EBELN, EBELP and WERKS
and then use them.
This is because you cannot compare offset by offset and if you do it at all in Loop statement it will be a very ridiculous code.
because I guess you would like to compare something like this
X_DATA0(10) = Y_DATA0(10)
So,
please create new tables, more your data there and then manipulate these tables.
Regards
Nishant
‎2007 Oct 29 5:49 AM
Try giving offset while moving as following..
loop at y_data into e_data.
read table x_data into f_data with ...
if sy-subrc eq 0.
move y_data+0(20) to z_data-ebeln.
move x_data-ihrez+20(10) to z_data-ihrez.
move y_data-werks+30(10) to z_data-werks.
append z_data
endif.
Hope this clarifies wat m saying..reply back in case of doubt
Reward points if it helps
‎2007 Oct 29 5:53 AM
hey prashant,
did u read that the tables are actually having only one field as line of 512 chars?
How will he put a condition in read statement?
regards
Nishant
Message was edited by:
Nishant Rustagi
‎2007 Oct 29 5:51 AM
What are the fields and its sequence in the two tables?will you always have X_NEW_DATA with EBELN and IHREZ
and Y_NEW_DATA with EBELN, EBELP and WERKS in the 512 character internal tables?
Message was edited by:
Abhishek Jolly