2007 Jun 18 8:47 AM
hallow
i have a internal table with lot of values and i wont to now for example if
if in one value i have adress and move it to field of mine
data new data old data
pernr 123 725
prsno 12 72
phone 3589752 3589752
adress 8523 8523
move adress to my field
importnt my internal table have just 3 fields data new data old data
and pernr and persn is data where become in the append
best regards
2007 Jun 18 8:57 AM
Hello,
DO like this.
data: lv_address(32).
loop at itab.
if not itab-address is initial.
lv_address = itab-address.
write: lv_address.
endif.
endloop.
Regards,
Vasanth
Hello,
DO like this.
data: lv_address(32).
loop at itab.
if not itab-address is initial.
lv_address = itab-address.
write: lv_address.
endif.
endloop.
Regards,
Vasanth
2007 Jun 18 8:53 AM
Hi,
Could you be a bit more clearer as to what you really want to do?
Thanks.
Sandeep.
2007 Jun 18 8:57 AM
Hello,
DO like this.
data: lv_address(32).
loop at itab.
if not itab-address is initial.
lv_address = itab-address.
write: lv_address.
endif.
endloop.
Regards,
Vasanth
2007 Jun 18 10:55 AM
hi Vasanth M
Thankes for your answer!
its not easy like it look.
i have not field of itab-address adress is data that i get in the append of tables
u can see in fm hr_log_get_detail the table <b>fields</b> in all time it gets data
before change and after change i wont to take this data inside and move it to my own table
example
if i change the adress i see in table somthihng like that
data old_data new_data
adress london new york
if i change phone i get another line in table
data old_data new_data
adress london new york
phone 123 456
and i wont to move the new data to my like move 456 to new_phone....
hope u understand me
Best Regards
2007 Jun 18 11:41 AM
i think you are asking about modify statement.
if it is so then <suppose you want to change the address>
read table itab with key data = 'ADDRESS'.
if sy-subrc = 0.
itab-old_data = '123'.
itab-new_data = '456'.
modify itab index sy-tabix.
endif.
regards
shiba dutta
2007 Jun 18 11:20 AM
2007 Jun 18 11:39 AM
Hello Tal,
Try like this.
Say for eg. your itab has all the four fields
data new data old data
pernr 123 725
prsno 12 72
phone 3589752 3589752
adress 8523 8523
"Declare a new itab like this.
data: begin opf itab occurs 0,
pernr_old(10),
pernr_new(10),
prsno_old(10),
prsno_new(10),
phone_old(10),
phone_new(10),
adress_old(10),
adress_new(10),
end of itab1.
loop at itab.
case itab-data.
when 'PERNR'.
itab1-pernr_old = itab-old_data.
itab1-pernr_new = itab-new_data.
when 'PRSNO'.
itab1-prsno_old = itab-old_data.
itab1-prsno_new = itab-new_data.
when 'PHONE'.
itab1-phone_old = itab-old_data.
itab1-phone_new = itab-new_data.
when 'ADRESS'.
itab1-adress_old = itab-old_data.
itab1-adress_new = itab-new_data.
append itab1.
endcase.
endloop.
Hope this helps you.
In case of any further difficulties please revert back to me.
vasanth
2007 Jun 18 11:57 AM
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |