2022 Nov 21 2:28 PM
In most of the fields of an ITAB the1st & last character is " and must be removed.
How can we say: Remove the 1st or the last character in all fields of the ITAB, if it is equal to ".
Thanks
2022 Nov 21 3:08 PM
something with replace ?
replace all occurrences of '""' in itab-fieldname with ''.
2022 Nov 21 3:17 PM
I finally found the following:
REPLACE ALL OCCURRENCES OF REGEX '^\"|\"$' IN TABLE it_file_header WITH ''
But I have another serious problem. 4 out of 5 ITABs have amount fields and I am getting the following error:
The table "A" expects a character-like field (in CHAR MODE) or a byte-like field (in BYTE MODE) as its row type.
And I want to avoid LOOPs
2022 Nov 21 5:13 PM
You can't avoid loops. There are no languages where you can avoid loops (except maybe functional languages).
2022 Nov 22 7:09 AM
Exactly. REPLACE ALL OCCURRENCES is implemented in the ABAP language using loops.
Even functional languages have loops in their compiled form. Without loops, a language cannot be Turing Complete.
2022 Nov 22 7:58 AM
Matthew, Sandra, you misunderstood me. I didn't say to not use LOOPs but to minimize the use especially if ITABs have a lot of records, like mine. I have 5 ITABs with this problem in all character fields and four of them have amount fields and these 4 have more than 100000 records. That's why I wanted to avoid LOOPs.
Thanks