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

delete operation

Former Member
0 Likes
362

Hi Frns,

please resolve the problem ...

Data: v1(10) type c .

v1 = abc****~ .

i want to delete the adjecent * of ~ only , not all the * . how can i do please resolve the problem .

result should be like this v1 = abc~ .

Thanks and Regards .

Priyank

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
343

Hi

Check this Code...

DATA: v1(20) TYPE c .

v1 = 'abc***~**a ***' .

WRITE:/ v1.

REPLACE ALL OCCURRENCES OF '*~' IN v1 WITH space.

CONDENSE v1.

WRITE:/ v1.

2 REPLIES 2
Read only

Former Member
0 Likes
344

Hi

Check this Code...

DATA: v1(20) TYPE c .

v1 = 'abc***~**a ***' .

WRITE:/ v1.

REPLACE ALL OCCURRENCES OF '*~' IN v1 WITH space.

CONDENSE v1.

WRITE:/ v1.

Read only

RaymondGiuseppi
Active Contributor
0 Likes
343

Maybe you could try (if only one * is deleted)

DO.
  REPLACE ALL OCCURRENCES OF '*~' IN v1 WITH '~'.
  IF sy-subrc NE 0. EXIT. ENDDO.
ENDDO.

For older versions

DO.
  REPLACE  '*~'  WITH  '~' INTO v1.
  IF sy-subrc NE 0. EXIT. ENDDO.
ENDDO.

Regards