Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results forĀ 
Search instead forĀ 
Did you mean:Ā 
Read only

String between two patterns

Former Member
0 Likes
821

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,

3 REPLIES 3
Read only

larshp
Active Contributor
0 Likes
691

Do you need the theoretical possible material numbers, or the materials that exist in database table MARA?

Read only

Sandra_Rossi
Active Contributor
0 Likes
691

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".

Read only

RaymondGiuseppi
Active Contributor
0 Likes
691

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.