Skip to Content
0
Former Member
Mar 19, 2009 at 11:00 PM

REPLACE ALL OCCURRENCES = Short dump!

2793 Views

I am getting confused around the REPLACE ALL OCCURRENCES command..

basically..

I have a field that i need to convert to CAPS and replace the "spaces" with "_"

But my lack of abap skills = Short dump!

So this short dump hinted that the field was to blame as it was String (0).. so i thought i would move into the CHAR30 field as it would be no longer than 30 characters...

    MOVE GS_SPECIFIC_CAMPAIGN-CAMPAIGN_NAME TO GW_CAMPAIGN_NAME.

        TRANSLATE GW_CAMPAIGN_NAME TO UPPER CASE.
        REPLACE ALL OCCURRENCES OF SPACE IN GW_CAMPAIGN_NAME WITH '_'.

But this still results in the short dump:

Runtime Errors REPLACE_INFINITE_LOOP

Exception CX_SY_REPLACE_INFINITE_LOOP

Maybe i am missing something but the error said:

Ensure that the command "REPLACE ALL OCCURENCES OF ..." is not executed with a search string of length 0.

I am using the same command, but only for populating variables into a text string... that is replacing &1 rather than a space!

I did try the REGEX command i also found in keyword search but that resulted in a different short dump!

Am i missing something obvious??