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

How to remove character '

former_member194416
Contributor
0 Likes
880

Hi am writing a program which analyze source codes some of the results are like "call function 'func_name' " and I need to get the func_name here without ' . Since ' is a special character and used in ABAP coding I can't write a code like replace ' . Does anyone have a solution for this.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
809

Hi,

Assign a text-element as ( ' ) and then use it in the replace statement.

Else use like this


Constants: c_quot(4)     type c value ''''.        " For value '

now you can use the replace statement with c_quot.

Regards,

Vik

Hi am writing a program which analyze source codes some of the results are like "call function 'func_name' " and I need to get the func_name here without ' . Since ' is a special character and used in ABAP coding I can't write a code like replace ' . Does anyone have a solution for this.

5 REPLIES 5
Read only

Former Member
0 Likes
809

why dont you use split statement

Read only

0 Likes
809

Even if I try to use split I can't write split text at '''. It still don't make any sense in ABAP.

Read only

Former Member
0 Likes
809

Hello

Working code:


REPORT ZSEARCH.
PARAMETERS: P_NAME LIKE D010SINF-PROG.
DATA: PROGTXT(72) TYPE C OCCURS 0 WITH HEADER LINE.
DATA: FUNCT TYPE RS38L_FNAM OCCURS 0 WITH HEADER LINE.

READ REPORT P_NAME INTO PROGTXT.
LOOP AT PROGTXT.
  IF PROGTXT CS 'CALL FUNCTION'.
    SEARCH PROGTXT FOR ''''.
    IF SY-SUBRC = 0.
      DO.
        SHIFT PROGTXT LEFT BY 1 PLACES.
        IF PROGTXT(1) = ''''.
          SHIFT PROGTXT LEFT BY 1 PLACES.
          DO.
            SHIFT PROGTXT RIGHT BY 1 PLACES.
            IF PROGTXT+71(1) = ''''.
              SHIFT PROGTXT RIGHT BY 1 PLACES.
              CONDENSE PROGTXT.
              FUNCT = PROGTXT. COLLECT FUNCT. EXIT.
            ENDIF.
          ENDDO.
          EXIT.
        ENDIF.
      ENDDO.
    ENDIF.
  ENDIF.
ENDLOOP.
LOOP AT FUNCT.
  WRITE: FUNCT. NEW-LINE.
ENDLOOP.

Read only

Former Member
0 Likes
810

Hi,

Assign a text-element as ( ' ) and then use it in the replace statement.

Else use like this


Constants: c_quot(4)     type c value ''''.        " For value '

now you can use the replace statement with c_quot.

Regards,

Vik

Read only

0 Likes
809

Thank you vikred this solved my issue.