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

REPLACE RECORD or REPLACE LINE

Former Member
0 Likes
666

Hello gurus,

I need hepl to solve this problem:

The line with 00 is in a currency and the line with 10 is the same amount in EURO.

00 Account1 Currency USD amount

10 Account1 Currency EUR amount

00 Account2 Currency AUD amount

10 Account2 Currency EUR amount

00 Account2 Currency USD amount

10 Account2 Currency EUR amount

I need the ABAP code to replace the line 00 with 10.

Something like:

if 00 write me 10.

Thanks in advance,

Ramona

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
625

Hi,

If you do not want to show '00' then delete all entries with '00' from your internal table.

Or if the values need to be displayed , but with .10'..

loop at itab.

if itab-field1 = '00'.

itab-field1 = '10'.

endif.

write 😕 itab-field1,

itab-field2, ...........

endloop.

Regards,

Srini.

4 REPLIES 4
Read only

Former Member
0 Likes
625

You can declare these as strings...or variables..

and use REPLACE syntax to change values

for example:

Data: STR1(2) value '00',

STR2(2) value '10'.

STR(2) value .

REPLACE STR1 WITH STR2 INTO STR.

WRITE:/ STR.

orelse..

write like this..

if str1 = '00'.

replace str1 with str2.

endif.

write:/ str1.

Then the output of str1 will be '10'.

Thanks

Ram Ganji

Read only

Former Member
0 Likes
626

Hi,

If you do not want to show '00' then delete all entries with '00' from your internal table.

Or if the values need to be displayed , but with .10'..

loop at itab.

if itab-field1 = '00'.

itab-field1 = '10'.

endif.

write 😕 itab-field1,

itab-field2, ...........

endloop.

Regards,

Srini.

Read only

kesavadas_thekkillath
Active Contributor
0 Likes
625

Make use of the syntax find in table and replace in table - Hit f1 and find it.

Read only

Former Member
0 Likes
625

thanx a lot.