You should be able to improve the lookup in the second table by using a secondary table key. Such a key needs to be declared when you declare the table variable:
DATA lt_items TYPE TABLE OF whatever WITH NON-UNIQUE SORTED KEY k1 COMPONENTS key.
You can then use this key to accelerate lookups in that table from O(n)
or O(log n)
time complexity:
LOOP AT lt_header INTO lwa_header.
LOOP AT lt_items INTO lwa_item
USING KEY k1
WHERE key = lwa_header-KNO.
"...
ENDLOOP.
ENDLOOP.
When you can guarantee that the values in lt_items-key are always unique (there are no two lines with the same value for "key"), then you can even use a hashed key, which is even faster (constant time):
DATA lt_items TYPE TABLE OF whatever WITH UNIQUE HASHED KEY k1 COMPONENTS key.
LOOP AT lt_header INTO lwa_header.
READ TABLE lt_items INTO lwa_item
WITH TABLE KEY k1
COMPONENTS key = lwa_header-KNO.
IF sy-subrc = 0.
"...
ENDIF.
ENDLOOP.