Skip to Content
Former Member
Feb 26, 2007 at 04:07 AM

Partial of awkey in WHERE clause


How to have a partial field in a WHERE Clause? I would like to select the 1st 10 digits of AWKEY from BKPF and match the BELNR from RSEG so that I can take out BLDAT from BKPF.

SELECT SINGLE belnr INTO rseg-belnr FROM rseg WHERE ebeln EQ wa_ekpo-ebeln.

SELECT SINGLE awkey INTO bkpf-awkey FROM bkpf WHERE gjahr EQ rseg-gjahr AND awkey+0(10) EQ rseg-belnr.

SELECT SINGLE bldat INTO bkpf-bldat FROM bkpf.

MOVE wa_bldat TO wa_ekpo-bldat.

But I got an error that said the Field "AWKEY=0(10)" unknown.

Can anyone guide me on this? Thank you