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

Query doubt..

Former Member
0 Likes
346

Hi,

I want to write a query is such a way that first 4 characters are distinct for given fields in a table. Only the first found instances should return.

Ex:

PORD100-1

PORD100-2

PORD200-1

INVC200-345

INVC200-789

The select query should return following since I am comparing only first four chracters i.e PORD and INVC in my case.

PORD100-1

INVC200-345

2 REPLIES 2
Read only

Former Member
0 Likes
326

Hi,

this code will surely help u try this.

select single field1 from <db table> into i_field1.

write:/ i_field1.

select single field1 from <db table> into j_field1 where field11(4) <> i_field11(4).

write:/ j_field1.

regards,

bharat.

Read only

Former Member
0 Likes
326

Hi!

You can do it in an ABAP program (SE38), checking the first 4 characters, with a synatx like this: field(4).

In query (SQ01) you shall insert an ABAP code with the syntax I showed above.

Regards

Tamá