I need to select a field from knb1 where kunnr from knb1 is equal to kunnr in likp and assign it to field KART_KLIENT1. For a reason I can't warp my head around, it says that neither table knb1 nor likp have a column kunnr... Which both of them do.
I don't know where to look for a problem, both knb1 and likp are predefined database tables in SAP and kunnr column is there by default.
I am working in SQ02, adding the code to one of the fields.
- If I add knb1 and lipk to TABLES section, there's an error saying they are already defined.
- Trying to define kunnr in DATA section (TYPE or LIKE) doesn't change anything.
- Using '~' instead of '-' in WHERE part of the SELECT doesn't change anything.
Thank you for your time.
TYPES: BEGIN OF ty_knb,
tlfns TYPE knb1,
END OF ty_knb.
DATA: wa_knb TYPE ty_knb.
SELECT SINGLE TLFNS
INTO wa_knb
FROM knb1
WHERE knb1-kunnr = likp-kunnr.
KART_KLIENT1 = wa_knb-tlfns.
TABLES
andDATA
but I guess you mean "ABAP Keyword". According to your code, it seems that your infoset is querying the tableLIKP
primarily, in that case your code should not do a syntax error aboutlikp-kunnr
(but it's an error to haveknb1-kunnr
at the left of=
, it should be eitherknb1~kunnr
orkunnr
). Please clarify which table(s) your infoset is querying primarily. Note that the codes of two Additional Fields share the same global scope, you cannot declare the same type or variable twice. – Sandra Rossi