Skip to Content
Former Member
Mar 28, 2010 at 09:26 AM

Matching a string of text with another


Hello Gurus

I have what is hopefully a fun problem for someone to help me solve. I was unable to find the relevant commands in the ABAP dictionary and am not the best at ABAP anyway!

We have field with properties:


Data Type NUMC

Length 20

In reality the data in this field should be 13 characters long and we are not interested in strings that are not this length.

From the remaining data we want to compare characters 8-12 to another text string, lets call it ABCDE. We are then only interested in those that match.


if there were three values for /BIC/OZBARCODE:




ABCDE - would be deleted as of the wrong length

ABCDEXXXXXXXX - would be deleted as the relevant string does not fall in the right place

XXXXXXXABCDEX - would be kept


No need to give me the whole code, I just need the bits that will say:

If length of /BIC/OZBARCODE = 13


if characters 8-12 of /BIC/OZBARCODE = ABCDE

Many thanks in advance for any help.