Hello Experts,
I am "read table dbtable" in a program and iam getting an error that 'field does not eixts'. Can anybody please let me know what is the reason?
Thanks a lot for you help.
Code:
DB table <b>ZTABLE</b> has the following fields:
KUNNR
BSTNK
VBELN
POSNR
MATNR
MAKTX
ZZWKTNR2
PRSDT
ZNEWDT
ERNAM
ZPOSTDT
ZPOSTTIME
data: i_ztable like ztable occurs 0 with header line. sort i_ztable by kunnr bstnk vbeln posnr matnr zzwktnr2. if not i_ztable is initial. * loop at i_ztable. read table ztable with key kunnr = i_ztable-kunnr bstnk = i_ztable-bstnk vbeln = i_ztable-chargeback posnr = i_ztable-posnr matnr = i_ztable-matnr zzwktnr2 = i_ztable-zzwktnr2 binary search. * endloop.
During syntax check it's giving error: <i>The field KUNNR is unknown</i>.
You can do like this
data: wa type ztable. Select single * from ztable into wa where kunnr = i_ztable-kunnr and bstnk = i_ztable-bstnk and vbeln = i_ztable-chargeback and posnr = i_ztable-posnr and matnr = i_ztable-matnr and zzwktnr2 = i_ztable-zzwktnr2.
Regards,
Satish
Add a comment