Skip to Content
-2

Question on looping records and using special characters

Mar 13, 2017 at 02:40 PM

44

avatar image

Hello Team,

I am fetching records from VBAK table and I want to filter those out based on order type.

If the order type is Z*AB than only I want to do some operation like if the order type is Z1AB or Z2AB or Z3AB ..or ZHAB or ZDAB than the loop should be processed.

I am writing code as

LOOP AT IT_VBAK INTO W_VBAK where AUART CP 'Z*AB'.

ENDLOOP.

I had checked in debugging and its working but my doubt is CP basically considers any open spaces and matches the pattern and makes loop pass.

Please suggest how to achieve this in record processing for Z*AB order types.

Thanks,

rg

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Horst Keller
Mar 13, 2017 at 10:49 PM
2

First of all, check the documentation for CP:

https://help.sap.com/http.svc/rc/abapdocu_751_index_htm/7.51/en-US/index.htm?file=abenlogexp_strings.htm

Then, I propose to write (module) tests for your expected values.

Share
10 |10000 characters needed characters left characters exceeded