Skip to Content
avatar image
-2
Former Member

String between two patterns

Hi All,

We have a table where there are two columns called material_from and material_to. Here ā€˜Zā€™ stands for alphanumeric character.

I need to get the key fields for a material if the material is in between material_from and material_to.

For example: if the material code is 23030232A6 then I need to get the key field as 0002 and 3.

Please help.

regards,

untitled.png (17.8 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Jun 10, 2017 at 09:15 AM

    It sounds like a very basic question. Use "LOOP AT table WHERE material_from <= material AND material_to >= material" or "SELECT key FROM table WHERE material_from <= material AND material_to >= material" to answer your question "how to know if material is in between material_from and material_to".

    Add comment
    10|10000 characters needed characters exceeded

  • Jun 12, 2017 at 06:36 AM

    Could you first check for activation of any conversion-exit for material number in your current system, if yes convert the material id to check to external format before writing the very simple LOOP AT WHERE statement.

    Add comment
    10|10000 characters needed characters exceeded