09-05-2008 3:32 PM
I need to do the following:
d_tab = cl_abap_char_utilities=>horizontal_tab.
d_line = cl_abap_char_utilities=>cr_lf.
replace ',' in d_contract with ' '.
replace d_tab in d_contract with ' '.
replace d_line in d_contract with ' '.
condense d_contract.
but it isn't working. It is replacing the horizontal tab but it is not replacing the carriage return. When I look in the debugger the field d_contract is '###'. After it replaces d_tab I have d_contract = '##'. It is my understanding that a carriage return is represented as ##. Also, this is the last field in the line so I assume it is a carriage return.
When it tries to replace d_line in d_contract (carriage return in the field) it doesn't replace anything.
Any ideas?
Regards,
Davis
09-05-2008 4:03 PM
The problem ended up being extra tabs. I fixed the issue by changing the delete statements to delete all and I also added an extra field in the split statement.
09-15-2008 9:14 AM
>
> The problem ended up being extra tabs. I fixed the issue by changing the delete statements to delete all and I also added an extra field in the split statement.
Can you or anyone explain more of this? Thank you so much..i got the same problem...
09-15-2008 11:46 AM
I did the following:
d_tab = cl_abap_char_utilities=>horizontal_tab.
replace all occurrences of ',' in d_contract with ' '.
replace all occurrences of d_tab in d_contract with ' '.
condense d_contract.
The split is as follows(the variables aren't the same but I don't have the code in front of me): split wa_string at d_var d_var1 d_var2 d_Var3 d_contract d_string.
I added the variable d_string to the split. This will consume all extra characters in the string (this is where the extra tabs will go).
Regards,
Davis