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

Substring in SELECT statement

sergio_cifuentes
Participant
0 Likes
1,713

hi, i need to do a substring of a field in the where condition of a select statement, something like this:

SELECT *

FROM bseg

INTO CORRESPONDING FIELDS OF TABLE ti_bseg

FOR ALL ENTRIES IN ti_bkpf

WHERE bukrs EQ ti_bkpf-bukrs

AND belnr EQ ti_bkpf-belnr

AND gjahr EQ ti_bkpf-gjahr

AND hkont(4) EQ '1111'. <------ THIS IS WHAT I WANT TO DO

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,509

Try:


AND hkont LIKE '1111%'

There is a conversion exit at work here, so I'm not entirely sure.

Yes - when I tested it, I had to pad with leading zeros.

Rob

Message was edited by:

Rob Burbank

5 REPLIES 5
Read only

Former Member
0 Likes
1,509

Hi Sergio,

To my knowledge

AND hkont(4) EQ '1111'.

or

AND hkont(4) = '1111'.

should work fine. Are you getting any error??

Regards

Aneesh.

Read only

0 Likes
1,509

yes the error is this:

Field "HKONT(4)" unknown.

Read only

Former Member
0 Likes
1,510

Try:


AND hkont LIKE '1111%'

There is a conversion exit at work here, so I'm not entirely sure.

Yes - when I tested it, I had to pad with leading zeros.

Rob

Message was edited by:

Rob Burbank

Read only

0 Likes
1,509

this works fine, thanks!!

Read only

0 Likes
1,509

Glad to help.

Rob