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

Code to delete

Former Member
0 Likes
770

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
Read only

Former Member
0 Likes
751

Hi,

Use this code.

REPLACE '/' with SPACE into itab-f1.

CONDENSE itab-f1 NO-GAPS.

Regards,

RS

6 REPLIES 6
Read only

ferry_lianto
Active Contributor
0 Likes
751

Hi,

Please try this.


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

Regards,

Ferry Lianto

Read only

Former Member
0 Likes
751

Try this code.

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

Read only

Former Member
0 Likes
752

Hi,

Use this code.

REPLACE '/' with SPACE into itab-f1.

CONDENSE itab-f1 NO-GAPS.

Regards,

RS

Read only

Former Member
0 Likes
751

hi ramana,

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

Regards...

Arun.

Reward points if useful.

Read only

Former Member
0 Likes
751

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

Read only

Former Member
0 Likes
751

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