‎2009 Nov 07 5:32 PM
Hello
Can somebody explain me the logic of ALL OCCURRENCIES in the the example below :
I think that this operator should replace A , ! with ' ' but the real output is different.
The real output is AA!A. It replaces all small characters with ' '. Why
DATA : l_PD(10) TYPE C.
*
l_pd = 'AbbA!A'.
*
*
replace all OCCURRENCES OF REGEX
'[^!"%&''()*+,-./:;<=>?_0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ]' in
l_pd with ' '.
*
‎2009 Nov 09 7:14 AM
Example
LOOP AT it_otfdata1 INTO wotfdata .
REPLACE FIRST OCCURRENCE OF 'ORIGINAL' IN wotfdata-tdprintpar WITH 'DUPLICATE'.
IF sy-subrc = 0.
MODIFY it_otfdata1 FROM wotfdata INDEX sy-tabix TRANSPORTING tdprintpar.
*exit.
ENDIF.
ENDLOOP.
APPEND LINES OF it_otfdata1 TO it_otfdata.
‎2009 Nov 07 6:41 PM
Hi commander,
please paste code as
code , thanks.
Regards,
Clemens
‎2009 Nov 08 1:23 PM
... and put search (patterns) characters in square brackets [[ and ]].
See also [Regular Expressions in Routines|http://help.sap.com/saphelp_nw70/helpdata/en/42/9d6ceabb211d73e10000000a1553f6/frameset.htm]
Regards,
Clemens
‎2009 Nov 09 7:14 AM
Example
LOOP AT it_otfdata1 INTO wotfdata .
REPLACE FIRST OCCURRENCE OF 'ORIGINAL' IN wotfdata-tdprintpar WITH 'DUPLICATE'.
IF sy-subrc = 0.
MODIFY it_otfdata1 FROM wotfdata INDEX sy-tabix TRANSPORTING tdprintpar.
*exit.
ENDIF.
ENDLOOP.
APPEND LINES OF it_otfdata1 TO it_otfdata.