Application Development 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: 

Code to delete

Former Member
0 Kudos
114

Hi,

I need to check field 'f1' from itab and delete the character '/'.

I must delete where itab-f1 = '/'.

suppose itab-f1 = abc/def

it should show itab-f1 = abcdef

How should I write the code?

Message was edited by:

ramana peddu

1 ACCEPTED SOLUTION

Former Member
0 Kudos
95

Hi,

Use this code.

REPLACE '/' with SPACE into itab-f1.

CONDENSE itab-f1 NO-GAPS.

Regards,

RS

6 REPLIES 6

ferry_lianto
Active Contributor
0 Kudos
95

Hi,

Please try this.


...
TRANSLATE ITAB-F1 USING '/ '.
CONDENSE ITAB-F1 NO-GAPS.
...

Regards,

Ferry Lianto

Former Member
0 Kudos
95

Try this code.

LOOP AT itab.
  REPLACE ALL OCCURANCES OF '/' IN  itab-f1 WITH SPACE.
  CONDENSE itab-f1 NO-GAPS.
  MODIFY itab.
ENDLOOP.

Former Member
0 Kudos
96

Hi,

Use this code.

REPLACE '/' with SPACE into itab-f1.

CONDENSE itab-f1 NO-GAPS.

Regards,

RS

Former Member
0 Kudos
95

hi ramana,

instead of using delete stmt u can try split command for ur purpose.

Regards...

Arun.

Reward points if useful.

Former Member
0 Kudos
95

HI..,

if ur field is of type C,

then it will solve ur problem..

loop at itab.

replace all occurrences of '/' in itab-f1 with ' '.

condense itab-f1 with no-gaps.

endloop.

regards,

sai ramesh

Former Member
0 Kudos
95

Hi Ramana,

Use TRANSLATE statement inside LOOP...ENDLOOP.

LOOP AT ITAB.

TRANSLATE ITAB-F1 USING '/ '.

CONDENSE ITAB-F1 NO-GAPS.

MODIFY ITAB INDEX SY-TABIX.

ENDLOOP.

Thanks,

Vinay