2009 Aug 13 8:51 AM
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.
2009 Aug 13 9:05 AM
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,
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
2009 Aug 13 8:57 AM
2009 Aug 13 9:02 AM
Even if I try to use split I can't write split text at '''. It still don't make any sense in ABAP.
2009 Aug 13 9:03 AM
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.
2009 Aug 13 9:05 AM
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
2009 Aug 13 9:22 AM
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |