Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

help to bring data from itab

Former Member
0 Likes
986

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
970

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

7 REPLIES 7
Read only

Former Member
0 Likes
970

Hi,

Could you be a bit more clearer as to what you really want to do?

Thanks.

Sandeep.

Read only

Former Member
0 Likes
971

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

Read only

0 Likes
970

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

Read only

0 Likes
970

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

Read only

Former Member
0 Likes
970

hallow all

maybe some one else can help?

Regards

Read only

Former Member
0 Likes
970

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

Read only

0 Likes
970

hi Vasanth M

thankes i try it.

Regards